HC_Show_Include_Segment

Key HC_Show_Include_Segment(Key key, char *pathname)
Key HC_Show_Include_Segment(Key key, char pathname)

Returns the segment that is referenced by an inclusion.

Given the key returned by a previous call to Include_Segment(), Find_Contents(), or Begin_Contents_Search() in which the type returned was an “include”, this routine will indicate which segment was included. This information might be used, for example, to copy the “include” into a new segment in order to use the instanced geometry but change an attribute (e.g.: color).

Show_Include_Segment() returns the key of the segment instead of the pathname.

Include Segment Pathnames

Suppose there is an include segment with a pathname such as:

/include/a/b

wherein “a” contains a matrix, and “b” contains geometry. This segment is used in a scene as follows:

Open_Segment ("?picture")
    Include_Segment ("/include/a")
    Include_Segment ("/include/a/b")
Close_Segment()

The HOOPS picture in this case would show two versions of the geometry, as one would expect. However, prior to HOOPS 6.2 a selection on either instance of the geometry would have returned the same path:

/include/a/b
<  /driver/msw/window0

From this construct, there was no way to distinguish which version of the object was hit. HOOPS 6.2 added additional arrows to indicate that the selected instance was to a containing segment. Thus, a selection of the direct instance of “b” will be the same as the old version, but a selection of the geometry instanced by an include of the “a” segment will return:

/include/a/b
<<  /driver/msw/window0

Some programs may directly parse the path string and so depend on the old behavior. To accommodate those there is a new System_Option “old style pathnames” which will cause Hoops to generate the old form only.

HC_Include_Segment, HC_Begin_Contents_Search

Parameters

key: Unique numeric identifier pointing to a previously defined include reference.

pathname: Full pathname of the segment that is referenced by key.

Returns

The key of the segment that is referenced by the passed key.