Polygon Class Reference

Inheritance diagram for Polygon:

Inheritance graph

Public Member Functions

def __init__(self, points)
def addHandler(self, handler)[Inherited from _EventTrigger]
def addPoint(self, point, index=-1)[Inherited from Path]
def adjustReference(self, dx, dy)[Inherited from Drawable]
def clearPoints(self)[Inherited from Path]
def clone(self)[Inherited from Drawable]
def deletePoint(self, index=-1)[Inherited from Path]
def flip(self, angle=0)[Inherited from Drawable]
def getBorderColor(self)[Inherited from Shape]
def getBorderWidth(self)[Inherited from Shape]
def getDepth(self)[Inherited from Drawable]
def getFillColor(self)[Inherited from FillableShape]
def getNumberOfPoints(self)[Inherited from Path]
def getPoint(self, index)[Inherited from Path]
def getPoints(self)[Inherited from Path]
def getReferencePoint(self)[Inherited from Drawable]
def move(self, dx, dy)[Inherited from Drawable]
def moveTo(self, x, y)[Inherited from Drawable]
def removeHandler(self, handler)[Inherited from _EventTrigger]
def rotate(self, angle)[Inherited from Drawable]
def scale(self, factor)[Inherited from Drawable]
def setBorderColor(self, color)[Inherited from Shape]
def setBorderWidth(self, width)[Inherited from Shape]
def setDepth(self, depth)[Inherited from Drawable]
def setFillColor(self, color)[Inherited from FillableShape]
def setPoint(self, point, index=-1)[Inherited from Path]
def shear(self, shear, angle=0)[Inherited from Drawable]
def stretch(self, xFactor, yFactor, angle=0)[Inherited from Drawable]
def wait(self)[Inherited from _EventTrigger]

Detailed Description

A polygon that can be drawn to a canvas.

Member Function Documentation

def __init__ (   self,

Construct a new Polygon instance.

The polygon is described as a series of points that are connected in order.
The last point is automatically connected back to the first to close the polygon.

These points can be initialized by sending each individual Point
as a separate parameter, or by sending a single parameter
containing a sequence of Points. If no parameters are sent, the
polygon initially has zero points.

The reference point for a polygon is initially aligned with the
first point of the polygon.

Reimplemented from FillableShape.

def addHandler (   self,
) [inherited]

Register an EventHandler instance with this object.

def addPoint (   self,
  index = -1 
) [inherited]

Add a new point to the Path.

point  a Point instance
index  designates where on the path the new point is placed
   (at the end, by default)

def adjustReference (   self,
) [inherited]

Move the local reference point relative to its current position.

Note that the object is not moved at all.

def clearPoints (   self  )  [inherited]

Remove all points, setting this back to an empty Path.

def clone (   self  )  [inherited]

Return a duplicate of the drawable object.

Note that the duplicate is not automatically added to any
canvases or layers, even if original is currently so.

def deletePoint (   self,
  index = -1 
) [inherited]

Remove the Point at the given index.

By default, deletes the last point.

def flip (   self,
  angle = 0 
) [inherited]

Flip the object reflected about its current reference point.

By default the flip is a left-to-right flip with a vertical axis of symmetry.

angle     a clockwise rotation of the axis of symmetry away from vertical

def getBorderColor (   self  )  [inherited]

Return the color of the object's border.

def getBorderWidth (   self  )  [inherited]

Return the width of the border.

def getDepth (   self  )  [inherited]

Return the depth of the object.

def getFillColor (   self  )  [inherited]

Return the color of the shape's interior.

def getNumberOfPoints (   self  )  [inherited]

Return the current number of points.

def getPoint (   self,
) [inherited]

Return a copy of the Point at the given index.

Subsequently mutating that copy has no effect on the Path.

def getPoints (   self  )  [inherited]

Return a list of Point instances that are copies of the points on the Path.

def getReferencePoint (   self  )  [inherited]

Return a copy of the current reference point.

Note that mutating that copy has no effect on the Drawable object.

def move (   self,
) [inherited]

Move the object dx units along X-axis and dy units along Y-axis.

For the default coordinate system, positive dx is rightward and
negative is leftward; positive dy is downard and negative is upward.

def moveTo (   self,
) [inherited]

Move the object to align its reference point with (x,y)

def removeHandler (   self,
) [inherited]

Unregister an EventHandler instance from this object.

def rotate (   self,
) [inherited]

Rotate the object around its current reference point.

angle  number of degrees of clockwise rotation

Reimplemented in Text.

def scale (   self,
) [inherited]

Scale the object relative to its current reference point.

factor      scale is multiplied by this number (must be positive)

Reimplemented in Text.

def setBorderColor (   self,
) [inherited]

Set the border color to a copy of the indicated color.

The parameter can be either:
   - a string with the name of the color
   - an (r,g,b) tuple
   - an existing Color instance

def setBorderWidth (   self,
) [inherited]

Set the width of the border to the indicated width.

Reimplemented in Button.

def setDepth (   self,
) [inherited]

Set the depth of the object.

Objects with a higher depth will be rendered behind those with lower depths.

def setFillColor (   self,
) [inherited]

Set the interior color of the shape to the color.

The parameter can be either:
   - a string with the name of the color
   - an (r,g,b) tuple
   - an existing Color instance

def setPoint (   self,
  index = -1 
) [inherited]

Change the Point at the given index to a new value.

By default, the last point is changed.

def shear (   self,
  angle = 0 
) [inherited]

Shear the object relative to its current reference point.

By default, points with the same y-coordinate as the reference point are left
unchanged.  A point d units above the reference point is shifted d * shear
units to the right.  The optional angle parameter rotates the axis
that the shearing occurs along.

angle      clockwise angle for shear

def stretch (   self,
  angle = 0 
) [inherited]

Stretch the shape in mutltiple direction.

By default the x-axis is scaled by a factor of xFactor and the
y-axis is scaled by a factor of yFactor.  The optional
parameter rotates the directions that the streching is performed

def wait (   self  )  [inherited]

Wait for an event to occur.

When an event occurs, an Event instance is returned
with information about what has happened.

The documentation for this class was generated from the following file:
Generated on Fri Dec 21 18:19:31 2007 by  doxygen 1.5.3