mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-07-19 13:54:09 +08:00
0027884: Modeling Algorithms - Possible improvement for 2d classifier
Added the implementation of bndbox<->line and bndbox<->segment intersections for 2D to Bnd_Box2d Added the speedup for 2d classification to BRepClass_Intersector.cxx Added the test for our improvement
This commit is contained in:
@@ -46,33 +46,41 @@ BRepClass_FaceClassifier::BRepClass_FaceClassifier(BRepClass_FaceExplorer& F,
|
||||
//function : BRepClass_FaceClassifier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepClass_FaceClassifier::BRepClass_FaceClassifier(const TopoDS_Face& F,
|
||||
const gp_Pnt& P,
|
||||
const Standard_Real Tol)
|
||||
BRepClass_FaceClassifier::BRepClass_FaceClassifier(const TopoDS_Face& theF,
|
||||
const gp_Pnt& theP,
|
||||
const Standard_Real theTol,
|
||||
const Standard_Boolean theUseBndBox,
|
||||
const Standard_Real theGapCheckTol)
|
||||
{
|
||||
Perform(F,P,Tol);
|
||||
Perform(theF, theP, theTol, theUseBndBox, theGapCheckTol);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : BRepClass_FaceClassifier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepClass_FaceClassifier::BRepClass_FaceClassifier(const TopoDS_Face& F,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Tol)
|
||||
BRepClass_FaceClassifier::BRepClass_FaceClassifier(const TopoDS_Face& theF,
|
||||
const gp_Pnt2d& theP,
|
||||
const Standard_Real theTol,
|
||||
const Standard_Boolean theUseBndBox,
|
||||
const Standard_Real theGapCheckTol)
|
||||
{
|
||||
Perform(F,P,Tol);
|
||||
Perform(theF, theP, theTol, theUseBndBox, theGapCheckTol);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepClass_FaceClassifier::Perform(const TopoDS_Face& F,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Tol)
|
||||
void BRepClass_FaceClassifier::Perform(const TopoDS_Face& theF,
|
||||
const gp_Pnt2d& theP,
|
||||
const Standard_Real theTol,
|
||||
const Standard_Boolean theUseBndBox,
|
||||
const Standard_Real theGapCheckTol)
|
||||
{
|
||||
BRepClass_FaceExplorer Fex(F);
|
||||
BRepClass_FClassifier::Perform(Fex,P,Tol);
|
||||
BRepClass_FaceExplorer aFex(theF);
|
||||
aFex.SetMaxTolerance(theGapCheckTol);
|
||||
aFex.SetUseBndBox(theUseBndBox);
|
||||
BRepClass_FClassifier::Perform(aFex, theP, theTol);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,9 +92,11 @@ void BRepClass_FaceClassifier::Perform(const TopoDS_Face& F,
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepClass_FaceClassifier::Perform(const TopoDS_Face& aF,
|
||||
const gp_Pnt& aP,
|
||||
const Standard_Real aTol)
|
||||
void BRepClass_FaceClassifier::Perform(const TopoDS_Face& theF,
|
||||
const gp_Pnt& theP,
|
||||
const Standard_Real theTol,
|
||||
const Standard_Boolean theUseBndBox,
|
||||
const Standard_Real theGapCheckTol)
|
||||
{
|
||||
Standard_Integer aNbExt, aIndice, i;
|
||||
Standard_Real aU1, aU2, aV1, aV2, aMaxDist, aD;
|
||||
@@ -96,14 +106,14 @@ void BRepClass_FaceClassifier::Perform(const TopoDS_Face& aF,
|
||||
aMaxDist=RealLast();
|
||||
aIndice=0;
|
||||
//
|
||||
BRepAdaptor_Surface aSurf(aF, Standard_False);
|
||||
BRepTools::UVBounds(aF, aU1, aU2, aV1, aV2);
|
||||
aExtrema.Initialize(aSurf, aU1, aU2, aV1, aV2, aTol, aTol);
|
||||
BRepAdaptor_Surface aSurf(theF, Standard_False);
|
||||
BRepTools::UVBounds(theF, aU1, aU2, aV1, aV2);
|
||||
aExtrema.Initialize(aSurf, aU1, aU2, aV1, aV2, theTol, theTol);
|
||||
//
|
||||
//modified by NIZNHY-PKV Wed Aug 13 11:28:47 2008f
|
||||
rejected=Standard_True;
|
||||
//modified by NIZNHY-PKV Wed Aug 13 11:28:49 2008t
|
||||
aExtrema.Perform(aP);
|
||||
aExtrema.Perform(theP);
|
||||
if(!aExtrema.IsDone()) {
|
||||
return;
|
||||
}
|
||||
@@ -124,6 +134,6 @@ void BRepClass_FaceClassifier::Perform(const TopoDS_Face& aF,
|
||||
if(aIndice) {
|
||||
aExtrema.Point(aIndice).Parameter(aU1, aU2);
|
||||
aPuv.SetCoord(aU1, aU2);
|
||||
Perform(aF, aPuv, aTol);
|
||||
Perform(theF, aPuv, theTol, theUseBndBox, theGapCheckTol);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user