Chapter 8:
Color Model Attributes (ACM_)

ATTRIBUTE

Description

ACM_AUTOMATIC_COLORMODEL

Automatic Color Model Control

ACM_COLORDIVISIONS

Color Division in Color Model

ACM_COLORMODEL

Color Model scheme

ACM_SERIES_COLOR

Series Color in a Color Model

ACM_WASH

Wash of a Color Model

ACM_WASHBEGIN

Wash Begin color of a Color Model

ACM_WASHEND

Wash End color of a Color Model

ACM_AUTOMATIC_COLORMODEL

 

This attribute enables (TRUE) / disables (FALSE) automatic color modeling. When TRUE, the color model (by series, by group) is decided by the charting engine. When there is only one series, color model appears "by group". When there are more than one series, color model appears "by series".

Type:

BOOLEAN16

Valid Range:

TRUE/FALSE

 

TRUE=

Automatic Color Modeling

 

FALSE=

Use ACM_COLORMODEL

Default:

FALSE

Also See:

ACM_COLORMODEL

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

All

   

ACM_COLORDIVISIONS

 

This attribute sets the number of color divisions to be used by the ACM_COLORMODEL attribute when CM_BY_HEIGHT is selected.

Type:

INT16

Valid Range:

any INT16 value

Default:

10

Example:

INT16 iCdivs = 5;
SetGraphAttr ( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,
     NULL_SERIESID,
     NULL_GROUPID,
     ACM_COLORDIVISIONS,
      (void FAR *) &iCdivs );

Also See:

ACM_COLORMODEL

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

All

   

ACM_COLORMODEL

 

This attribute selects a coloring scheme to use for the 3D risers, i.e. by height, angle, series, group, or normal. Most graphs use the series coloring scheme, in which each riser series is assigned a specific color.

Type:

INT16

Valid Range:

A value from the ColorModelConstants enum:

 

ColorModelConstants

Value

Description

 

CM_BY_FACE

0

Riser coloring scheme - per face in 3D graphs

 

CM_BY_SERIES

1

Color by Rows (series); one color per row.

 

CM_BY_GROUP

2

Color by Columns (groups); one color per column.

 

CM_BY_ANGLE

3

Color by Angle: color for all risers calculated based on the viewing angle (looks like a light being shone on a real 3D object). Used mostly for surface graphs.

 

CM_BY_HEIGHT

4

Color by Height; higher risers = lighter colors.

 

CM_BY_VALUE_X

5

Depends on distance to LEFT WALL (Y axis)

 

CM_BY_VALUE_Y

6

Depends on distance to FLOOR (X-axis)

 

CM_BY_VALUE_Z

7

3D only, depends on distance to RIGHT WALL

Default:

CM_BY_SERIES

Example:

INT16 iModel = CM_BY_HEIGHT;
SetGraphAttr ( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,
     NULL_SERIESID,
     NULL_GROUPID,
     ACM_COLORMODEL,
      (void FAR *) &iModel );

Notes:

1.

When CM_BY_HEIGHT is selected, use ACM_COLORDIVISIONS to specify the number of different colors to use in the "by height" arrangement.

 

2.

Your application must call DrawTheGraph() or DryRunTheGraph() after this attribute is set in order for it to have any effect on the graph.

Also See:

ACM_COLORDIVISIONS

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

All

   

ACM_SERIES_COLOR

 

This attribute sets the color of a particular series of risers. It will work with all color modeling schemes except CM_BY_FACE where the riser colors are expected to be colored by 3D face.

Type:

struct {
     INT16 nSeriesID;
     RGB16 rgb;
} TDG_SeriesColorInfo,FAR *TDG_SeriesColorPtr;

Valid Range:

nSeriesID: An INT16 value identifying the series to be colored

 

rgb: 0...65535. PGSDK uses a 48-bit color space (16 bits for each element red, green, blue). For the Windows platform, you must multiply each value by 256 to convert a Windows 8-bit color value to the PGSDK 16-bit color value. Example:

 

nRed = 256; // full red in Windows
MyRGB16 red = nRed<<8; // Set PGSDK to full red

Default:

None

Example:

TDG_SeriesColorInfo Ser1Color;
RGB16 aRGB[5] = {
     { 0, 0, 0}, /* BLACK */
     {HALF,HALF,HALF}, /* GREY */
     {FULL, 0, 0}, /* RED */
     { 0,FULL, 0}, /* GREEN */
     { 0, 0,FULL}}; /* BLUE */
Ser1Color.nSeriesID = 1;
/* Color Series 1 risers grey */
Ser1Color.rgb = aRGB[1];
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,
     NULL_SERIESID,
     NULL_GROUPID,
     ACM_SERIES_COLOR,
      (void FAR *) &Ser1Color);

Also See:

ACM_COLORMODEL

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

Yes, specify in nSeriesID

No

All

ACM_WASH

 

