Salome HOME
Unit tests:
[modules/shaper.git] / src / PythonAPI / model / features / rotation.py
index 3318cd16bdb1b16520243d64dcaf3af55526d36b..4ec1745351f273ebd878c35b6781c17417a22ecf 100644 (file)
@@ -7,9 +7,18 @@ from model.roots import Interface
 
 
 def addRotation(part, *args):
-    """Add an Rotation feature to the Part and return Rotation.
+    """Add a Rotation feature to the Part.
 
-    Pass all args to Rotation __init__ function.
+    .. function:: addRotation(part, main_objects, axis_object, angle)
+
+    Args:
+        part (ModelAPI_Document): part document
+        main_objects (list of Selection): main objects
+        axis_object (list of Selection): axis object
+        angle (double): angle
+
+    Returns:
+        Rotation: rotation object
     """
     assert(args)
     feature = part.addFeature("Rotation")
@@ -17,8 +26,19 @@ def addRotation(part, *args):
 
 
 class Rotation(Interface):
+    """Interface class for Rotation features.
+
+    .. function:: Rotation(feature)
+
+        Create interface for the feature without initialization.
+
+    .. function:: Rotation(feature, main_objects, axis_object, angle)
+
+        Create interface for the feature and initialize the feature with arguments.
+    """
 
     def __init__(self, feature, *args):
+        """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
         Interface.__init__(self, feature)
         assert(self._feature.getKind() == "Rotation")
 
@@ -38,7 +58,7 @@ class Rotation(Interface):
         self.setAxisObject(args[1])
         self.setAngle(args[2])
 
-        self._execute()
+        self.execute()
         pass
 
     def setMainObjects(self, main_objects):
@@ -46,7 +66,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):
@@ -54,7 +74,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):
@@ -62,5 +82,5 @@ class Rotation(Interface):
 
         See __init__.
         """
-        self._fill_attribute(self._angle, angle)
+        self._fillAttribute(self._angle, angle)
         pass