mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0025043: there is no possibility to know what exactly subshape of source shape has detected problems by BRepAlgoAPI_Check
Since there is a possibility to run the check on self-intersection (BOPAlgo_CheckerSI algorithm) in non-destructive mode (source shape will not be modified) there is no need to make copies of the arguments of BRepAlgoAPI_Check. Test case added
This commit is contained in:
parent
fc88faf18a
commit
a967f10410
@ -322,6 +322,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
||||
//
|
||||
anArgs.Append(aS);
|
||||
aChecker.SetArguments(anArgs);
|
||||
aChecker.SetNonDestructive(Standard_True);
|
||||
//
|
||||
aChecker.Perform();
|
||||
iErr=aChecker.ErrorStatus();
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include <BRepAlgoAPI_Check.ixx>
|
||||
#include <BOPAlgo_ArgumentAnalyzer.hxx>
|
||||
#include <BRepBuilderAPI_Copy.hxx>
|
||||
#include <BRepCheck_Analyzer.hxx>
|
||||
|
||||
//=======================================================================
|
||||
@ -104,14 +103,14 @@
|
||||
const Standard_Boolean bTestSI)
|
||||
{
|
||||
myResult.Clear();
|
||||
myS1 = theS1.IsNull() ? theS1 : BRepBuilderAPI_Copy(theS1).Shape();
|
||||
myS2 = theS2.IsNull() ? theS2 : BRepBuilderAPI_Copy(theS2).Shape();
|
||||
myS1 = theS1;
|
||||
myS2 = theS2;
|
||||
//
|
||||
myAnalyzer = new BOPAlgo_ArgumentAnalyzer();
|
||||
//
|
||||
myAnalyzer->SetShape1(myS1);
|
||||
myAnalyzer->SetShape2(myS2);
|
||||
myAnalyzer->OperationType()=theOp;
|
||||
myAnalyzer->OperationType() = theOp;
|
||||
myAnalyzer->ArgumentTypeMode() = Standard_True;
|
||||
myAnalyzer->SmallEdgeMode() = bTestSE;
|
||||
myAnalyzer->SelfInterMode() = bTestSI;
|
||||
|
@ -2646,6 +2646,69 @@ static Standard_Integer OCC24925 (Draw_Interpretor& theDI,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OCC25043
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#include <BRepAlgoAPI_Check.hxx>
|
||||
static Standard_Integer OCC25043 (Draw_Interpretor& theDI,
|
||||
Standard_Integer theArgNb,
|
||||
const char** theArgVec)
|
||||
{
|
||||
if (theArgNb != 2) {
|
||||
theDI << "Usage: " << theArgVec[0] << " shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape aShape = DBRep::Get(theArgVec[1]);
|
||||
if (aShape.IsNull())
|
||||
{
|
||||
theDI << theArgVec[1] << " shape is NULL\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
BRepAlgoAPI_Check anAlgoApiCheck(aShape, Standard_True, Standard_True);
|
||||
|
||||
if (!anAlgoApiCheck.IsValid())
|
||||
{
|
||||
BOPAlgo_ListIteratorOfListOfCheckResult anCheckIter(anAlgoApiCheck.Result());
|
||||
for (; anCheckIter.More(); anCheckIter.Next())
|
||||
{
|
||||
const BOPAlgo_CheckResult& aCurCheckRes = anCheckIter.Value();
|
||||
const BOPCol_ListOfShape& aCurFaultyShapes = aCurCheckRes.GetFaultyShapes1();
|
||||
BOPCol_ListIteratorOfListOfShape aFaultyIter(aCurFaultyShapes);
|
||||
for (; aFaultyIter.More(); aFaultyIter.Next())
|
||||
{
|
||||
const TopoDS_Shape& aFaultyShape = aFaultyIter.Value();
|
||||
|
||||
Standard_Boolean anIsFaultyShapeFound = Standard_False;
|
||||
TopExp_Explorer anExp(aShape, aFaultyShape.ShapeType());
|
||||
for (; anExp.More() && !anIsFaultyShapeFound; anExp.Next())
|
||||
{
|
||||
if (anExp.Current().IsEqual(aFaultyShape))
|
||||
anIsFaultyShapeFound = Standard_True;
|
||||
}
|
||||
|
||||
if (!anIsFaultyShapeFound)
|
||||
{
|
||||
theDI << "Error. Faulty Shape is NOT found in source shape.\n";
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
theDI << "Info. Faulty shape if found in source shape\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
theDI << "Error. Problems are not detected. Test is not performed.";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OCC23010
|
||||
//purpose :
|
||||
@ -2740,5 +2803,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||
"\nOCAF persistence without setting environment variables",
|
||||
__FILE__, OCC24925, group);
|
||||
theCommands.Add ("OCC23010", "OCC23010 STEP_file", __FILE__, OCC23010, group);
|
||||
theCommands.Add ("OCC25043", "OCC25043 shape", __FILE__, OCC25043, group);
|
||||
return;
|
||||
}
|
||||
|
20
tests/bugs/modalg_5/bug25043
Normal file
20
tests/bugs/modalg_5/bug25043
Normal file
@ -0,0 +1,20 @@
|
||||
puts "============"
|
||||
puts "OCC25043"
|
||||
puts "============"
|
||||
puts ""
|
||||
###############################
|
||||
## there is no possibility to know what exactly subshape of source shape has detected problems by BRepAlgoAPI_Check
|
||||
###############################
|
||||
|
||||
pload QAcommands
|
||||
restore [locate_data_file bug25043.brep] a
|
||||
|
||||
decho off
|
||||
set info [OCC25043 a]
|
||||
decho on
|
||||
|
||||
if { [regexp "Faulty shape if found in source shape" ${info}] == 1 } {
|
||||
puts "OK : Good result"
|
||||
} else {
|
||||
puts "Error : Wrong result"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user