Brief Index      Full Index      I.M. Reference

Reference_Geometry


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)

Function Documentation

void Reference_Geometry ( const char *  segname  ) 

Directs HOOPS to create a reference to some geometry when processing a segment.

Parameters:
segname - Name, possibly including wildcards and lists, of extra segment(s) from which the geometry should be included when displaying the current segment.

DETAILS

Reference_Geometry() inserts a request into the currently open segment. The request asks that whenever this segment is displayed, the referenced geometry should be searched for and included as part of the scene, as if it had already existed in the segment. If the referenced geometry is a segment, all the geometry within that segment is included.

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();

See also:
Copy_Geometry, Open_Geometry, Conditional_Reference, KShow_Conditional_Reference, KShow_Reference_Geometry

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.

Parameters:
segname - Name, possibly including wildcards and lists, of extra segment(s) from which the geometry should be included when displaying the current segment.
Returns:
reference_key Unique numeric identifier to the reference. This is not the same as the key of the geometry being referenced.

DETAILS

No additional details. See Reference_Geometry().

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.

Parameters:
geom_key - Key to the geometry that should be included when displaying the current segment.

DETAILS

No additional details. See Reference_Geometry().

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.

Parameters:
geom_key - Key to the geometry that should be included when displaying the current segment.
Returns:
reference_key Unique numeric identifier to the reference. This is not the same as the key of the geometry being referenced.

DETAILS

No additional details. See Reference_Geometry().

Main Index
Brief Index      Full Index      I.M. Functions