![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
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.
- TSolidPen (const TSolidPen &)
- TSolidPen (GCoordinate penWidth, EPenBalance balance =kCenterFrame)
- TSolidPen ()
Interface Category:
API.
Purpose:
- Copy constructor.
- Constructor to specify a pen with a specific width and balance. You must supply the width. The default balance is kCenterFrame.
- Default constructor. Sets pen width to 0.0 (hairline) and balance to kCenterFrame.
Calling Context:
- Called to copy an object.
- Called to construct a pen of a specified width and balance.
- Called by the stream-in operators and as the default constructor.
Parameters:
- const TSolidPen & -The object to be copied.
- GCoordinate penWidth -The width of the pen (in world coordinates).
- EPenBalance balance =kCenterFrame -The pen balance (kCenterFrame, kInsetFrame, or kOutsetFrame).
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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:
- EPenBalance & penBalance -The type of pen balance (internal, centered, or external).
- GCoordinate & penWidth -The width of the pen in world coordinates.
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:
- const TSolidPen & source -The object to be copied.
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:
- TStream & towhere -The stream to which the object streams itself out.
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:
- TStream & fromwhere -The stream from which the object streams itself in.
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:
- const TGRect & bounds -The rectangle to be adjusted.
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.