Salome HOME
Fixed PythonAPI tests
[modules/shaper.git] / src / PythonAPI / model / features / translation.py
index 802b4d8e81f3b5a933eed327d2dcd9929f6f4d6d..171c988d42af89471b923778cb93e40e92a35232 100644 (file)
@@ -7,9 +7,18 @@ from model.roots import Interface
 
 
 def addTranslation(part, *args):
-    """Add an Translation feature to the Part and return Translation.
+    """Add a Translation feature to the Part.
 
-    Pass all args to Translation __init__ function.
+    .. function:: addTranslation(part, main_objects, axis_object, distance)
+
+    Args:
+        part (ModelAPI_Document): part document
+        main_objects (list of Selection): main objects
+        axis_object (Selection): axis objects
+        distance (double): distance
+
+    Returns:
+        Translation: translation object
     """
     assert(args)
     feature = part.addFeature("Translation")
@@ -19,12 +28,13 @@ def addTranslation(part, *args):
 class Translation(Interface):
     """Interface class for Translation features.
 
-    Translation(feature) -> feature interface without initialization
-    Translation(feature, main_objects, axis_object, distance) ->
-        feature interface initialized from arguments:
-        - main_objects
-        - axis_object
-        - distance
+    .. function:: Translation(feature)
+
+        Create interface for the feature without initialization.
+
+    .. function:: Translation(feature, main_objects, axis_object, distance)
+
+        Create interface for the feature and initialize the feature with arguments.
     """
 
     def __init__(self, feature, *args):
@@ -48,7 +58,7 @@ class Translation(Interface):
         self.setAxisObject(args[1])
         self.setDistance(args[2])
 
-        self._execute()
+        self.execute()
         pass
 
     def setMainObjects(self, main_objects):
@@ -56,7 +66,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 +74,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 +82,5 @@ class Translation(Interface):
 
         See __init__.
         """
-        self._fill_attribute(self._distance, distance)
+        self._fillAttribute(self._distance, distance)
         pass