1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024933: Inconsistent results of self-interferences checker in SALOME and DRAW Applications.

class BOPAlgo_CheckerSI
   - methods:
void BOPAlgo_CheckerSI::Perform()

class BOPAlgo_ArgumentAnalyzer
   - methods:
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()

The changes have been done to provide the consistence
between results in SALOME Application and DRAW Application

The sytax of the command "bopcheck" has been changed:
bopcheck Shape [level of check: 0 - 9] [-t -s]
The options:
 -t - display elapsed CPU time
 -s - run in serial (non-parallel) mode. The default mode is parallel.

Modified test cases bugs/modalg_5/bug24029 and bugs/modalg_5/bug24764 according to changed output format of the "bopcheck" command.
This commit is contained in:
pkv
2014-05-22 17:24:17 +04:00
committed by apn
parent 6268cc68d7
commit 63def8e679
8 changed files with 387 additions and 440 deletions

View File

@@ -16,12 +16,13 @@
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <TColStd_Array2OfBoolean.hxx>
#include <gp_Pnt.hxx>
#include <Geom_Surface.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
@@ -29,34 +30,34 @@
#include <TopoDS_Wire.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Solid.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
//
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_SequenceOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <TColStd_Array2OfBoolean.hxx>
#include <IntTools_Range.hxx>
#include <IntTools_EdgeEdge.hxx>
#include <IntTools_CommonPrt.hxx>
#include <BOPAlgo_Operation.hxx>
#include <BOPAlgo_CheckerSI.hxx>
#include <BOPAlgo_BuilderFace.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_VectorOfInterfVV.hxx>
#include <BOPDS_VectorOfInterfVE.hxx>
#include <BOPDS_VectorOfInterfEE.hxx>
#include <BOPDS_VectorOfInterfVF.hxx>
#include <BOPDS_VectorOfInterfEF.hxx>
#include <BOPDS_VectorOfInterfFF.hxx>
#include <BOPInt_Context.hxx>
#include <BOPTools_AlgoTools3D.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <Geom_Surface.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_MapOfPassKey.hxx>
#include <BOPAlgo_Operation.hxx>
#include <BOPAlgo_CheckerSI.hxx>
#include <BOPAlgo_BuilderFace.hxx>
// ================================================================================
// function: Constructor
@@ -302,145 +303,57 @@ void BOPAlgo_ArgumentAnalyzer::TestTypes()
//=======================================================================
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
{
Standard_Integer ii=0, j;
Standard_Boolean bSelfInt;
Standard_Integer ii;
//
for(ii = 0; ii < 2; ii++) {
const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2;
if(aS.IsNull()) {
continue;
}
//
Standard_Boolean bIsEmpty = (ii == 0) ? myEmpty1 : myEmpty2;
if (bIsEmpty) {
continue;
}
BOPAlgo_CheckerSI aChecker;
//
Standard_Integer iErr, n1, n2;
BOPDS_MapIteratorMapOfPassKey aItMPK;
BOPCol_ListOfShape anArgs;
BOPAlgo_CheckerSI aChecker;
//
anArgs.Append(aS);
aChecker.SetArguments(anArgs);
//
aChecker.Perform();
Standard_Integer iErr = aChecker.ErrorStatus();
iErr=aChecker.ErrorStatus();
//
const BOPDS_PDS& theDS = aChecker.PDS();
BOPDS_VectorOfInterfVV& aVVs=theDS->InterfVV();
BOPDS_VectorOfInterfVE& aVEs=theDS->InterfVE();
BOPDS_VectorOfInterfEE& aEEs=theDS->InterfEE();
BOPDS_VectorOfInterfVF& aVFs=theDS->InterfVF();
BOPDS_VectorOfInterfEF& aEFs=theDS->InterfEF();
BOPDS_VectorOfInterfFF& aFFs=theDS->InterfFF();
BOPDS_VectorOfInterfVZ& aVZs=theDS->InterfVZ();
BOPDS_VectorOfInterfEZ& aEZs=theDS->InterfEZ();
BOPDS_VectorOfInterfFZ& aFZs=theDS->InterfFZ();
BOPDS_VectorOfInterfZZ& aZZs=theDS->InterfZZ();
const BOPDS_DS& aDS=*(aChecker.PDS());
const BOPDS_MapOfPassKey& aMPK=aDS.Interferences();
//
Standard_Integer aNbTypeInt, aTypeInt, i, nI1, nI2;
Standard_Integer aNb[] = {
aVVs.Extent(), aVEs.Extent(), aEEs.Extent(),
aVFs.Extent(), aEFs.Extent(), aFFs.Extent(),
aVZs.Extent(), aEZs.Extent(), aFZs.Extent(),
aZZs.Extent()
};
//
BOPDS_Interf* aInt=NULL;
//
aNbTypeInt=BOPDS_DS::NbInterfTypes();
for (aTypeInt = 0; aTypeInt < aNbTypeInt; ++aTypeInt) {
for (i = 0; i < aNb[aTypeInt]; ++i) {
switch(aTypeInt) {
case 0:
aInt=(BOPDS_Interf*)(&aVVs(i));
break;
case 1:
aInt=(BOPDS_Interf*)(&aVEs(i));
break;
case 2:
aInt=(BOPDS_Interf*)(&aEEs(i));
break;
case 3:
aInt=(BOPDS_Interf*)(&aVFs(i));
break;
case 4:
aInt=(BOPDS_Interf*)(&aEFs(i));
break;
case 5:
aInt=(BOPDS_Interf*)(&aFFs(i));
break;
case 6:
aInt=(BOPDS_Interf*)(&aVZs(i));
break;
case 7:
aInt=(BOPDS_Interf*)(&aEZs(i));
break;
case 8:
aInt=(BOPDS_Interf*)(&aFZs(i));
break;
case 9:
aInt=(BOPDS_Interf*)(&aZZs(i));
break;
default:
aInt=NULL;
}
//
aInt->Indices(nI1, nI2);
if (nI1 == nI2) {
continue;
}
if (theDS->IsNewShape(nI1) || theDS->IsNewShape(nI2)) {
continue;
}
//
if (aTypeInt == 4) {
BOPDS_InterfEF& aEF=aEFs(i);
if (aEF.CommonPart().Type()==TopAbs_SHAPE) {
continue;
}
}
//
const TopoDS_Shape& aS1 = theDS->Shape(nI1);
const TopoDS_Shape& aS2 = theDS->Shape(nI2);
//
if (aTypeInt == 5) {
bSelfInt = Standard_False;
BOPDS_InterfFF& aFF = aFFs(i);
BOPDS_VectorOfPoint& aVP=aFF.ChangePoints();
Standard_Integer aNbP=aVP.Extent();
BOPDS_VectorOfCurve& aVC=aFF.ChangeCurves();
Standard_Integer aNbC=aVC.Extent();
if (!aNbP && !aNbC) {
continue;
}
for (j=0; j<aNbC; ++j) {
BOPDS_Curve& aNC=aVC(j);
BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
if (aLPBC.Extent()) {
bSelfInt = Standard_True;
break;
}
}
if (!bSelfInt) {
continue;
}
}
//
BOPAlgo_CheckResult aResult;
if(ii == 0) {
aResult.SetShape1(myShape1);
aResult.AddFaultyShape1(aS1);
aResult.AddFaultyShape1(aS2);
}
else {
aResult.SetShape2(myShape2);
aResult.AddFaultyShape2(aS1);
aResult.AddFaultyShape2(aS2);
}
aResult.SetCheckStatus(BOPAlgo_SelfIntersect);
myResult.Append(aResult);
aItMPK.Initialize(aMPK);
for (; aItMPK.More(); aItMPK.Next()) {
const BOPDS_PassKey& aPK=aItMPK.Value();
aPK.Ids(n1, n2);
if(aDS.IsNewShape(n1) || aDS.IsNewShape(n2)) {
continue;
}
//
const TopoDS_Shape& aS1=aDS.Shape(n1);
const TopoDS_Shape& aS2=aDS.Shape(n2);
//
BOPAlgo_CheckResult aResult;
if(ii == 0) {
aResult.SetShape1(myShape1);
aResult.AddFaultyShape1(aS1);
aResult.AddFaultyShape1(aS2);
}
else {
aResult.SetShape2(myShape2);
aResult.AddFaultyShape2(aS1);
aResult.AddFaultyShape2(aS2);
}
aResult.SetCheckStatus(BOPAlgo_SelfIntersect);
myResult.Append(aResult);
}
//
if (iErr) {
@@ -456,7 +369,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
aResult.SetCheckStatus(BOPAlgo_OperationAborted);
myResult.Append(aResult);
}
}
}// for(ii = 0; ii < 2; ii++) {
}
// ================================================================================
// function: TestSmallEdge

View File

@@ -126,6 +126,8 @@ void BOPAlgo_CheckerSI::Init()
void BOPAlgo_CheckerSI::Perform()
{
try {
Standard_Integer iErr;
//
OCC_CATCH_SIGNALS
//
myErrorStatus=0;
@@ -142,37 +144,43 @@ void BOPAlgo_CheckerSI::Perform()
}
//
BOPAlgo_PaveFiller::Perform();
iErr=myErrorStatus;
//
if (!myErrorStatus) {
PerformVZ();
PerformVZ();
if (myErrorStatus) {
iErr=myErrorStatus;
}
//
if (!myErrorStatus) {
PerformEZ();
}
//
if (!myErrorStatus) {
PerformFZ();
PerformEZ();
if (myErrorStatus) {
iErr=myErrorStatus;
}
//
if (!myErrorStatus) {
PerformZZ();
PerformFZ();
if (myErrorStatus) {
iErr=myErrorStatus;
}
//
PerformZZ();
if (myErrorStatus) {
iErr=myErrorStatus;
}
//
if (!myErrorStatus) {
PostTreat();
PostTreat();
if (myErrorStatus) {
iErr=myErrorStatus;
}
//
if (myNonDestructive) {
Standard_Integer iErr;
//
iErr=myErrorStatus;
//
PostTreatCopy();
if (!myErrorStatus) {
myErrorStatus=iErr;
if (myErrorStatus) {
iErr=myErrorStatus;
}
}
//
if (iErr) {
myErrorStatus=iErr;
}
}
//
catch (Standard_Failure) {
@@ -183,7 +191,6 @@ void BOPAlgo_CheckerSI::Perform()
myErrorStatus=11;
}
}
//=======================================================================
//function : PostTreat
//purpose :