Contents Up Previous Next

wxPolygonShape

A wxPolygonShape's shape is defined by a number of points passed to the object's constructor. It can be used to create new shapes such as diamonds and triangles.

Derived from

wxShape

Members

wxPolygonShape::wxPolygonShape
wxPolygonShape::~wxPolygonShape
wxPolygonShape::Create
wxPolygonShape::AddPolygonPoint
wxPolygonShape::CalculatePolygonCentre
wxPolygonShape::DeletePolygonPoint
wxPolygonShape::GetPoints
wxPolygonShape::UpdateOriginalPoints


wxPolygonShape::wxPolygonShape

wxPolygonShape(void)

Constructor. Call wxPolygonShape::Create to specify the polygon's vertices.


wxPolygonShape::~wxPolygonShape

~wxPolygonShape()

Destructor.


wxPolygonShape::Create

void Create(wxList* points)

Takes a list of wxRealPoints; each point is an offset from the centre. The polygon's destructor will delete these points, so do not delete them yourself.


wxPolygonShape::AddPolygonPoint

void AddPolygonPoint(int pos = 0)

Add a control point after the given point.


wxPolygonShape::CalculatePolygonCentre

void CalculatePolygonCentre()

Recalculates the centre of the polygon.


wxPolygonShape::DeletePolygonPoint

void DeletePolygonPoint(int pos = 0)

Deletes a control point.


wxPolygonShape::GetPoints

wxList * GetPoints()

Returns a pointer to the internal list of polygon vertices (wxRealPoints).


wxPolygonShape::UpdateOriginalPoints

void UpdateOriginalPoints()

If we've changed the shape, must make the original points match the working points with this function.