]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] Add to arc support of inversion.
authorspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:03:33 +0000 (14:03 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:08 +0000 (14:53 +0300)
src/PythonAPI/model/sketcher/arc.py
src/PythonAPI/model/sketcher/sketch.py

index 212666af86e5b149d06cb1de0b5f42c1ada8b185..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,9 +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()
-        
-        
+
+
     ########
     #
     # Getters
@@ -52,26 +55,28 @@ class Arc(Interface):
     def result(self):
         """Return the arc circular line attribute."""
         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)
 
     ########
     #
index 9a5c3c78460c73e0babce35307f4b9381bb81b08..ed0b1398ac0766955e24d51e8d5f86d25b7031ae 100644 (file)
@@ -152,7 +152,7 @@ class Sketch(Interface):
         circle_feature = self._feature.addFeature("SketchCircle")
         return Circle(circle_feature, *args)
 
-    def addArc(self, *args):
+    def addArc(self, *args, **kwargs):
         """Add an arc of circle to the sketch and return an arc object.
 
         Two different syntaxes are allowed:
@@ -176,7 +176,7 @@ class Sketch(Interface):
         if not args:
             raise TypeError("No arguments given")
         arc_feature = self._feature.addFeature("SketchArc")
-        return Arc(arc_feature, *args)
+        return Arc(arc_feature, *args, **kwargs)
 
     #-------------------------------------------------------------
     #