Home | Trees | Index | Help |
|
---|
Package wx :: Package lib :: Package ogl :: Class PolygonShape |
|
object
--+ |ShapeEvtHandler
--+ |Shape
--+ | 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.
Method Summary | |
---|---|
__init__(self)
| |
Add a control point after the given point. | |
TRUE if attachment is a valid attachment point. | |
CalculateBoundingBox(self)
| |
Recalculates the centre of the polygon, and readjusts the point offsets accordingly. | |
ClearPoints(self)
| |
Takes a list of wx.RealPoints or tuples; each point is an offset from the centre. | |
Delete the given control point. | |
Get the position at which the given attachment point should be drawn. | |
Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text). | |
Get the number of attachment points for this shape. | |
GetOriginalHeight(self)
| |
GetOriginalPoints(self)
| |
GetOriginalWidth(self)
| |
Get the point at which the line from (x1, y1) to (x2, y2) hits the shape. | |
Return the internal list of polygon vertices. | |
Given a point on a canvas, returns TRUE if the point was on the shape, and returns the nearest attachment point and distance from the given point and target. | |
Make a list of control points (draggable handles) appropriate to the shape. | |
OnDraw(self,
dc)
| |
OnDrawOutline(self,
dc,
x,
y,
w,
h)
| |
OnSizingBeginDragLeft(self,
pt,
x,
y,
keys,
attachment)
| |
OnSizingDragLeft(self,
pt,
draw,
x,
y,
keys,
attachment)
| |
OnSizingEndDragLeft(self,
pt,
x,
y,
keys,
attachment)
| |
Reset the positions of the control points (for instance when the shape's shape has changed). | |
Rotate about the given axis by the given amount in radians. | |
SetOriginalHeight(self,
h)
| |
SetOriginalWidth(self,
w)
| |
SetSize(self,
new_width,
new_height,
recursive)
| |
If we've changed the shape, must make the original points match the working points with this function. |
Class Variable Summary |
---|
Method Details |
---|
AddPolygonPoint(self, pos)Add a control point after the given point. |
AttachmentIsValid(self, attachment)TRUE if attachment is a valid attachment point.
|
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. |
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)Get the position at which the given attachment point should be drawn. If attachment isn't found among the attachment points of the shape, returns None.
|
GetBoundingBoxMin(self)Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text). Must be overridden.
|
GetNumberOfAttachments(self)Get the number of attachment points for this shape.
|
GetPerimeterPoint(self, x1, y1, x2, y2)Get the point at which the line from (x1, y1) to (x2, y2) hits the shape. Returns False if the line doesn't hit the perimeter.
|
GetPoints(self)Return the internal list of polygon vertices. |
HitTest(self, x, y)Given a point on a canvas, returns TRUE if the point was on the shape, and returns the nearest attachment point and distance from the given point and target.
|
MakeControlPoints(self)Make a list of control points (draggable handles) appropriate to the shape.
|
ResetControlPoints(self)Reset the positions of the control points (for instance when the shape's shape has changed).
|
Rotate(self, x, y, theta)Rotate about the given axis by the given amount in radians.
|
UpdateOriginalPoints(self)If we've changed the shape, must make the original points match the working points with this function. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:07:54 2007 | http://epydoc.sf.net |