Class: TGrafState

Declaration: GrafState.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TGrafStateAccessor TLinkedGrafState TRootGrafState

Purpose:

TGrafState is an abstract base class for representing a graphic state. A graphic state consists of all the graphical state variables needed to draw a geometry, including the paint, transfer mode, pen geometry, matrix, clip area, and so forth. These state variables are organized into seven substates. Four of these substates are used in 2-D graphics: (1) the 2-D attribute state (represented by a TAttributeState object that contains attribute objects, including paint, transfer mode, pen geometry, and image sampling, as well as an extensible list of TGrafAttributes); (2) the view matrix state (represented by a TMatrixState object whose transformation matrix defines the 2-D view coordinate system); (3) the 2-D model matrix state (represented by another TMatrixState object that defines the 2-D model coordinate system); and (4) the clip state (represented by a TClipState object that defines a clipping area, which need not be rectangular). The other three substates are used for 3-D graphics: (1) the 3-D attribute state (in this case, an instance of TAttribute3DState, which includes information such as shaders, colors, pen, and backface culling); (2) the scene state (an instance of TSceneState, which includes global features such as lights and camera); and (3) the 3-D model matrix state (an instance of TMatrix3DState, which defines the 3-D model coordinate system). Note that these substate classes do not derive from TGrafState. Most application programmers use TGrafPort objects, rather than use TGrafState objects directly. TGrafPorts have a TGrafState, and they also have knowledge of rendering devices, which TGrafStates do not. The TGrafState class does not itself provide any protocol for a hierarchy of graphic states; that ability is provided by its derived class TLinkedGrafState. The substate classes (TAttributeState and so on) also provide hierarchical behavior through their descendants, such as TLinkableAttributeState. Again, however, most application programmers use ports (such as TLinkedBundlePort) for this purpose.

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

Provided classes: TRootGrafState and TLinkedGrafState. Derived classes should override all the Get member functions, which are pure virtual.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

The version enum of this class treated as private by developers.

Member Function: TGrafState::~TGrafState

virtual ~ TGrafState ()

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: TGrafState::GetAttributeState

virtual const TAttributeState * GetAttributeState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TAttributeState containing 2-D attributes. This is a pure virtual function that must be overridden by derived classes.

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: TGrafState::GetAttribute3DState

virtual const TAttribute3DState * GetAttribute3DState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TAttribute3DState containing 3-D attributes. This is a pure virtual function that must be overridden by derived classes.

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: TGrafState::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 pure virtual function that must be overridden by derived classes.

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: TGrafState::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 pure virtual function that must be overridden by derived classes.

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: TGrafState::GetClipState

virtual const TClipState * GetClipState () const

Interface Category:

API.

Purpose:

Returns a constant pointer to a TClipState that defines the 2-D clipping area. This is a pure virtual function that must be overridden by derived classes.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrafState::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 pure virtual function that must be overridden by derived classes.

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: TGrafState::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 pure virtual function that must be overridden by derived classes.

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: TGrafState::TGrafState

  1. TGrafState ()
  2. TGrafState (const TGrafState &)

Interface Category:

API.

Purpose:

  1. Default constructor. This is a protected constructor that must be overridden by derived classes.
  2. Copy constructor. This is a protected constructor that must be overridden by derived classes.

Calling Context:

  1. Do not call this function directly.
  2. Called to copy an object. Do not call this function directly, except from within the copy constructor of a derived object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrafState::operator=

TGrafState & operator =(const TGrafState &)

Interface Category:

API.

Purpose:

Assignment operator. This is a protected constructor that must be overridden by derived classes.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrafState::operator>>=

TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator. This is a protected member function .

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrafState::operator<<=

TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator. This is a protected member function.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

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.