Functions | |
void | Reference_Geometry (const char *segname) |
HC_KEY | KReference_Geometry (const char *segname) |
void | Reference_Geometry_By_Key (HC_KEY geom_key) |
HC_KEY | KReference_Geometry_By_Key (HC_KEY geom_key) |
void Reference_Geometry | ( | const char * | segname | ) |
Directs HOOPS to create a reference to some geometry when processing a segment.
segname | - Name, possibly including wildcards and lists, of extra segment(s) from which the geometry should be included when displaying the current segment. |
The difference between Reference_Geometry() and Copy_Geometry() is that Copy_Geometry() actually makes a copy of the referenced geometry. The user would call Copy_Geometry() to make changes and leave the original geometry alone. To simply 'reuse' a piece of geometry by referencing it, use Reference_Geometry() and gain the memory savings.
Referenced geometry does not come with any of the attributes from the segment in which it resides, unless the geometry has attributes applied to it directly via Open_Geometry(). To correct referenced geometry for its original color and/or modelling matrix, simply open up the reference via Open_Geometry() and apply the needed attributes to it. For example:
HC_KEY shellKey = HC_KInsert_Shell(...); HC_Open_Segment("front axle") HC_KEY ref_key = HC_KReference_Geometry_By_Key (shellKey); HC_Open_Geometry (ref_key); HC_Translate_Object (-0.5, 0.5, 0.0); HC_Set_Color ("red"); HC_Close_Geometry (); HC_Close_Segment();
HC_KEY KReference_Geometry | ( | const char * | segname | ) |
Similar to Reference_Geometry(), but returns a key to the reference that can be used lated to delete the reference.
segname | - Name, possibly including wildcards and lists, of extra segment(s) from which the geometry should be included when displaying the current segment. |
void Reference_Geometry_By_Key | ( | HC_KEY | geom_key | ) |
Similar to Reference_Geometry(), but references a particular item, rather than a segment and all of its contents.
geom_key | - Key to the geometry that should be included when displaying the current segment. |
HC_KEY KReference_Geometry_By_Key | ( | HC_KEY | geom_key | ) |
Similar to KReference_Geometry_By_Key(), but returns a key to the reference that can be used lated to delete the reference.
geom_key | - Key to the geometry that should be included when displaying the current segment. |