Brief Index      Full Index      Events Index      I.M. Reference

Style_Segment

Functions

HC_KEY Style_Segment (const char *style)
HC_KEY Style_Segment_By_Key (HC_KEY seg_key)
HC_KEY Style_Segment_Key_By_Key (HC_KEY target_segment, HC_KEY style_segment)
HC_KEY Named_Style_Segment (char const *style_name)
HC_KEY Named_Style_Segment_By_Key (HC_KEY target_segment, char const *style_name)
HC_KEY Conditional_Style (const char *style, const char *conditions)
HC_KEY Conditional_Style_By_Key (HC_KEY seg_key, const char *conditions)

Function Documentation

HC_KEY Style_Segment ( const char *  style)

"Styles" the currently open segment to be drawn in the style of the referenced ones.

Parameters:
style- Name, possibly including wildcards, of other segment(s).

DETAILS

Inserts a request into the currently open segment that whenever this segment is displayed, the referenced segment(s) should be searched for and their opinions about attribute settings used. In other words, this segment should be displayed in the style of the referenced segment.

The most common use of "styling" is when you want to change something in a large or arbitrary number of places without having to go to, or refer to, all those places.

By convention, style segments should have no life of their own---they should have no drawing primitives inside. Also by convention, Stylee's live in the "Style Library" segment tree---their full names should begin with "?Style Library/...". There is no reason for this, though, besides aesthetics.

The attribute inheritance rules are as follows:

If the current segment has an opinion about an attribute, the style's opinion about it is ignored. Otherwise, the style's opinion, if any, is used. If the style has subsegments or includee's, they have no effect on the requester. If there are several styles to be applied to the current segment, they have equal precedence. If they conflict about their attributes, the results are random. If the style itself is styled, the net opinion to be applied to the current segment is figured first.

This should be compared with Include_Segment() , which adds to but does not change the current segment in any way.

The referenced segment (the segment that's to be used as a style) doesn't need to have anything in it, but it must at least exist at the time Style_Segment() is called.

NOTES

"Driver", "Streaming Mode", and "Metafile" attributes are not subject to being done as a Style.

RESTRICTIONS

See also:
Copy_Segment, Include_Segment, Conditional_Style
HC_KEY Style_Segment_By_Key ( HC_KEY  seg_key)

Similar to Style_Segment(), but operates on a style referenced by an HC_KEY.

Parameters:
seg_key- A key to the segment whose style you want to reference.
Returns:
A new key for the segment as styled, as opposed to its original segment key.

DETAILS

No additional details. See Style_Segment()

HC_KEY Style_Segment_Key_By_Key ( HC_KEY  target_segment,
HC_KEY  style_segment 
)

Similar to Style_Segment(), but styles a segment identified by target_segment.

Parameters:
target_segment- A key to the segment to be styled.
style_segment- A key to the segment whose style you want to reference.
Returns:
A new key for the segment as styled, as opposed to its original segment key.

DETAILS

No additional details. See Style_Segment().

HC_KEY Named_Style_Segment ( char const *  style_name)

Requests that the current segment be drawn in the style of the segment associated with the given name.

Parameters:
style_name- Name of the custom style.
Returns:
A new key for the segment as styled, as opposed to its original segment key.

DETAILS

Inserts a request into the currently open segment that whenever this segment is displayed, the referenced segment should be searched for and its opinions about attribute settings used. Each segment can have at most one named style associated with it.

See also:
Style_Segment, Define_Named_Style, UnDefine_Named_Style, Show_Named_Style_Segment
HC_KEY Named_Style_Segment_By_Key ( HC_KEY  target_segment,
char const *  style_name 
)

Similar to Named_Style_Segment() but operates on a key rather than an open segment.

Parameters:
target_segment- The segment to receive the indicated style.
style_name- Name of the custom style.
Returns:
A new key for the segment as styled, as opposed to its original segment key.

DETAILS

No additional details. See Named_Style_Segment().

HC_KEY Conditional_Style ( const char *  style,
const char *  conditions 
)

Similar to Style_Segment(), but uses a list of conditions that must be satisfied in order for the inclusion to apply.

Parameters:
style- Pathname to extra segment(s) to be styled when displaying the current segment.
conditions- The conditions that are associated with a particular conditional style and that are valid input to Set_Conditions().
Returns:
A new key for the segment as styled, as opposed to its original segment key.

DETAILS

The Conditional variant of Style_Segment allows the user to register, during the styling, one or a series of conditions that must match with the conditions set on the containing segment ( see Set_Conditions() ) in order for the styling to apply. The conditions are user-defined and have no internal meaning to HOOPS other than as elements that can be compared. Conditions are inherited down the tree like other regular attributes and are resolved at draw time when inheritance is fully resolved.

See also:
Show_Conditional_Style, Set_Conditions, Show_Conditions
HC_KEY Conditional_Style_By_Key ( HC_KEY  seg_key,
const char *  conditions 
)

Similar to Conditional_Style(), but accepts a key rather than a pathname to identify the segment to be styled.

Parameters:
seg_key- Segment key to extra segment(s) to be styled when displaying the current segment.
conditions- The conditions that are associated with a particular conditional style and that are valid input to Set_Conditions().
Returns:
A new key for the segment as styled, as opposed to its original segment key.

DETAILS

No additional details. See Conditional_Style()

Brief Index      Full Index      Events Index      I.M. Reference