IPaint
- IPaint is a concrete class that encapsulates the color and image pattern the user can set.
It is used to specify the color appearance of the source primitive.
IPaint - Member Functions and Data by Group
Constructors & Destructor
Use the constructors and destructor to create and destroy objects of class IPaint.
- ~IPaint
public:
virtual ~IPaint()
- Destroys an IPaint object.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- IPaint
- This function constructs an IPaint object.
Overload 1
public:
IPaint( const IBaseColor& aColor,
const IMaskPattern& maskPattern = IMaskPattern::solid ( ),
const IGPoint2D& patternPhase = IGPoint2D::origin ( ) )
- Use this constructor to create an IPaint object that takes a reference of a color and a mask pattern.
- aColor
- A constant reference to the color to be used.
- maskPattern
- A constant reference to the mask pattern. Default value is IMaskPattern::kSolid.
- patternPhase
- A constant reference to the point which is the offset to start tiling. Default is the origin of the maskPattern.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Overload 2
public:
IPaint( const IGImage& imagePattern,
const IGPoint2D& patternPhase = IGPoint2D::origin ( ) )
- Use this constructor to take a reference of image pattern.
- imagePattern
- The image pattern to be used.
- patternPhase
- The offset to start tiling. Default is the origin of the imagePattern.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Overload 3
- Copy constructor.
public:
IPaint(const IPaint&)
- Use this constructor to create an IPaint object that is copied from the given one.
- IPaint
- A constant reference to the IPaint object to be copied.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Overload 4
- Default constructor.
public:
IPaint()
- Use this constructor to creates a paint with black color and empty pattern.
Mask pattern is set to solid and pattern phase is set to zero.
Hit flag is set to false and hit detection is enabled.
Moved from protected for streaming.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Assignment Operator
Use this operator to assign the given object to the source one.
- operator =
public:
IPaint& operator =(const IPaint& source)
- Assignment operator.
- source
- A constant reference to the IPaint object on the right-hand side.
- Return
- A non-const reference to the left-hand side object.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Modifying the Paint Object
Use the functions in this group to set or remove the paint objects image pattern, to set its base color, to set its mask pattern, or to
set the offset point to the start of the tiling.
- removeImagePattern
public:
virtual void removeImagePattern()
- Deletes the image pattern and resets to NULL.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- setColor
public:
virtual void setColor(const IBaseColor& color)
- Sets the color of the paint after deleting the existing one.
- color
- The new color to be used.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- setImagePattern
public:
virtual void setImagePattern(const IGImage& imagePattern)
- Sets the image pattern of the paint object after deleting the existing one.
- imagePattern
- The image to be used as the image pattern.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- OS/2 Considerations
- The Image Fill Pattern can only be of size 8x8 , or unpredictable result.
- setMaskPattern
public:
virtual void
setMaskPattern( const IMaskPattern& MaskPattern = IMaskPattern::solid ( ) )
- Sets the pattern of the paint object after deleting the existing one.
- MaskPattern
- A constant reference to the new mask pattern to be set. By default, this value is the enum IMaskPattern::kSolid.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- setPatternPhase
public:
virtual void setPatternPhase(const IGPoint2D& patternPhase)
- Sets the new offset point to start tiling of the mask pattern in the paint object.
- patternPhase
- A constant reference to the new offset point of the mask pattern.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Obtaining Information About the Paint Object
Use the functions in this group to obtain information about the paint object, such as its base color, its image pattern, its
mask pattern, and the start of its tiling.
- color
public:
virtual const IBaseColor* color() const
- Returns the color of this IPaint object.
- Return
- A constant pointer to the color.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- imagePattern
public:
virtual const IGImage* imagePattern() const
- Returns the image pattern of the IPaint.
- Return
- A constant pointer to the image pattern.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- maskPattern
public:
virtual const IMaskPattern* maskPattern() const
- Returns the mask pattern of this IPaint object.
- Return
- A constant pointer to the mask pattern.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- patternPhase
public:
virtual const IGPoint2D* patternPhase() const
- Returns the offset point to start tiling of the mask pattern of this IPaint object.
- Return
- A constant pointer to the offset point.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Streaming a Paint Object In and Out
Use the functions in this group to read a paint object in from a stream or write one out to a stream.
- readFromStream
protected:
virtual void readFromStream(IDataStream& toWhere)
- Reads the paint object from the specified stream.
- fromWhere
- A reference to the stream from which the paint object is read.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- writeToStream
protected:
virtual void writeToStream(IDataStream& toWhere) const
- Writes the paint object out to the specified stream.
- toWhere
- A reference to the stream to which the paint object is written.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
Testing Two Paint Objects for Equality or Inequality
Use the equality and inequality operators in this group to test two paint objects for equality.
- operator !=
public:
virtual bool operator !=(const IPaint&) const
- Tests two IPaint objects for inequality.
- rhs
- A constant reference to the IPaint object to be compared with.
- Return
- True if any corresponding elements have different values.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- operator ==
public:
virtual bool operator ==(const IPaint&) const
- Tests two IPaint objects for equality.
- rhs
- A constant reference to the IPaint object to be compared with.
- Return
- True if all corresponding elements of the two have same value.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
IPaint - Inherited Member Functions and Data
Inherited Public Functions
- IMStreamable
-
- IPaint
-
Inherited Public Data
Inherited Protected Functions
- IMStreamable
-
IMStreamable()
IMStreamable(const IMStreamable& other)
virtual void readFromStream(IDataStream& fromwhere) = 0
virtual void writeToStream(IDataStream& towhere) const = 0
Inherited Protected Data