Salome HOME
EDF 1337 : Sketcher 3D define a point by angle
authorrnc <rnc@opencascade.com>
Wed, 10 Oct 2012 14:55:29 +0000 (14:55 +0000)
committerrnc <rnc@opencascade.com>
Wed, 10 Oct 2012 14:55:29 +0000 (14:55 +0000)
Changed the name and order of parameter of tui methods for building a point by angles in order ot be consistent with GUI.

src/GEOM/GEOM_Engine.cxx
src/GEOM_SWIG/GEOM_TestAll.py
src/GEOM_SWIG/gsketcher.py

index 9881571743c7f6b4dd014de2e50d9bfc75bb80bf..501909d7a084270cbff3cb369f4cbf6bebda7592 100644 (file)
@@ -1105,15 +1105,15 @@ bool ProcessFunction(Handle(GEOM_Function)&             theFunction,
               TCollection_AsciiString aCMDtrunc = aStrVals.Value(1);
               aCMDtrunc.Trunc(3);
               if (aCMDpref.Value(4) == 'C')
-                aNewDescr += "sk.addPointAngleHRad";
+                aNewDescr += "sk.addPointRadiusAngleH";
               else
-                aNewDescr += "sk.addPointAnglesRad";
+                aNewDescr += "sk.addPointRadiusAngles";
               if (aCMDpref.Value(5) == 'A')
-                aNewDescr += "Absolute(\"";
+                aNewDescr += "Absolute(";
               else
-                aNewDescr += "Relative(\"";
-              aNewDescr += aCMDtrunc + "\", " +
-                aStrVals.Value(2) + ", " + aStrVals.Value(3) + ", " + aStrVals.Value(4) + ")";
+                aNewDescr += "Relative(";
+              aNewDescr +=  aStrVals.Value(4) + ", " +
+                aStrVals.Value(2) + ", " + aStrVals.Value(3) + ", " + "\""+aCMDtrunc+"\"" + ")";
             }
           }
           aNewDescr += "\n\t";
index b74b8081640f0cbe76a37327f41e8a3f9fb242bc..af022ee8d5ba811fddd3676291bba6633d91b432 100644 (file)
@@ -109,8 +109,12 @@ def TestAll (geompy, math):
   sk = geompy.Sketcher3D()
   sk.addPointsAbsolute(0,0,0, 70,0,0)
   sk.addPointsRelative(0, 0, 130)
-  sk.addPointAnglesLength("OXY", 50, 0, 100)
-  sk.addPointAnglesLength("OXZ", 30, 80, 130)
+  sk.addPointRadiusAnglesRelative(100, 50, 0,"OXY")
+  sk.addPointRadiusAnglesRelative(130, 30, 80, "OXZ")
+  sk.addPointRadiusAnglesAbsolute(500, 60, 30,"OXY")
+  sk.addPointRadiusAngleHRelative(100, 50, 0,"OXY")
+  sk.addPointRadiusAngleHRelative(130, 30, 40, "OXZ")
+  sk.addPointRadiusAngleHAbsolute(800, 60, 30,"OXY")
   sk.close()
   Sketcher3d_1 = sk.wire()
 
index f5ccc63bc09e3b1f5f2127aae9affbc1e851a686..11ef9bb6d6f183b00046a1fdf7bcf5fdac2013e7 100644 (file)
@@ -123,26 +123,26 @@ class Sketcher3D:
     #  origin (0, 0, 0) will become the first sketcher point.
     #  The radius and angles coordinates are defined 
     #  in a local coordinate system which origin is the last point of the sketch
-    #  
-    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    #
+    #  @param length length of the segment
     #  @param angle1 angle in a plane, defined by the \a axes
     #  @param angle2 angle from the plane, defined by the \a axes
-    #  @param length length of the segment
-    def addPointAnglesRadRelative (self, axes, angle1, angle2, length):
+    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    def addPointRadiusAnglesRelative (self, length, angle1, angle2, axes="OXY"):
         """
         Add one straight segment, defined by two angles and length.
         If the first point of sketcher is not yet defined, the
         origin (0, 0, 0) will become the first sketcher point.
 
         Parameters:
-            axes can be: "OXY", "OYZ" or "OXZ"
+            length length of the segment
             angle1 angle in a plane, defined by the \a axes
             angle2 angle from the plane, defined by the \a axes
-            length length of the segment
+            axes can be: "OXY", "OYZ" or "OXZ"
 
         Example of usage:
             sk = geompy.Sketcher3D()
-            sk.addPointAnglesRadRelative("OXY", 50, 0, 100)
+            sk.addPointRadiusAnglesRelative(100, 50, 0, "OXY")
             a3D_Sketcher_1 = sk.wire()
         """
         self.myCommand = self.myCommand + ":%s"%axes+"SR"+" %s %s %s" % (printVar(angle1), printVar(angle2), printVar(length))