This attribute is used in conjunction with ACM_WASHBEGIN and ACM_WASHEND to apply a smooth interpolated wash between the specified begin and end colors. The ACT_WASHEND attribute defines the beginning color of a wash to be applied to all risers in a graph. The ACM_WASHEND attribute defines the ending color of the wash. This attribute applies apply a smooth interpolation of colors between the colors defined in ACM_WASHBEGIN and ACM_WASHEND. The wash is applied according to the coloring scheme specified by ACM_COLORMODEL. For example, if the beginning wash color is grey and the ending wash color is red, the CM_BY_HEIGHT color model method washes grey to red from shortest to tallest risers. The tallest risers have the least amount of wash (e.g., mostly red), the shortest risers have the most amount of wash (e.g., totally grey).

Type:

NULL

Valid Range:

NULL

Default:

NULL

Example:

static RGB16 aRGB[5] = {
     { 0, 0, 0}, /* BLACK */
     {FULL,FULL,FULL}, /* WHITE */
     {FULL, 0, 0}, /* RED */
     { 0,FULL, 0}, /* GREEN */
     { 0, 0,FULL}}; /* BLUE */
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,NULL_SERIESID,NULL_GROUPID,
     ACM_WASHBEGIN, (void FAR *) &aRGB[1]);
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,NULL_SERIESID,NULL_GROUPID,
     ACM_WASHEND, (void FAR *)&aRGB[2]);
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,NULL_SERIESID,NULL_GROUPID,
     ACM_WASH, NULL);

Notes:

This attribute works for all color modeling schemes except CM_BY_FACE.

Also See:

ACM_WASHBEGIN, ACM_WASHEND & ACM_COLORMODEL

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

All

   

ACM_WASHBEGIN

 

This attribute defines the beginning color of a wash to be applied to all risers in a graph. The ACM_WASHEND attribute defines the ending color of the wash. The ACM_WASH attribute can be used to apply a smooth interpolation of colors between ACM_WASHBEGIN and ACM_WASHEND. The wash is applied according to the coloring scheme specified by ACM_COLORMODEL. For example, if the beginning wash color is grey and the ending wash color is red, the CM_BY_HEIGHT color model method washes grey to red from shortest to tallest risers. The tallest risers have the least amount of wash (e.g., mostly red), the shortest risers have the most amount of wash (e.g., totally grey).

Type:

struct {
     UINT16 red;
     UINT16 green;
     UINT16 blue;
} RGB16, FAR *RGB16Ptr;

Valid Range:

See the RGB16 structure in Appendix A.

Default:

red = 0, green = 65535, blue = 65535

Example:

static RGB16 aRGB[5] = {
     { 0, 0, 0}, /* BLACK */
     {FULL,FULL,FULL}, /* WHITE */
     {FULL, 0, 0}, /* RED */
     { 0,FULL, 0}, /* GREEN */
     { 0, 0,FULL}}; /* BLUE */
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,NULL_SERIESID,NULL_GROUPID,
     ACM_WASHBEGIN, (void FAR *) &aRGB[1]);
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,NULL_SERIESID,NULL_GROUPID,
     ACM_WASHEND, (void FAR *)&aRGB[2]);
SetGraphAttr( gpGraph, GRAPH_LAYER, NULL_OBJECTID,
     NULL_SERIESID,NULL_GROUPID, ACM_WASH, NULL);

Notes:

This attribute works for all color modeling schemes except CM_BY_FACE.

Also See:

ACM_COLORMODEL, ACM_WASH & ACM_WASHEND

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

All

ACM_WASHEND

 

This attribute defines the ending color of a wash to be applied to all risers in a graph. The ACM_WASHBEGIN attribute defines the beginning color of the wash. The ACM_WASH attribute can be used to apply a smooth interpolation of colors between ACM_WASHBEGIN and ACM_WASHEND. The wash is applied according to the coloring scheme specified by ACM_COLORMODEL.

Type:

struct {
     UINT16 red;
     UINT16 green;
     UINT16 blue;
} RGB16, FAR *RGB16Ptr;

Valid Range:

See the RGB16 structure in Appendix A.

Default:

red = 65535, green = 0, blue = 0

Example:

static RGB16 aRGB[5] = {
     { 0, 0, 0}, /* BLACK */
     {FULL,FULL,FULL}, /* WHITE */
     {FULL, 0, 0}, /* RED */
     { 0,FULL, 0}, /* GREEN */
     { 0, 0,FULL}}; /* BLUE */
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,NULL_SERIESID,NULL_GROUPID,
     ACM_WASHBEGIN, (void FAR *) &aRGB[1]);
SetGraphAttr( gpGraph, GRAPH_LAYER,
     NULL_OBJECTID,NULL_SERIESID,NULL_GROUPID,
     ACM_WASHEND, (void FAR *)&aRGB[2]);
SetGraphAttr( gpGraph, GRAPH_LAYER, NULL_OBJECTID,
     NULL_SERIESID,NULL_GROUPID, ACM_WASH, NULL);

Notes:

This attribute works for all color modeling schemes except CM_BY_FACE.

Also See:

ACM_COLORMODEL, ACM_WASH & ACM_WASHBEGIN

Usage

ObjectID

SeriesID

GroupID

GraphTypes

Requirements:

No

No

No

All