IGRPoint2DArray

IGRPoint2DArray provides array access for collections of IGRPoints. IGCurve2D uses IGRPoint2DArray. Note that IRawArray, from which this class inherits, does not check whether allocation is successful. Before constructing a new array, check to ensure that there is enough memory; use a reasonable size.


IGRPoint2DArray - Member Functions and Data by Group

Constructors & Destructor

Use these functions to construct and destroy objects of array objects of class IGRPoint2DArray.


[view class]
~IGRPoint2DArray
public:
~IGRPoint2DArray()
Destroys an object of class IGRPoint2DArray.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IGRPoint2DArray
Constructs an object of clas IGRPoint2DArray that provides array access for collections of IGRPoints.


Overload 1
Copy constructor
public:
IGRPoint2DArray(const IGRPoint2DArray& source)
Use this constructor to create an access array object of class IGRPoint2DArray that is copied from the given one.

source
A constant reference to the point array to be copied.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
Creates an array of IGRPoints of the specified size. The points are left uninitialized.
public:
IGRPoint2DArray(unsigned long size = 0)
Use this constructor to create an array of IGRPoints of the specified size whose points are not initialized.

size
The size of the array. Default value is 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
Constructs an IGRPoint2DArray from an IGPoint2DArray by setting fW = 1.0.
public:
IGRPoint2DArray(const IGPoint2DArray& source)
Use this constructor to create an object of class IGRPoint2DArray that is copied from the given one, setting fW = 1.0.

source
A constant reference to the IGPoint2DArray to copy from.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Bounding Rectangle of all Points in the Array

Use this function to create a rectangle that encompassess all the points in the array.


[view class]
bounds
public:
IGRect2D bounds() const
Creates a IGRect2D that bounds the points in the IGRPoint2DArray.

Return
The bounding rectangle.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Obtaining Information Array Access Object

Use the functions in this group to obtain information such as the number of points an array access object contains and the point indicated by a specific index into the array.


[view class]
numberOfPoints
public:
unsigned long numberOfPoints() const
Computes the number of points in the IGRPoint2DArray.

Return
The number of points in the array.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
point
public:
IGRPoint2D point(unsigned long i) const
Gets the point of class IGRPoint2D at the specified index.

i
The index (whose value must be less than the number of points in the array).

Return
The point at the specified index.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Setting the Array Access Points

Use the function in this group to set the point at a specific index into the array of the IGRPoint2DArray object.


[view class]
setPoint
public:
void setPoint(unsigned long i, const IGRPoint2D& p)
Sets the IGRPoint2D at the specified index, to the specified point.

i
The index whose value must be less than the number of points in the array.
p
The new point.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Streaming an Object In and Out

Use the functions in this group to read an IGRPoint2DArray object in from the specified stream or write it out to it.


[view class]
operator <<=
public:
IDataStream& operator <<=(IDataStream&)
Reads the IGrPoint2DArray object in from the specified stream.

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

Return
The original stream.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator >>=
public:
IDataStream& operator >>=(IDataStream&) const
Writes the IGRPoint2DArray object out to the specified stream.

toWhere
A reference to the stream that the object is written out to.

Return
The original stream.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IGRPoint2DArray - Inherited Member Functions and Data

Inherited Public Functions

IRawArray

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data