Class: TCap

Declaration: GrafCaps.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TFlushCap TRoundCap TSquareCap

Purpose:

TCap is an abstract base class for implementing caps. Caps define the style in which to finish open geometries such as lines and curves. Caps are only created by the pen at points of zero discontinuity. A special pen can, however, change this default behavior. Caps define how the ends of open geometries are finished in the final drawing. Variations of caps include flush caps (where the geometry is cut flush at the end) and round caps (where a semicircle is appended to the end point of the geometry.) The end point of the geometry is considered to be the point used when defining the geometry, excluding any adjustments made for line width or other attributes. Caps can be applied to either end of an open geometry and can be different from one another. A cap can be thought of as an area attached to the end of the geometry. Within the area of the cap is a location known as the anchor point. This point is attached to the geometry at the end point. Adjustments to the size and orientation of the cap are made after the cap is anchored to the geometry. TCap, an abstract base class, declares a pure virtual function, MakeCap, that uses the data in TCapInfo to create the appropriate cap. Classes deriving from TCap provide the functionality for creating flush caps, round caps, square caps, and area caps by overriding TCap::MakeCap.

Instantiation:

Abstract base class; do not allocate.

Deriving Classes:

Provided classes include TFlushCap, TRoundCap, TSquareCap and TAreaCap. All classes deriving from TCap must implement the MakeCap function. Derived classes should also override AdjustBounds. (The extension mechanism for this class is not implemented.)

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TCap::~TCap

virtual ~ TCap ()

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

virtual 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: TCap::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in 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: TCap::TCap

  1. TCap ()
  2. TCap (const TCap &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators. Initializes nothing.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TCap is an abstract base class. Do not allocate.

Member Function: TCap::operator=

TCap & operator =(const TCap & source)

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: TCap::AdjustBounds

virtual TGRect AdjustBounds (const TGRect & currentBounds, const TPen * pen =NIL) const

Interface Category:

API.

Purpose:

Adjusts the bounds of the passed rect as per the pen and the cap itself.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A TGRect that is the modified version of the rectangle passed as the current bounds.

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.