From: jfa Date: Fri, 3 Dec 2010 11:22:19 +0000 (+0000) Subject: 0021019: EDF 1574 GEOM: Make Common doesn't stop when applied to a corrupted shape. X-Git-Tag: V6_2_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fc6914d8460bce232d3914b5c73fc81b9241bd00;p=modules%2Fgeom.git 0021019: EDF 1574 GEOM: Make Common doesn't stop when applied to a corrupted shape. --- diff --git a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx index d311b0dce..bf71dc65d 100644 --- a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #include #include @@ -26,12 +25,17 @@ #include #include +#include +#include + #include #include #include #include #include #include +#include + #include #include #include @@ -39,10 +43,8 @@ #include #include #include + #include -#include -#include -#include #include #include @@ -93,7 +95,7 @@ void AddSimpleShapes(TopoDS_Shape theShape, TopTools_ListOfShape& theList) //function : Execute //purpose : //======================================================================= -Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const +Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const { if (Label().IsNull()) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); @@ -109,6 +111,14 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape aShape2 = aRefShape2->GetValue(); if (!aShape1.IsNull() && !aShape2.IsNull()) { + // check arguments for Mantis issue 0021019 + BRepCheck_Analyzer ana (aShape1, Standard_True); + if (!ana.IsValid()) + StdFail_NotDone::Raise("Common operation will not be performed, because argument shape is not valid"); + ana.Init(aShape2); + if (!ana.IsValid()) + StdFail_NotDone::Raise("Common operation will not be performed, because argument shape is not valid"); + // perform COMMON operation if (aType == BOOLEAN_COMMON) { BRep_Builder B;