From: spo Date: Tue, 3 Nov 2015 10:28:04 +0000 (+0300) Subject: Rename _fill_attribute to _fillAttribute. Make redirection using functions. X-Git-Tag: V_2.1.0~206^2~21^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cc2a5c393262911987a4a036b60ff50178f32655;p=modules%2Fshaper.git Rename _fill_attribute to _fillAttribute. Make redirection using functions. --- diff --git a/src/PythonAPI/extension/box.py b/src/PythonAPI/extension/box.py index 6808cd441..c4ef0018a 100644 --- a/src/PythonAPI/extension/box.py +++ b/src/PythonAPI/extension/box.py @@ -52,15 +52,15 @@ class Box(Interface): def setWidth(self, width): """B.setWidth(float) -- modify width attribute""" - self._fill_attribute(self._width, width) + self._fillAttribute(self._width, width) pass def setLength(self, length): """B.setLength(float) -- modify length attribute""" - self._fill_attribute(self._length, length) + self._fillAttribute(self._length, length) pass def setHeight(self, height): """B.setHeight(float) -- modify height attribute""" - self._fill_attribute(self._height, height) + self._fillAttribute(self._height, height) pass diff --git a/src/PythonAPI/model/construction/axis.py b/src/PythonAPI/model/construction/axis.py index 5e2694227..2ec9ab00f 100644 --- a/src/PythonAPI/model/construction/axis.py +++ b/src/PythonAPI/model/construction/axis.py @@ -57,10 +57,10 @@ class Axis(Interface): pass def __clear(self): - self._fill_attribute(self._CreationMethod, "AxisByPointsCase") - self._fill_attribute(self._FirstPoint, None) - self._fill_attribute(self._SecondPoint, None) - self._fill_attribute(self._CylindricalFace, None) + self._fillAttribute(self._CreationMethod, "AxisByPointsCase") + self._fillAttribute(self._FirstPoint, None) + self._fillAttribute(self._SecondPoint, None) + self._fillAttribute(self._CylindricalFace, None) def setPoints(self, p1, p2): """Modify points attribute of the feature. @@ -68,9 +68,9 @@ class Axis(Interface): See __init__. """ self.__clear() - self._fill_attribute(self._CreationMethod, "AxisByPointsCase") - self._fill_attribute(self._FirstPoint, p1) - self._fill_attribute(self._SecondPoint, p2) + self._fillAttribute(self._CreationMethod, "AxisByPointsCase") + self._fillAttribute(self._FirstPoint, p1) + self._fillAttribute(self._SecondPoint, p2) pass def setCylindricalFace(self, face): @@ -79,6 +79,6 @@ class Axis(Interface): See __init__. """ self.__clear() - self._fill_attribute(self._CreationMethod, "AxisByCylindricalFaceCase") - self._fill_attribute(self._CylindricalFace, face) + self._fillAttribute(self._CreationMethod, "AxisByCylindricalFaceCase") + self._fillAttribute(self._CylindricalFace, face) pass diff --git a/src/PythonAPI/model/construction/plane.py b/src/PythonAPI/model/construction/plane.py index f007de248..6035493e8 100644 --- a/src/PythonAPI/model/construction/plane.py +++ b/src/PythonAPI/model/construction/plane.py @@ -63,13 +63,13 @@ class Plane(Interface): pass def __clear(self): - self._fill_attribute(self._CreationMethod, "PlaneByFaceAndDistance") - self._fill_attribute(self._plane_face, None) - self._fill_attribute(self._distance, 0) - self._fill_attribute(self._a, 0) - self._fill_attribute(self._b, 0) - self._fill_attribute(self._c, 0) - self._fill_attribute(self._d, 0) + self._fillAttribute(self._CreationMethod, "PlaneByFaceAndDistance") + self._fillAttribute(self._plane_face, None) + self._fillAttribute(self._distance, 0) + self._fillAttribute(self._a, 0) + self._fillAttribute(self._b, 0) + self._fillAttribute(self._c, 0) + self._fillAttribute(self._d, 0) def setFaceAndDistance(self, face, distance): """Modify face and distance attribute of the feature. @@ -77,9 +77,9 @@ class Plane(Interface): See __init__. """ self.__clear() - self._fill_attribute(self._CreationMethod, "PlaneByFaceAndDistance") - self._fill_attribute(self._plane_face, face) - self._fill_attribute(self._distance, distance) + self._fillAttribute(self._CreationMethod, "PlaneByFaceAndDistance") + self._fillAttribute(self._plane_face, face) + self._fillAttribute(self._distance, distance) pass def setGeneralEquation(self, a, b, c, d): @@ -88,9 +88,9 @@ class Plane(Interface): See __init__. """ self.__clear() - self._fill_attribute(self._CreationMethod, "PlaneByGeneralEquation") - self._fill_attribute(self._a, a) - self._fill_attribute(self._b, b) - self._fill_attribute(self._c, c) - self._fill_attribute(self._d, d) + self._fillAttribute(self._CreationMethod, "PlaneByGeneralEquation") + self._fillAttribute(self._a, a) + self._fillAttribute(self._b, b) + self._fillAttribute(self._c, c) + self._fillAttribute(self._d, d) pass diff --git a/src/PythonAPI/model/construction/point.py b/src/PythonAPI/model/construction/point.py index 6d0428007..3892a1abd 100644 --- a/src/PythonAPI/model/construction/point.py +++ b/src/PythonAPI/model/construction/point.py @@ -52,7 +52,7 @@ class Point(Interface): See __init__. """ - self._fill_attribute(self._x, x) - self._fill_attribute(self._y, y) - self._fill_attribute(self._z, z) + self._fillAttribute(self._x, x) + self._fillAttribute(self._y, y) + self._fillAttribute(self._z, z) pass diff --git a/src/PythonAPI/model/exchange/exchange.py b/src/PythonAPI/model/exchange/exchange.py index 66f5c7809..7acbc28ca 100644 --- a/src/PythonAPI/model/exchange/exchange.py +++ b/src/PythonAPI/model/exchange/exchange.py @@ -48,7 +48,7 @@ class Import(Interface): See __init__. """ - self._fill_attribute(self._file_path, file_path) + self._fillAttribute(self._file_path, file_path) pass @@ -102,7 +102,7 @@ class Export(Interface): See __init__. """ - self._fill_attribute(self._file_path, file_path) + self._fillAttribute(self._file_path, file_path) pass def setFileFormat(self, file_format): @@ -110,7 +110,7 @@ class Export(Interface): See __init__. """ - self._fill_attribute(self._file_format, file_format) + self._fillAttribute(self._file_format, file_format) pass def setObjects(self, objects): @@ -118,5 +118,5 @@ class Export(Interface): See __init__. """ - self._fill_attribute(self._objects, object) + self._fillAttribute(self._objects, object) pass diff --git a/src/PythonAPI/model/features/boolean.py b/src/PythonAPI/model/features/boolean.py index 95e27d019..0beb4674c 100644 --- a/src/PythonAPI/model/features/boolean.py +++ b/src/PythonAPI/model/features/boolean.py @@ -76,12 +76,12 @@ class Boolean(Interface): def setMainObjects(self, main_objects): """F.setMainObjects(iterable) -- modify main_objects attribute""" - self._fill_attribute(self._main_objects, main_objects) + self._fillAttribute(self._main_objects, main_objects) pass def setToolObjects(self, tool_objects): """F.setToolObjects(iterable) -- modify tool_objects attribute""" - self._fill_attribute(self._tool_objects, tool_objects) + self._fillAttribute(self._tool_objects, tool_objects) pass def setBoolType(self, bool_type): @@ -92,5 +92,5 @@ class Boolean(Interface): - GeomAlgoAPI_Boolean.BOOL_CUT - GeomAlgoAPI_Boolean.BOOL_COMMON """ - self._fill_attribute(self._bool_type, bool_type) + self._fillAttribute(self._bool_type, bool_type) pass diff --git a/src/PythonAPI/model/features/extrusion.py b/src/PythonAPI/model/features/extrusion.py index a6a18ee02..27c2ec243 100644 --- a/src/PythonAPI/model/features/extrusion.py +++ b/src/PythonAPI/model/features/extrusion.py @@ -83,12 +83,12 @@ class Extrusion(Interface): def __clear(self): self._CreationMethod.setValue("BySizes") - self._fill_attribute(self._to_size, 0) - self._fill_attribute(self._from_size, 0) - self._fill_attribute(self._to_object, None) - self._fill_attribute(self._to_offset, 0) - self._fill_attribute(self._from_object, None) - self._fill_attribute(self._from_offset, 0) + self._fillAttribute(self._to_size, 0) + self._fillAttribute(self._from_size, 0) + self._fillAttribute(self._to_object, None) + self._fillAttribute(self._to_offset, 0) + self._fillAttribute(self._from_object, None) + self._fillAttribute(self._from_offset, 0) pass def setBase(self, base): @@ -96,7 +96,7 @@ class Extrusion(Interface): See __init__. """ - self._fill_attribute(self._base, base) + self._fillAttribute(self._base, base) pass def setSizes(self, to_size, from_size): @@ -105,9 +105,9 @@ class Extrusion(Interface): See __init__. """ self.__clear() - self._fill_attribute(self._CreationMethod, "BySizes") - self._fill_attribute(self._to_size, to_size) - self._fill_attribute(self._from_size, from_size) + self._fillAttribute(self._CreationMethod, "BySizes") + self._fillAttribute(self._to_size, to_size) + self._fillAttribute(self._from_size, from_size) pass def setSize(self, size): @@ -133,10 +133,10 @@ class Extrusion(Interface): """ self.__clear() self._CreationMethod.setValue("ByPlanesAndOffsets") - self._fill_attribute(self._to_object, to_object) - self._fill_attribute(self._to_offset, to_offset) - self._fill_attribute(self._from_object, from_object) - self._fill_attribute(self._from_offset, from_offset) + self._fillAttribute(self._to_object, to_object) + self._fillAttribute(self._to_offset, to_offset) + self._fillAttribute(self._from_object, from_object) + self._fillAttribute(self._from_offset, from_offset) pass def result(self): diff --git a/src/PythonAPI/model/features/extrusion_boolean.py b/src/PythonAPI/model/features/extrusion_boolean.py index a5b4d1e09..9399e860a 100644 --- a/src/PythonAPI/model/features/extrusion_boolean.py +++ b/src/PythonAPI/model/features/extrusion_boolean.py @@ -90,12 +90,12 @@ class ExtrusionBoolean(CompositeBoolean): def __clear(self): self._CreationMethod.setValue("BySizes") - self._fill_attribute(self._to_size, 0) - self._fill_attribute(self._from_size, 0) - self._fill_attribute(self._to_object, None) - self._fill_attribute(self._to_offset, 0) - self._fill_attribute(self._from_object, None) - self._fill_attribute(self._from_offset, 0) + self._fillAttribute(self._to_size, 0) + self._fillAttribute(self._from_size, 0) + self._fillAttribute(self._to_object, None) + self._fillAttribute(self._to_offset, 0) + self._fillAttribute(self._from_object, None) + self._fillAttribute(self._from_offset, 0) pass def setSizes(self, to_size, from_size): @@ -105,8 +105,8 @@ class ExtrusionBoolean(CompositeBoolean): """ self.__clear() self._CreationMethod.setValue("BySizes") - self._fill_attribute(self._to_size, to_size) - self._fill_attribute(self._from_size, from_size) + self._fillAttribute(self._to_size, to_size) + self._fillAttribute(self._from_size, from_size) pass def setPlanesAndOffsets(self, to_object, to_offset, @@ -117,9 +117,9 @@ class ExtrusionBoolean(CompositeBoolean): """ self.__clear() self._CreationMethod.setValue("ByPlanesAndOffsets") - self._fill_attribute(self._to_object, to_object) - self._fill_attribute(self._to_offset, to_offset) - self._fill_attribute(self._from_object, from_object) - self._fill_attribute(self._from_offset, from_offset) + self._fillAttribute(self._to_object, to_object) + self._fillAttribute(self._to_offset, to_offset) + self._fillAttribute(self._from_object, from_object) + self._fillAttribute(self._from_offset, from_offset) pass diff --git a/src/PythonAPI/model/features/extrusion_sketch.py b/src/PythonAPI/model/features/extrusion_sketch.py index fdd436874..4bdb13ce7 100644 --- a/src/PythonAPI/model/features/extrusion_sketch.py +++ b/src/PythonAPI/model/features/extrusion_sketch.py @@ -74,12 +74,12 @@ class ExtrusionSketch(CompositeSketch): def __clear(self): self._CreationMethod.setValue("BySizes") - self._fill_attribute(self._to_size, 0) - self._fill_attribute(self._from_size, 0) - self._fill_attribute(self._to_object, None) - self._fill_attribute(self._to_offset, 0) - self._fill_attribute(self._from_object, None) - self._fill_attribute(self._from_offset, 0) + self._fillAttribute(self._to_size, 0) + self._fillAttribute(self._from_size, 0) + self._fillAttribute(self._to_object, None) + self._fillAttribute(self._to_offset, 0) + self._fillAttribute(self._from_object, None) + self._fillAttribute(self._from_offset, 0) pass def setSizes(self, to_size, from_size): @@ -89,8 +89,8 @@ class ExtrusionSketch(CompositeSketch): """ self.__clear() self._CreationMethod.setValue("BySizes") - self._fill_attribute(self._to_size, to_size) - self._fill_attribute(self._from_size, from_size) + self._fillAttribute(self._to_size, to_size) + self._fillAttribute(self._from_size, from_size) pass def setPlanesAndOffsets(self, to_object, to_offset, @@ -101,9 +101,9 @@ class ExtrusionSketch(CompositeSketch): """ self.__clear() self._CreationMethod.setValue("ByPlanesAndOffsets") - self._fill_attribute(self._to_object, to_object) - self._fill_attribute(self._to_offset, to_offset) - self._fill_attribute(self._from_object, from_object) - self._fill_attribute(self._from_offset, from_offset) + self._fillAttribute(self._to_object, to_object) + self._fillAttribute(self._to_offset, to_offset) + self._fillAttribute(self._from_object, from_object) + self._fillAttribute(self._from_offset, from_offset) pass diff --git a/src/PythonAPI/model/features/group.py b/src/PythonAPI/model/features/group.py index d0c4207e6..bfe661307 100644 --- a/src/PythonAPI/model/features/group.py +++ b/src/PythonAPI/model/features/group.py @@ -48,5 +48,5 @@ class Group(Interface): See __init__. """ - self._fill_attribute(self._group_list, group_list) + self._fillAttribute(self._group_list, group_list) pass diff --git a/src/PythonAPI/model/features/partition.py b/src/PythonAPI/model/features/partition.py index 04876d232..d2242347f 100644 --- a/src/PythonAPI/model/features/partition.py +++ b/src/PythonAPI/model/features/partition.py @@ -58,7 +58,7 @@ class Partition(Interface): See __init__. """ - self._fill_attribute(self._main_objects, main_objects) + self._fillAttribute(self._main_objects, main_objects) pass def setToolObjects(self, tool_objects): @@ -66,7 +66,7 @@ class Partition(Interface): See __init__. """ - self._fill_attribute(self._tool_objects, tool_objects) + self._fillAttribute(self._tool_objects, tool_objects) pass def setPartitionCombine(self, partition_combine): @@ -74,5 +74,5 @@ class Partition(Interface): See __init__. """ - self._fill_attribute(self._partition_combine, partition_combine) + self._fillAttribute(self._partition_combine, partition_combine) pass diff --git a/src/PythonAPI/model/features/placement.py b/src/PythonAPI/model/features/placement.py index 258389e97..4153d39e6 100644 --- a/src/PythonAPI/model/features/placement.py +++ b/src/PythonAPI/model/features/placement.py @@ -65,7 +65,7 @@ class Placement(Interface): See __init__. """ - self._fill_attribute(self._objects_list, objects_list) + self._fillAttribute(self._objects_list, objects_list) pass def setStartShape(self, start_shape): @@ -73,7 +73,7 @@ class Placement(Interface): See __init__. """ - self._fill_attribute(self._start_shape, start_shape) + self._fillAttribute(self._start_shape, start_shape) pass def setEndShape(self, end_shape): @@ -81,7 +81,7 @@ class Placement(Interface): See __init__. """ - self._fill_attribute(self._end_shape, end_shape) + self._fillAttribute(self._end_shape, end_shape) pass def setReverseDirection(self, reverse_direction): @@ -89,7 +89,7 @@ class Placement(Interface): See __init__. """ - self._fill_attribute(self._reverse_direction, reverse_direction) + self._fillAttribute(self._reverse_direction, reverse_direction) pass def setCentering(self, centering): @@ -97,5 +97,5 @@ class Placement(Interface): See __init__. """ - self._fill_attribute(self._centering, centering) + self._fillAttribute(self._centering, centering) pass diff --git a/src/PythonAPI/model/features/revolution.py b/src/PythonAPI/model/features/revolution.py index 662190a1b..e816d6204 100644 --- a/src/PythonAPI/model/features/revolution.py +++ b/src/PythonAPI/model/features/revolution.py @@ -83,12 +83,12 @@ class Revolution(Interface): def __clear(self): self._CreationMethod.setValue("ByAngles") - self._fill_attribute(self._to_angle, 0) - self._fill_attribute(self._from_angle, 0) - self._fill_attribute(self._to_object, None) - self._fill_attribute(self._to_offset, 0) - self._fill_attribute(self._from_object, None) - self._fill_attribute(self._from_offset, 0) + self._fillAttribute(self._to_angle, 0) + self._fillAttribute(self._from_angle, 0) + self._fillAttribute(self._to_object, None) + self._fillAttribute(self._to_offset, 0) + self._fillAttribute(self._from_object, None) + self._fillAttribute(self._from_offset, 0) pass def setBase(self, base): @@ -96,7 +96,7 @@ class Revolution(Interface): See __init__. """ - self._fill_attribute(self._base, base) + self._fillAttribute(self._base, base) pass def setAxisObject(self, axis_object): @@ -104,7 +104,7 @@ class Revolution(Interface): See __init__. """ - self._fill_attribute(self._axis_object, axis_object) + self._fillAttribute(self._axis_object, axis_object) pass def setAngles(self, to_angle, from_angle): @@ -114,8 +114,8 @@ class Revolution(Interface): """ self.__clear() self._CreationMethod.setValue("ByAngles") - self._fill_attribute(self._to_angle, to_angle) - self._fill_attribute(self._from_angle, from_angle) + self._fillAttribute(self._to_angle, to_angle) + self._fillAttribute(self._from_angle, from_angle) pass def setPlanesAndOffsets(self, to_object, to_offset, @@ -126,8 +126,8 @@ class Revolution(Interface): """ self.__clear() self._CreationMethod.setValue("ByPlanesAndOffsets") - self._fill_attribute(self._to_object, to_object) - self._fill_attribute(self._to_offset, to_offset) - self._fill_attribute(self._from_object, from_object) - self._fill_attribute(self._from_offset, from_offset) + self._fillAttribute(self._to_object, to_object) + self._fillAttribute(self._to_offset, to_offset) + self._fillAttribute(self._from_object, from_object) + self._fillAttribute(self._from_offset, from_offset) pass diff --git a/src/PythonAPI/model/features/revolution_boolean.py b/src/PythonAPI/model/features/revolution_boolean.py index 2b80d0c88..34f3fbc08 100644 --- a/src/PythonAPI/model/features/revolution_boolean.py +++ b/src/PythonAPI/model/features/revolution_boolean.py @@ -97,12 +97,12 @@ class RevolutionBoolean(CompositeBoolean): def __clear(self): self._CreationMethod.setValue("ByAngles") - self._fill_attribute(self._to_angle, 0) - self._fill_attribute(self._from_angle, 0) - self._fill_attribute(self._to_object, None) - self._fill_attribute(self._to_offset, 0) - self._fill_attribute(self._from_object, None) - self._fill_attribute(self._from_offset, 0) + self._fillAttribute(self._to_angle, 0) + self._fillAttribute(self._from_angle, 0) + self._fillAttribute(self._to_object, None) + self._fillAttribute(self._to_offset, 0) + self._fillAttribute(self._from_object, None) + self._fillAttribute(self._from_offset, 0) pass def setAxisObject(self, axis_object): @@ -110,7 +110,7 @@ class RevolutionBoolean(CompositeBoolean): See __init__. """ - self._fill_attribute(self._axis_object, axis_object) + self._fillAttribute(self._axis_object, axis_object) pass def setAngles(self, to_angle, from_angle): @@ -120,8 +120,8 @@ class RevolutionBoolean(CompositeBoolean): """ self.__clear() self._CreationMethod.setValue("ByAngles") - self._fill_attribute(self._to_angle, to_angle) - self._fill_attribute(self._from_angle, from_angle) + self._fillAttribute(self._to_angle, to_angle) + self._fillAttribute(self._from_angle, from_angle) pass def setPlanesAndOffsets(self, to_object, to_offset, @@ -132,9 +132,9 @@ class RevolutionBoolean(CompositeBoolean): """ self.__clear() self._CreationMethod.setValue("ByPlanesAndOffsets") - self._fill_attribute(self._to_object, to_object) - self._fill_attribute(self._to_offset, to_offset) - self._fill_attribute(self._from_object, from_object) - self._fill_attribute(self._from_offset, from_offset) + self._fillAttribute(self._to_object, to_object) + self._fillAttribute(self._to_offset, to_offset) + self._fillAttribute(self._from_object, from_object) + self._fillAttribute(self._from_offset, from_offset) pass diff --git a/src/PythonAPI/model/features/revolution_sketch.py b/src/PythonAPI/model/features/revolution_sketch.py index 55e751cc4..feafe5f1e 100644 --- a/src/PythonAPI/model/features/revolution_sketch.py +++ b/src/PythonAPI/model/features/revolution_sketch.py @@ -82,12 +82,12 @@ class RevolutionSketch(CompositeSketch): def __clear(self): self._CreationMethod.setValue("ByAngles") - self._fill_attribute(self._to_angle, 0) - self._fill_attribute(self._from_angle, 0) - self._fill_attribute(self._to_object, None) - self._fill_attribute(self._to_offset, 0) - self._fill_attribute(self._from_object, None) - self._fill_attribute(self._from_offset, 0) + self._fillAttribute(self._to_angle, 0) + self._fillAttribute(self._from_angle, 0) + self._fillAttribute(self._to_object, None) + self._fillAttribute(self._to_offset, 0) + self._fillAttribute(self._from_object, None) + self._fillAttribute(self._from_offset, 0) pass def setAxisObject(self, axis_object): @@ -95,7 +95,7 @@ class RevolutionSketch(CompositeSketch): See __init__. """ - self._fill_attribute(self._axis_object, axis_object) + self._fillAttribute(self._axis_object, axis_object) pass def setAngles(self, to_angle, from_angle): @@ -105,8 +105,8 @@ class RevolutionSketch(CompositeSketch): """ self.__clear() self._CreationMethod.setValue("ByAngles") - self._fill_attribute(self._to_angle, to_angle) - self._fill_attribute(self._from_angle, from_angle) + self._fillAttribute(self._to_angle, to_angle) + self._fillAttribute(self._from_angle, from_angle) pass def setPlanesAndOffsets(self, to_object, to_offset, @@ -117,9 +117,9 @@ class RevolutionSketch(CompositeSketch): """ self.__clear() self._CreationMethod.setValue("ByPlanesAndOffsets") - self._fill_attribute(self._to_object, to_object) - self._fill_attribute(self._to_offset, to_offset) - self._fill_attribute(self._from_object, from_object) - self._fill_attribute(self._from_offset, from_offset) + self._fillAttribute(self._to_object, to_object) + self._fillAttribute(self._to_offset, to_offset) + self._fillAttribute(self._from_object, from_object) + self._fillAttribute(self._from_offset, from_offset) pass diff --git a/src/PythonAPI/model/features/roots.py b/src/PythonAPI/model/features/roots.py index 3aa27d42c..2aeacfe17 100644 --- a/src/PythonAPI/model/features/roots.py +++ b/src/PythonAPI/model/features/roots.py @@ -38,17 +38,17 @@ class CompositeBoolean(Interface): def setSketch(self, sketch): """Modify sketch attribute""" - self._fill_attribute(self._sketch, sketch) + self._fillAttribute(self._sketch, sketch) pass def setSketchSelection(self, sketch_selection): """Modify sketch_selection attribute""" - self._fill_attribute(self._sketch_selection, sketch_selection) + self._fillAttribute(self._sketch_selection, sketch_selection) pass def setBooleanObjects(self, boolean_objects): """Modify boolean_objects attribute""" - self._fill_attribute(self._boolean_objects, boolean_objects) + self._fillAttribute(self._boolean_objects, boolean_objects) pass @@ -85,10 +85,10 @@ class CompositeSketch(Interface): def setSketch(self, sketch): """Modify sketch attribute""" - self._fill_attribute(self._sketch, sketch) + self._fillAttribute(self._sketch, sketch) pass def setSketchSelection(self, sketch_selection): """Modify sketch_selection attribute""" - self._fill_attribute(self._sketch_selection, sketch_selection) + self._fillAttribute(self._sketch_selection, sketch_selection) pass diff --git a/src/PythonAPI/model/features/rotation.py b/src/PythonAPI/model/features/rotation.py index 2c8b044a0..9165b89fa 100644 --- a/src/PythonAPI/model/features/rotation.py +++ b/src/PythonAPI/model/features/rotation.py @@ -56,7 +56,7 @@ class Rotation(Interface): See __init__. """ - self._fill_attribute(self._main_objects, main_objects) + self._fillAttribute(self._main_objects, main_objects) pass def setAxisObject(self, axis_object): @@ -64,7 +64,7 @@ class Rotation(Interface): See __init__. """ - self._fill_attribute(self._axis_object, axis_object) + self._fillAttribute(self._axis_object, axis_object) pass def setAngle(self, angle): @@ -72,5 +72,5 @@ class Rotation(Interface): See __init__. """ - self._fill_attribute(self._angle, angle) + self._fillAttribute(self._angle, angle) pass diff --git a/src/PythonAPI/model/features/translation.py b/src/PythonAPI/model/features/translation.py index 802b4d8e8..12aa6ab94 100644 --- a/src/PythonAPI/model/features/translation.py +++ b/src/PythonAPI/model/features/translation.py @@ -56,7 +56,7 @@ class Translation(Interface): See __init__. """ - self._fill_attribute(self._main_objects, main_objects) + self._fillAttribute(self._main_objects, main_objects) pass def setAxisObject(self, axis_object): @@ -64,7 +64,7 @@ class Translation(Interface): See __init__. """ - self._fill_attribute(self._axis_object, axis_object) + self._fillAttribute(self._axis_object, axis_object) pass def setDistance(self, distance): @@ -72,5 +72,5 @@ class Translation(Interface): See __init__. """ - self._fill_attribute(self._distance, distance) + self._fillAttribute(self._distance, distance) pass diff --git a/src/PythonAPI/model/parameter/parameter.py b/src/PythonAPI/model/parameter/parameter.py index 9b436b710..0dd32f485 100644 --- a/src/PythonAPI/model/parameter/parameter.py +++ b/src/PythonAPI/model/parameter/parameter.py @@ -52,7 +52,7 @@ class Parameter(Interface): See __init__. """ - self._fill_attribute(self._name, name) + self._fillAttribute(self._name, name) pass def setExpression(self, expression): @@ -60,5 +60,5 @@ class Parameter(Interface): See __init__. """ - self._fill_attribute(self._expression, expression) + self._fillAttribute(self._expression, expression) pass diff --git a/src/PythonAPI/model/roots.py b/src/PythonAPI/model/roots.py index 1fa83ee57..7f463a95b 100644 --- a/src/PythonAPI/model/roots.py +++ b/src/PythonAPI/model/roots.py @@ -38,16 +38,11 @@ class Interface(): def __init__(self, feature): """x.__init__(...) initializes x; see x.__class__.__doc__ for signature""" self._feature = feature - self._attribute_white_list = [ - "execute", - "getKind", "results", "firstResult", "lastResult", - ] def __getattr__(self, name): """Process missing attributes. Add get*() methods for access feature attributes. - Redirect some missing attributes to the feature. """ if name.startswith("get"): possible_names = [ @@ -60,16 +55,33 @@ class Interface(): return getattr(self, possible_name) return getter - if name in self._attribute_white_list: - return getattr(self._feature, name) - raise AttributeError() def feature(self): """Return ModelAPI_Feature.""" return self._feature - def _fill_attribute(self, attribute, value): + def execute(self): + """Computes or recomputes the results""" + return self._feature.execute() + + def getKind(self): + """Return the unique kind of the feature""" + return self._feature.getKind() + + def results(self): + """Return current results of the feature""" + return self._feature.results() + + def firstResult(self): + """Return the first result in the list of results""" + return self._feature.firstResult() + + def lastResult(self): + """Return the result in the list of results""" + return self._feature.lastResult() + + def _fillAttribute(self, attribute, value): """Fill ModelAPI_Attribute* with value.""" tools.fill_attribute(attribute, value)