|
|
@ -316,7 +316,7 @@ class PointSet: |
|
|
|
for p in self._points: |
|
|
|
for p in self._points: |
|
|
|
p.unselect() |
|
|
|
p.unselect() |
|
|
|
|
|
|
|
|
|
|
|
def add_point(self, x, y, color, attrs=[]): |
|
|
|
def add_point(self, x, y, color, weight=1.0, attrs=[]): |
|
|
|
""" |
|
|
|
""" |
|
|
|
Adds a point in screen coordinates and an optional attribute to |
|
|
|
Adds a point in screen coordinates and an optional attribute to |
|
|
|
the list. |
|
|
|
the list. |
|
|
@ -324,6 +324,7 @@ class PointSet: |
|
|
|
@param x The x-coordinate. |
|
|
|
@param x The x-coordinate. |
|
|
|
@param y The y-coordinate. |
|
|
|
@param y The y-coordinate. |
|
|
|
@param color The color of the point. |
|
|
|
@param color The color of the point. |
|
|
|
|
|
|
|
@param weight The point weight. |
|
|
|
@param attr An optional attribute. |
|
|
|
@param attr An optional attribute. |
|
|
|
@raises ExceededWindowBoundsError If the point could not be constructed |
|
|
|
@raises ExceededWindowBoundsError If the point could not be constructed |
|
|
|
because it would be outside the |
|
|
|
because it would be outside the |
|
|
@ -337,8 +338,11 @@ class PointSet: |
|
|
|
if not isinstance(color, Color): |
|
|
|
if not isinstance(color, Color): |
|
|
|
raise ValueError("Point color must be a Color enum.") |
|
|
|
raise ValueError("Point color must be a Color enum.") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not isinstance(weight, float): |
|
|
|
|
|
|
|
raise ValueError("Point weight must be a float.") |
|
|
|
|
|
|
|
|
|
|
|
point = Point(x, y, color, self._point_size, |
|
|
|
point = Point(x, y, color, self._point_size, |
|
|
|
self._viewport_width, self._viewport_height) |
|
|
|
self._viewport_width, self._viewport_height, weight) |
|
|
|
|
|
|
|
|
|
|
|
for attr in attrs: |
|
|
|
for attr in attrs: |
|
|
|
point.add_attribute(attr) |
|
|
|
point.add_attribute(attr) |
|
|
|