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

0024682: Move out B-spline cache from curves and surfaces to dedicated classes BSplCLib_Cache and BSplSLib_Cache

1. B-spline cache was moved into separated classes: BSplCLib_Cache for 2D and 3D curves and BSplSLib_Cache for surfaces.

2. The cache is used now in corresponding adaptor classes (Geom2dAdaptor_Curve, GeomAdaptor_Curve and GeomAdaptor_Surface) when the curve or surface is a B-spline.

3. Algorithms were changed to use adaptors for B-spline calculations instead of curves or surfaces.

4. Precised calculation of derivatives of surface of revolution is implemented for the points of surface placed on the axis of revolution (Geom_SurfaceOfRevolution.cxx)

5. Small modifications are made to adjust algorithms to new behavior of B-spline calculation.

6. Test cases were modified according to the modern behavior.

7. Changes in BOPAlgo_WireSplitter, BOPTools_AlgoTools, BRepLib_CheckCurveOnSurface and ShapeAnalysis_Wire to use adaptors instead of geometric entities

8. Allow Geom2dAdaptor and GeomAdaptor in case of offset curve to use corresponding adaptor for basis curve

Modification of test-cases according to the new behavior.
This commit is contained in:
azv
2015-05-28 13:36:57 +03:00
committed by bugmaster
parent 9176540c64
commit 94f71cad33
137 changed files with 4104 additions and 2503 deletions

View File

@@ -26,6 +26,7 @@
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <GeomProjLib.hxx>
@@ -56,12 +57,12 @@ class BRepLib_CheckCurveOnSurface_GlobOptFunc :
const Standard_Real theFirst,
const Standard_Real theLast)
:
myCurve(theC3D),
myPCurve(theC2D),
mySurf(theSurf),
myFirst(theFirst),
myLast(theLast)
{
myCurve = new GeomAdaptor_HCurve(theC3D);
myPCurve = new Geom2dAdaptor_HCurve(theC2D);
mySurf = new GeomAdaptor_HSurface(theSurf);
}
//
virtual Standard_Integer NbVariables() const {
@@ -160,9 +161,9 @@ class BRepLib_CheckCurveOnSurface_GlobOptFunc :
return ((myFirst <= theParam) && (theParam <= myLast));
}
Handle(Geom_Curve) myCurve;
Handle(Geom2d_Curve) myPCurve;
Handle(Geom_Surface) mySurf;
Handle(GeomAdaptor_HCurve) myCurve;
Handle(Geom2dAdaptor_HCurve) myPCurve;
Handle(GeomAdaptor_HSurface) mySurf;
Standard_Real myFirst;
Standard_Real myLast;
};

View File

@@ -773,7 +773,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
Standard_Boolean periodic = C->IsPeriodic();
GeomAdaptor_Curve aCA(C);
TopoDS_Vertex V1,V2;
if (periodic) {
@@ -813,14 +813,15 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
Standard_Boolean p1inf = Precision::IsNegativeInfinite(p1);
Standard_Boolean p2inf = Precision::IsPositiveInfinite(p2);
gp_Pnt P1,P2;
if (!p1inf) P1 = C->Value(p1);
if (!p2inf) P2 = C->Value(p2);
if (!p1inf) P1 = aCA.Value(p1);
if (!p2inf) P2 = aCA.Value(p2);
Standard_Real preci = BRepLib::Precision();
BRep_Builder B;
// check for closed curve
Standard_Boolean closed = Standard_False;
Standard_Boolean degenerated = Standard_False;
if (!p1inf && !p2inf)
closed = (P1.Distance(P2) <= preci);
@@ -836,13 +837,19 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
V2 = V1;
else {
if (!V1.IsSame(V2)) {
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
}
else if (P1.Distance(BRep_Tool::Pnt(V1)) >
Max(preci,BRep_Tool::Tolerance(V1))) {
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
Max(preci,BRep_Tool::Tolerance(V1))) {
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
}
else
{
gp_Pnt PM = aCA.Value((p1+p2)/2);
if (P1.Distance(PM) < preci)
degenerated = Standard_True;
}
}
}
@@ -898,6 +905,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
B.Add(E,V2);
}
B.Range(E,p1,p2);
B.Degenerated(E, degenerated);
myError = BRepLib_EdgeDone;
Done();