General Information about Structure Control and Miscellaneous Functions


For a related topics and a list of Structure Control and Miscellaneous Functions, see Structure Control and Miscellaneous Functions.

Topics in this section include:

There are some output commands that control the traversal of structure resources or do not directly cause the implementation to render anything.

The following Structure Control output commands control the renderer's traversal of structure networks:

The following miscellaneous output commands do not cause the renderer to render anything. They are provided primarily for application convenience:

Another output command controls the degree of parallelism that a renderer may use when processing the structure:

Conditional Traversal

For an overview, see Structure Control and Miscellaneous Functions.

Several of the output commands described in this chapter, along with the Extent Size lookup table, team up to provide a useful facility known as conditional traversal. One common use of conditional traversal is to reduce the amount of graphic data sent to the renderer if the graphic data is either out of view (clip test) or too small to be useful (size test).

Clip Test

See also Size Test.

For an overview, see Structure Control and Miscellaneous Functions.

Although the renderer will clip out-of-view data, it is often faster for the application to communicate the extent of an entire sub-network to the renderer and let the renderer perform the clip test once for the entire sub-network. Applications often keep graphic data that is contained in a small volume within a structure or sub-network.

To take advantage of this information, use the Test Extent (see PEXOCCTestExtent or PEXOCCTestExtent2D) output command to tell the renderer what the extent is of an object stored in a structure or sub-network. The renderer determines if the object is clipped completely from the view volume and sets a condition flag to indicate the result. Next, use the Conditional Execute Structure or Conditional Include Structure to draw the structure or sub-network depending on the condition flag. If the condition flag indicates that the object was completely clipped, the renderer does not traverse the requested sub-network, otherwise it does traverse it.

Note that this procedure saved the renderer the task of clip testing each primitive in the sub-network in the case when the entire object was clipped.

Size Test

See also Clip Test.

For an overview, see Structure Control and Miscellaneous Functions.

In some complex scenes, very detailed objects may only be a few pixels in size due to the current transformations. It is often a waste to draw the entire object because the details are lost in the small number of pixels the object occupies on the screen. It is therefore desirable to draw an alternate description of the object that represents the object with less detail and is faster to draw.

The principle is similar to the clip test, except that the renderer compares the supplied extent to the value given in the Extent Size lookup table. The Test Extent OC's (PEXOCCTestExtent and PEXOCCTestExtent2D) use a lookup table instead of a direct value to allow the application to alter all the values in the table to easily control the thresholds at which these size decisions are made. The renderer transforms the extent to DC before comparing the extent to the value in the Extent Size table, which is also in DC. The renderer stores the results of the test in the condition flags. You then use the three conditional output commands to control drawing of the various representations of the object.

Example: Suppose you want to draw a scene with many houses. The user is able to change the view so that the houses are displayed in any size, from very large to very small. If the house is displayed larger than a certain size (> 20 pixels), you want to draw the outline of the house, and if the house is smaller, then a dot polymarker will do. Start by storing the extent (20) in the Extent Size lookup table. Also, store the two representations of the house (dot, outline) in their own separate structures. Use the Test Extent OC (PEXOCCTestExtent and PEXOCCTestExtent2D) to test the extent of the house against the lookup table entry containing the size value (20 pixels). Then, use the Conditional Execute structure OC to draw a structure with the dot polymarker representation if the condition flag indicates the size check was less than the table value. In the same manner, use the Conditional Execute structure OC to draw the structure containing the polyline representation of the outline of the house if the size check was greater than or equal to the table value.