]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add assertions to set attribute for features.
authorspo <sergey.pokhodenko@opencascade.com>
Thu, 29 Oct 2015 14:27:48 +0000 (17:27 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 30 Oct 2015 12:55:40 +0000 (15:55 +0300)
15 files changed:
src/PythonAPI/model/construction/axis.py
src/PythonAPI/model/construction/plane.py
src/PythonAPI/model/construction/point.py
src/PythonAPI/model/exchange/exchange.py
src/PythonAPI/model/features/extrusion_boolean.py
src/PythonAPI/model/features/extrusion_sketch.py
src/PythonAPI/model/features/group.py
src/PythonAPI/model/features/partition.py
src/PythonAPI/model/features/placement.py
src/PythonAPI/model/features/revolution.py
src/PythonAPI/model/features/revolution_boolean.py
src/PythonAPI/model/features/revolution_sketch.py
src/PythonAPI/model/features/rotation.py
src/PythonAPI/model/features/translation.py
src/PythonAPI/model/parameter/parameter.py

index 498ca567a780f677c72fe254d50e160fdf0953d9..6bbaea87fcecf5577437fdccd01a172556aca822 100644 (file)
@@ -39,6 +39,11 @@ class Axis(Interface):
         self._SecondPoint = self._feature.data().selection("SecondPoint")
         self._CylindricalFace = self._feature.data().selection("CylindricalFace")
 
+        assert(self._CreationMethod)
+        assert(self._FirstPoint)
+        assert(self._SecondPoint)
+        assert(self._CylindricalFace)
+
         if not args:
             return
 
index caacbf654669554df0cc99cf2554d1ada2b68ac4..f98c57b3eabfe6882ab7f7bf9e667ce54c309ce1 100644 (file)
@@ -42,6 +42,14 @@ class Plane(Interface):
         self._c = self._feature.data().real("C")
         self._d = self._feature.data().real("D")
 
+        assert(self._CreationMethod)
+        assert(self._plane_face)
+        assert(self._distance)
+        assert(self._a)
+        assert(self._b)
+        assert(self._c)
+        assert(self._d)
+
         if not args:
             return
 
index ad7ef42b64de911f082e168628c0f818ec3ff5b4..c3c649784ec516c3fe4c31b599cb2737f3f58edc 100644 (file)
@@ -34,6 +34,10 @@ class Point(Interface):
         self._y = self._feature.data().real("y")
         self._z = self._feature.data().real("z")
 
+        assert(self._x)
+        assert(self._y)
+        assert(self._z)
+
         if not args:
             return
 
index 9648b7d529524b5f75dfd5b5698ec45815516c49..fdeaa4ccab7e60a35dc8ef312527d36a61c4e816 100644 (file)
@@ -32,6 +32,8 @@ class Import(Interface):
 
         self._file_path = self._feature.data().string("file_path")
 
+        assert(self._file_path)
+
         if not args:
             return
 
@@ -78,6 +80,10 @@ class Export(Interface):
         self._file_format = self._feature.data().string("file_format")
         self._objects = self._feature.data().selectionList("selection_list")
 
+        assert(self._file_path)
+        assert(self._file_format)
+        assert(self._objects)
+
         if not args:
             return
 
index 61f40a72a578c64d35678d139d23d63425e18bf2..a5b3f8804ff58b08f2804820d0cb6e3de82d57fd 100644 (file)
@@ -38,6 +38,14 @@ class ExtrusionBoolean(CompositeBoolean):
         self._from_object = self._feature.data().selection("from_object")
         self._from_offset = self._feature.data().real("from_offset")
 
+        assert(self._CreationMethod)
+        assert(self._to_size)
+        assert(self._from_size)
+        assert(self._to_object)
+        assert(self._to_offset)
+        assert(self._from_object)
+        assert(self._from_offset)
+
         if not args:
             return
 
index fea6ff9749e0053e96f3da908dea061a100561b1..dd161f367abc0cbbd019d26e29fd9253b24f0cfa 100644 (file)
@@ -29,6 +29,14 @@ class ExtrusionSketch(CompositeSketch):
         self._from_object = self._feature.data().selection("from_object")
         self._from_offset = self._feature.data().real("from_offset")
 
+        assert(self._CreationMethod)
+        assert(self._to_size)
+        assert(self._from_size)
+        assert(self._to_object)
+        assert(self._to_offset)
+        assert(self._from_object)
+        assert(self._from_offset)
+
         if not args:
             return
 
index 19a795b001685a0553bc82cc6cbc3fe6c489258a..a9fbfbe76ea08883aedfe40e3a5deee715c5ab16 100644 (file)
@@ -24,6 +24,8 @@ class Group(Interface):
 
         self._group_list = self._feature.data().selectionList("group_list")
 
+        assert(self._group_list)
+
         assert(len(args) == 1)
         self.setGroupList(args[0])
         pass
index d7226537a3da275c0a494c4a7c1df86a9946b938..b37ef8ecde28123025dcae3e180f4a15324c640c 100644 (file)
@@ -38,6 +38,10 @@ class Partition(Interface):
         self._tool_objects = self._feature.data().selectionList("tool_objects")
         self._partition_combine = self._feature.data().boolean("partition_combine")
 
+        assert(self._main_objects)
+        assert(self._tool_objects)
+        assert(self._partition_combine)
+
         if main_objects is None:
             return
 
index 6122b83e53928c50b483316fe6e2469e3f5fd86c..78f2bf9ec42edad74e554961d724bc2e0f8b55c8 100644 (file)
@@ -28,6 +28,12 @@ class Placement(Interface):
         self._reverse_direction = self._feature.data().boolean("placement_reverse_direction")
         self._centering = self._feature.data().boolean("placement_centering")
 
+        assert(self._objects_list)
+        assert(self._start_shape)
+        assert(self._end_shape)
+        assert(self._reverse_direction)
+        assert(self._centering)
+
         assert(len(args) == 5)
         self.setObjectList(args[0])
         self.setStartShape(args[1])
index cd43c9106ca36f4a7205e2d3b40e4b3778209f03..02ff467389edb03d00ef2daf84d17abea8c9b072 100644 (file)
@@ -53,6 +53,16 @@ class Revolution(Interface):
         self._from_object = self._feature.data().selection("from_object")
         self._from_offset = self._feature.data().real("from_offset")
 
+        assert(self._base)
+        assert(self._axis_object)
+        assert(self._CreationMethod)
+        assert(self._to_angle)
+        assert(self._from_angle)
+        assert(self._to_object)
+        assert(self._to_offset)
+        assert(self._from_object)
+        assert(self._from_offset)
+
         if base is None:
             return
 
index 4f50c49415830f6dfb36f3568588b2eaf02466fb..3dd8ef7df6b4a985469fb49520d8e8edee61ef9a 100644 (file)
@@ -39,6 +39,15 @@ class RevolutionBoolean(CompositeBoolean):
         self._from_object = self._feature.data().selection("from_object")
         self._from_offset = self._feature.data().real("from_offset")
 
+        assert(self._axis_object)
+        assert(self._CreationMethod)
+        assert(self._to_angle)
+        assert(self._from_angle)
+        assert(self._to_object)
+        assert(self._to_offset)
+        assert(self._from_object)
+        assert(self._from_offset)
+
         if not args:
             return
 
index 5f27690a98e2489c677e52db944ba78ad6b6e7d8..95de94dd36bf19f9a0ef376827d9d06f20873bc5 100644 (file)
@@ -30,6 +30,15 @@ class RevolutionSketch(CompositeSketch):
         self._from_object = self._feature.data().selection("from_object")
         self._from_offset = self._feature.data().real("from_offset")
 
+        assert(self._axis_object)
+        assert(self._CreationMethod)
+        assert(self._to_angle)
+        assert(self._from_angle)
+        assert(self._to_object)
+        assert(self._to_offset)
+        assert(self._from_object)
+        assert(self._from_offset)
+
         if not args:
             return
 
index 9df8c311db31ee6d7484bffe96370fbacb8ffbe0..bbec2c31e16eae18bf41d9d38270e42cbb575bce 100644 (file)
@@ -26,6 +26,10 @@ class Rotation(Interface):
         self._axis_object = self._feature.data().selection("axis_object")
         self._angle = self._feature.data().real("angle")
 
+        assert(self._main_objects)
+        assert(self._axis_object)
+        assert(self._angle)
+
         assert(len(args) == 3)
         self.setMainObjects(args[0])
         self.setAxisObject(args[1])
index d36a72239dece104d680880ce038dbf377cd6da2..0260c643da2e2309903234dca0460e034745b24f 100644 (file)
@@ -26,6 +26,10 @@ class Translation(Interface):
         self._axis_object = self._feature.data().selection("axis_object")
         self._distance = self._feature.data().real("distance")
 
+        assert(self._main_objects)
+        assert(self._axis_object)
+        assert(self._distance)
+
         assert(len(args) == 3)
         self.setMainObjects(args[0])
         self.setAxisObject(args[1])
index 7a5c28f67d2a9ddc5434b3678b63b731acb73f39..377992d7c9c2c5213156eab076afe8fa90ccc5b9 100644 (file)
@@ -31,10 +31,12 @@ class Parameter(Interface):
         Interface.__init__(self, feature)
         assert(self._feature.getKind() == "Parameter")
 
-        self._CreationMethod = self._feature.data().string("CreationMethod")
         self._variable = self._feature.data().selection("variable")
         self._expression = self._feature.data().real("expression")
 
+        assert(self._variable)
+        assert(self._expression)
+
         if not args:
             return