Class: TClipState

Declaration: ClipState.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TLinkableClipState TLinkableTransformedClipState TRootClipState

Purpose:

TClipState is an abstract class that supplies a clipping area. A clipping area is a boundary beyond which a 2-D graphic is not drawn. For example, the Taligent logo can be approximated by two sets of concentric ellipses that are clipped by a square. Although clipping areas are frequently rectangular, they can just as easily have any shape that can be represented by a TGArea object. The clipping area is just one of the state variables in a graphics state, represented by TGrafState; the entire set of state variables define how to render a geometry. (In addition to the TClipState, a TGrafState contains a TMatrixState, which encapsulates the transformation matrix for a 2-D graphic, as well as a TAttributeState, which contains attributes such as paint, transfer mode, and pen geometry.) Derived classes typically implement storage, concatenation behavior, and caching of appropriate values. In particular, derived classes such as TLinkableClipState provide the ability to construct a hierarchy of clipping areas. However, most application programmers will use port objects, such as TLinkedClipPort, rather than use TClipState objects directly. Like other state classes, TClipState implements member functions for maintaining a time stamp. Time stamps are a quick and efficient way to determine if two TClipState objects are equal. If the time stamps of the two objects are equal, then the objects are equal. However, if the time stamps are not equal, the objects might or might not be equal. The time stamp is updated whenever the object changes. As a special case, a time stamp of zero indicates that the object has an infinite clipping area (which means that nothing gets clipped). Normal time stamps are stored separately for each object in a hierarchy of clip states. Using normal time stamps, each object in the hierarchy must be queried to determine whether anything in the hierarchy has changed. Shared time stamps provide a more efficient alternative. A TSharedTimeStampState object contains a time stamp that changes whenever any part of the clip state hierarchy changes. TClipState::GetSharedTimeStampState returns a pointer to this object, allowing you to determine more quickly if anything has changed.

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

Provided classes: TLinkableClipState and TLinkableTransformedClipState. A derived class must maintain the value of its time stamp. If any part of the object's visible value changes, then it updates its time stamp by calling UpdateTimeStamp.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

The version enum of this class should be treated as private.

Member Function: TClipState::~TClipState

virtual ~ TClipState ()

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: TClipState::GetClipArea

virtual const TGArea * GetClipArea () const

Interface Category:

API.

Purpose:

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

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a constant pointer to the clipping area.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TClipState::TClipState

  1. TClipState ()
  2. TClipState (const TClipState &)

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 designed to be be overridden by derived classes.

Calling Context:

  1. Do not call this function directly, except from within the default constructor of a derived class.
  2. Do not call this function directly, except from within the copy constructor of a derived class.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TClipState::operator=

TClipState & operator =(const TClipState &)

Interface Category:

API.

Purpose:

Assignment operator. This is a protected member function that is designed to be overridden by derived classes.

Calling Context:

Do not call this function directly, except from within the operator equals of a derived class.

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: TClipState::operator>>=

TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator. This is a protected member function that is designed to be called by the derived class stream-out operator.

Calling Context:

Called to stream out data.

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: TClipState::operator<<=

TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator. This is a protected member function that is designed to be called by the derived class stream-out operator.

Calling Context:

Called to stream in data.

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.

Member Function: TClipState::GetSharedTimeStampState

virtual TTimeStampState* GetSharedTimeStampState () const

Interface Category:

API.

Purpose:

Returns a pointer to the shared time stamp of this object. The shared time stamp changes whenever any clip state within the hierarchy changes. This is a pure virtual function that must to be overridden by derived classes.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns a pointer to the shared time stamp of the hierarchy.

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.