class Circle(Interface):
"""Interface for circle feature data manipulation."""
- def __init__(self, feature, x, y, radius):
+ def __init__(self, feature, *args):
Interface.__init__(self, feature)
assert(self._feature.getKind() == "SketchCircle")
self._feature.data().attribute("CircleCenter")
)
self._radius = self._feature.data().real("CircleRadius")
- self.setCenter(x, y)
- self.setRadius(radius)
+
+ if not args:
+ return
+
+ if len(args) != 3:
+ raise TypeError(
+ "Invalid number of arguments, 3 arguments needed (%s given)"
+ % len(args)
+ )
+
+ self.setCenter(args[0], args[1])
+ self.setRadius(args[2])
self.execute()
def setCenter(self, x, y):
"""Set the radius of the circle."""
self._radius.setValue(radius)
- def centerData(self):
- """Return center data."""
+ def center(self):
+ """Return the center attribute of the circle."""
return self._center
- def radiusData(self):
- """Return radius data."""
- return self._radius
+ def radius(self):
+ """Return the radius value.
+
+ :return: radius
+ :rtype: double
+ """
+ return self._radius.value()
def result(self):
"""Return the cicular line attribute."""