Table Of Contents

Previous topic

PolygonControlPoint

Next topic

RectangleShape

This Page

phoenix_title PolygonShape

A PolygonShape’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.


class_hierarchy Inheritance Diagram

Inheritance diagram for class PolygonShape

Inheritance diagram of PolygonShape


super_classes Known Superclasses

lib.ogl._basic.Shape


method_summary Methods Summary

__init__  
AddPolygonPoint Add a control point after the given point.
AttachmentIsValid  
CalculateBoundingBox  
CalculatePolygonCentre Recalculates the centre of the polygon, and
ClearPoints  
Create Takes a list of wx.RealPoints or tuples; each point is an offset
DeletePolygonPoint Delete the given control point.
GetAttachmentPosition  
GetBoundingBoxMin  
GetNumberOfAttachments  
GetOriginalHeight  
GetOriginalPoints  
GetOriginalWidth  
GetPerimeterPoint  
GetPoints Return the internal list of polygon vertices.
HitTest  
MakeControlPoints  
OnDraw  
OnDrawOutline  
OnSizingBeginDragLeft  
OnSizingDragLeft  
OnSizingEndDragLeft  
ResetControlPoints  
Rotate  
SetOriginalHeight  
SetOriginalWidth  
SetSize  
UpdateOriginalPoints If we’ve changed the shape, must make the original points match the

api Class API



class PolygonShape(Shape)

A PolygonShape’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.


Methods



__init__(self)


AddPolygonPoint(self, pos)

Add a control point after the given point.



AttachmentIsValid(self, attachment)


CalculateBoundingBox(self)


CalculatePolygonCentre(self)

Recalculates the centre of the polygon, and readjusts the point offsets accordingly. Necessary since the centre of the polygon is expected to be the real centre of the bounding box.



ClearPoints(self)


Create(self, the_points = None)

Takes a list of wx.RealPoints or tuples; each point is an offset from the centre.



DeletePolygonPoint(self, pos)

Delete the given control point.



GetAttachmentPosition(self, attachment, nth = 0, no_arcs = 1, line = None)


GetBoundingBoxMin(self)


GetNumberOfAttachments(self)


GetOriginalHeight(self)


GetOriginalPoints(self)


GetOriginalWidth(self)


GetPerimeterPoint(self, x1, y1, x2, y2)


GetPoints(self)

Return the internal list of polygon vertices.



HitTest(self, x, y)


MakeControlPoints(self)


OnDraw(self, dc)


OnDrawOutline(self, dc, x, y, w, h)


OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0)


OnSizingDragLeft(self, pt, draw, x, y, keys = 0, attachment = 0)


OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0)


ResetControlPoints(self)


Rotate(self, x, y, theta)


SetOriginalHeight(self, h)


SetOriginalWidth(self, w)


SetSize(self, new_width, new_height, recursive = True)


UpdateOriginalPoints(self)

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