Package wx :: Package lib :: Package floatcanvas :: Module FloatCanvas :: Class PointsObjectMixin
[frames | no frames]

Class PointsObjectMixin

Known Subclasses:
Line, PointSet, Polygon

This is a mixin class that provides some methods suitable for use with objects that have a set of (x,y) coordinate pairs.


Method Summary
  CalcBoundingBox(self)
  SetPoints(self, Points, copy)
Sets the coordinates of the points of the object to Points (NX2 array).

Method Details

SetPoints(self, Points, copy=True)

Sets the coordinates of the points of the object to Points (NX2 array).

By default, a copy is made, if copy is set to False, a reference is used, iff Points is a NumPy array of Floats. This allows you to change some or all of the points without making any copies.

For example:

Points = Object.Points Points += (5,10) # shifts the points 5 in the x dir, and 10 in the y dir. Object.SetPoints(Points, False) # Sets the points to the same array as it was


Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:14:17 2007 http://epydoc.sf.net