Table Of Contents

Previous topic

PointSet

Next topic

Polygon

This Page

phoenix_title PointsObjectMixin

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


class_hierarchy Inheritance Diagram

Inheritance diagram for class PointsObjectMixin

Inheritance diagram of PointsObjectMixin


method_summary Methods Summary

CalcBoundingBox  
Move Move(Delta): moves the object by delta, where delta is an (dx,
SetPoints Sets the coordinates of the points of the object to Points (NX2 array).

api Class API



class PointsObjectMixin

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


Methods



CalcBoundingBox(self)


Move(self, Delta)

Move(Delta): moves the object by delta, where delta is an (dx, dy) pair. Ideally a Numpy array of shape (2,)



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