Brief Index      Full Index      I.M. Reference

Show_Bounding_Cuboid


Functions

HC_BOOLEAN Show_Bounding_Cuboid (HC_POINT *min, HC_POINT *max)
HC_BOOLEAN QShow_Bounding_Cuboid (const char *segment, HC_POINT *min, HC_POINT *max)
HC_BOOLEAN Show_Bounding_Cuboid_By_Key (HC_KEY key, HC_POINT *min, HC_POINT *max)

Function Documentation

HC_BOOLEAN Show_Bounding_Cuboid ( HC_POINT *  min,
HC_POINT *  max 
)

Returns the cuboid used by HOOPS to circumscribe the geometry within a segment.

Parameters:
min - The lower-most nearest diagonal point (xmin,ymin,zmin) of the cuboid to encompass the geometry contained within the segment. Returned to user. Passed by reference in all languages.
max - The upper-most distant diagonal point (xmax,ymax,zmax) of the cuboid to encompass the geometry contained within the segment. Returned to user. Passed by reference in all languages.
Returns:
success

DETAILS

This function returns to the user the bounding cuboid that is currently associated with the given segment. If the current bounding volume is not a bounding cuboid, it will be converted into a bounding cuboid before returning to the user. In no case will anything new be calculated.

The standard form of Show_Bounding_Cuboid can only apply to a segment, since it is specified by a complete path. The "By_Key" variant needs a key that refers to a valid segment or polyhedron (i.e. a shell or mesh).

NOTES

It is important for the user to pay attention to the return value, since if the function fails, the min and max will be left untouched. The most common causes for this function to fail are "no bounding volumes" (see Define_System_Options() ), or an empty segment.

HOOPS uses three different types of bounding volumes internally: rectangles (right rectangular figures in the Z=0 plane), spheres, and cuboids (right rectangular prisms aligned with the coordinate axes). The user does not get to choose which volume is used by HOOPS, since HOOPS figures that out and uses what's optimal for the scene.

Bounding volumes are enabled by the system option "bounding volumes". This tells the system to generate bounding volumes for new geometry, and propagate them up the tree, transforming and merging as it goes up. Most types of geometry other than shells, meshes and NURBS surfaces have no associated bounding volumes. The bounding volume at a segment is given in object-relative-units (oru), and so does not account for any transforms that are inherited from above. Transform-dependent geometry, including text (except its insertion point), marker symbols (except its insertion point) and/or any I.M. draw-time modifications, are left out of bounding volume calculations.

Users gain further control of bounding volumes with the control update flags. "Bounding volume retention" is the default for segments and means that bounding volumes should be attached to the segment. Even if this is off, the bounding volume might propagate higher in the tree---it just won't be stored at that particular segment.

If the user turns retention off and then on, the bounding volume may need recomputation, which is forced by the "compute bounding volume" control update flag. When HOOPS walks the tree during drawing or selection, it checks the current segment for a bounding volume. If one is present, it is clipped against the view. If the volume is entirely outside the view, processing does not proceed down that branch of the tree. For trees with some degree of spatial organization, this results in good performance as object go off-screen.

RESTRICTIONS

See also:
Compute_Circumcuboid, Compute_Coordinates, Compute_Transform, Define_System_Options, Show_Bounding_Info, Show_Bounding_Sphere, Set_Bounding_Cuboid.

HC_BOOLEAN QShow_Bounding_Cuboid ( const char *  segment,
HC_POINT *  min,
HC_POINT *  max 
)

Similar to Show_Bounding_Cuboid(), but operates on a given segment rather than the currently open one.

Parameters:
segment - Segment name to use.
min - The lower-most nearest diagonal point (xmin,ymin,zmin) of the cuboid to encompass the geometry contained within the segment. Returned to user. Passed by reference in all languages.
max - The upper-most distant diagonal point (xmax,ymax,zmax) of the cuboid to encompass the geometry contained within the segment. Returned to user. Passed by reference in all languages.
Returns:
success

DETAILS

No additional details. See Show_Bounding_Cuboid()

HC_BOOLEAN Show_Bounding_Cuboid_By_Key ( HC_KEY  key,
HC_POINT *  min,
HC_POINT *  max 
)

Similar to Show_Bounding_Cuboid(), but operates on an object referenced by an HC_KEY.

Parameters:
key - Key of the segment or polyhedron to use.
min - The lower-most nearest diagonal point (xmin,ymin,zmin) of the cuboid to encompass the geometry contained within the segment. Returned to user. Passed by reference in all languages.
max - The upper-most distant diagonal point (xmax,ymax,zmax) of the cuboid to encompass the geometry contained within the segment. Returned to user. Passed by reference in all languages.
Returns:
success

DETAILS

No additional details. See Show_Bounding_Cuboid()

Main Index
Brief Index      Full Index      I.M. Functions