Class: TLinkedGrafState

Declaration: GrafState.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TGrafState

Inherited By:

TLinkedBundle3DGrafState TLinkedBundleGrafState TLinkedClipGrafState TLinkedModelMatrix3DGrafState TLinkedModelMatrixGrafState TLinkedSceneGrafState TLinkedViewMatrixGrafState

Purpose:

TLinkedGrafState is an abstract base class derived from TGrafState. It provides linking for a hierarchy of graphic states. The only linking protocol that TLinkedGrafState provides is a constructor argument that specifies the parent graphic state. TLinkedGrafState's Get member functions simply return the parent state's objects. A derived class can override this behavior as necessary. Think of a linked graphics state as a semantic copy of another graphics state (its parent), with one or more changes made to the copy. It is called a linked graphics state because of the efficient mechanism used to achieve this result. Because it is much too slow to actually make a copy of the parent state, the linked state stores a pointer to the parent and only changes those portions of the graphic state that are different from the parent state. Thus, linked graphics states are very lightweight; they are meant to be created and deleted as needed. In the typical case of a linked graphics state object, one specific state object is modified by concatenating the child's matrix with the parent's matrix. However, some modifications are more complicated that this. Most programmers use classes derived from TLinkedGrafPort, rather than from TLinkedGrafState. The former derived classes make internal use of the latter to implement linking behavior. For example, a TLinkedBundlePort uses a TLinkedBundleGrafState.

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

Provided classes include: TLinkedDeviceState, TLinkedBundleGrafState, TLinkedAttributeGrafState, TLinkedBundle3DGrafState, TLinkedAttribute3DGrafState, TLinkedViewMatrixGrafState, TLinkedModelMatrixGrafState, TLinkedClipGrafState, TLinkedSceneGrafState, and TLinkedModelMatrix3DGrafState. Some of these classes take objects such as a TGrafBundle or TGrafMatrix as constructor arguments, rather than substate objects such as TAttributeState. Typically, a derived class overrides one or two of the Get member functions (such as GetAttributeState), in order to return the child's object instead of the parent's, where applicable.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TLinkedGrafState::~TLinkedGrafState

virtual ~ TLinkedGrafState ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetAttributeState

virtual const TAttributeState * GetAttributeState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TAttributeState containing 2-D attributes. This is a virtual function that is designed to be overridden in a derived class if needed. The default behavior is to return the attribute state of the parent.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TAttributeState containing 2-D attributes.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetAttribute3DState

virtual const TAttribute3DState * GetAttribute3DState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TAttribute3DState containing 3-D attributes. This is a virtual function that is designed to be overridden in a derived class if needed. The default behavior is to return the 3-D attribute state of the parent.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TAttribute3DState containing 3-D attributes.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetViewMatrixState

virtual const TMatrixState * GetViewMatrixState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TMatrixState that defines the 2-D view coordinate system. This is a virtual function that is designed to be overridden in a derived class if needed. The default behavior is to return the view matrix state of the parent.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TMatrixState that defines the 2-D view coordinate system.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetModelMatrixState

virtual const TMatrixState * GetModelMatrixState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TMatrixState that defines the 2-D model coordinate system. This is a virtual function that is designed to be overridden in a derived class if needed. The default behavior is to return the model matrix state of the parent.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TMatrixState that defines the 2-D model coordinate system.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetClipState

virtual const TClipState * GetClipState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TClipState that defines a 2-D clipping area. This is a virtual function that is designed to be overridden in a derived class if needed. The default behavior is to return the clip state of the parent.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TClipState that defines a 2-D clipping area.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetSceneState

virtual const TSceneState * GetSceneState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TSceneState containing global 3-D features, such as the camera and lights. This is a virtual function that is designed to be overridden in a derived class if needed. The default behavior is to return the scene state of the parent.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TSceneState containing global 3-D features.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetModelMatrix3DState

virtual const TMatrix3DState * GetModelMatrix3DState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TMatrix3DState that defines the 3-D model coordinate system. This is a virtual function that is designed to be overridden in a derived class if needed. The default behavior is to return the 3-D model matrix state of the parent.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TMatrix3DState that defines the 3-D model coordinate system.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::TLinkedGrafState

TLinkedGrafState (const TGrafState * parent)

Interface Category:

API.

Purpose:

Constructor used to link this TLinkedGrafState to the given parent TGrafState. This is a protected constructor that must be overridden by derived classes.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLinkedGrafState::GetParent

const TGrafState * GetParent () const

Interface Category:

API.

Purpose:

Returns a pointer to the parent TGrafState object.

Calling Context:

Call from a derived class to get a pointer to the parent TGrafState object.

Parameters:

Return Value:

Returns a pointer to the parent TGrafState object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.