From: vsr Date: Sat, 27 Dec 2014 08:24:34 +0000 (+0300) Subject: Bug in 2D sketcher: X-Git-Tag: V7_5_1b1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eb2585293f9f0844076e24f57d80710725ff8f37;p=modules%2Fgeom.git Bug in 2D sketcher: a) Improper set of command parameters (notebook variables) in "rectangle" mode. b) Added support of notebook variables in the Python API class Sketcher2D. --- diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index fde880b43..c4d6cd219 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -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; } diff --git a/src/GEOM_SWIG/gsketcher.py b/src/GEOM_SWIG/gsketcher.py index 004e8e63e..67fbaca57 100644 --- a/src/GEOM_SWIG/gsketcher.py +++ b/src/GEOM_SWIG/gsketcher.py @@ -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