@@ -154,25 +154,25 @@ class Sketcher3D:
     #  The radius and angles coordinates are defined 
     #  in a coordinate system which origin is the global coordinate system origin
     #  
-    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    #  @param radius distance to the coordinate system origin
     #  @param angle1 angle in a plane, defined by the \a axes
     #  @param angle2 angle from the plane, defined by the \a axes
-    #  @param radius distance to the coordinate system origin
-    def addPointAnglesRadAbsolute (self, axes, angle1, angle2, radius):
+    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    def addPointRadiusAnglesAbsolute (self, radius, angle1, angle2, axes="OXY"):
         """
         Add one straight segment, defined by two angles and length.
         If the first point of sketcher is not yet defined, the
         origin (0, 0, 0) will become the first sketcher point.
 
         Parameters:
-            axes can be: "OXY", "OYZ" or "OXZ"
+            radius distance to the coordinate system origin
             angle1 angle in a plane, defined by the \a axes
             angle2 angle from the plane, defined by the \a axes
-            radius distance to the coordinate system origin
+            axes can be: "OXY", "OYZ" or "OXZ"
 
         Example of usage:
             sk = geompy.Sketcher3D()
-            sk.addPointAnglesRadAbsolute("OXY", 50, 0, 100)
+            sk.addPointRadiusAnglesAbsolute(100, 50, 0, "OXY")
             a3D_Sketcher_1 = sk.wire()
         """
         self.myCommand = self.myCommand + ":%s"%axes+"SA"+" %s %s %s" % (printVar(angle1), printVar(angle2), printVar(radius))
@@ -188,21 +188,21 @@ class Sketcher3D:
     #  @param angle angle in a plane, defined by the \a axes
     #  @param height height from the plane, defined by the \a axes
     #  @param radius distance to the coordinate system origin
-    def addPointAngleHRadRelative (self, axes, angle, height, length):
+    def addPointRadiusAngleHRelative (self, length, angle, height, axes="OXY"):
         """
         Add one straight segment, defined by two angles and length.
         If the first point of sketcher is not yet defined, the
         origin (0, 0, 0) will become the first sketcher point.
 
         Parameters:
-            axes can be: "OXY", "OYZ" or "OXZ"
-            angle1 angle in a plane, defined by the \a axes
-            height height from the plane, defined by the \a axes
             radius distance to the coordinate system origin
+            angle  angle in a plane, defined by the \a axes
+            height height from the plane, defined by the \a axes
+            axes can be: "OXY", "OYZ" or "OXZ"
 
         Example of usage:
             sk = geompy.Sketcher3D()
-            sk.addPointAngleHRadRelative("OXY", 50, 40, 100)
+            sk.addPointRadiusAngleHRelative(100, 50, 40, "OXY")
             a3D_Sketcher_1 = sk.wire()
         """
         self.myCommand = self.myCommand + ":%s"%axes+"CR"+" %s %s %s" % (printVar(angle), printVar(height), printVar(length))
@@ -213,12 +213,12 @@ class Sketcher3D:
     #  origin (0, 0, 0) will become the first sketcher point.
     #  The radius height and angle coordinates are defined 
     #  in a coordinate system which origin is the global coordinate system origin
-    #  
-    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    # 
+    #  @param radius distance to the coordinate system origin
     #  @param angle angle in a plane, defined by the \a axes
     #  @param height height from the plane, defined by the \a axes
-    #  @param radius distance to the coordinate system origin
-    def addPointAngleHRadAbsolute (self, axes, angle, height, radius):
+    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    def addPointRadiusAngleHAbsolute (self, radius, angle, height, axes="OXY"):
         """
         Add one straight segment, defined by two angles and length.
         If the first point of sketcher is not yet defined, the
@@ -232,7 +232,7 @@ class Sketcher3D:
 
         Example of usage:
             sk = geompy.Sketcher3D()
-            sk.addPointAngleHRadAbsolute("OXY", 50, 40, 100)
+            sk.addPointRadiusAngleHAbsolute( 100, 50, 40, "OXY")
             a3D_Sketcher_1 = sk.wire()
         """
         self.myCommand = self.myCommand + ":%s"%axes+"CA"+" %s %s %s" % (printVar(angle), printVar(height), printVar(radius))