1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0028599: Replacement of old Boolean operations with new ones in BRepProj_Projection algorithm

The usage of *BRepAlgo_Section* has been replaced with the usage of *BRepAlgoAPI_Section* in *BRepProj_Projection* algorithm.

The TODO statements have been removed from the failing test case in the "prj" grid as they are working correctly now.

The following changes have been made to improve the performance *BRepAlgoAPI_Section*:
1. Revision of the *IntPolyh_Intersection* class to avoid repeated calculation of the deflection of the same triangulation.
2. Small revision of the Edge/Face intersection algorithm to perform Extrema computation on the whole intersection range of the edge instead of discrete ranges.
3. Implementation of the extrema computation for the Circle and Sphere.
4. Correct computation of the parameter of the point on the Circle.
This commit is contained in:
emv
2017-12-26 14:28:27 +03:00
committed by apn
parent 95f688263d
commit 03cca6f742
50 changed files with 2340 additions and 1978 deletions

View File

@@ -17,24 +17,22 @@
// modified by Michael KLOKOV Wed Mar 6 15:01:25 2002
// modified by Eugeny MALTCHIKOV Wed Jul 04 11:13:01 2012
#include <BOPAlgo_BOP.hxx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_Section.hxx>
#include <BOPDS_DS.hxx>
#include <BRep_Tool.hxx>
#include <BRepAlgoAPI_Section.hxx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPDS_DS.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pln.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
//
static
@@ -176,11 +174,9 @@ BRepAlgoAPI_Section::~BRepAlgoAPI_Section()
void BRepAlgoAPI_Section::Init(const Standard_Boolean bFlag)
{
myOperation=BOPAlgo_SECTION;
myParametersChanged = Standard_False;
myApprox = Standard_False;
myComputePCurve1 = Standard_False;
myComputePCurve2 = Standard_False;
myParametersChanged = Standard_True;
//
if (bFlag) {
Build();
@@ -194,7 +190,6 @@ void BRepAlgoAPI_Section::Init1(const TopoDS_Shape& S1)
{
myArguments.Clear();
myArguments.Append(S1);
myParametersChanged = Standard_True;
}
//=======================================================================
//function : Init1
@@ -220,7 +215,6 @@ void BRepAlgoAPI_Section::Init2(const TopoDS_Shape& S2)
{
myTools.Clear();
myTools.Append(S2);
myParametersChanged = Standard_True;
}
//=======================================================================
//function : Init2
@@ -244,10 +238,7 @@ void BRepAlgoAPI_Section::Init2(const Handle(Geom_Surface)& Sf)
//=======================================================================
void BRepAlgoAPI_Section::Approximation(const Standard_Boolean B)
{
if(myApprox != B) {
myApprox = B;
myParametersChanged = Standard_True;
}
myApprox = B;
}
//=======================================================================
//function : ComputePCurveOn1
@@ -255,10 +246,7 @@ void BRepAlgoAPI_Section::Approximation(const Standard_Boolean B)
//=======================================================================
void BRepAlgoAPI_Section::ComputePCurveOn1(const Standard_Boolean B)
{
if(myComputePCurve1 != B) {
myComputePCurve1 = B;
myParametersChanged = Standard_True;
}
myComputePCurve1 = B;
}
//=======================================================================
//function : ComputePCurveOn2
@@ -266,10 +254,7 @@ void BRepAlgoAPI_Section::ComputePCurveOn1(const Standard_Boolean B)
//=======================================================================
void BRepAlgoAPI_Section::ComputePCurveOn2(const Standard_Boolean B)
{
if(myComputePCurve2 != B) {
myComputePCurve2 = B;
myParametersChanged = Standard_True;
}
myComputePCurve2 = B;
}
//=======================================================================
//function : SetAttributes
@@ -277,9 +262,9 @@ void BRepAlgoAPI_Section::ComputePCurveOn2(const Standard_Boolean B)
//=======================================================================
void BRepAlgoAPI_Section::SetAttributes()
{
BOPAlgo_SectionAttribute theSecAttr(myApprox,
myComputePCurve1,
myComputePCurve2);
BOPAlgo_SectionAttribute theSecAttr(myApprox,
myComputePCurve1,
myComputePCurve2);
myDSFiller->SetSectionAttribute(theSecAttr);
}
//=======================================================================

View File

@@ -193,8 +193,6 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Section();
Standard_EXPORT Standard_Boolean HasAncestorFaceOn2 (const TopoDS_Shape& E, TopoDS_Shape& F) const;
protected:
@@ -203,24 +201,12 @@ protected:
Standard_EXPORT virtual void SetAttributes() Standard_OVERRIDE;
private:
Standard_Boolean myParametersChanged;
Standard_Boolean myApprox;
Standard_Boolean myComputePCurve1;
Standard_Boolean myComputePCurve2;
};
#endif // _BRepAlgoAPI_Section_HeaderFile