Class: TSimpleClipState

Declaration: ClipState.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TLinkableTransformedClipState

Inherited By:

None.

Purpose:

TSimpleClipState is a concrete class, derived from TLinkableTransformedClipState, that implements the simplest case of a clip state: a single, owned clipping area in a local coordinate system. TSimpleClipState's single local clipping area can be made part of a hierarchy by linking the TSimpleClipState to another clip state object. TSimpleClipState implements linking by transforming its local clipping area by the specified matrix (obtained from the TMatrixState argument to LinkTo), and then intersecting the result with the parent's clipping area. When this happens, TSimpleClipState caches the result, updates its own time stamp, and records the parent's time stamp. Then, if the same parent is used again, its time stamp is compared to the recorded one. If neither the parent's time stamp nor the local time stamp has changed, the clipping areas are known to be unchanged, so it is not necessary for the TSimpleClipState to recalculate the transformation and intersection. You can set the local clipping area to any TGArea. It is OK to change the local clipping area or the parent's clipping area while this object is linked to the parent; doing so causes the concatenation to be recomputed.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TSimpleClipState::TSimpleClipState

  1. TSimpleClipState ()
  2. TSimpleClipState (const TSimpleClipState &)
  3. TSimpleClipState (const TGArea & localClipArea)

Interface Category:

API.

Purpose:

  1. Default constructor. Sets the local clipping area to an infinite rectangle and the parent object to NIL.
  2. Copy constructor.
  3. Constructor used to set the clipping area to the given TGArea.

Calling Context:

  1. Called by the stream-in operators. You can also call this function directly.
  2. Called to copy an object.
  3. 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: TSimpleClipState::~TSimpleClipState

virtual ~ TSimpleClipState ()

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

virtual const TGArea * GetClipArea () const

Interface Category:

API.

Purpose:

Returns a constant pointer to the clipping area (which is already concatenated with the parent's clipping area if the object has been linked to a parent). The clipping area is validated and recomputed (if necessary) before being returned.

Calling Context:

Because the value of the clip area depends on the parent's clip area as well as the local clip area, this function should only be called when linked to a parent.

Parameters:

Return Value:

Returns a constant pointer to the clipping area represented by this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleClipState::LinkTo

virtual void LinkTo (const TClipState * parenClipState, const TMatrixState * matrixState)

Interface Category:

API.

Purpose:

Makes the specified TClipState the parent of this object by applying the specified transformation matrix to this object's clipping area and then intersecting the two object's clipping areas.

Calling Context:

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: TSimpleClipState::Unlink

virtual void Unlink ()

Interface Category:

API.

Purpose:

Severs the connection between this object and its parent.

Calling Context:

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

TSimpleClipState & operator =(const TSimpleClipState &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

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

bool operator ==(const TSimpleClipState &) const

Interface Category:

API.

Purpose:

Compares two objects and returns true if they are equal. To be equal, they must be linked to the same parent and have the same clipping area.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if both objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleClipState::operator!=

bool operator != (const TSimpleClipState &) const

Interface Category:

API.

Purpose:

Compares two objects and returns true if they are not equal. They must be linked to the same parent and have the same clipping area to be equal.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the objects are not equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleClipState::operator>>=

TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

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

TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator. When streaming in a TSimpleClipState object, the parent object is set to NIL and the intersecting clip area is set to an infinite rectangle.

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: TSimpleClipState::SetLocalClipArea

void SetLocalClipArea (const TGArea &)

Interface Category:

API.

Purpose:

Sets the local clipping area to the given TGArea. If this object has a parent the shared time stamp is updated.

Calling Context:

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: TSimpleClipState::GetLocalClipArea

const TGArea * GetLocalClipArea () const

Interface Category:

API.

Purpose:

Returns the local clipping area.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TGArea object that represents the local clipping area.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleClipState::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.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to a TTimeStampState object that represents the time of the last modification of any clip state in this 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.