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

0024869: OCAF testing framework extending

OCAF testing framework extending.
Test case for issue CR24869
This commit is contained in:
szy
2014-05-08 11:35:35 +04:00
committed by bugmaster
parent 7389f96df0
commit 372ceec4ce
5 changed files with 172 additions and 22 deletions

View File

@@ -35,6 +35,7 @@
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Section.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopExp_Explorer.hxx>
@@ -147,6 +148,11 @@ Standard_Integer DNaming_BooleanOperationDriver::Execute(TFunction_Logbook& theL
else if(aFunction->GetDriverGUID() == COMMON_GUID){
BRepAlgoAPI_Common aMkCom (anOBJECT, aTOOL);
anIsDone = CheckAndLoad(aMkCom, aFunction);
}
// case SECTION
else if(aFunction->GetDriverGUID() == SECTION_GUID){
BRepAlgoAPI_Section aMkSect (anOBJECT, aTOOL);
anIsDone = CheckAndLoad(aMkSect, aFunction);
}
else {
aFunction->SetFailure(UNSUPPORTED_FUNCTION);
@@ -319,6 +325,39 @@ void DNaming_BooleanOperationDriver::LoadNamingDS (const TDF_Label& theResultLab
}
}
//=======================================================================
//function : LoadNamingDS
//purpose :
//=======================================================================
void DNaming_BooleanOperationDriver::LoadSectionNDS (const TDF_Label& theResultLabel,
BRepAlgoAPI_BooleanOperation& MS) const
{
const TopoDS_Shape& ResSh = MS.Shape();
const TopoDS_Shape& ObjSh = MS.Shape1();
const TopoDS_Shape& ToolSh = MS.Shape2();
if (ResSh.IsNull()) {
#ifdef DEB
cout<<"LoadSectionNamingDS: The result of the boolean operation is null"<<endl;
#endif
return;
}
// LoadResult
DNaming::LoadResult(theResultLabel, MS);
TopTools_DataMapOfShapeShape SubShapes;
TopExp_Explorer Exp(ResSh, TopAbs_EDGE);
for (; Exp.More(); Exp.Next()) {
SubShapes.Bind(Exp.Current(),Exp.Current());
}
// Naming of modified faces:
TNaming_Builder genEdB (theResultLabel.NewChild()); //FindChild(1,Standard_True));
DNaming::LoadAndOrientGeneratedShapes (MS, ObjSh, TopAbs_FACE, genEdB,SubShapes);
DNaming::LoadAndOrientGeneratedShapes (MS, ToolSh, TopAbs_FACE, genEdB, SubShapes);
}
//=======================================================================
//function : CheckAndLoad
//purpose : checks result of operation and performs Topological Naming
@@ -351,8 +390,10 @@ Standard_Boolean DNaming_BooleanOperationDriver::CheckAndLoad
else if(theFunction->GetDriverGUID() == CUT_GUID) {
LoadNamingDS(RESPOSITION(theFunction), theMkOpe); // the same naming only for case of solids
} else if(theFunction->GetDriverGUID() == COMMON_GUID) {
LoadNamingDS(RESPOSITION(theFunction), theMkOpe);
}
LoadNamingDS(RESPOSITION(theFunction), theMkOpe);
} else if(theFunction->GetDriverGUID() == SECTION_GUID) {
LoadSectionNDS(RESPOSITION(theFunction), theMkOpe);
}
theFunction->SetFailure(DONE);
return Standard_True;