From: jfa Date: Mon, 6 Aug 2012 13:39:16 +0000 (+0000) Subject: Mantis issue 0021778: [CEA 612] MakeSolid on an unclosed shell in TUI X-Git-Tag: V6_6_0a1~51 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8fb1906b75da73edb4ba5413fcfdd2e2da8fb1d5;p=modules%2Fgeom.git Mantis issue 0021778: [CEA 612] MakeSolid on an unclosed shell in TUI --- diff --git a/src/BuildGUI/BuildGUI_SolidDlg.cxx b/src/BuildGUI/BuildGUI_SolidDlg.cxx index fcd5307ea..e8f4f63fc 100644 --- a/src/BuildGUI/BuildGUI_SolidDlg.cxx +++ b/src/BuildGUI/BuildGUI_SolidDlg.cxx @@ -258,11 +258,13 @@ bool BuildGUI_SolidDlg::isValid (QString& msg) GEOM::MeasureOpPtr anOp; anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId())); - for ( int i = 0, n = myShells.count(); i < n && ok; i++ ) { - CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get()); - if (strlen(aRes.in())) { - msg = QObject::tr(aRes.in()).arg(GEOMBase::GetName(myShells[i].get())); - ok = false; + if (!GroupSolid->CheckButton1->isChecked() || myShells.count() == 1) { + for (int i = 0, n = myShells.count(); i < n && ok; i++) { + CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get()); + if (strlen(aRes.in())) { + msg = QObject::tr(aRes.in()).arg(GEOMBase::GetName(myShells[i].get())); + ok = false; + } } } return ok; diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 3e5ab3dcf..ca34d8893 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -3016,7 +3016,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM.GEOM_Object, containing the created solid. # # @ref tui_creation_solid "Example" - def MakeSolid(self,theShells): + def MakeSolid(self, theShells): """ Create a solid, bounded by the given shells. @@ -3027,6 +3027,12 @@ class geompyDC(GEOM._objref_GEOM_Gen): New GEOM.GEOM_Object, containing the created solid. """ # Example: see GEOM_TestAll.py + if len(theShells) == 1: + descr = self.MeasuOp.IsGoodForSolid(theShells[0]) + #if len(descr) > 0: + # raise RuntimeError, "MakeSolidShells : " + descr + if descr == "WRN_SHAPE_UNCLOSED": + raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape" anObj = self.ShapesOp.MakeSolidShells(theShells) RaiseIfFailed("MakeSolidShells", self.ShapesOp) return anObj