]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Bug in 2D sketcher: V7_5_1b1
authorvsr <vsr@opencascade.com>
Sat, 27 Dec 2014 08:24:34 +0000 (11:24 +0300)
committervsr <vsr@opencascade.com>
Sat, 27 Dec 2014 08:24:34 +0000 (11:24 +0300)
a) Improper set of command parameters (notebook variables) in "rectangle" mode.
b) Added support of notebook variables in the Python API class Sketcher2D.

src/EntityGUI/EntityGUI_SketcherDlg.cxx
src/GEOM_SWIG/gsketcher.py

index fde880b435ff86b93d04d8b036b20a894c0f582e..c4d6cd219eaae2f9b948e7f6026d78cfedcef6e3 100644 (file)
@@ -2258,7 +2258,7 @@ QString EntityGUI_SketcherDlg::GetNewCommand( QString& theParameters )
                                   + ":TT " + QString::number( myX2, Format, DigNum) + " " + QString::number( myY1, Format, DigNum)
                                   + ":WW";
                           
-      theParameters = myX1Str + ":" + myY1Str + ":" + myX2Str + ":" + myY2Str ;
+      theParameters = myX1Str + ":" + myY1Str + ":" + myX1Str + ":" + myY2Str + ":" + myX2Str + ":" + myY2Str + ":" + myX2Str + ":" + myY1Str;
     }
   return myNewCommand;
 }
index 004e8e63e9a171e558b218f351f3988ee00da3bb..67fbaca57f87b10c20e2a721fc5be55eac8aaeb4 100644 (file)
@@ -1160,11 +1160,16 @@ class Sketcher2D:
         if self.closed:
             self.myCommand = self.myCommand + ":WW"
 
+        from salome.geom.geomBuilder import ParseSketcherCommand, RaiseIfFailed
+        Command,Parameters = ParseSketcherCommand(self.myCommand)
+
         import GEOM
-        if isinstance(WorkingPlane, list): wire = self.geompyD.CurvesOp.MakeSketcher(self.myCommand, WorkingPlane)
-        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): wire = self.geompyD.CurvesOp.MakeSketcherOnPlane(self.myCommand, WorkingPlane)
+        if isinstance(WorkingPlane, list): wire = self.geompyD.CurvesOp.MakeSketcher(Command, WorkingPlane)
+        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): wire = self.geompyD.CurvesOp.MakeSketcherOnPlane(Command, WorkingPlane)
 
         self.myCommand = "Sketcher"
+        RaiseIfFailed("Sketcher", self.geompyD.CurvesOp)
+        wire.SetParameters(Parameters)
         self.geompyD._autoPublish(wire, theName, "wire")
         return wire
         
@@ -1204,11 +1209,16 @@ class Sketcher2D:
         else:
             raise RuntimeError, "Sketcher2D.close() : can't build face on unclosed wire"
 
+        from salome.geom.geomBuilder import ParseSketcherCommand, RaiseIfFailed
+        Command,Parameters = ParseSketcherCommand(self.myCommand)
+
         import GEOM
-        if isinstance(WorkingPlane, list): face = self.geompyD.CurvesOp.MakeSketcher(self.myCommand, WorkingPlane)
-        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): face = self.geompyD.CurvesOp.MakeSketcherOnPlane(self.myCommand, WorkingPlane)
+        if isinstance(WorkingPlane, list): face = self.geompyD.CurvesOp.MakeSketcher(Command, WorkingPlane)
+        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): face = self.geompyD.CurvesOp.MakeSketcherOnPlane(Command, WorkingPlane)
 
         self.myCommand = "Sketcher"
+        RaiseIfFailed("Sketcher", self.geompyD.CurvesOp)
+        face.SetParameters(Parameters)
         self.geompyD._autoPublish(face, theName, "face")
         return face