mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0030670: Modeling Algorithms - Performance improvement of Boolean Operations algorithm
The following improvements have been made in Boolean operations algorithm: 1. Added possibility to update FaceInfo structure for many faces at once which helps to avoid nested loops. 2. Improve Point-Face classification procedure by caching the FaceExplorer for a face.
This commit is contained in:
@@ -67,7 +67,7 @@ IntTools_FClass2d::IntTools_FClass2d()
|
||||
//=======================================================================
|
||||
IntTools_FClass2d::IntTools_FClass2d(const TopoDS_Face& aFace,
|
||||
const Standard_Real TolUV)
|
||||
: Toluv(TolUV), Face(aFace)
|
||||
: Toluv(TolUV), Face(aFace)
|
||||
{
|
||||
Init(Face, Toluv);
|
||||
}
|
||||
@@ -662,8 +662,12 @@ TopAbs_State IntTools_FClass2d::Perform
|
||||
aFCTol = (!bUIn) ? aURes : aVRes;
|
||||
}
|
||||
//
|
||||
BRepClass_FaceClassifier aClassifier;
|
||||
aClassifier.Perform(Face,Puv,aFCTol);
|
||||
|
||||
if (myFExplorer.get() == NULL)
|
||||
myFExplorer.reset (new BRepClass_FaceExplorer (Face));
|
||||
|
||||
BRepClass_FClassifier aClassifier;
|
||||
aClassifier.Perform(*myFExplorer, Puv, aFCTol);
|
||||
aStatus = aClassifier.State();
|
||||
}
|
||||
|
||||
@@ -779,8 +783,12 @@ TopAbs_State IntTools_FClass2d::TestOnRestriction
|
||||
}
|
||||
}
|
||||
else { //-- TabOrien(1)=-1 Wrong Wire
|
||||
BRepClass_FaceClassifier aClassifier;
|
||||
aClassifier.Perform(Face,Puv,Tol);
|
||||
|
||||
if (myFExplorer.get() == NULL)
|
||||
myFExplorer.reset (new BRepClass_FaceExplorer (Face));
|
||||
|
||||
BRepClass_FClassifier aClassifier;
|
||||
aClassifier.Perform(*myFExplorer, Puv, Tol);
|
||||
aStatus = aClassifier.State();
|
||||
}
|
||||
|
||||
|
@@ -21,16 +21,18 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepClass_FaceExplorer.hxx>
|
||||
#include <BRepTopAdaptor_SeqOfPtr.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
#include <memory>
|
||||
|
||||
class TopoDS_Face;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! Class provides an algorithm to classify a 2d Point
|
||||
//! in 2d space of face using boundaries of the face.
|
||||
class IntTools_FClass2d
|
||||
@@ -108,6 +110,15 @@ private:
|
||||
Standard_Real Vmax;
|
||||
Standard_Boolean myIsHole;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER < 1600
|
||||
mutable std::auto_ptr<BRepClass_FaceExplorer> myFExplorer;
|
||||
#else
|
||||
mutable std::unique_ptr<BRepClass_FaceExplorer> myFExplorer;
|
||||
#endif
|
||||
#else
|
||||
mutable std::unique_ptr<BRepClass_FaceExplorer> myFExplorer;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user