class Arc(Interface):
"""Interface to a sketch arc feature."""
- def __init__(self, feature, *args):
+ def __init__(self, feature, *args, **kwargs):
Interface.__init__(self, feature)
assert(self._feature.getKind() == "SketchArc")
self._end_point = geomDataAPI_Point2D(
self._feature.data().attribute("ArcEndPoint")
)
+ self._inversed = self._feature.boolean("InversedArc")
if len(args) == 6:
self.__createByCoordinates(*args)
elif len(args) == 3:
raise WrongNumberOfArguments(
"Arc takes 3 or 6 arguments (%s given)" % len(args)
)
+ if "inversed" in kwargs:
+ self.setInversed(kwargs["inversed"])
self.execute()
-
- ########
- #
- # Set methods
- #
- ########
-
- def setCenter(self, x, y):
- """Set arc center."""
- self._center.setValue(x, y)
-
- def setStartPoint(self, x, y):
- """Set start point."""
- self._start_point.setValue(x, y)
-
- def setEndPoint(self, x, y):
- """Set end point value."""
- self._end_point.setValue(x, y)
-
-
+
+
########
#
# Getters
########
- def centerData(self):
- """Return the center point data."""
+ def center(self):
+ """Return the center point."""
return self._center
- def startPointData(self):
- """Return the start point data."""
+ def startPoint(self):
+ """Return the start point."""
return self._start_point
- def endPointData(self):
- """Return the end point data."""
+ def endPoint(self):
+ """Return the end point."""
return self._end_point
def result(self):
return self._feature.lastResult()
+ ########
+ #
+ # Set methods
+ #
+ ########
+
+ def setCenter(self, x, y):
+ """Set arc center."""
+ self._center.setValue(x, y)
+
+ def setStartPoint(self, x, y):
+ """Set start point."""
+ self._start_point.setValue(x, y)
+
+ def setEndPoint(self, x, y):
+ """Set end point value."""
+ self._end_point.setValue(x, y)
+
+ def setInversed(self, inversed):
+ self._fillAttribute(self._inversed, inversed)
+
########
#
# Private methods