IPen

The IPen class is designed to encapsulate most of the functionality of 2-dimensional pens.


IPen - Member Functions and Data by Group

Constructors & Destructor

Use the constructors in this group to construct and destroy objects of class IPen.


[view class]
~IPen
public:
~IPen()

Destructs an object of class IPen.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IPen
Constructs an object of class IPen.


Overload 1
Copy constructor.
public:
IPen(const IPen&)

IPen
A constant reference to the IPen to copy from.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IPen( EPenType type, GCoordinate penWidth = 1.0, EPenBalance = kCenterFrame )
Constructor with input values. When creating a kHairline Pen the penWidth and the pen Balance parameters are ignored.

type
The type of the pen.
penWidth
The width of the pen in world coordinates. The default value is 1.0.
EPenBalance
The type of pen balance (internal, external, or centered). The default value is kCenterFrame.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
public:
IPen()
Constructor with default value: fPenType = kSolid, fPenWidth = 1.0, fPenBalance = kCenterFrame. When creating a kHairline Pen the penWidth and the pen Balance parameters are ignored.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment Operator

Use the operator in this group to assign the given object to the target one.


[view class]
operator =
public:
IPen& operator =(const IPen& source)
Assignment operator.

source
The pen to copy from.

Return
A non-const reference to the left-hand side object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Comparing Two IPen Objects for Equality or Inequality

Use the operators in this group to compare the two IPen objects for equality or inequality.


[view class]
operator !=
public:
virtual bool operator !=(const IPen&) const
Tests two IPen objects for inequality.

IPen
A constant reference to the IPen to be compared with.

Return
True if not all the corresponding parameters of the two IPen objects have same value.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ==
public:
virtual bool operator ==(const IPen&) const
Tests two IPen objects for equality.

IPen
A constant reference to the IPen to be compared with.

Return
True if the corresponding parameters of the two IPen objects have same value.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Getting and Setting the Pen Balance Parameters

Use the functions in this group to get and set the pen balance parameters.


[view class]
penParams
public:
EPenType penParams( GCoordinate& penWidth, EPenBalance& penBalance ) const
Gets the parameters of this pen.

penWidth
The width of the pen in world coordinates. The default value is 1.0.
penBalance
The type of pen balance (internal, external, or centered).

Return
The type of pen.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setPenParams
public:
void setPenParams( EPenType type, GCoordinate penWidth = 1.0, EPenBalance = kCenterFrame )
Sets the parameters of this pen using suitable combinations. (e.g. for kHairline sets penWidth to 1.0 and penBalance to unknownFrame) The Pen Balance attribute of the pen does not affect the rendering of open geometries such as lines, curves etc. Also, for hairline pen the pen width and the penBalance attributes are ignored.

type
The type of pen.
penWidth
The width of the pen in world coordinates. The default value is 1.0.
EPenBalance
The type of pen balance (internal, external, or centered). The default value is kCenterFrame.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Getting and Setting the Pen Balance Type

Use the functions in this group to get and set the pen balance type.


[view class]
penBalance
public:
EPenBalance penBalance() const
Gets the type of pen balance.

Return
The type of pen balance.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setPenBalance
public:
void setPenBalance(EPenBalance penBalance)
Sets the type of pen balance using suitable combinations. (e.g. for kHairline sets penWidth to 1.0 and penBalance to unknownFrame)

penWidth
The type of pen balance.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Getting and Setting the Pen Type and Width

Use the functions in this group to get and set the pen type and width.


[view class]
penType
public:
EPenType penType() const
Gets the type of this pen.

Return
The type of pen.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
penWidth
public:
GCoordinate penWidth() const
Gets the width of the pen in world coordinates.

Return
The width of the pen.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setPenType
public:
void setPenType(EPenType penType)
Sets the type of the pen using suitable combinations.(e.g. for kHairline sets penWidth to 1.0 and penBalance to unknownFrame) For pens setting of the pen type might also reset the other paramters: for kHairline, sets PenWidth to 1.0 and PenBalance to unknownFrame; for kUnknownPen, sets PenWidth to 1.0 and PenBalance to UnknownFrame; otherwise, no change.

penType
The type of the pen.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setPenWidth
public:
void setPenWidth(GCoordinate penWidth)
Sets the width of the pen in world coordinates using suitable combinations.

penWidth
The width of the pen in world coordinates.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Streaming the IPen Object In and Out

Use the functions in this group to read the IPen object in from the specified stream and write it out to it.


[view class]
readFromStream
protected:
virtual void readFromStream(IDataStream& toWhere)
Reads the IPen object in from the specified stream.

fromWhere
The stream from which the IPen object is read in.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
writeToStream
protected:
virtual void writeToStream(IDataStream& toWhere) const
Writes the IPen object out to the specified stream.

toWhere
The stream to which the IPen object is written out.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IPen - Enumerations


[view class]
EPenBalance
enum EPenBalance { kCenterFrame, 
                   kInsetFrame, 
                   kUnknownFrame }
EPenBalance describes the details of the pen behavior.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
EPenType
enum EPenType { kHairline, 
                kSolid, 
                kDashed, 
                kDot, 
                kDashDot, 
                kDashDotDot, 
                kInvisible, 
                kUnknownPen }
EPenType describes the details of the pen behavior.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IPen - Inherited Member Functions and Data

Inherited Public Functions

IMStreamable

Inherited Public Data

Inherited Protected Functions

IMStreamable

Inherited Protected Data