Class Reference pointArray

An array of points to store polygon or path data. More...

Member

pointArray( )
pointArray(pointArray array)
pointArray(int size)
void addCornerArea(double value1,double value2,int angleInt=0)
void attach(int x, int y)
void attachPoint(point p)
point center()
point centerOfGravity()
void chamfer(double value,int type,int angleInt=0)
void filletBezier(double value,int type,int angleInt=0)
void filletRound(double value,int type,int angleInt=0)
void flip()
void insert(uint i, point p)
point maximum()
point minimum()
point point(int i)
void resize(int size)
void set(int i, int x, int y)
void setPoint(int i,point p)
int size()

Detailed Description

This class stores an array of class point. The size of the array can be adjusted at runtime and has no limitation. It can be used to create paths, polygons or other shapes.

Example:


 pointArray pa=l->thisElement->getPoints();
 string sx,sy;
 for (i=0; i<pa.size(); i++){
    p=pa.point(i);
    sx.setNum(p.x());
    sy.setNum(p.y());
    }

See also: class point, class drawingField

Member Function Documentation


pointArray::pointArray( )

Creates an empty array of points.


pointArray::pointArray(pointArray array)

Creates an array of points containing a copy of array


pointArray::pointArray(int size)

Creates a array of points with the given size.


void pointArray::addCornerArea(double value1,double value2,int angleInt=0)

Modifies a pointArray in the same way as cell::addCornerAreaSelect it does for selected polygons.


void pointArray::attach(int x, int y)

Add a point with the cooridinates (x,y) to the end of the pointArray. The size of the array will be increased.


void pointArray::attachPoint(point p)

Add the point p to the end of the pointArray. The size of the array will be increased.


point pointArray::center()

Returns: the center of of the bounding box of the polygon (introduced with release 20180623)


point pointArray::centerOfGravity()

Returns: the center of gravity of the polygon


void pointArray::chamfer(double value,int type,int angleInt=0)

Modifies a pointArray in the same way as cell::chamferSelect it does for selected polygons.


void pointArray::filletBezier(double value,int type,int angleInt=0)

Modifies a pointArray in the same way as cell::filletBezierSelect it does for selected polygons.


void pointArray::filletRound(double value,int type,int angleInt=0)

Modifies a pointArray in the same way as cell::filletRoundSelect it does for selected polygons.


void pointArray::flip()

will flip the order of the point in the array. First point will get last point, etc.


void pointArray::insert(uint i, point p)

Inserts the point p at position i into the array. The size of the array will be increased.


point pointArray::maximum()

Returns: the upper right corner of the bounding box of the polygon (introduced with release 20180623)


point pointArray::minimum()

Returns: the lower left corner of the bounding box of the polygon (introduced with release 20180623)


point pointArray::point(int i)

Returns: the point at the position i


void pointArray::resize(int size)

Changed the size of the array. If size is bigger than the current size of the array, new points will be added to the end of the array. If it is smaller, points at the end will be deleted.


void pointArray::set(int i, int x, int y)

Changed the coordinates of the point at position i to the values x and y.


void pointArray::setPoint(int i,point p)

Sets the point p at the index of i.


int pointArray::size()

Returns: the size of the array