]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] Add Entity class for sketch entity and make Line as an inheritant of...
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 16 Dec 2015 08:36:53 +0000 (11:36 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:07 +0000 (14:53 +0300)
src/PythonAPI/model/sketcher/entity.py [new file with mode: 0644]
src/PythonAPI/model/sketcher/line.py

diff --git a/src/PythonAPI/model/sketcher/entity.py b/src/PythonAPI/model/sketcher/entity.py
new file mode 100644 (file)
index 0000000..b2cea88
--- /dev/null
@@ -0,0 +1,15 @@
+
+from model.roots import Interface
+
+class Entity(Interface):
+    """Interface for editing of a sketch entity feature."""
+
+    def __init__(self, feature):
+        Interface.__init__(self, feature)
+
+        # Initialize attributes
+        self._auxiliary = self._feature.boolean("Auxiliary")
+
+    def setAuxiliary(self, a):
+        """Set the Auxiliarity."""
+        self._auxiliary.setValue(a)
index e4111e0708ae4292b40124067bee9f94bd34e8aa..93f354ba063a45c76f4e7ba7ed71e747d725e5c6 100644 (file)
@@ -2,10 +2,12 @@ from GeomDataAPI import geomDataAPI_Point2D
 from model.roots import Interface
 from model.errors import WrongNumberOfArguments
 
-class Line(Interface):
+from .entity import Entity
+
+class Line(Entity):
     """Interface for editing of a sketch line feature."""
     def __init__(self, feature, *args):
-        Interface.__init__(self, feature)
+        Entity.__init__(self, feature)
         assert(self._feature.getKind() == "SketchLine")
 
         # Initialize attributes