Class: TSolidPen

Declaration: GrafPens.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TPen

Inherited By:

None.

Purpose:

TSolidPen renders a solid line that is defined by a balance, transform, and pen width. These properties have the same meanings as prescribed by the base class, TPen (which does not implement them itself).

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None. A class that draws dashed lines might be provided in the future.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TSolidPen::TSolidPen

  1. TSolidPen (const TSolidPen &)
  2. TSolidPen (GCoordinate penWidth, EPenBalance balance =kCenterFrame)
  3. TSolidPen ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Constructor to specify a pen with a specific width and balance. You must supply the width. The default balance is kCenterFrame.
  3. Default constructor. Sets pen width to 0.0 (hairline) and balance to kCenterFrame.

Calling Context:

  1. Called to copy an object.
  2. Called to construct a pen of a specified width and balance.
  3. Called by the stream-in operators and as the default constructor.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSolidPen::~TSolidPen

virtual ~ TSolidPen ()

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: TSolidPen::GetPenData

virtual EPenType GetPenData (EPenBalance & penBalance, GCoordinate & penWidth) const

Interface Category:

API.

Purpose:

Provides the caller with the most commonly needed information about this pen.

Calling Context:

Called when you need the balance, width, and type information about a pen quickly.

Parameters:

Return Value:

Returns an EPenType of kSolidPen.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSolidPen::GetPenType

virtual EPenType GetPenType () const

Interface Category:

API.

Purpose:

Returns the type of pen defined by this derived class of TPen.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns an EPenType of value kSolidPen.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSolidPen::GetPenBalance

virtual EPenBalance GetPenBalance () const

Interface Category:

API.

Purpose:

Returns the type of pen balance defined by this pen.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns an EPenBalance value (kCenterFrame, kInsetFrame or kOutsetFrame).

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSolidPen::GetPenWidth

virtual GCoordinate GetPenWidth () const

Interface Category:

API.

Purpose:

Returns the width of the pen in world coordinates.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a GCoordinate object specifying the width of the pen.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSolidPen::operator=

TSolidPen & operator =(const TSolidPen & 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: TSolidPen::operator>>=

virtual TStream & operator >>=(TStream & towhere) 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: TSolidPen::operator<<=

virtual TStream & operator <<= (TStream & fromwhere)

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

virtual TGRect AdjustBounds (const TGRect & bounds) const

Interface Category:

API.

Purpose:

Adjusts the size of the bounding rectangle to account for the width of the pen. The incoming rectangle is adjusted, if necessary, to account for the pen width. The rectangle is usually made smaller so that the added width of the pen restores the bounding rectangle to the originally specified size.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A TGRect which contains the adjusted rectangle coordinates.

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.