1 """Sketch circle feature interface."""
3 from GeomDataAPI import geomDataAPI_Point2D
4 from model.roots import Interface
6 class Circle(Interface):
7 """Interface for circle feature data manipulation."""
8 def __init__(self, feature, *args):
9 Interface.__init__(self, feature)
10 assert(self._feature.getKind() == "SketchCircle")
12 self._center = geomDataAPI_Point2D(
13 self._feature.data().attribute("CircleCenter")
15 self._radius = self._feature.data().real("CircleRadius")
22 "Invalid number of arguments, 3 arguments needed (%s given)"
26 self.setCenter(args[0], args[1])
27 self.setRadius(args[2])
30 def setCenter(self, x, y):
31 """Set the center of the circle."""
32 self._center.setValue(x, y)
34 def setRadius(self, radius):
35 """Set the radius of the circle."""
36 self._radius.setValue(radius)
39 """Return the center attribute of the circle."""
43 """Return the radius value.
48 return self._radius.value()
51 """Return the cicular line attribute."""
52 return self._feature.lastResult()