Brief Index      Full Index      I.M. Reference

Copy_Segment


Functions

void Copy_Segment (const char *old, const char *new)
HC_KEY KCopy_Segment (const char *old, const char *new)

Function Documentation

void Copy_Segment ( const char *  old,
const char *  new 
)

Completely duplicates a segment.

Parameters:
old - Segment(s) to be Copied. Can contain wildcards.
new - New name to use. Can contain a "/*" on the end, but cannot contain any other wildcards (see below).

DETAILS

Copy_Segment() duplicates the contents of old and inserts them into new. "Contents" consists of all the attributes, styles, includes, geometry, and subsegments, and all the attributes, styles, includes and geometry in all the subsegments. When Copy_Segment() finishes, the segment tree starting at new will be an exact copy of old. It is not necessary to use a "..." to get the whole tree copied, because this is HOOPS normal mode.

If you just want the same piece of a picture to appear in two different contexts, you can redraw that piece in the "?Include Library..." segment tree. Then request an Include_Segment() in each place where the piece is needed. Doing it this way helps the system compute displays efficiently and helps you stay organized. (If you find yourself making a copy just because you need to override an attribute setting of the original, consider making a utility segment that has the original's contents, minus the offending attribute(s), and have other parts of the application refer to that utility segment.)

If the new specification contains a wildcard on the end, that wildcard gets matched with the lowest-level name on the incoming segment. For example, a copy from "A/B/C" to "D/*" creates a segment named "D/C". More commonly, you would use a wildcard on the new segment name only if you were using wildcards on the input name too, such as copying from "A/B/*" to "D/*".

NOTES

If new does not exist, it is created. If new existed but was not empty, Copy_Segment() will complain.

If new is a blank or null string, a new "nameless" segment (see Open_Segment() ) is created.

If more than one output segment is created, and you used KCopy_Segment() , you will get an error when the system tries to return the key.

RESTRICTIONS

See also:
Include_Segment, Rename_Segment, Open_Segment, Close_Segment, Delete_Segment.

HC_KEY KCopy_Segment ( const char *  old,
const char *  new 
)

Similar to Copy_Segment(), but returns an HC_KEY to the object.

Parameters:
old - Segment(s) to be Copied. Can contain wildcards.
new - New name to use. Can contain a "/*" on the end, but cannot contain any other wildcards (see below).
Returns:
key

DETAILS

No additional details. See Copy_Segment()

Main Index
Brief Index      Full Index      I.M. Functions