]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PythonAPI/model/sketcher/arc.py
Salome HOME
Fix Platine test
[modules/shaper.git] / src / PythonAPI / model / sketcher / arc.py
index 0a7ae432dc7be7bb0484d68f10aa37590bf6eb39..7502a6b566039986d5a82633f5e72018a8d1ec74 100644 (file)
@@ -6,7 +6,7 @@ from model.roots import Interface
 
 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")
 
@@ -19,6 +19,7 @@ class Arc(Interface):
         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:
@@ -27,27 +28,11 @@ class Arc(Interface):
             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
@@ -55,16 +40,16 @@ class Arc(Interface):
     ########
 
 
-    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):
@@ -72,6 +57,27 @@ class Arc(Interface):
         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