#include <BRepAlgoAPI_Check.ixx>
#include <BOPAlgo_ArgumentAnalyzer.hxx>
-#include <BRepBuilderAPI_Copy.hxx>
#include <BRepCheck_Analyzer.hxx>
//=======================================================================
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;
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 :
"\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;
}
--- /dev/null
+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"
+}