Show_Color

Functions

HC_BOOLEAN PShow_Net_Color (int count, const HC_KEY *keys, char *color_spec)
 Similar to Show_Color(), but returns the net effective settings along a discrete path of segments. More...
 
void Show_Color (char *color_spec)
 Returns the named color(s) used to render the contents of the currently open segment. More...
 
void Show_Color_By_Index (char *types, int *index)
 Returns the color map indices used to render the contents of the currently open segment. More...
 
void Show_Color_By_Value (char *types, char *colorspace, float *a, float *b, float *c)
 Returns the numerically-defined colors of objects in the currently open segment. More...
 

Detailed Description

Function Documentation

◆ PShow_Net_Color()

HC_BOOLEAN PShow_Net_Color ( int  count,
const HC_KEY *  keys,
char *  color_spec 
)

Similar to Show_Color(), but returns the net effective settings along a discrete path of segments.

Parameters
countThe size of keys
keysAn array of HC_KEY's delineating a path of segments.
color_specA specification for the desired color setting. Passed by reference. Returned to user.

DETAILS

As with all PShow_Net_* routines, pathkeys[0] represents the lowest (a.k.a the "most local" or "leaf"), and pathkeys[keycount-1] represents the highest segment. If the path is incomplete, missing segments are filled in if possible. Missing segments must be part of the same direct ancestry in order to be filled in. If the desired path contains an include link, the shortest unambiguous set of pathkeys would be [leaf, includelink, root], where includelink is the return value from Include_Segment().
By default, HOOPS will determine the Net attribute from the last specified key all the way to the root. If you add -1 at the end of the array, the PShow_Net routines will not proceed beyond the end of the last specified key.

◆ Show_Color()

void Show_Color ( char *  color_spec)

Returns the named color(s) used to render the contents of the currently open segment.

Parameters
color_spec- A specification for the desired color setting. Passed by reference. Returned to user.
Supported Options:
ambient light, ambient, back, cut edges, cut faces, cut geometry, edges, edge contrast, faces, face contrast, geometry, lights, lighting, lines, line contrast, markers, marker contrast, polygon contrast, polygons, polylines, text, text contrast, vertex contrast, vertices, windows, window contrast

DETAILS

No additional details. See Set_Color()

NOTES

When the value being passed back is a char *, be sure you've declared your string variable to be long enough.

The Show Color routines will complain if they're called and the attribute is not actually set in the segment. Use Show_Existence() to avoid this, if necessary.

RESTRICTIONS

In the Show Color routines the color_space is returned to you, not passed in. In the present implementation, the color will be equivalent to the color you originally set, but it won't necessarily be written the same way. For example, if you set a color by RGB value, the system may, at its discretion, return an HLS color when asked to show that color. If you want a particular color space, use Compute_Color() on the return values.

The internal RGB-to-HLS and HLS-to-RGB routines are not exactly inverse. This might cause Show_Color_By_Value() not to give results matching the loaded values.

See also
Set_Color_By_Value, Set_Color_By_Index, Set_Color_By_FIndex, Set_Color_Map, Define_Color_Name, Define_Texture, Set_Rendering_Options, Set_Line_Pattern, Set_Edge_Pattern, Set_Marker_Symbol, Set_Face_Pattern, Set_Text_Font, Insert_Distant_Light, Open_Face, Open_Edge, Open_Vertex

◆ Show_Color_By_Index()

void Show_Color_By_Index ( char *  types,
int *  index 
)

Returns the color map indices used to render the contents of the currently open segment.

Parameters
types- A list of geometry types. Passed by reference. Returned to user.
index- The offset in the applicable color map in which the colors are found. The very first entry is at offset zero. Passed by reference. Returned to user.

DETAILS

No additional details. See Set_Color_By_Index()

◆ Show_Color_By_Value()

void Show_Color_By_Value ( char *  types,
char *  colorspace,
float *  a,
float *  b,
float *  c 
)

Returns the numerically-defined colors of objects in the currently open segment.

Parameters
types- A list of geometry types – e.g., faces, lines, polygon, etc. Passed by reference. Returned to user.
colorspace- Special constant—either "HLS", "HSV", "HIC", or "RGB". Passed by reference. Returned to user.
a- The location or value in the given color space. Passed by reference. Returned to user.
b-
c-
// a simple example for returning RGB values on the current segment
char types[128];
char space[128];
float r, g, b;
HC_Show_Color_By_Value(types, space, &r, &g, &b);
Warning
To use this function, all the settings in the segment must be the same. The function will return the list of types affected (the first argument), but there can only be one set of values applied to the segment for this function to work.

If multiple values are set on this segment, then use Show_One_Color_By_Value() to find out the color value for a particular geometry type (e.g., faces, lines, etc.).

DETAILS

No additional details. See Set_Color_By_Value()