0023648: Add tool for checking shapes on validity for boolean operations.

Modifications:
1. To provide the checking tool for single or couple of shapes in the
context of issue "0021762:Integration of new Boolean Operation Algorithm
into OCCT" has been implemented new class BRepAlgoAPI_Check.
This class provides possibility to check single shape or couple of shapes
on topological validity, small edges and self-interference. Also, the couple
of shapes can be checked on validity for boolean operation of given type.
2. According to the issue "0023613:Add diagnostic tool for BOP" by GKA
has been implemented new static public function BRepAlgoAPI::BoolDump().
This function is used for saving the initial shapes and the result shape of
boolean operation in case if the arguments or the result are not valid shapes
in terms of BRepAlgoAPI_Check.
This commit is contained in:
emv
2013-02-27 13:04:39 +04:00
parent a7dd5d0fbd
commit da21902312
4 changed files with 189 additions and 56 deletions

View File

@@ -20,6 +20,9 @@
#include <BRepAlgoAPI_BooleanOperation.ixx>
#include <BRepAlgoAPI.hxx>
#include <BRepAlgoAPI_Check.hxx>
#include <BRepLib_FuseEdges.hxx>
#include <TopExp.hxx>
#include <TopTools_MapOfShape.hxx>
@@ -233,6 +236,13 @@ const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Modified(const TopoDS_
Standard_Boolean bIsNewFiller;
Standard_Integer iErr;
//
//dump arguments and result of boolean operation in tcl script
char *pathdump = getenv("CSF_DEBUG_BOP");
Standard_Boolean isDump = (pathdump != NULL),
isDumpArgs = Standard_False,
isDumpRes = Standard_False;
Standard_CString aPath = pathdump;
//
myBuilderCanWork=Standard_False;
NotDone();
//
@@ -256,6 +266,11 @@ const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Modified(const TopoDS_
const TopoDS_Shape& aS1 = myS1;
const TopoDS_Shape& aS2 = myS2;
//
if (isDump) {
BRepAlgoAPI_Check aChekArgs(aS1, aS2, myOperation);
isDumpArgs = !aChekArgs.IsValid();
}
//
myShape.Nullify();
myBuilder=new BOPAlgo_BOP;
@@ -269,6 +284,15 @@ const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Modified(const TopoDS_
myErrorStatus=0;
myBuilderCanWork=Standard_True;
myShape=myBuilder->Shape();
//
if (isDump) {
BRepAlgoAPI_Check aCheckRes(myShape);
isDumpRes = !aCheckRes.IsValid();
if (isDumpArgs || isDumpRes) {
BRepAlgoAPI::DumpOper(aPath, aS1, aS2, myShape, myOperation, isDumpArgs);
}
}
//
Done();
}
else {