IGQuadrilateral

IGQuadrilateral provides a four-sided polygon. This class specifies the quadrilateral used for specifying perspective and affine mapping.


IGQuadrilateral - Member Functions and Data by Group

Constructors & Destructor

Use the functions in this group to create and destroy quadrilateral objects.


[view class]
~IGQuadrilateral
public:
virtual ~IGQuadrilateral()
Destroys the quadrilateral object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IGQuadrilateral
Constructs a quadrilateral.


Overload 1
Creates a quadrilateral for a rectilinear mapping.
public:
IGQuadrilateral(const IGRect2D&)
Use this constructor to create a quadrilateral object for a rectilinear mapping.

rect
A constant reference to a rectangle. (0=TopLeft, 1=TopRight, 2=BottomRight, 3=BottomLeft).

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
Default constructor.
public:
IGQuadrilateral()
Use this constructor to create an IGQuadrilateral with all vertices at the origin.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
Copy constructor.
public:
IGQuadrilateral(const IGQuadrilateral&)
Use this constructor to create a quadrilateral object that is copied from the given one.

src
A constant reference to the IGQuadrilateral object to be copied.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 4
Creates a quadrilateral using the given IGPoint2D point values.
public:
IGQuadrilateral( const IGPoint2D& p0, const IGPoint2D& p1, const IGPoint2D& p2, const IGPoint2D& p3 )
Use this constructor to create a quadrilateral for a general perspective mapping.

p0
Vertex 0.
p1
Vertex 1.
p2
Vertex 2.
p3
Vertex 3.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment Operator

Use this function to assign one quadrilateral object to another.


[view class]
operator =
public:
IGQuadrilateral& operator =(const IGQuadrilateral& Src)
Assignment operator.

src
A constant reference to the object to be copied.

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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Modifying Quadrilateral Values

Use the functions in this group to modify the quadrilateral object, for example, to set a specific vertex or to pass a quadrilateral through a linear transformation.


[view class]
setPoint
public:
void setPoint(unsigned long index, const IGPoint2D& p)
Sets the specified vertex of the quadrilateral.

index
The index value for the vertex. It must be less than 4.
p
The new value for the vertex.

Exception

IGraphicException when the parameter index is greater than 3. The errorId is set to IGraphicException::kIndexAboveRange.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
transformBy
public:
void transformBy(const IGrafMatrix& mat)
Passes a quadrilateral through a linear transformation.

mat
A constant reference to the transformation matrix.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Obtaining Information About the Quadrilateral

Use the functions in this group to obtain information about the quadrilateral, such as whether it is a degenerate polygon, its geometry's bounding rectangle, the value of a specific vertex, or the values of its four vertices.


[view class]
bounds
public:
IGRect2D bounds() const
Returns the geometry's bounding rectangle, which is the smallest axis-aligned rectangle that encloses the quadrilateral.

Return
The bounding rectangle.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isDegenerate
public:
bool isDegenerate() const
Checks to see if the IGQuadrilateral is a degenerate polygon.

Return
True if the points that make up the quadrilateral are either concave or colinear (no two points are identical or no three points are colinear).

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
point
public:
IGPoint2D point(unsigned long index) const
Returns the specified vertex of the quadrilateral.

index
The index value for the required vertex. It must be less than 4.

Return
The specified vertex point.

Exception

IGraphicException when the parameter index is greater than 3. The errorId is set to IGraphicException::kIndexAboveRange.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
points
public:
void points( IGPoint2D& p0, IGPoint2D& p1, IGPoint2D& p2, IGPoint2D& p3 ) const
Returns, in the specified parameters, the quadrilateral's four vertices.

p0
Vertex 0.
p1
Vertex 1.
p2
Vertex 2.
p3
Vertex 3.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Streaming the Object In and Out

Use the functions in this group to write the quadrilateral object out to a stream or read it in from a stream using either the functions or the operators for these purposes. The functions are readFromStream and writeToStream. The operators are operator <<= and operator >>=.


[view class]
operator <<=
public:
IDataStream& operator <<=(IDataStream&)
Operator that streams in the quadrilateral object from the stream specified.

inStream
A reference to the stream from which the object is read.

Return
A reference to the original data stream.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator >>=
public:
IDataStream& operator >>=(IDataStream&) const
Operator that streams out the quadrilateral object to the stream specified.

outStream
A reference to the stream to which the object is written.

Return
A reference to the original data stream.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

fromWhere
A reference to the stream from which the quadrilateral object is read.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

toWhere
A reference to the stream used to stream the quadrilateral object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Testing Two Quadrilaterals for Equality or Inequality

Use the functions in this group to test two quadrilaterals for equality or inequality.


[view class]
operator !=
public:
bool operator !=(const IGQuadrilateral& Src) const
Test the two quadrilaterals for inequality.

src
A constant reference to the quadrilateral to be compared with the current one.

Return
True if at least one of four corresponding vertices of the quadrilaterals are different.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ==
public:
bool operator ==(const IGQuadrilateral& Src) const
Test the two quadrilaterals for equality.

src
A constant reference to the quadrilateral to be compared with the current one.

Return
True if all four corresponding vertices of the quadrilaterals are equal.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IGQuadrilateral - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data