Graphic State Classes

The state classes described in the headings that follow are instantiated during the Draw call to handle the graphic state information. The linked port classes let you customize the rendering process to use your own scene bundle; define a clipping area; and to concatenate specific substates such as an attribute bundle, modeling matrix, or view matrix to the graphic state. The linked port classes are described under the heading "Linked ports" on page 368.

TAttributeState

As shown in Figure 231, TAttributeState is the abstract base class for the 2D attribute bundle (TGrafBundle). TGrafState::GetAttributeState returns the 2D attribute state instance of the graphic state.


TLinkableAttributeState: This abstract base class lets a child TAttributeState instance link to a parent TAttributeState instance. The linking occurs by way of the LinkTo and Unlink functions, which are called from within the TLinkedBundlePort class described under the heading "Linked ports" on page 368.

TFlattenedAttributeState: This class can be used by the graphics device (see the heading "Graphics devices" on page 372) during rendering calls to spool the data to a printer or file.

TLinkedBundleState: This class links an instance of a TGrafBundle to a parent TAttributeState instance to support hierarchies of bundles. The linking occurs in the constructor.

TAttribute3DState

As shown in Figure 232, TAttribute3DState is the abstract base class for the 3D attribute bundle (TGrafBundle3D). TGrafState::GetAttribute3DState returns the 3D attribute state object of the graphic state. The architecture is exactly parallel to TAttributeState.


TLinkableAttribute3DState: This abstract base class lets a child TAttribute3DState instance link to a parent TAttribute3DState instance. The linking occurs by way of the LinkTo and Unlink functions, which are called from within the TLinkedBundle3DPort class described under the heading "Linked ports" on page 368.

TLinkedBundle3DState: This class links an instance of a TGrafBundle3D to a parent TAttribute3DState instance to support hierarchies of bundles. Linking occurs in the constructor.

TMatrixState

As shown in Figure 233, TMatrixState is the abstract base class that provides a 2D transformation matrix. TMatrixState::GetMatrix returns the 2D transformation matrix (TGrafMatrix) of the 2D graphic state. By default, the 2D transformation matrix of the graphic state is the identity matrix.


TLinkableMatrixState: This abstract base class lets a child TMatrixState instance link to a parent TMatrixState instance by way of the LinkTo and Unlink functions, which are called from within the TLinkedModelMatrix class described under the heading "Linked ports" on page 368.

TSimpleMatrixState: This class implements a single local matrix. When linked to a parent TMatrixState instance, this class preconcatenates its matrix with the TMatrixState instance.

TMatrix3DState

As shown in Figure 234, TMatrix3DState is the abstract base class that provides a 3D transformation matrix. TCamera and TLinkableMatrix3DState derive from TMatrix3DState. TCamera is an abstract base class that contains the viewing parameters for a 3D scene. See Chapter 17 for a full description of the TCamera class. TLinkableCamera and TLinkableMatrix3DState are described under the headings that follow.

TMatrix3DState::GetMatrix returns the 3D transformation matrix (TGrafMatrix3D) of the 3D graphic state. By default the 3D transformation matrix of the graphic state is the identity matrix. This class is exactly parallel to TMatrixState.


Linkable cameras

Figure 235 shows the class architecture for linking cameras.


TLinkableCamera: This abstract base class lets one TMatrix3DState instance link to another TMatrix3DState instance by way of the LinkTo and Unlink functions, which are called from within the TLinkedScenePort class described under the heading "Linked ports" on page 368. The LinkTo function has protocol for linking the camera to a TMatrix3DState and TClipState.

TPerspectiveCamera: This class provides a camera that corresponds to cameras in the real world. Its center of projection is at the point where the projectors converge. Projectors are straight lines that connect points in the scene with their corresponding points in the projection plane. The size of the projected image depends on the relative distances between the camera, the projection plane, and the 3D scene.

TParallelCamera: This class provides a camera in which the projectors are parallel and the projected image size is always the same regardless of the distances involved.

NOTE See Chapter 17 for more information on perspective and
parallel cameras.

Linkable matrices

Figure 236 shows the class architecture for linking 3D matrices.


TLinkableMatrix3DState: This abstract base class lets a child TMatrix3DState instance link to a parent TMatrix3DState instance by way of the LinkTo and Unlink functions, which are called from within the TLinkedModelMatrix3D class described under the heading "Linked ports" on page 368.

TSimpleMatrix3DState: This class implements a single local matrix. When linked to a parent TMatrix3DState instance, this class preconcatenates its matrix with the TMatrix3DState instance.

TSceneState

As shown in Figure 237, this is the abstract base class for accessing the scene bundle (TSceneBundle). The TSceneState functions shown in the diagram return the ambient lighting, atmosphere shader, and camera of the graphic state. The default settings for the graphic state scene bundle are described in Chapter 17.


TLinkableClippingSceneState: This abstract base class allows linking to a matrix and a clip area by taking instances of TMatrixState and TClipState as parameters to the LinkTo function. The camera uses this information to calculate its 3D matrix.

TLinkableSceneState: This abstract base class lets one TSceneState instance link to another TSceneState instance by way of the LinkTo and Unlink functions, which are called from within the TLinkedScenePort class described under the heading "Linked ports" on page 368.

TClipState

As shown in Figure 238, this is the abstract base class for the clip area (TGArea). TClipState::TGGetClipArea returns the 2D clipping area of the graphic state. By default, the graphic state clipping area is infinite.


TLinkableTransformedClipState: This abstract base class allows linking to a coordinate system and lets a child TClipState instance link to a parent TClipState instance by taking instances of TMatrixState and TClipState as parameters to the LinkTo function. This class transforms its local clip area by the TMatrixState parameter and intersects the result with the clip area specified by the TClipState parameter.

TSimpleClipState: This class implements a single, local clip area.

TLinkableClipState: This abstract base class lets a child TClipState instance link to a parent TClipState instance by way of the LinkTo and Unlink functions, which are called from within the TLinkedClipPort class described under the heading "Linked ports" on page 368.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker