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

Compare commits

...

1 Commits

Author SHA1 Message Date
anv
7358493768 0033108: Coding - Updating geometric adaptors to work via Handles
Updated most interfaces to work with adaptors by handles
2022-09-06 14:09:47 +03:00
609 changed files with 5619 additions and 5655 deletions

View File

@@ -55,7 +55,7 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
return;
}
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
Handle(Geom2dAdaptor_Curve) anAdaptor = new Geom2dAdaptor_Curve(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor, 1.e-2);
if (anEdgeDistrib.IsDone())
{
@@ -72,9 +72,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
if (myDisplayPole)
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve)
if (anAdaptor->GetType() == GeomAbs_BezierCurve)
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Geom2d_BezierCurve) aBezier = anAdaptor->Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for (int i = 1; i <= aBezier->NbPoles(); i++)
{
@@ -87,9 +87,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
aPrsGroup->AddPrimitiveArray(anArrayOfVertex);
}
if (anAdaptor.GetType() == GeomAbs_BSplineCurve)
if (anAdaptor->GetType() == GeomAbs_BSplineCurve)
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor->BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
for (int i = 1; i <= aBSpline->NbPoles(); i++)
{
@@ -103,11 +103,11 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
}
}
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
if (myDisplayCurbure && (anAdaptor->GetType() != GeomAbs_Line))
{
const Standard_Integer nbintv = anAdaptor.NbIntervals(GeomAbs_CN);
const Standard_Integer nbintv = anAdaptor->NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1, nbintv + 1);
anAdaptor.Intervals(TI, GeomAbs_CN);
anAdaptor->Intervals(TI, GeomAbs_CN);
Standard_Real Resolution = 1.0e-9, Curvature;
Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution);
gp_Pnt2d P1, P2;

View File

@@ -30,7 +30,7 @@ void AdaptorCurve_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
Handle(GeomAdaptor_Curve) anAdaptorCurve = new GeomAdaptor_Curve(myCurve);
switch (theMode)
{
case 1:

View File

@@ -1840,7 +1840,7 @@ void GeometrySamples::BoundingBoxOfSurface3dSample()
// Compute BSpline surface bounding box.
Bnd_Box aBndBox;
BndLib_AddSurface::AddOptimal(GeomAdaptor_Surface(aBSplineSurf), Precision::Confusion(), aBndBox);
BndLib_AddSurface::AddOptimal(new GeomAdaptor_Surface(aBSplineSurf), Precision::Confusion(), aBndBox);
myResult << "Bounding box:" << std::endl;
myResult << " Min corner = [ "
<< aBndBox.CornerMin().X() << ", "
@@ -1881,7 +1881,7 @@ void GeometrySamples::BoundingBoxOfCurves3dSample()
// Compute BSpline curve bounding box.
Bnd_Box aBndBox;
BndLib_Add3dCurve::AddOptimal(GeomAdaptor_Curve(aBSplineCurve), Precision::Confusion(), aBndBox);
BndLib_Add3dCurve::AddOptimal(new GeomAdaptor_Curve(aBSplineCurve), Precision::Confusion(), aBndBox);
myResult << "Bounding box:" << std::endl;
myResult << " Min corner = [ "
<< aBndBox.CornerMin().X() << ", "

View File

@@ -102,7 +102,7 @@ void Sample2D_Face::FillData(Standard_Boolean isSizesRecompute)
for (TopExp_Explorer anEdgeIter (myshape, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Current());
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2);
if (!anEdgeDistrib.IsDone())
{
@@ -153,7 +153,7 @@ void Sample2D_Face::FillData(Standard_Boolean isSizesRecompute)
if (!aTrimmedCurve.IsNull())
{
Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve);
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib (aCurveOnEdge, 1.e-2);
if (!anEdgeDistrib.IsDone())
{
@@ -253,7 +253,7 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager)& ,
// make a 3D curve from 2D trimmed curve to display it
Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve);
// make distribution of points
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2);
if (anEdgeDistrib.IsDone())
{

View File

@@ -655,7 +655,7 @@ void GeomSources::gpTest9(CGeometryDoc* aDoc)
Standard_Real radius = 5;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
Geom2dAdaptor_Curve GAC (C);
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C);
Standard_Real startparam = 10*M_PI/180;
Standard_Real abscissa = 45*M_PI/180;
gp_Pnt2d P1;
@@ -668,23 +668,23 @@ void GeomSources::gpTest9(CGeometryDoc* aDoc)
//==============================================================
TCollection_AsciiString Message (" \n\
\n\
\n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Geom2dAdaptor_Curve GAC (C); \n\
Standard_Real startparam = 10*PI180; \n\
Standard_Real abscissa = 45*PI180; \n\
gp_Pnt2d P1; \n\
C->D0(startparam,P1); \n\
// abscissa is the distance along the curve from startparam \n\
GCPnts_AbscissaPoint AP (GAC, abscissa, startparam); \n\
gp_Pnt2d P2; \n\
if (AP.IsDone()){C->D0(AP.Parameter(),P2);} \n\
// P is now correctly set \n\
\n\
\n");
\n\
\n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C); \n\
Standard_Real startparam = 10*PI180; \n\
Standard_Real abscissa = 45*PI180; \n\
gp_Pnt2d P1; \n\
C->D0(startparam,P1); \n\
// abscissa is the distance along the curve from startparam \n\
GCPnts_AbscissaPoint AP (GAC, abscissa, startparam); \n\
gp_Pnt2d P2; \n\
if (AP.IsDone()){C->D0(AP.Parameter(),P2);} \n\
// P is now correctly set \n\
\n\
\n");
AddSeparator(aDoc,Message);
//--------------------------------------------------------------
Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(C);
@@ -723,7 +723,7 @@ void GeomSources::gpTest10(CGeometryDoc* aDoc)
Standard_Real radius = 5;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
Geom2dAdaptor_Curve GAC (C);
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C);
Standard_Real abscissa = 3;
GCPnts_UniformAbscissa UA (GAC,abscissa);
TColgp_SequenceOfPnt2d aSequence;
@@ -743,29 +743,29 @@ void GeomSources::gpTest10(CGeometryDoc* aDoc)
//==============================================================
TCollection_AsciiString Message (" \
\n\
gp_Pnt2d P; \n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Geom2dAdaptor_Curve GAC (C); \n\
Standard_Real abscissa = 3; \n\
GCPnts_UniformAbscissa UA (GAC,abscissa); \n\
TColgp_SequenceOfPnt2d aSequence; \n\
if (UA.IsDone()) \n\
{ \n\
Standard_Real N = UA.NbPoints(); \n\
Standard_Integer count = 1; \n\
for(;count<=N;count++) \n\
{ \n\
C->D0(UA.Parameter(count),P); \n\
Standard_Real Parameter = UA.Parameter(count); \n\
// append P in a Sequence \n\
aSequence.Append(P); \n\
} \n\
} \n\
Standard_Real Abscissa = UA.Abscissa(); \n\
\n");
\n\
gp_Pnt2d P; \n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C); \n\
Standard_Real abscissa = 3; \n\
GCPnts_UniformAbscissa UA (GAC,abscissa); \n\
TColgp_SequenceOfPnt2d aSequence; \n\
if (UA.IsDone()) \n\
{ \n\
Standard_Real N = UA.NbPoints(); \n\
Standard_Integer count = 1; \n\
for(;count<=N;count++) \n\
{ \n\
C->D0(UA.Parameter(count),P); \n\
Standard_Real Parameter = UA.Parameter(count); \n\
// append P in a Sequence \n\
aSequence.Append(P); \n\
} \n\
} \n\
Standard_Real Abscissa = UA.Abscissa(); \n\
\n");
AddSeparator(aDoc,Message);
//--------------------------------------------------------------
Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(C);
@@ -3895,21 +3895,21 @@ void GeomSources::gpTest48(CGeometryDoc* aDoc)
Handle(Geom2d_BSplineCurve) SPL2 = anInterpolation.Curve();
Bnd_Box2d aCBox;
Geom2dAdaptor_Curve GACC (C);
Handle(Geom2dAdaptor_Curve) GACC = new Geom2dAdaptor_Curve(C);
BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox);
Standard_Real aCXmin, aCYmin, aCXmax, aCYmax;
aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax);
Bnd_Box2d aSPL1Box;
Geom2dAdaptor_Curve GAC1 (SPL1);
Handle(Geom2dAdaptor_Curve) GAC1 = new Geom2dAdaptor_Curve(SPL1);
BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box);
Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax;
aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax);
Bnd_Box2d aSPL2Box;
Geom2dAdaptor_Curve GAC2 (SPL2);
Handle(Geom2dAdaptor_Curve) GAC2 = new Geom2dAdaptor_Curve(SPL2);
BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box);
Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax;
@@ -3930,14 +3930,14 @@ Handle(Geom2d_BSplineCurve) SPL1 ; // SPL1 = ... \n\
Handle(Geom2d_BSplineCurve) SPL2 ; // SPL2 = ... \n\
\n\
Bnd_Box2d aCBox; \n\
Geom2dAdaptor_Curve GACC (C); \n\
Handle(Geom2dAdaptor_Curve) GACC = new Geom2dAdaptor_Curve(C); \n\
BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox); \n\
\n\
Standard_Real aCXmin, aCYmin, aCXmax, aCYmax; \n\
aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax); \n\
\n\
Bnd_Box2d aSPL1Box; \n\
Geom2dAdaptor_Curve GAC1 (SPL1); \n\
Handle(Geom2dAdaptor_Curve) GAC1 = new Geom2dAdaptor_Curve(SPL1); \n\
BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box); \n\
\n\
Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax; \n\
@@ -3945,7 +3945,7 @@ aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax); \n");
Message += "\
\n\
Bnd_Box2d aSPL2Box; \n\
Geom2dAdaptor_Curve GAC2 (SPL2); \n\
Handle(Geom2dAdaptor_Curve) GAC2 = new Geom2dAdaptor_Curve(SPL2); \n\
BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box); \n\
\n\
Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax; \n\
@@ -4005,7 +4005,7 @@ void GeomSources::gpTest49(CGeometryDoc* aDoc)
Handle(Geom_Circle) C =
new Geom_Circle(anAxis,radius);
GeomAdaptor_Curve GAC (C);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(C);
BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox);
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ;
@@ -4021,7 +4021,7 @@ gp_Ax2 anAxis(gp_Pnt(0,0,0),gp_Dir(1,2,-5)); \n\
\n\
Handle(Geom_Circle) C = \n\
new Geom_Circle(anAxis,radius); \n\
GeomAdaptor_Curve GAC (C); \n\
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(C); \n\
BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox); \n\
\n\
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\
@@ -4097,7 +4097,7 @@ void GeomSources::gpTest50(CGeometryDoc* aDoc)
GeomFill_FillingStyle Type = GeomFill_StretchStyle;
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type);
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface();
GeomAdaptor_Surface GAS (aSurf);
Handle(GeomAdaptor_Surface) GAS = new GeomAdaptor_Surface(aSurf);
Bnd_Box aBox;
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox);
@@ -4122,19 +4122,19 @@ array2.SetValue(2,gp_Pnt (-20, 20, 0)); \n\
array2.SetValue(3,gp_Pnt ( 20, 30,-10)); \n\
array2.SetValue(4,gp_Pnt ( 30, 70,-20)); \n\
array2.SetValue(5,gp_Pnt ( 40, 90,-10)); \n\
Handle(Geom_BSplineCurve) SPL2 = \n\
Handle(Geom_BSplineCurve) SPL2 = \n\
GeomAPI_PointsToBSpline(array2).Curve(); \n\
\n\
GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface(); \n\
GeomAdaptor_Surface GAS (aSurf); \n\
Bnd_Box aBox; \n\
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox); \n\
\n\
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\
aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); \n\
\n");
\n\
GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface(); \n\
Handle(GeomAdaptor_Surface) GAS = new GeomAdaptor_Surface(aSurf); \n\
Bnd_Box aBox; \n\
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox); \n\
\n\
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\
aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); \n\
\n");
AddSeparator(aDoc,Message);
//--------------------------------------------------------------

View File

@@ -34,7 +34,7 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
Handle(Geom2dAdaptor_Curve) anAdaptor = new Geom2dAdaptor_Curve(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor,1.e-2);
if(anEdgeDistrib.IsDone())
{
@@ -48,9 +48,9 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
if (myDisplayPole)
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve )
if (anAdaptor->GetType() == GeomAbs_BezierCurve )
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Geom2d_BezierCurve) aBezier = anAdaptor->Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for(int i=1;i<=aBezier->NbPoles();i++)
{
@@ -60,9 +60,9 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
aPrsGroup->AddPrimitiveArray (anArrayOfVertex);
}
if (anAdaptor.GetType() == GeomAbs_BSplineCurve )
if (anAdaptor->GetType() == GeomAbs_BSplineCurve )
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor->BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex =
new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
@@ -76,12 +76,12 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
}
}
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
if (myDisplayCurbure && (anAdaptor->GetType() != GeomAbs_Line))
{
Standard_Integer ii;
Standard_Integer intrv, nbintv = anAdaptor.NbIntervals(GeomAbs_CN);
Standard_Integer intrv, nbintv = anAdaptor->NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1,nbintv+1);
anAdaptor.Intervals(TI,GeomAbs_CN);
anAdaptor->Intervals(TI,GeomAbs_CN);
Standard_Real Resolution = 1.0e-9, Curvature;
Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution);
gp_Pnt2d P1, P2;

View File

@@ -18,7 +18,7 @@ void ISession_Curve::Compute (const Handle(PrsMgr_PresentationManager)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Curve anAdaptorCurve (myCurve);
Handle(GeomAdaptor_Curve) anAdaptorCurve = new GeomAdaptor_Curve(myCurve);
switch (theMode)
{
case 1:

View File

@@ -22,8 +22,7 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Surface anAdaptorSurface (mySurface);
Handle(GeomAdaptor_Surface) anAdaptorHSurface = new GeomAdaptor_Surface (mySurface);
Handle(GeomAdaptor_Surface) anAdaptorSurface = new GeomAdaptor_Surface (mySurface);
Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer();
aPoleDrawer->SetOwnLineAspects();
@@ -41,7 +40,7 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
}
case 0:
{
StdPrs_WFSurface::Add (thePrs, anAdaptorHSurface, myDrawer);
StdPrs_WFSurface::Add (thePrs, anAdaptorSurface, myDrawer);
break;
}
}

View File

@@ -188,7 +188,7 @@ void AIS_Axis::Compute (const Handle(PrsMgr_PresentationManager)& ,
thePrs->SetInfiniteState (myInfiniteState);
if (!myIsXYZAxis)
{
GeomAdaptor_Curve curv (myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
StdPrs_Curve::Add (thePrs, curv, myDrawer);
}
else

View File

@@ -211,7 +211,7 @@ void AIS_Circle::UnsetWidth()
void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentation)
{
GeomAdaptor_Curve curv(myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);
@@ -226,7 +226,7 @@ void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentatio
//=======================================================================
void AIS_Circle::ComputeArc (const Handle(Prs3d_Presentation)& thePresentation)
{
GeomAdaptor_Curve curv(myComponent, myUStart, myUEnd);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent, myUStart, myUEnd);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);

View File

@@ -211,7 +211,7 @@ void AIS_Line::UnsetWidth()
//=======================================================================
void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentation)
{
GeomAdaptor_Curve curv(myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
//pas de prise en compte lors du FITALL
@@ -230,7 +230,7 @@ void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentati
myComponent = new Geom_Line(P1,gp_Dir(P2.XYZ()-P1.XYZ()));
Standard_Real dist = P1.Distance(P2);
GeomAdaptor_Curve curv(myComponent,0.,dist);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent,0.,dist);
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
}

View File

@@ -222,7 +222,7 @@ void AIS_Plane::Compute (const Handle(PrsMgr_PresentationManager)& ,
ComputeFrame();
const Handle(Geom_Plane)& pl = myComponent;
Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
GeomAdaptor_Surface surf(thegoodpl);
Handle(GeomAdaptor_Surface) surf = new GeomAdaptor_Surface(thegoodpl);
StdPrs_Plane::Add (thePrs, surf, myDrawer);
}
else

View File

@@ -93,7 +93,7 @@ static void findfourpoints(const Standard_Real ,
}
}
/*static Standard_Real curvature(const Standard_Real U, const Adaptor3d_Curve& C)
/*static Standard_Real curvature(const Standard_Real U, const Handle(Adaptor3d_Curve)& C)
{
Standard_Real k, tau, mod1, mod2, OMEGA;
gp_Pnt P;
@@ -151,34 +151,40 @@ Approx_CurvlinFunc::Approx_CurvlinFunc(const Handle(Adaptor2d_Curve2d)& C2D1, co
void Approx_CurvlinFunc::Init()
{
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
switch(myCase) {
case 1:
Init (*myC3D, mySi_1, myUi_1);
myFirstU1 = myC3D->FirstParameter();
myLastU1 = myC3D->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
{
Init(myC3D, mySi_1, myUi_1);
myFirstU1 = myC3D->FirstParameter();
myLastU1 = myC3D->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
}
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur.FirstParameter();
myLastU1 = CurOnSur.LastParameter();
myFirstU2 = myLastU2 = 0;
break;
{
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
CurOnSur->Load(myC2D1);
CurOnSur->Load(mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur->FirstParameter();
myLastU1 = CurOnSur->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
}
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur.FirstParameter();
myLastU1 = CurOnSur.LastParameter();
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
Init(CurOnSur, mySi_2, myUi_2);
myFirstU2 = CurOnSur.FirstParameter();
myLastU2 = CurOnSur.LastParameter();
{
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur->FirstParameter();
myLastU1 = CurOnSur->LastParameter();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
Init(CurOnSur, mySi_2, myUi_2);
myFirstU2 = CurOnSur->FirstParameter();
myLastU2 = CurOnSur->LastParameter();
}
}
Length();
@@ -190,20 +196,20 @@ void Approx_CurvlinFunc::Init()
//purpose : Init the values
//history : 23/10/1998 PMN : Cut at curve's discontinuities
//=======================================================================
void Approx_CurvlinFunc::Init(Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si,
Handle(TColStd_HArray1OfReal)& Ui) const
void Approx_CurvlinFunc::Init (const Handle(Adaptor3d_Curve)& C, Handle(TColStd_HArray1OfReal)& Si,
Handle(TColStd_HArray1OfReal)& Ui) const
{
Standard_Real Step, FirstU, LastU;
Standard_Integer i, j, k, NbInt, NbIntC3;
FirstU = C.FirstParameter();
LastU = C.LastParameter();
FirstU = C->FirstParameter();
LastU = C->LastParameter();
NbInt = 10;
NbIntC3 = C.NbIntervals(GeomAbs_C3);
NbIntC3 = C->NbIntervals(GeomAbs_C3);
TColStd_Array1OfReal Disc(1, NbIntC3+1);
if (NbIntC3 >1) {
C.Intervals(Disc, GeomAbs_C3);
C->Intervals(Disc, GeomAbs_C3);
}
else {
Disc(1) = FirstU;
@@ -325,46 +331,44 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
if ((Last - First) < Tol) return;
Standard_Real FirstU, LastU;
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) HCurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
Handle(Adaptor3d_CurveOnSurface) TCurOnSur;
switch(myCase) {
case 1:
myC3D = myC3D->Trim(myFirstU1, myLastU1, Tol);
FirstU = GetUParameter(*myC3D, First, 1);
LastU = GetUParameter (*myC3D, Last, 1);
FirstU = GetUParameter(myC3D, First, 1);
LastU = GetUParameter (myC3D, Last, 1);
myC3D = myC3D->Trim(FirstU, LastU, Tol);
break;
case 3:
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(myFirstU2, myLastU2, Tol));
myC2D2 = HCurOnSur->GetCurve();
mySurf2 = HCurOnSur->GetSurface();
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D2, mySurf2);
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(myFirstU2, myLastU2, Tol));
myC2D2 = TCurOnSur->GetCurve();
mySurf2 = TCurOnSur->GetSurface();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
FirstU = GetUParameter(CurOnSur, First, 1);
LastU = GetUParameter(CurOnSur, Last, 1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(FirstU, LastU, Tol));
myC2D2 = HCurOnSur->GetCurve();
mySurf2 = HCurOnSur->GetSurface();
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(FirstU, LastU, Tol));
myC2D2 = TCurOnSur->GetCurve();
mySurf2 = TCurOnSur->GetSurface();
Standard_FALLTHROUGH
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(myFirstU1, myLastU1, Tol));
myC2D1 = HCurOnSur->GetCurve();
mySurf1 = HCurOnSur->GetSurface();
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(myFirstU1, myLastU1, Tol));
myC2D1 = TCurOnSur->GetCurve();
mySurf1 = TCurOnSur->GetSurface();
CurOnSur->Load(myC2D1);
CurOnSur->Load(mySurf1);
FirstU = GetUParameter(CurOnSur, First, 1);
LastU = GetUParameter(CurOnSur, Last, 1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(FirstU, LastU, Tol));
myC2D1 = HCurOnSur->GetCurve();
mySurf1 = HCurOnSur->GetSurface();
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(FirstU, LastU, Tol));
myC2D1 = TCurOnSur->GetCurve();
mySurf1 = TCurOnSur->GetSurface();
}
myFirstS = First;
myLastS = Last;
@@ -372,41 +376,39 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
void Approx_CurvlinFunc::Length()
{
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
Standard_Real FirstU, LastU;
switch(myCase){
case 1:
FirstU = myC3D->FirstParameter();
LastU = myC3D->LastParameter();
myLength = Length (*myC3D, FirstU, LastU);
myLength = Length (myC3D, FirstU, LastU);
myLength1 = myLength2 = 0;
break;
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength = Length(CurOnSur, FirstU, LastU);
myLength1 = myLength2 = 0;
break;
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength1 = Length(CurOnSur, FirstU, LastU);
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength2 = Length(CurOnSur, FirstU, LastU);
myLength = (myLength1 + myLength2)/2;
}
}
Standard_Real Approx_CurvlinFunc::Length(Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LastU) const
Standard_Real Approx_CurvlinFunc::Length(const Handle(Adaptor3d_Curve)& C, const Standard_Real FirstU, const Standard_Real LastU) const
{
Standard_Real Length;
@@ -423,24 +425,22 @@ Standard_Real Approx_CurvlinFunc::GetLength() const
Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const
{
Standard_Real S=0, S1, S2;
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
switch (myCase) {
case 1:
S = GetSParameter (*myC3D, U, myLength);
S = GetSParameter (myC3D, U, myLength);
break;
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
S = GetSParameter(CurOnSur, U, myLength);
break;
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
S1 = GetSParameter(CurOnSur, U, myLength1);
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
S2 = GetSParameter(CurOnSur, U, myLength2);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
S1 = GetSParameter(CurOnSur, U, myLength1);
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
S2 = GetSParameter(CurOnSur, U, myLength2);
S = (S1 + S2)/2;
}
return S;
@@ -448,9 +448,9 @@ Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const
Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
const Standard_Real S,
const Standard_Integer NumberOfCurve) const
Standard_Real Approx_CurvlinFunc::GetUParameter (const Handle(Adaptor3d_Curve)& C,
const Standard_Real S,
const Standard_Integer NumberOfCurve) const
{
Standard_Real deltaS, base, U, Length;
Standard_Integer NbInt, NInterval, i;
@@ -513,12 +513,12 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
return U;
}
Standard_Real Approx_CurvlinFunc::GetSParameter(Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Len) const
Standard_Real Approx_CurvlinFunc::GetSParameter(const Handle(Adaptor3d_Curve)& C, const Standard_Real U, const Standard_Real Len) const
{
Standard_Real S, Origin;
Origin = C.FirstParameter();
S = myFirstS + Length(C, Origin, U)/Len;
Origin = C->FirstParameter();
S = myFirstS + Length(C, Origin, U)/Len;
return S;
}
@@ -530,7 +530,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase1(const Standard_Real S, const Stan
gp_Vec dC_dU, dC_dS, d2C_dU2, d2C_dS2;
Standard_Real U, Mag, dU_dS, d2U_dS2;
U = GetUParameter (*myC3D, S, 1);
U = GetUParameter (myC3D, S, 1);
switch(Order) {
@@ -612,16 +612,16 @@ Standard_Boolean Approx_CurvlinFunc::EvalCurOnSur(const Standard_Real S, const S
if (NumberOfCurve == 1) {
Cur2D = myC2D1;
Surf = mySurf1;
Adaptor3d_CurveOnSurface CurOnSur(myC2D1, mySurf1);
Surf = mySurf1;
Handle(Adaptor3d_CurveOnSurface) CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
U = GetUParameter(CurOnSur, S, 1);
if(myCase == 3) Length = myLength1;
else Length = myLength;
}
else if (NumberOfCurve == 2) {
Cur2D = myC2D2;
Surf = mySurf2;
Adaptor3d_CurveOnSurface CurOnSur(myC2D2, mySurf2);
Surf = mySurf2;
Handle(Adaptor3d_CurveOnSurface) CurOnSur = new Adaptor3d_CurveOnSurface(myC2D2, mySurf2);
U = GetUParameter(CurOnSur, S, 2);
Length = myLength2;
}

View File

@@ -64,14 +64,14 @@ public:
Standard_EXPORT void Length();
//! Computes length of the curve segment.
Standard_EXPORT Standard_Real Length (Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
Standard_EXPORT Standard_Real Length (const Handle(Adaptor3d_Curve)& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
Standard_EXPORT Standard_Real GetLength() const;
//! returns original parameter corresponding S. if
//! Case == 1 computation is performed on myC2D1 and mySurf1,
//! otherwise it is done on myC2D2 and mySurf2.
Standard_EXPORT Standard_Real GetUParameter (Adaptor3d_Curve& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
Standard_EXPORT Standard_Real GetUParameter (const Handle(Adaptor3d_Curve)& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
//! returns original parameter corresponding S.
Standard_EXPORT Standard_Real GetSParameter (const Standard_Real U) const;
@@ -100,10 +100,10 @@ private:
Standard_EXPORT void Init();
Standard_EXPORT void Init (Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
Standard_EXPORT void Init (const Handle(Adaptor3d_Curve)& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
//! returns curvilinear parameter corresponding U.
Standard_EXPORT Standard_Real GetSParameter (Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Length) const;
Standard_EXPORT Standard_Real GetSParameter (const Handle(Adaptor3d_Curve)& C, const Standard_Real U, const Standard_Real Length) const;
Standard_EXPORT Standard_Boolean EvalCurOnSur (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result, const Standard_Integer NumberOfCurve) const;

View File

@@ -111,7 +111,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
const gp_Pnt& APoint,
const Standard_Real Tolerance,
const Standard_Integer NumIteration,
const Adaptor3d_Curve& Curve,
const Handle(Adaptor3d_Curve)& Curve,
Standard_Boolean& Status,
Standard_Real& Result)
{
@@ -125,7 +125,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
do
{
num_iter++;
Curve.D2(param, a_point, d1, d2);
Curve->D2(param, a_point, d1, d2);
vector = gp_Vec(a_point,APoint);
func = vector.Dot(d1);
@@ -143,8 +143,8 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
if( Abs(func_derivative) > Toler )
param -= func / func_derivative;
param = Max(param,Curve.FirstParameter());
param = Min(param,Curve.LastParameter());
param = Max(param,Curve->FirstParameter());
param = Min(param,Curve->LastParameter());
}
} while (not_done && num_iter <= NumIteration);
@@ -156,7 +156,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
//purpose :
//=======================================================================
static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
const Adaptor3d_CurveOnSurface& cons,
const Handle(Adaptor3d_CurveOnSurface)& cons,
const Standard_Integer nbp)
{
Standard_Real d2 = 0.0; // Square max discrete deviation.
@@ -170,7 +170,7 @@ static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
try
{
Pc3d = c3d->Value(u);
Pcons = cons.Value(u);
Pcons = cons->Value(u);
}
catch (Standard_Failure const&)
{
@@ -202,7 +202,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
const Standard_Integer nbp,
const Standard_Real *pc3d,
const Handle(Adaptor3d_Curve)& c3d,
const Adaptor3d_CurveOnSurface& cons,
const Handle(Adaptor3d_CurveOnSurface)& cons,
Standard_Real& tol,
const Standard_Real oldtol)
{
@@ -217,8 +217,8 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
Standard_Real aParamFirst = 3.0 * pc3d[0] - 2.0 * pc3d[nbp - 1];
Standard_Real aParamLast = 3.0 * pc3d[nbp - 1] - 2.0 * pc3d[0];
Standard_Real FirstPar = cons.FirstParameter();
Standard_Real LastPar = cons.LastParameter();
Standard_Real FirstPar = cons->FirstParameter();
Standard_Real LastPar = cons->LastParameter();
if (aParamFirst < FirstPar)
aParamFirst = FirstPar;
if (aParamLast > LastPar)
@@ -247,7 +247,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
return Standard_False;
}
tprev = tcons;
gp_Pnt Pcons = cons.Value(tcons);
gp_Pnt Pcons = cons->Value(tcons);
Standard_Real temp = Pc3d.SquareDistance(Pcons);
if(temp > d2) d2 = temp;
}
@@ -337,9 +337,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
// Create and fill data structure.
Approx_SameParameter_Data aData;
aData.myCOnS = Adaptor3d_CurveOnSurface(myHCurve2d,mySurf);
aData.myC2dPF = aData.myCOnS.FirstParameter();
aData.myC2dPL = aData.myCOnS.LastParameter();
aData.myCOnS = new Adaptor3d_CurveOnSurface(myHCurve2d,mySurf);
aData.myC2dPF = aData.myCOnS->FirstParameter();
aData.myC2dPL = aData.myCOnS->LastParameter();
aData.myC3dPF = myC3d->FirstParameter();
aData.myC3dPL = myC3d->LastParameter();
aData.myNbPnt = 0; // No points initially.
@@ -376,7 +376,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if(aData.myNbPnt < aNbPnt )
{
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
myCurve2d = Geom2dAdaptor::MakeCurve (*myHCurve2d);
myCurve2d = Geom2dAdaptor::MakeCurve (myHCurve2d);
myDone = Standard_False;
return;
}
@@ -444,11 +444,11 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if (anApproximator.IsDone() || anApproximator.HasResult())
{
Adaptor3d_CurveOnSurface ACS = aData.myCOnS;
Handle(Adaptor3d_CurveOnSurface) ACS = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS->ShallowCopy());
GeomLib_MakeCurvefromApprox aCurveBuilder(anApproximator);
Handle(Geom2d_BSplineCurve) aC2d = aCurveBuilder.Curve2dFromTwo1d(1,2);
Handle(Adaptor2d_Curve2d) aHCurve2d = new Geom2dAdaptor_Curve(aC2d);
aData.myCOnS.Load(aHCurve2d);
aData.myCOnS->Load(aHCurve2d);
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
const Standard_Real aMult = 250.0; // To be tolerant with discrete tolerance.
@@ -482,9 +482,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
// using data from the last loop iteration or initial data. Use data set with minimal deflection.
// Original 2d curve.
aData.myCOnS.Load(myHCurve2d);
aData.myCOnS->Load(myHCurve2d);
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
myCurve2d = Geom2dAdaptor::MakeCurve (*myHCurve2d);
myCurve2d = Geom2dAdaptor::MakeCurve (myHCurve2d);
// Approximation curve.
Standard_Integer num_knots = aData.myNbPnt + 7;
@@ -515,7 +515,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
GeomLib_MakeCurvefromApprox aCurveBuilder(anApproximator);
Handle(Geom2d_BSplineCurve) aC2d = aCurveBuilder.Curve2dFromTwo1d(1,2);
Handle(Adaptor2d_Curve2d) aHCurve2d = new Geom2dAdaptor_Curve(aC2d);
aData.myCOnS.Load(aHCurve2d);
aData.myCOnS->Load(aHCurve2d);
Standard_Real anApproxTol = ComputeTolReached(myC3d,aData.myCOnS,2 * myNbSamples);
if (anApproxTol < myTolReached)
@@ -527,7 +527,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
myDone = Standard_True;
}
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS.ShallowCopy());
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS->ShallowCopy());
}
//=======================================================================
@@ -643,18 +643,18 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
// Compute initial distance on boundary points.
gp_Pnt Pcons, Pc3d;
theData.myCOnS.D0(theData.myC2dPF, Pcons);
theData.myCOnS->D0(theData.myC2dPF, Pcons);
myC3d->D0(theData.myC3dPF, Pc3d);
Standard_Real dist2 = Pcons.SquareDistance(Pc3d);
Standard_Real dmax2 = dist2;
theData.myCOnS.D0(theData.myC2dPL, Pcons);
theData.myCOnS->D0(theData.myC2dPL, Pcons);
myC3d->D0(theData.myC3dPL, Pc3d);
dist2 = Pcons.SquareDistance(Pc3d);
dmax2 = Max(dmax2, dist2);
Extrema_LocateExtPC Projector;
Projector.Initialize (*myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Projector.Initialize (myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Standard_Integer count = 1;
Standard_Real previousp = theData.myC3dPF, initp=0, curp;
@@ -662,7 +662,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
Standard_Boolean isProjOk = Standard_False;
for (Standard_Integer ii = 1; ii < theData.myNbPnt; ii++)
{
theData.myCOnS.D0(theData.myPC2d[ii],Pcons);
theData.myCOnS->D0(theData.myPC2d[ii],Pcons);
myC3d->D0(theData.myPC3d[ii],Pc3d);
dist2 = Pcons.SquareDistance(Pc3d);
@@ -692,7 +692,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
}
else
{
ProjectPointOnCurve(initp,Pcons,theData.myTol,30, *myC3d,isProjOk,curp);
ProjectPointOnCurve(initp,Pcons,theData.myTol,30, myC3d,isProjOk,curp);
}
isProjOk = isProjOk && // Good projection.
curp > previousp + myDeltaMin && // Point is separated from previous.
@@ -706,7 +706,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
}
// Whole parameter space search using general extrema.
Extrema_ExtPC PR(Pcons, *myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Extrema_ExtPC PR(Pcons, myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
if (!PR.IsDone() || PR.NbExt() == 0) // Lazy evaluation is used.
continue;
@@ -747,7 +747,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
//function : ComputeTangents
//purpose : Sub-method in Build.
//=======================================================================
Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSurface & theCOnS,
Standard_Boolean Approx_SameParameter::ComputeTangents(const Handle(Adaptor3d_CurveOnSurface) & theCOnS,
Standard_Real &theFirstTangent,
Standard_Real &theLastTangent) const
{
@@ -758,7 +758,7 @@ Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSu
// First point.
const Standard_Real aParamFirst = myC3d->FirstParameter();
theCOnS.D1(aParamFirst, aPntCOnS, aVecConS);
theCOnS->D1(aParamFirst, aPntCOnS, aVecConS);
myC3d->D1(aParamFirst, aPnt, aVec);
Standard_Real aMagnitude = aVecConS.Magnitude();
if (aMagnitude > aSmallMagnitude)
@@ -768,7 +768,7 @@ Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSu
// Last point.
const Standard_Real aParamLast = myC3d->LastParameter();
theCOnS.D1(aParamLast,aPntCOnS,aVecConS);
theCOnS->D1(aParamLast,aPntCOnS,aVecConS);
myC3d->D1(aParamLast, aPnt, aVec);
aMagnitude = aVecConS.Magnitude();
@@ -834,7 +834,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real &theBestSqTol) const
{
Extrema_LocateExtPC Projector;
Projector.Initialize (*myC3d, myC3d->FirstParameter(), myC3d->LastParameter(), theData.myTol);
Projector.Initialize (myC3d, myC3d->FirstParameter(), myC3d->LastParameter(), theData.myTol);
Standard_Real curp = 0.0;
Standard_Boolean projok = Standard_False;
@@ -862,7 +862,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real uc3d = 0.5*(theData.myPC3d[ii]+theData.myPC3d[ii+1]);
gp_Pnt Pcons;
theData.myCOnS.D0(ucons,Pcons);
theData.myCOnS->D0(ucons,Pcons);
Projector.Perform(Pcons, uc3d);
if (Projector.IsDone())
{
@@ -873,7 +873,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
}
else
{
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, *myC3d,projok,curp);
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, myC3d,projok,curp);
}
if(projok)
{
@@ -910,7 +910,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real uc3d = 0.5*(theData.myPC3d[n]+theData.myPC3d[n+1]);
gp_Pnt Pcons;
theData.myCOnS.D0(ucons,Pcons);
theData.myCOnS->D0(ucons,Pcons);
Projector.Perform(Pcons, uc3d);
if (Projector.IsDone())
{
@@ -921,7 +921,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
}
else
{
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, *myC3d,projok,curp);
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, myC3d,projok,curp);
}
if(projok)
{

View File

@@ -103,7 +103,7 @@ private:
//! a lot of memory is used in intermediate computations.
struct Approx_SameParameter_Data
{
Adaptor3d_CurveOnSurface myCOnS; // Curve on surface.
Handle(Adaptor3d_CurveOnSurface) myCOnS; // Curve on surface.
Standard_Integer myNbPnt; // Number of points.
Standard_Real *myPC3d; // Parameters on 3d curve.
Standard_Real *myPC2d; // Parameters on 2d curve.
@@ -155,7 +155,7 @@ private:
//! Computes tangents on boundary points.
//@return true if tangents are not null and false otherwise.
Standard_Boolean ComputeTangents(const Adaptor3d_CurveOnSurface & theCOnS,
Standard_Boolean ComputeTangents(const Handle(Adaptor3d_CurveOnSurface) & theCOnS,
Standard_Real &theFirstTangent,
Standard_Real &theLastTangent) const;

View File

@@ -640,7 +640,7 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange)
{
// At this stage, context should contain adaptor for all intersected faces,
// so getting a type of the underlying surface should be done at no cost.
if (myContext->SurfaceAdaptor(TopoDS::Face(aF)).GetType() == GeomAbs_Plane)
if (myContext->SurfaceAdaptor(TopoDS::Face(aF))->GetType() == GeomAbs_Plane)
{
// Check bounding box of the face - it should not be open in any side
const Bnd_Box& aBox = aSI.Box();

View File

@@ -889,7 +889,7 @@ Standard_Boolean BOPAlgo_PaveFiller::GetPBBox(const TopoDS_Edge& theE,
}
else {
// build bounding box
BRepAdaptor_Curve aBAC(theE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(theE);
Standard_Real aTol = BRep_Tool::Tolerance(theE) + Precision::Confusion();
BndLib_Add3dCurve::Add(aBAC, theSFirst, theSLast, aTol, theBox);
thePBBox.Bind(thePB, theBox);

View File

@@ -373,9 +373,9 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange)
//
Standard_Boolean bLinePlane = Standard_False;
if (aNbCPrts) {
BRepAdaptor_Curve aBAC(aE);
bLinePlane = (aBAC.GetType() == GeomAbs_Line &&
myContext->SurfaceAdaptor(aF).GetType() == GeomAbs_Plane);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
bLinePlane = (aBAC->GetType() == GeomAbs_Line &&
myContext->SurfaceAdaptor(aF)->GetType() == GeomAbs_Plane);
}
//
for (i=1; i<=aNbCPrts; ++i) {
@@ -916,7 +916,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
// Projection tool
GeomAPI_ProjectPointOnSurf& aProjPS = myContext->ProjPS(aF);
BRepAdaptor_Surface& aSurfAdaptor = myContext->SurfaceAdaptor (aF);
const Handle(BRepAdaptor_Surface)& aSurfAdaptor = myContext->SurfaceAdaptor (aF);
// Iterate on pave blocks and combine pairs containing
// the same vertices
@@ -996,7 +996,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
if (!myContext->IsPointInFace(aF, gp_Pnt2d(U, V)))
continue;
if (aSurfAdaptor.GetType() != GeomAbs_Plane ||
if (aSurfAdaptor->GetType() != GeomAbs_Plane ||
aBAC.GetType() != GeomAbs_Line)
{
gp_Pnt aPOnS = aProjPS.NearestPoint();

View File

@@ -76,8 +76,8 @@
#include <TopTools_ListOfShape.hxx>
//
static Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1,
const BRepAdaptor_Surface& aBAS2);
static Standard_Real ToleranceFF(const Handle(BRepAdaptor_Surface)& aBAS1,
const Handle(BRepAdaptor_Surface)& aBAS2);
/////////////////////////////////////////////////////////////////////////
//=======================================================================
@@ -322,10 +322,10 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
const TopoDS_Face& aF1 = (*(TopoDS_Face *)(&myDS->Shape(nF1)));
const TopoDS_Face& aF2 = (*(TopoDS_Face *)(&myDS->Shape(nF2)));
//
const BRepAdaptor_Surface& aBAS1 = myContext->SurfaceAdaptor(aF1);
const BRepAdaptor_Surface& aBAS2 = myContext->SurfaceAdaptor(aF2);
if (aBAS1.GetType() == GeomAbs_Plane &&
aBAS2.GetType() == GeomAbs_Plane) {
const Handle(BRepAdaptor_Surface)& aBAS1 = myContext->SurfaceAdaptor(aF1);
const Handle(BRepAdaptor_Surface)& aBAS2 = myContext->SurfaceAdaptor(aF2);
if (aBAS1->GetType() == GeomAbs_Plane &&
aBAS2->GetType() == GeomAbs_Plane) {
// Check if the planes are really interfering
Standard_Boolean bToIntersect = CheckPlanes(nF1, nF2);
if (!bToIntersect) {
@@ -347,8 +347,8 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
// Keep shift value to use it as the tolerance for intersection curves
Standard_Real aShiftValue = 0.;
if (aBAS1.GetType() != GeomAbs_Plane ||
aBAS2.GetType() != GeomAbs_Plane) {
if (aBAS1->GetType() != GeomAbs_Plane ||
aBAS2->GetType() != GeomAbs_Plane) {
Standard_Boolean isFound = Standard_False;
for (TopExp_Explorer aExp1(aF1, TopAbs_EDGE); !isFound && aExp1.More(); aExp1.Next())
@@ -785,7 +785,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
//
// check if the pave block has a valid range
Standard_Real aFirst, aLast;
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aTolR3D,
if (!BRepLib::FindValidRange(new GeomAdaptor_Curve(aIC.Curve()), aTolR3D,
aT1, BRep_Tool::Pnt(aV1), Max (aTolR3D, BRep_Tool::Tolerance(aV1)),
aT2, BRep_Tool::Pnt(aV2), Max (aTolR3D, BRep_Tool::Tolerance(aV2)),
aFirst, aLast))
@@ -3176,7 +3176,7 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC)
// Check if there will be valid range on the curve
Standard_Real aFirst, aLast;
Standard_Real aNewTolV = Max(aTolV, aDistVP + BOPTools_AlgoTools::DTolerance());
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
if (!BRepLib::FindValidRange(new GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
aT[0], aP[0], aNewTolV,
aT[1], aP[1], aNewTolV,
aFirst, aLast))
@@ -3479,25 +3479,25 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges)
//purpose : Computes the TolFF according to the tolerance value and
// types of the faces.
//=======================================================================
Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1,
const BRepAdaptor_Surface& aBAS2)
Standard_Real ToleranceFF(const Handle(BRepAdaptor_Surface)& aBAS1,
const Handle(BRepAdaptor_Surface)& aBAS2)
{
Standard_Real aTol1 = aBAS1.Tolerance();
Standard_Real aTol2 = aBAS2.Tolerance();
Standard_Real aTol1 = aBAS1->Tolerance();
Standard_Real aTol2 = aBAS2->Tolerance();
Standard_Real aTolFF = Max(aTol1, aTol2);
//
Standard_Boolean isAna1, isAna2;
isAna1 = (aBAS1.GetType() == GeomAbs_Plane ||
aBAS1.GetType() == GeomAbs_Cylinder ||
aBAS1.GetType() == GeomAbs_Cone ||
aBAS1.GetType() == GeomAbs_Sphere ||
aBAS1.GetType() == GeomAbs_Torus);
isAna1 = (aBAS1->GetType() == GeomAbs_Plane ||
aBAS1->GetType() == GeomAbs_Cylinder ||
aBAS1->GetType() == GeomAbs_Cone ||
aBAS1->GetType() == GeomAbs_Sphere ||
aBAS1->GetType() == GeomAbs_Torus);
//
isAna2 = (aBAS2.GetType() == GeomAbs_Plane ||
aBAS2.GetType() == GeomAbs_Cylinder ||
aBAS2.GetType() == GeomAbs_Cone ||
aBAS2.GetType() == GeomAbs_Sphere ||
aBAS2.GetType() == GeomAbs_Torus);
isAna2 = (aBAS2->GetType() == GeomAbs_Plane ||
aBAS2->GetType() == GeomAbs_Cylinder ||
aBAS2->GetType() == GeomAbs_Cone ||
aBAS2->GetType() == GeomAbs_Sphere ||
aBAS2->GetType() == GeomAbs_Torus);
//
if (!isAna1 || !isAna2) {
aTolFF = Max(aTolFF, 5.e-6);

View File

@@ -277,8 +277,8 @@ class BOPAlgo_MPC : public BOPAlgo_ParallelAlgo {
}
else
{
const BRepAdaptor_Surface& aBAS = myContext->SurfaceAdaptor(myF);
if (aBAS.IsUPeriodic() || aBAS.IsVPeriodic())
const Handle(BRepAdaptor_Surface)& aBAS = myContext->SurfaceAdaptor(myF);
if (aBAS->IsUPeriodic() || aBAS->IsVPeriodic())
{
// The curve already exists. Adjust it for periodic cases.
BOPTools_AlgoTools2D::AdjustPCurveOnSurf

View File

@@ -254,15 +254,15 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
const TopoDS_Face& aDF = (*(TopoDS_Face *)(&myDS->Shape(nFD)));
//
Standard_Real aTolV = BRep_Tool::Tolerance(aDV);
const BRepAdaptor_Surface& aBAS = myContext->SurfaceAdaptor(aDF);
const Handle(BRepAdaptor_Surface)& aBAS = myContext->SurfaceAdaptor(aDF);
//
// 2D intersection tolerance should be computed as a resolution
// from the tolerance of vertex to resolve the touching cases
Standard_Real aTolInt = Precision::PConfusion();
// UResolution from the tolerance of the vertex
Standard_Real aURes = aBAS.UResolution(aTolV);
Standard_Real aURes = aBAS->UResolution(aTolV);
// VResolution from the tolerance of the vertex
Standard_Real aVRes = aBAS.VResolution(aTolV);
Standard_Real aVRes = aBAS->VResolution(aTolV);
//
aTolInt = Max(aTolInt, Max(aURes, aVRes));
//
@@ -279,8 +279,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
aTolCmp = Max(aTolCmp, (bUDir ? aURes : aVRes));
//
// Prepare adaptor for the degenerated edge for intersection
Geom2dAdaptor_Curve aGAC1;
aGAC1.Load(aC2DDE, aTD1, aTD2);
Handle(Geom2dAdaptor_Curve) aGAC1 = new Geom2dAdaptor_Curve(aC2DDE, aTD1, aTD2);
//
BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPBOut);
for (; aItLPB.More(); aItLPB.Next()) {
@@ -297,14 +296,14 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
}
//
// Prepare adaptor for the passing edge for intersection
Geom2dAdaptor_Curve aGAC2;
Handle(Geom2dAdaptor_Curve) aGAC2 = new Geom2dAdaptor_Curve();
//
Handle(Geom2d_Line) aL2D = Handle(Geom2d_Line)::DownCast(aC2D);
if (!aL2D.IsNull()) {
aGAC2.Load(aC2D);
aGAC2->Load(aC2D);
}
else {
aGAC2.Load(aC2D, aT1, aT2);
aGAC2->Load(aC2D, aT1, aT2);
}
// Intersection
Geom2dInt_GInter aGInter(aGAC1, aGAC2, aTolInt, aTolInt);

View File

@@ -69,7 +69,7 @@ static
TopTools_MapOfShape& theMEdgesNoUniquePlane);
static
Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindPlane(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Pln& thePlane);
static
@@ -84,7 +84,7 @@ static
gp_Dir& theTgt);
static
Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindEdgeTangent(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Vec& theTangent);
//=======================================================================
@@ -410,7 +410,7 @@ Standard_Integer BOPAlgo_Tools::EdgesToWires(const TopoDS_Shape& theEdges,
aExp.Init(aSEdges, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE = TopoDS::Edge(aExp.Current());
BRepAdaptor_Curve aBAC(aE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
//
gp_Pln aPln;
if (FindPlane(aBAC, aPln)) {
@@ -773,7 +773,7 @@ Standard_Boolean FindEdgeTangent(const TopoDS_Edge& theEdge,
gp_Dir *pDTE = theDMEdgeTgt.ChangeSeek(theEdge);
if (!pDTE) {
gp_Vec aVTE;
BRepAdaptor_Curve aBAC(theEdge);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(theEdge);
if (!FindEdgeTangent(aBAC, aVTE)) {
return Standard_False;
}
@@ -787,26 +787,26 @@ Standard_Boolean FindEdgeTangent(const TopoDS_Edge& theEdge,
//function : FindEdgeTangent
//purpose : Finds the tangent for the edge
//=======================================================================
Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindEdgeTangent(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Vec& theTangent)
{
if (!theCurve.Is3DCurve()) {
if (!theCurve->Is3DCurve()) {
return Standard_False;
}
// for the line the tangent is defined by the direction
if (theCurve.GetType() == GeomAbs_Line) {
theTangent = theCurve.Line().Position().Direction();
if (theCurve->GetType() == GeomAbs_Line) {
theTangent = theCurve->Line().Position().Direction();
return Standard_True;
}
//
// for other curves take D1 and check for its length
Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter());
Standard_Real aT, aT1(theCurve->FirstParameter()), aT2(theCurve->LastParameter());
const Standard_Integer aNbP = 11;
const Standard_Real aDt = (aT2 - aT1) / aNbP;
//
for (aT = aT1 + aDt; aT <= aT2; aT += aDt) {
gp_Pnt aP;
theCurve.D1(aT, aP, theTangent);
theCurve->D1(aT, aP, theTangent);
if (theTangent.Magnitude() > Precision::Confusion()) {
return Standard_True;
}
@@ -819,47 +819,47 @@ Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
//function : FindPlane
//purpose : Finds the plane in which the edge is located
//=======================================================================
Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindPlane(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Pln& thePlane)
{
if (!theCurve.Is3DCurve()) {
if (!theCurve->Is3DCurve()) {
return Standard_False;
}
//
Standard_Boolean bFound = Standard_True;
gp_Vec aVN;
switch (theCurve.GetType()) {
switch (theCurve->GetType()) {
case GeomAbs_Line:
return Standard_False;
case GeomAbs_Circle:
aVN = theCurve.Circle().Position().Direction();
aVN = theCurve->Circle().Position().Direction();
break;
case GeomAbs_Ellipse:
aVN = theCurve.Ellipse().Position().Direction();
aVN = theCurve->Ellipse().Position().Direction();
break;
case GeomAbs_Hyperbola:
aVN = theCurve.Hyperbola().Position().Direction();
aVN = theCurve->Hyperbola().Position().Direction();
break;
case GeomAbs_Parabola:
aVN = theCurve.Parabola().Position().Direction();
aVN = theCurve->Parabola().Position().Direction();
break;
default: {
// for all other types of curve compute two tangent vectors
// on the curve and cross them
bFound = Standard_False;
Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter());
Standard_Real aT, aT1(theCurve->FirstParameter()), aT2(theCurve->LastParameter());
const Standard_Integer aNbP = 11;
const Standard_Real aDt = (aT2 - aT1) / aNbP;
//
aT = aT1;
gp_Pnt aP1;
gp_Vec aV1;
theCurve.D1(aT, aP1, aV1);
theCurve->D1(aT, aP1, aV1);
//
for (aT = aT1 + aDt; aT <= aT2; aT += aDt) {
gp_Pnt aP2;
gp_Vec aV2;
theCurve.D1(aT, aP2, aV2);
theCurve->D1(aT, aP2, aV2);
//
aVN = aV1^aV2;
if (aVN.Magnitude() > Precision::Confusion()) {
@@ -872,7 +872,7 @@ Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
}
//
if (bFound) {
thePlane = gp_Pln(theCurve.Value(theCurve.FirstParameter()), gp_Dir(aVN));
thePlane = gp_Pln(theCurve->Value(theCurve->FirstParameter()), gp_Dir(aVN));
}
return bFound;
}
@@ -935,7 +935,7 @@ Standard_Boolean FindPlane(const TopoDS_Shape& theWire,
if (theMEdgesNoUniquePlane.Contains(aE)) {
continue;
}
BRepAdaptor_Curve aBAC(aE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
if (FindPlane(aBAC, thePlane)) {
return Standard_True;
}

View File

@@ -56,7 +56,7 @@ static
Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge,
const TopoDS_Face& myFace,
const GeomAdaptor_Surface& aGAS,
const Handle(GeomAdaptor_Surface)& aGAS,
const Standard_Boolean aFlag,
const Handle(IntTools_Context)& theContext);
@@ -86,7 +86,7 @@ static
const Standard_Real aAngleOut);
static
void Path (const GeomAdaptor_Surface& aGAS,
void Path (const Handle(GeomAdaptor_Surface)& aGAS,
const TopoDS_Face& myFace,
const MyDataMapOfShapeBoolean& aVertMap,
const TopoDS_Vertex& aVa,
@@ -103,16 +103,16 @@ static
static
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
Standard_Real VTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
void RefineAngles(const TopoDS_Face& myFace,
@@ -293,8 +293,8 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
}
//
// 3. Angles in mySmartMap
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(myFace);
const GeomAdaptor_Surface& aGAS=aBAS.Surface();
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(myFace);
const Handle(GeomAdaptor_Surface)& aGAS = aBAS->Surface();
//
for (i=1; i<=aNb; i++) {
const TopoDS_Vertex& aV = (*(TopoDS_Vertex *)(&mySmartMap.FindKey(i)));
@@ -351,7 +351,7 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
// function: Path
// purpose:
//=======================================================================
void Path (const GeomAdaptor_Surface& aGAS,
void Path (const Handle(GeomAdaptor_Surface)& aGAS,
const TopoDS_Face& myFace,
const MyDataMapOfShapeBoolean& aVertMap,
const TopoDS_Vertex& aVFirst,
@@ -740,7 +740,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge,
const TopoDS_Face& myFace,
const GeomAdaptor_Surface& aGAS,
const Handle(GeomAdaptor_Surface)& aGAS,
const Standard_Boolean bIsIN,
const Handle(IntTools_Context)& theContext)
{
@@ -825,16 +825,16 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
// purpose:
//=======================================================================
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
Standard_Real aTol2D, anUr, aVr, aTolV3D;
GeomAbs_SurfaceType aType;
//
aType=aGAS.GetType();
aType=aGAS->GetType();
aTolV3D=BRep_Tool::Tolerance(aV);
anUr=aGAS.UResolution(aTolV3D);
aVr =aGAS.VResolution(aTolV3D);
anUr=aGAS->UResolution(aTolV3D);
aVr =aGAS->VResolution(aTolV3D);
aTol2D=(aVr>anUr) ? aVr : anUr;
//
if (aTol2D < aTolV3D) {
@@ -852,10 +852,10 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
//purpose :
//=======================================================================
Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
const Standard_Real aTolV3D = BRep_Tool::Tolerance(aV);
const Standard_Real anUr = aGAS.UResolution(aTolV3D);
const Standard_Real anUr = aGAS->UResolution(aTolV3D);
//
return anUr;
}
@@ -865,10 +865,10 @@ Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
//purpose :
//=======================================================================
Standard_Real VTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
const Standard_Real aTolV3D = BRep_Tool::Tolerance(aV);
const Standard_Real anVr = aGAS.VResolution(aTolV3D);
const Standard_Real anVr = aGAS->VResolution(aTolV3D);
//
return anVr;
}
@@ -1011,7 +1011,8 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
gp_Pnt2d aPV, aP, aP1, aP2;
Handle(Geom2d_Curve) aC2D;
Handle(Geom2d_Line) aLi;
Geom2dAdaptor_Curve aGAC1, aGAC2;
Handle(Geom2dAdaptor_Curve) aGAC1 = new Geom2dAdaptor_Curve();
Handle(Geom2dAdaptor_Curve) aGAC2 = new Geom2dAdaptor_Curve();
Geom2dInt_GInter aGInter;
IntRes2d_Domain aDomain1, aDomain2;
//
@@ -1020,16 +1021,16 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
aTolInt=1.e-10;
//
BOPTools_AlgoTools2D::CurveOnSurface(aE, myFace, aC2D, aT1, aT2, aTol, theContext);
aGAC1.Load(aC2D, aT1, aT2);
aGAC1->Load(aC2D, aT1, aT2);
//
aTV=BRep_Tool::Parameter (aV, aE, myFace);
aGAC1.D0(aTV, aPV);
aGAC1->D0(aTV, aPV);
//
aTOp = (fabs(aTV-aT1) < fabs(aTV-aT2)) ? aT2 : aT1;
//
const Standard_Real MaxDT = 0.3 * (aT2 - aT1);
aGAC1.D0(aT1, aP1);
aGAC1.D0(aT2, aP2);
aGAC1->D0(aT1, aP1);
aGAC1->D0(aT2, aP2);
aDomain1.SetValues(aP1, aT1, aTolInt, aP2, aT2, aTolInt);
//
for (i=0; i<2; ++i) {
@@ -1039,7 +1040,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
gp_Dir2d aDiri(aXi, aYi);
aLi=new Geom2d_Line(aPV, aDiri);
//
aGAC2.Load(aLi);
aGAC2->Load(aLi);
//
aGInter.Perform(aGAC1, aDomain1, aGAC2, aDomain2, aTolInt, aTolInt);
if (!aGInter.IsDone()) {
@@ -1067,7 +1068,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
}
//
aT = aT1max + aCf*dT;
aGAC1.D0(aT, aP);
aGAC1->D0(aT, aP);
gp_Vec2d aV2D(aPV, aP);
gp_Dir2d aDir2D(aV2D);
//

View File

@@ -1472,7 +1472,7 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
break; //xx
}
//
BRepAdaptor_Curve2d aBAC2D(aE, aFF);
Handle(BRepAdaptor_Curve2d) aBAC2D = new BRepAdaptor_Curve2d(aE, aFF);
aNbS=Geom2dInt_Geom2dCurveTool::NbSamples(aBAC2D);
if (aNbS>2) {
aNbS*=4;
@@ -1487,10 +1487,10 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
dU=-dU;
}
//
aBAC2D.D0(aU, aP2D0);
aBAC2D->D0(aU, aP2D0);
for(i=2; i<=aNbS; i++) {
aU=aU1+(i-1)*dU;
aBAC2D.D0(aU, aP2D1);
aBAC2D->D0(aU, aP2D1);
aP2D0.Coord(aX0, aY0);
aP2D1.Coord(aX1, aY1);
//
@@ -2152,26 +2152,26 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
}
//
// try to compute the minimal 3D step
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(aF);
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(aF);
Standard_Real aR = 0.;
GeomAbs_SurfaceType aSType = aBAS.GetType();
GeomAbs_SurfaceType aSType = aBAS->GetType();
switch (aSType) {
case GeomAbs_Cylinder: {
aR = aBAS.Cylinder().Radius();
aR = aBAS->Cylinder().Radius();
break;
}
case GeomAbs_Cone: {
gp_Lin aL(aBAS.Cone().Axis());
gp_Lin aL(aBAS->Cone().Axis());
aR = aL.Distance(aP);
break;
}
case GeomAbs_Sphere: {
aDtMin = Max(aDtMin, 5.e-4);
aR = aBAS.Sphere().Radius();
aR = aBAS->Sphere().Radius();
break;
}
case GeomAbs_Torus: {
aR = aBAS.Torus().MajorRadius();
aR = aBAS->Torus().MajorRadius();
break;
}
default:
@@ -2195,14 +2195,14 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
const BOPTools_CoupleOfShape& aCS = aIt.Value();
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aCS.Shape2()));
//
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(aF);
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(aF);
//
Standard_Real aUMin, aUMax, aVMin, aVMax;
theContext->UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
//
Standard_Real aDU = aUMax - aUMin;
if (aDU > 0.) {
Standard_Real aURes = aBAS.UResolution(aDtMax);
Standard_Real aURes = aBAS->UResolution(aDtMax);
if (2*aURes > aDU) {
break;
}
@@ -2210,7 +2210,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
//
Standard_Real aDV = aVMax - aVMin;
if (aDV > 0.) {
Standard_Real aVRes = aBAS.VResolution(aDtMax);
Standard_Real aVRes = aBAS->VResolution(aDtMax);
if (2*aVRes > aDV) {
break;
}

View File

@@ -251,24 +251,24 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnFace
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext)
{
BRepAdaptor_Surface aBASTmp;
const BRepAdaptor_Surface* pBAS;
Handle(BRepAdaptor_Surface) aBASTmp = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) pBAS;
if (!theContext.IsNull()) {
pBAS = &theContext->SurfaceAdaptor(theF);
pBAS = theContext->SurfaceAdaptor(theF);
}
else {
aBASTmp.Initialize(theF, Standard_True);
pBAS = &aBASTmp;
aBASTmp->Initialize(theF, Standard_True);
pBAS = aBASTmp;
}
//
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(*pBAS, theFirst, theLast, theC2D, theC2DA);
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(pBAS, theFirst, theLast, theC2D, theC2DA);
}
//=======================================================================
//function : AdjustPCurveOnFace
//purpose :
//=======================================================================
void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
(const BRepAdaptor_Surface& aBAS,
(const Handle(BRepAdaptor_Surface)& aBAS,
const Standard_Real aFirst,
const Standard_Real aLast,
const Handle(Geom2d_Curve)& aC2D,
@@ -278,11 +278,11 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
Standard_Real UMin, UMax, VMin, VMax, aT, u2, v2, du, dv, aDelta;
Standard_Real aUPeriod;
//
const TopoDS_Face& aF=aBAS.Face();
UMin=aBAS.FirstUParameter();
UMax=aBAS.LastUParameter();
VMin=aBAS.FirstVParameter();
VMax=aBAS.LastVParameter();
const TopoDS_Face& aF=aBAS->Face();
UMin=aBAS->FirstUParameter();
UMax=aBAS->LastUParameter();
VMin=aBAS->FirstVParameter();
VMax=aBAS->LastVParameter();
//
aDelta=Precision::PConfusion();
@@ -296,8 +296,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
//
// du
du = 0.;
if (aBAS.IsUPeriodic()) {
aUPeriod = aBAS.UPeriod();
if (aBAS->IsUPeriodic()) {
aUPeriod = aBAS->UPeriod();
//
// a. try to clarify u2 using the precision (aDelta)
@@ -311,10 +311,10 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
GeomInt::AdjustPeriodic(u2, UMin, UMax, aUPeriod, u2, du, 0.);
//
if (du==0.) {
if (aBAS.GetType()==GeomAbs_Cylinder) {
if (aBAS->GetType()==GeomAbs_Cylinder) {
Standard_Real aR, dFi, aTol;
//
gp_Cylinder aCylinder=aBAS.Cylinder();
gp_Cylinder aCylinder=aBAS->Cylinder();
aR=aCylinder.Radius();
aTol=MaxToleranceEdge(aF);
dFi=aTol/aR;
@@ -333,10 +333,10 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
// dv
dv = 0.;
if (aBAS.IsVPeriodic()) {
if (aBAS->IsVPeriodic()) {
Standard_Real aVPeriod, aVm, aVr, aVmid, dVm, dVr;
//
aVPeriod = aBAS.VPeriod();
aVPeriod = aBAS->VPeriod();
mincond = (VMin - v2 > aDelta);
maxcond = (v2 - VMax > aDelta);
//
@@ -361,8 +361,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
Standard_Real u,v;
u = u2 + du;
v = v2 + dv;
if (aBAS.IsUPeriodic()) {
aUPeriod = aBAS.UPeriod();
if (aBAS->IsUPeriodic()) {
aUPeriod = aBAS->UPeriod();
if ((UMax - UMin - 2*aDelta) > aUPeriod) {
if ((u > (UMin + aDelta + aUPeriod)) ||
(u < (UMax - aDelta - aUPeriod))) {
@@ -377,8 +377,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
}
//
u = u2 + du;
if (aBAS.IsVPeriodic()) {
Standard_Real aVPeriod = aBAS.VPeriod();
if (aBAS->IsVPeriodic()) {
Standard_Real aVPeriod = aBAS->VPeriod();
if ((VMax - VMin - 2*aDelta) > aVPeriod) {
if ((v > (VMin + aDelta + aVPeriod)) ||
(v < (VMax - aDelta - aVPeriod))) {
@@ -521,14 +521,14 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
Standard_Real& TolReached2d,
const Handle(IntTools_Context)& theContext)
{
BRepAdaptor_Surface aBASTmp;
const BRepAdaptor_Surface* pBAS;
Handle(BRepAdaptor_Surface) aBASTmp = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) pBAS;
if (!theContext.IsNull()) {
pBAS = &theContext->SurfaceAdaptor(aF);
pBAS = theContext->SurfaceAdaptor(aF);
}
else {
aBASTmp.Initialize(aF, Standard_True);
pBAS = &aBASTmp;
aBASTmp->Initialize(aF, Standard_True);
pBAS = aBASTmp;
}
//
Handle(BRepAdaptor_Surface) aBAHS = new BRepAdaptor_Surface(*pBAS);
@@ -622,7 +622,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
// Adjust curve for periodic surface
Handle(Geom2d_Curve) aC2DA;
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (*pBAS, aT1, aT2, aC2D, aC2DA);
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (pBAS, aT1, aT2, aC2D, aC2DA);
aC2D = aC2DA;
// Make sure that the range of the 2D curve is sufficient for representation of the 3D curve.
@@ -639,7 +639,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
}
// compute the appropriate tolerance for the edge
Handle(Geom_Surface) aS = pBAS->Surface().Surface();
Handle(Geom_Surface) aS = pBAS->Surface()->Surface();
aS = Handle(Geom_Surface)::DownCast(aS->Transformed(pBAS->Trsf()));
//
Standard_Real aT;

View File

@@ -129,7 +129,7 @@ public:
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
//! [aT1, aT2] - range to adjust
Standard_EXPORT static void AdjustPCurveOnSurf(const BRepAdaptor_Surface& aF,
Standard_EXPORT static void AdjustPCurveOnSurf(const Handle(BRepAdaptor_Surface)& aF,
const Standard_Real aT1,
const Standard_Real aT2,
const Handle(Geom2d_Curve)& aC2D,

View File

@@ -961,7 +961,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
//
Geom2dHatch_Hatcher& aHatcher = theContext->Hatcher(theF);
//
Geom2dAdaptor_Curve aHCur(theL2D);
Handle(Geom2dAdaptor_Curve) aHCur = new Geom2dAdaptor_Curve(theL2D);
//
aHatcher.ClrHatchings();
aIH = aHatcher.AddHatching(aHCur);

View File

@@ -488,7 +488,7 @@ static Standard_Real MapEdgeLength(const TopoDS_Edge& theEdge,
Standard_Real aLen = 0.;
if (!BRep_Tool::Degenerated(theEdge))
{
BRepAdaptor_Curve aCurve(theEdge);
Handle(BRepAdaptor_Curve) aCurve = new BRepAdaptor_Curve(theEdge);
aLen = GCPnts_AbscissaPoint::Length(aCurve);
}
pLen = theMapEdgeLen.Bound(theEdge, aLen);
@@ -505,7 +505,7 @@ namespace {
const TopoDS_Edge* Edge; // Edge
Standard_Real VParameter; // Parameter of the vertex on the edge
Standard_Boolean IsClosed; // Closed flag of the edge
Geom2dAdaptor_Curve GAdaptor; // 2D adaptor for PCurve of the edge on the face
Handle(Geom2dAdaptor_Curve) GAdaptor; // 2D adaptor for PCurve of the edge on the face
Standard_Real First; // First parameter in the range
Standard_Real Last; // Last parameter in the rage
};
@@ -532,10 +532,10 @@ static
Standard_Real aMaxDist = 0.;
Standard_Real aTol2d = 1.e-10;
//
IntRes2d_Domain aDom1(theEData1.GAdaptor.Value(aT11), aT11, aTol2d,
theEData1.GAdaptor.Value(aT12), aT12, aTol2d);
IntRes2d_Domain aDom2(theEData2.GAdaptor.Value(aT21), aT21, aTol2d,
theEData2.GAdaptor.Value(aT22), aT22, aTol2d);
IntRes2d_Domain aDom1(theEData1.GAdaptor->Value(aT11), aT11, aTol2d,
theEData1.GAdaptor->Value(aT12), aT12, aTol2d);
IntRes2d_Domain aDom2(theEData2.GAdaptor->Value(aT21), aT21, aTol2d,
theEData2.GAdaptor->Value(aT22), aT22, aTol2d);
//
anInter.Perform(theEData1.GAdaptor, aDom1, theEData2.GAdaptor, aDom2, aTol2d, aTol2d);
if (!anInter.IsDone() || (!anInter.NbSegments() && !anInter.NbPoints())) {
@@ -658,7 +658,7 @@ void CorrectWires(const TopoDS_Face& aFx,
if (aD2>aD2max) {
aD2max=aD2;
}
EdgeData anEData = {&aE, aT, isClosed, Geom2dAdaptor_Curve(aC2D), aT1, aT2};
EdgeData anEData = {&aE, aT, isClosed, new Geom2dAdaptor_Curve(aC2D), aT1, aT2};
aLEPars.Append(anEData);
}
//
@@ -894,7 +894,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
Handle(GeomAdaptor_Curve) aHCurve =
new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(ProjLib_ProjectedCurve) proj = new ProjLib_ProjectedCurve(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_Curve) GHPC =
new Geom2dAdaptor_Curve(PC,

View File

@@ -398,7 +398,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnPlane(const TopoDS_Edge& E,
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(GP);
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve Proj(HS, HC);
Handle(ProjLib_ProjectedCurve) Proj = new ProjLib_ProjectedCurve(HS, HC);
Handle(Geom2d_Curve) pc = Geom2dAdaptor::MakeCurve(Proj);
if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {

View File

@@ -20,7 +20,7 @@
#include <BRepAdaptor_Curve.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<BRepAdaptor_Curve> BRepAdaptor_Array1OfCurve;
typedef NCollection_Array1<Handle(BRepAdaptor_Curve)> BRepAdaptor_Array1OfCurve;
#endif

View File

@@ -90,8 +90,8 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
aCopy->myCurves = new (BRepAdaptor_HArray1OfCurve) (1, myCurves->Size());
for (Standard_Integer anI = 1; anI <= myCurves->Size(); ++anI)
{
const Handle(Adaptor3d_Curve) aCurve = myCurves->Value(anI).ShallowCopy();
const BRepAdaptor_Curve& aBrepCurve = *(Handle(BRepAdaptor_Curve)::DownCast(aCurve));
const Handle(Adaptor3d_Curve) aCurve = myCurves->Value(anI)->ShallowCopy();
const Handle(BRepAdaptor_Curve) aBrepCurve = Handle(BRepAdaptor_Curve)::DownCast(aCurve);
aCopy->myCurves->SetValue(anI, aBrepCurve);
}
aCopy->myKnots = myKnots;
@@ -129,7 +129,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
E = wexp.Current();
if (! BRep_Tool::Degenerated(E)) {
ii++;
myCurves->ChangeValue(ii).Initialize(E);
myCurves->ChangeValue(ii) = new BRepAdaptor_Curve(E);
if (AC) {
myKnots->SetValue(ii+1, myKnots->Value(ii));
myKnots->ChangeValue(ii+1) +=
@@ -141,12 +141,12 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
Forward = Standard_True; // Default ; The Reverse Edges are parsed.
if((NbEdge > 2) || ((NbEdge==2) && (!myWire.Closed())) ) {
TopAbs_Orientation Or = myCurves->Value(1).Edge().Orientation();
TopAbs_Orientation Or = myCurves->Value(1)->Edge().Orientation();
TopoDS_Vertex VI, VL;
TopExp::CommonVertex(myCurves->Value(1).Edge(),
myCurves->Value(2).Edge(),
TopExp::CommonVertex(myCurves->Value(1)->Edge(),
myCurves->Value(2)->Edge(),
VI);
VL = TopExp::LastVertex(myCurves->Value(1).Edge());
VL = TopExp::LastVertex(myCurves->Value(1)->Edge());
if (VI.IsSame(VL)) { // The direction of parsing is always preserved
if (Or == TopAbs_REVERSED)
Forward = Standard_False;
@@ -182,29 +182,29 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
CurIndex = (i1+i2)/2; // Small optimization
if (i1==i2) {
if (l > f)
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1).Trim(f, l, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1)->Trim(f, l, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1).Trim(l, f, PTol));
myCurves->SetValue(i1, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1)->Trim(l, f, PTol));
myCurves->SetValue(i1, HC);
}
else {
const BRepAdaptor_Curve& c1 = myCurves->Value(i1);
const BRepAdaptor_Curve& c2 = myCurves->Value(i2);
const Handle(BRepAdaptor_Curve)& c1 = myCurves->Value(i1);
const Handle(BRepAdaptor_Curve)& c2 = myCurves->Value(i2);
Standard_Real k;
k = c1.LastParameter();
k = c1->LastParameter();
if (k>f)
HC = Handle(BRepAdaptor_Curve)::DownCast(c1.Trim(f, k, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(c1->Trim(f, k, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(c1.Trim(k, f, PTol));
myCurves->SetValue(i1, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(c1->Trim(k, f, PTol));
myCurves->SetValue(i1, HC);
k = c2.FirstParameter();
k = c2->FirstParameter();
if (k<=l)
HC = Handle(BRepAdaptor_Curve)::DownCast(c2.Trim(k, l, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(c2->Trim(k, l, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(c2.Trim(l, k, PTol));
myCurves->SetValue(i2, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(c2->Trim(l, k, PTol));
myCurves->SetValue(i2, HC);
}
}
@@ -221,7 +221,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Integer index = CurIndex;
UonE = U;
Prepare(UonE, d, index);
E = myCurves->Value(index).Edge();
E = myCurves->Value(index)->Edge();
}
Standard_Real BRepAdaptor_CompCurve::FirstParameter() const
@@ -237,14 +237,14 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
GeomAbs_Shape BRepAdaptor_CompCurve::Continuity() const
{
if ( myCurves->Length() > 1) return GeomAbs_C0;
return myCurves->Value(1).Continuity();
return myCurves->Value(1)->Continuity();
}
Standard_Integer BRepAdaptor_CompCurve::NbIntervals(const GeomAbs_Shape S) const
{
Standard_Integer NbInt, ii;
for (ii=1, NbInt=0; ii<=myCurves->Length(); ii++)
NbInt += myCurves->ChangeValue(ii).NbIntervals(S);
NbInt += myCurves->ChangeValue(ii)->NbIntervals(S);
return NbInt;
}
@@ -256,9 +256,9 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real f, F, delta;
// First curve (direction of parsing of the edge)
n = myCurves->ChangeValue(1).NbIntervals(S);
n = myCurves->ChangeValue(1)->NbIntervals(S);
Handle(TColStd_HArray1OfReal) Ti = new (TColStd_HArray1OfReal) (1, n+1);
myCurves->ChangeValue(1).Intervals(Ti->ChangeArray1(), S);
myCurves->ChangeValue(1)->Intervals(Ti->ChangeArray1(), S);
InvPrepare(1, f, delta);
F = myKnots->Value(1);
if (delta < 0) {
@@ -273,9 +273,9 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
// and the next
for (ii=2; ii<=myCurves->Length(); ii++) {
n = myCurves->ChangeValue(ii).NbIntervals(S);
n = myCurves->ChangeValue(ii)->NbIntervals(S);
if (n != Ti->Length()-1) Ti = new (TColStd_HArray1OfReal) (1, n+1);
myCurves->ChangeValue(ii).Intervals(Ti->ChangeArray1(), S);
myCurves->ChangeValue(ii)->Intervals(Ti->ChangeArray1(), S);
InvPrepare(ii, f, delta);
F = myKnots->Value(ii);
if (delta < 0) {
@@ -321,7 +321,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
return myCurves->Value(index).Value(u);
return myCurves->Value(index)->Value(u);
}
void BRepAdaptor_CompCurve::D0(const Standard_Real U,
@@ -330,7 +330,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D0(u, P);
myCurves->Value(index)->D0(u, P);
}
void BRepAdaptor_CompCurve::D1(const Standard_Real U,
@@ -340,7 +340,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D1(u, P, V);
myCurves->Value(index)->D1(u, P, V);
V*=d;
}
@@ -352,7 +352,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D2(u, P, V1, V2);
myCurves->Value(index)->D2(u, P, V1, V2);
V1*=d;
V2 *= d*d;
}
@@ -365,7 +365,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D3(u, P, V1, V2, V3);
myCurves->Value(index)->D3(u, P, V1, V2, V3);
V1*=d;
V2 *= d*d;
V3 *= d*d*d;
@@ -378,7 +378,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Integer index = CurIndex;
Prepare(u, d, index);
return (myCurves->Value(index).DN(u, N) * Pow(d, N));
return (myCurves->Value(index)->DN(u, N) * Pow(d, N));
}
Standard_Real BRepAdaptor_CompCurve::Resolution(const Standard_Real R3d) const
@@ -386,7 +386,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real Res = 1.e200, r;
Standard_Integer ii, L = myCurves->Length();
for (ii=1; ii<=L; ii++) {
r = myCurves->Value(ii).Resolution(R3d);
r = myCurves->Value(ii)->Resolution(R3d);
if (r < Res) Res = r;
}
return Res;
@@ -401,57 +401,57 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
gp_Lin BRepAdaptor_CompCurve::Line() const
{
return myCurves->Value(1).Line();
return myCurves->Value(1)->Line();
}
gp_Circ BRepAdaptor_CompCurve::Circle() const
{
return myCurves->Value(1).Circle();
return myCurves->Value(1)->Circle();
}
gp_Elips BRepAdaptor_CompCurve::Ellipse() const
{
return myCurves->Value(1).Ellipse();
return myCurves->Value(1)->Ellipse();
}
gp_Hypr BRepAdaptor_CompCurve::Hyperbola() const
{
return myCurves->Value(1).Hyperbola();
return myCurves->Value(1)->Hyperbola();
}
gp_Parab BRepAdaptor_CompCurve::Parabola() const
{
return myCurves->Value(1).Parabola();
return myCurves->Value(1)->Parabola();
}
Standard_Integer BRepAdaptor_CompCurve::Degree() const
{
return myCurves->Value(1).Degree();
return myCurves->Value(1)->Degree();
}
Standard_Boolean BRepAdaptor_CompCurve::IsRational() const
{
return myCurves->Value(1).IsRational();
return myCurves->Value(1)->IsRational();
}
Standard_Integer BRepAdaptor_CompCurve::NbPoles() const
{
return myCurves->Value(1).NbPoles();
return myCurves->Value(1)->NbPoles();
}
Standard_Integer BRepAdaptor_CompCurve::NbKnots() const
{
return myCurves->Value(1).NbKnots();
return myCurves->Value(1)->NbKnots();
}
Handle(Geom_BezierCurve) BRepAdaptor_CompCurve::Bezier() const
{
return myCurves->Value(1).Bezier();
return myCurves->Value(1)->Bezier();
}
Handle(Geom_BSplineCurve) BRepAdaptor_CompCurve::BSpline() const
{
return myCurves->Value(1).BSpline();
return myCurves->Value(1)->BSpline();
}
//=======================================================================
@@ -496,7 +496,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
}
// Invert ?
const TopoDS_Edge& E = myCurves->Value(theCurIndex).Edge();
const TopoDS_Edge& E = myCurves->Value(theCurIndex)->Edge();
TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) ||
@@ -521,7 +521,7 @@ void BRepAdaptor_CompCurve::InvPrepare(const Standard_Integer index,
Standard_Real& Delta) const
{
// Invert?
const TopoDS_Edge& E = myCurves->Value(index).Edge();
const TopoDS_Edge& E = myCurves->Value(index)->Edge();
TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) ||

View File

@@ -80,8 +80,8 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
aCopy->myTrsf = myTrsf;
const Handle(Adaptor3d_Curve) aCurve = myCurve.ShallowCopy();
const GeomAdaptor_Curve& aGeomCurve = *(Handle(GeomAdaptor_Curve)::DownCast(aCurve));
const Handle(Adaptor3d_Curve) aCurve = myCurve->ShallowCopy();
const Handle(GeomAdaptor_Curve) aGeomCurve = Handle(GeomAdaptor_Curve)::DownCast(aCurve);
aCopy->myCurve = aGeomCurve;
if (!myConSurf.IsNull())
@@ -99,7 +99,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
//=======================================================================
void BRepAdaptor_Curve::Reset()
{
myCurve.Reset();
myCurve->Reset();
myConSurf.Nullify();
myEdge.Nullify();
myTrsf = gp_Trsf();
@@ -120,7 +120,8 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E)
Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,pf,pl);
if (!C.IsNull()) {
myCurve.Load(C,pf,pl);
myCurve = new GeomAdaptor_Curve();
myCurve->Load(C,pf,pl);
}
else {
Handle(Geom2d_Curve) PC;
@@ -147,7 +148,7 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E)
//=======================================================================
void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E,
const TopoDS_Face& F)
const TopoDS_Face& F)
{
myConSurf.Nullify();
@@ -202,7 +203,7 @@ Standard_Boolean BRepAdaptor_Curve::IsCurveOnSurface() const
//purpose :
//=======================================================================
const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
const Handle(GeomAdaptor_Curve)& BRepAdaptor_Curve::Curve() const
{
return myCurve;
}
@@ -212,9 +213,9 @@ const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
//purpose :
//=======================================================================
const Adaptor3d_CurveOnSurface& BRepAdaptor_Curve::CurveOnSurface() const
const Handle(Adaptor3d_CurveOnSurface)& BRepAdaptor_Curve::CurveOnSurface() const
{
return *myConSurf;
return myConSurf;
}
//=======================================================================
@@ -245,7 +246,7 @@ Standard_Real BRepAdaptor_Curve::Tolerance() const
Standard_Real BRepAdaptor_Curve::FirstParameter() const
{
if (myConSurf.IsNull()) {
return myCurve.FirstParameter();
return myCurve->FirstParameter();
}
else {
return myConSurf->FirstParameter();
@@ -257,10 +258,10 @@ Standard_Real BRepAdaptor_Curve::FirstParameter() const
//purpose :
//=======================================================================
Standard_Real BRepAdaptor_Curve::LastParameter() const
Standard_Real BRepAdaptor_Curve::LastParameter() const
{
if (myConSurf.IsNull()) {
return myCurve.LastParameter();
return myCurve->LastParameter();
}
else {
return myConSurf->LastParameter();
@@ -275,7 +276,7 @@ Standard_Real BRepAdaptor_Curve::LastParameter() const
GeomAbs_Shape BRepAdaptor_Curve::Continuity() const
{
if (myConSurf.IsNull()) {
return myCurve.Continuity();
return myCurve->Continuity();
}
else {
return myConSurf->Continuity();
@@ -290,7 +291,7 @@ GeomAbs_Shape BRepAdaptor_Curve::Continuity() const
Standard_Integer BRepAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
{
if (myConSurf.IsNull()) {
return myCurve.NbIntervals(S);
return myCurve->NbIntervals(S);
}
else {
return myConSurf->NbIntervals(S);
@@ -306,7 +307,7 @@ void BRepAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
if (myConSurf.IsNull()) {
myCurve.Intervals(T, S);
myCurve->Intervals(T, S);
}
else {
myConSurf->Intervals(T, S);
@@ -320,17 +321,16 @@ void BRepAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
//=======================================================================
Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol) const
const Standard_Real Last,
const Standard_Real Tol) const
{
// On fait une copie de this pour garder la trsf.
Handle(BRepAdaptor_Curve) res;
if (myConSurf.IsNull()){
Standard_Real pf = FirstParameter(), pl = LastParameter();
Handle(Geom_Curve) C = myCurve.Curve();
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,First,Last);
res = new BRepAdaptor_Curve (*this);
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,pf,pl);
Handle(GeomAdaptor_Curve) aGAC = myCurve;
const_cast<Handle(GeomAdaptor_Curve)&>(myCurve) = Handle(GeomAdaptor_Curve)::DownCast(myCurve->Trim(First, Last, Tol));
res = new BRepAdaptor_Curve(*this);
const_cast<Handle(GeomAdaptor_Curve)&>(myCurve) = aGAC;
}
else {
Handle(Adaptor3d_CurveOnSurface) sav = myConSurf;
@@ -350,7 +350,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
Standard_Boolean BRepAdaptor_Curve::IsClosed() const
{
if (myConSurf.IsNull()) {
return myCurve.IsClosed();
return myCurve->IsClosed();
}
else {
return myConSurf->IsClosed();
@@ -365,7 +365,7 @@ Standard_Boolean BRepAdaptor_Curve::IsClosed() const
Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
{
if (myConSurf.IsNull()) {
return myCurve.IsPeriodic();
return myCurve->IsPeriodic();
}
else {
return myConSurf->IsPeriodic();
@@ -380,7 +380,7 @@ Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
Standard_Real BRepAdaptor_Curve::Period() const
{
if (myConSurf.IsNull()) {
return myCurve.Period();
return myCurve->Period();
}
else {
return myConSurf->Period();
@@ -396,7 +396,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
{
gp_Pnt P;
if (myConSurf.IsNull())
P = myCurve.Value(U);
P = myCurve->Value(U);
else
P = myConSurf->Value(U);
P.Transform(myTrsf);
@@ -411,7 +411,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
void BRepAdaptor_Curve::D0(const Standard_Real U, gp_Pnt& P) const
{
if (myConSurf.IsNull())
myCurve.D0(U,P);
myCurve->D0(U,P);
else
myConSurf->D0(U,P);
P.Transform(myTrsf);
@@ -423,10 +423,10 @@ void BRepAdaptor_Curve::D0(const Standard_Real U, gp_Pnt& P) const
//=======================================================================
void BRepAdaptor_Curve::D1(const Standard_Real U,
gp_Pnt& P, gp_Vec& V) const
gp_Pnt& P, gp_Vec& V) const
{
if (myConSurf.IsNull())
myCurve.D1(U,P,V);
myCurve->D1(U,P,V);
else
myConSurf->D1(U,P,V);
P.Transform(myTrsf);
@@ -439,10 +439,10 @@ void BRepAdaptor_Curve::D1(const Standard_Real U,
//=======================================================================
void BRepAdaptor_Curve::D2(const Standard_Real U,
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
{
if (myConSurf.IsNull())
myCurve.D2(U,P,V1,V2);
myCurve->D2(U,P,V1,V2);
else
myConSurf->D2(U,P,V1,V2);
P.Transform(myTrsf);
@@ -456,11 +456,11 @@ void BRepAdaptor_Curve::D2(const Standard_Real U,
//=======================================================================
void BRepAdaptor_Curve::D3(const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
gp_Pnt& P,
gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
{
if (myConSurf.IsNull())
myCurve.D3(U,P,V1,V2,V3);
myCurve->D3(U,P,V1,V2,V3);
else
myConSurf->D3(U,P,V1,V2,V3);
P.Transform(myTrsf);
@@ -474,12 +474,12 @@ void BRepAdaptor_Curve::D3(const Standard_Real U,
//purpose :
//=======================================================================
gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
const Standard_Integer N) const
gp_Vec BRepAdaptor_Curve::DN (const Standard_Real U,
const Standard_Integer N) const
{
gp_Vec V;
if (myConSurf.IsNull())
V = myCurve.DN(U,N);
V = myCurve->DN(U,N);
else
V = myConSurf->DN(U,N);
V.Transform(myTrsf);
@@ -494,7 +494,7 @@ gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const
{
if (myConSurf.IsNull()) {
return myCurve.Resolution(R);
return myCurve->Resolution(R);
}
else {
return myConSurf->Resolution(R);
@@ -509,7 +509,7 @@ Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const
GeomAbs_CurveType BRepAdaptor_Curve::GetType() const
{
if (myConSurf.IsNull()) {
return myCurve.GetType();
return myCurve->GetType();
}
else {
return myConSurf->GetType();
@@ -525,7 +525,7 @@ gp_Lin BRepAdaptor_Curve::Line() const
{
gp_Lin L;
if (myConSurf.IsNull())
L = myCurve.Line();
L = myCurve->Line();
else
L = myConSurf->Line();
L.Transform(myTrsf);
@@ -541,7 +541,7 @@ gp_Circ BRepAdaptor_Curve::Circle() const
{
gp_Circ C;
if (myConSurf.IsNull())
C = myCurve.Circle();
C = myCurve->Circle();
else
C = myConSurf->Circle();
C.Transform(myTrsf);
@@ -557,7 +557,7 @@ gp_Elips BRepAdaptor_Curve::Ellipse() const
{
gp_Elips E;
if (myConSurf.IsNull())
E = myCurve.Ellipse();
E = myCurve->Ellipse();
else
E = myConSurf->Ellipse();
E.Transform(myTrsf);
@@ -573,7 +573,7 @@ gp_Hypr BRepAdaptor_Curve::Hyperbola() const
{
gp_Hypr H;
if (myConSurf.IsNull())
H = myCurve.Hyperbola();
H = myCurve->Hyperbola();
else
H = myConSurf->Hyperbola();
H.Transform(myTrsf);
@@ -589,7 +589,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
{
gp_Parab P;
if (myConSurf.IsNull())
P = myCurve.Parabola();
P = myCurve->Parabola();
else
P = myConSurf->Parabola();
P.Transform(myTrsf);
@@ -604,7 +604,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
Standard_Integer BRepAdaptor_Curve::Degree() const
{
if (myConSurf.IsNull())
return myCurve.Degree();
return myCurve->Degree();
else
return myConSurf->Degree();
}
@@ -617,7 +617,7 @@ Standard_Integer BRepAdaptor_Curve::Degree() const
Standard_Boolean BRepAdaptor_Curve::IsRational() const
{
if (myConSurf.IsNull())
return myCurve.IsRational();
return myCurve->IsRational();
else
return myConSurf->IsRational();
}
@@ -629,7 +629,7 @@ Standard_Boolean BRepAdaptor_Curve::IsRational() const
Standard_Integer BRepAdaptor_Curve::NbPoles() const
{
if (myConSurf.IsNull())
return myCurve.NbPoles();
return myCurve->NbPoles();
else
return myConSurf->NbPoles();
}
@@ -641,7 +641,7 @@ Standard_Integer BRepAdaptor_Curve::NbPoles() const
Standard_Integer BRepAdaptor_Curve::NbKnots() const
{
if (myConSurf.IsNull())
return myCurve.NbKnots();
return myCurve->NbKnots();
else
return myConSurf->NbKnots();
}
@@ -655,7 +655,7 @@ Handle(Geom_BezierCurve) BRepAdaptor_Curve::Bezier() const
{
Handle(Geom_BezierCurve) BC;
if (myConSurf.IsNull()) {
BC = myCurve.Bezier();
BC = myCurve->Bezier();
}
else {
BC = myConSurf->Bezier();
@@ -674,7 +674,7 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
{
Handle(Geom_BSplineCurve) BS;
if (myConSurf.IsNull()) {
BS = myCurve.BSpline();
BS = myCurve->BSpline();
}
else {
BS = myConSurf->BSpline();
@@ -690,10 +690,10 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
Handle(Geom_OffsetCurve) BRepAdaptor_Curve::OffsetCurve() const
{
if ( !Is3DCurve() || myCurve.GetType() != GeomAbs_OffsetCurve)
if ( !Is3DCurve() || myCurve->GetType() != GeomAbs_OffsetCurve)
throw Standard_NoSuchObject("BRepAdaptor_Curve::OffsetCurve");
Handle(Geom_OffsetCurve) anOffC = myCurve.OffsetCurve();
Handle(Geom_OffsetCurve) anOffC = myCurve->OffsetCurve();
return myTrsf.Form() == gp_Identity
? anOffC : Handle(Geom_OffsetCurve)::DownCast(anOffC->Transformed(myTrsf));
}

View File

@@ -103,10 +103,10 @@ public:
Standard_EXPORT Standard_Boolean IsCurveOnSurface() const;
//! Returns the Curve of the edge.
Standard_EXPORT const GeomAdaptor_Curve& Curve() const;
Standard_EXPORT const Handle(GeomAdaptor_Curve)& Curve() const;
//! Returns the CurveOnSurface of the edge.
Standard_EXPORT const Adaptor3d_CurveOnSurface& CurveOnSurface() const;
Standard_EXPORT const Handle(Adaptor3d_CurveOnSurface)& CurveOnSurface() const;
//! Returns the edge.
Standard_EXPORT const TopoDS_Edge& Edge() const;
@@ -217,7 +217,7 @@ public:
private:
gp_Trsf myTrsf;
GeomAdaptor_Curve myCurve;
Handle(GeomAdaptor_Curve) myCurve;
Handle(Adaptor3d_CurveOnSurface) myConSurf;
TopoDS_Edge myEdge;

View File

@@ -45,6 +45,7 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepAdaptor_Surface, Adaptor3d_Surface)
//=======================================================================
BRepAdaptor_Surface::BRepAdaptor_Surface()
{
mySurf = new GeomAdaptor_Surface();
}
@@ -56,6 +57,7 @@ BRepAdaptor_Surface::BRepAdaptor_Surface()
BRepAdaptor_Surface::BRepAdaptor_Surface(const TopoDS_Face& F,
const Standard_Boolean R)
{
mySurf = new GeomAdaptor_Surface();
Initialize(F,R);
}
@@ -69,9 +71,8 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::ShallowCopy() const
{
Handle(BRepAdaptor_Surface) aCopy = new BRepAdaptor_Surface();
const Handle(Adaptor3d_Surface) aSurface = mySurf.ShallowCopy();
const GeomAdaptor_Surface& aGeomSurface = *(Handle(GeomAdaptor_Surface)::DownCast(aSurface));
aCopy->mySurf = aGeomSurface;
const Handle(Adaptor3d_Surface) aSurface = mySurf->ShallowCopy();
aCopy->mySurf = Handle(GeomAdaptor_Surface)::DownCast(aSurface);
aCopy->myTrsf = myTrsf;
aCopy->myFace = myFace;
@@ -95,10 +96,10 @@ void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F,
if (Restriction) {
Standard_Real umin,umax,vmin,vmax;
BRepTools::UVBounds(F,umin,umax,vmin,vmax);
mySurf.Load(aSurface,umin,umax,vmin,vmax);
mySurf->Load(aSurface,umin,umax,vmin,vmax);
}
else
mySurf.Load(aSurface);
mySurf->Load(aSurface);
myTrsf = L.Transformation();
}
@@ -108,23 +109,11 @@ void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F,
//purpose :
//=======================================================================
const GeomAdaptor_Surface& BRepAdaptor_Surface::Surface() const
const Handle(GeomAdaptor_Surface)& BRepAdaptor_Surface::Surface() const
{
return mySurf;
}
//=======================================================================
//function : ChangeSurface
//purpose :
//=======================================================================
GeomAdaptor_Surface& BRepAdaptor_Surface::ChangeSurface()
{
return mySurf;
}
//=======================================================================
//function : Trsf
//purpose :
@@ -165,7 +154,7 @@ Standard_Real BRepAdaptor_Surface::Tolerance() const
void BRepAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
mySurf.UIntervals(T,S);
mySurf->UIntervals(T,S);
}
@@ -177,7 +166,7 @@ void BRepAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T,
void BRepAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
mySurf.VIntervals(T,S);
mySurf->VIntervals(T,S);
}
@@ -192,7 +181,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::UTrim
const Standard_Real Tol ) const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->UTrim(First,Last,Tol);
}
@@ -208,7 +197,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::VTrim
const Standard_Real Tol) const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->VTrim(First,Last,Tol);
}
@@ -221,7 +210,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::VTrim
gp_Pnt BRepAdaptor_Surface::Value(const Standard_Real U,
const Standard_Real V) const
{
return mySurf.Value(U,V).Transformed(myTrsf);
return mySurf->Value(U,V).Transformed(myTrsf);
}
//=======================================================================
@@ -233,7 +222,7 @@ void BRepAdaptor_Surface::D0(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P) const
{
mySurf.D0(U,V,P);
mySurf->D0(U,V,P);
P.Transform(myTrsf);
}
@@ -248,7 +237,7 @@ void BRepAdaptor_Surface::D1(const Standard_Real U,
gp_Vec& D1U,
gp_Vec& D1V)const
{
mySurf.D1(U,V,P,D1U,D1V);
mySurf->D1(U,V,P,D1U,D1V);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -268,7 +257,7 @@ void BRepAdaptor_Surface::D2(const Standard_Real U,
gp_Vec& D2V,
gp_Vec& D2UV)const
{
mySurf.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
mySurf->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -291,7 +280,7 @@ void BRepAdaptor_Surface::D3(const Standard_Real U,
gp_Vec& D3U, gp_Vec& D3V,
gp_Vec& D3UUV, gp_Vec& D3UVV)const
{
mySurf.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
mySurf->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -315,7 +304,7 @@ gp_Vec BRepAdaptor_Surface::DN(const Standard_Real U,
const Standard_Integer Nu,
const Standard_Integer Nv) const
{
return mySurf.DN(U,V,Nu,Nv).Transformed(myTrsf);
return mySurf->DN(U,V,Nu,Nv).Transformed(myTrsf);
}
//=======================================================================
@@ -325,7 +314,7 @@ gp_Vec BRepAdaptor_Surface::DN(const Standard_Real U,
gp_Pln BRepAdaptor_Surface::Plane()const
{
return mySurf.Plane().Transformed(myTrsf);
return mySurf->Plane().Transformed(myTrsf);
}
@@ -336,7 +325,7 @@ gp_Pln BRepAdaptor_Surface::Plane()const
gp_Cylinder BRepAdaptor_Surface::Cylinder()const
{
return mySurf.Cylinder().Transformed(myTrsf);
return mySurf->Cylinder().Transformed(myTrsf);
}
@@ -347,7 +336,7 @@ gp_Cylinder BRepAdaptor_Surface::Cylinder()const
gp_Sphere BRepAdaptor_Surface::Sphere()const
{
return mySurf.Sphere().Transformed(myTrsf);
return mySurf->Sphere().Transformed(myTrsf);
}
@@ -358,7 +347,7 @@ gp_Sphere BRepAdaptor_Surface::Sphere()const
gp_Cone BRepAdaptor_Surface::Cone()const
{
return mySurf.Cone().Transformed(myTrsf);
return mySurf->Cone().Transformed(myTrsf);
}
//=======================================================================
@@ -368,7 +357,7 @@ gp_Cone BRepAdaptor_Surface::Cone()const
gp_Torus BRepAdaptor_Surface::Torus()const
{
return mySurf.Torus().Transformed(myTrsf);
return mySurf->Torus().Transformed(myTrsf);
}
//=======================================================================
@@ -379,7 +368,7 @@ gp_Torus BRepAdaptor_Surface::Torus()const
Handle(Geom_BezierSurface) BRepAdaptor_Surface::Bezier() const
{
return Handle(Geom_BezierSurface)::DownCast
(mySurf.Bezier()->Transformed(myTrsf));
(mySurf->Bezier()->Transformed(myTrsf));
}
@@ -391,7 +380,7 @@ Handle(Geom_BezierSurface) BRepAdaptor_Surface::Bezier() const
Handle(Geom_BSplineSurface) BRepAdaptor_Surface::BSpline() const
{
return Handle(Geom_BSplineSurface)::DownCast
(mySurf.BSpline()->Transformed(myTrsf));
(mySurf->BSpline()->Transformed(myTrsf));
}
@@ -402,7 +391,7 @@ Handle(Geom_BSplineSurface) BRepAdaptor_Surface::BSpline() const
gp_Ax1 BRepAdaptor_Surface::AxeOfRevolution() const
{
return mySurf.AxeOfRevolution().Transformed(myTrsf);
return mySurf->AxeOfRevolution().Transformed(myTrsf);
}
@@ -413,7 +402,7 @@ gp_Ax1 BRepAdaptor_Surface::AxeOfRevolution() const
gp_Dir BRepAdaptor_Surface::Direction() const
{
return mySurf.Direction().Transformed(myTrsf);
return mySurf->Direction().Transformed(myTrsf);
}
@@ -425,7 +414,7 @@ gp_Dir BRepAdaptor_Surface::Direction() const
Handle(Adaptor3d_Curve) BRepAdaptor_Surface::BasisCurve() const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->BasisCurve();
}
@@ -439,7 +428,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Surface::BasisCurve() const
Handle(Adaptor3d_Surface) BRepAdaptor_Surface::BasisSurface() const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->BasisSurface();
}
@@ -451,6 +440,6 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::BasisSurface() const
Standard_Real BRepAdaptor_Surface::OffsetValue() const
{
return mySurf.OffsetValue();
return mySurf->OffsetValue();
}

View File

@@ -71,10 +71,7 @@ public:
Standard_EXPORT void Initialize (const TopoDS_Face& F, const Standard_Boolean Restriction = Standard_True);
//! Returns the surface.
Standard_EXPORT const GeomAdaptor_Surface& Surface() const;
//! Returns the surface.
Standard_EXPORT GeomAdaptor_Surface& ChangeSurface();
Standard_EXPORT const Handle(GeomAdaptor_Surface)& Surface() const;
//! Returns the surface coordinate system.
Standard_EXPORT const gp_Trsf& Trsf() const;
@@ -85,27 +82,27 @@ public:
//! Returns the face tolerance.
Standard_EXPORT Standard_Real Tolerance() const;
virtual Standard_Real FirstUParameter() const Standard_OVERRIDE { return mySurf.FirstUParameter(); }
virtual Standard_Real FirstUParameter() const Standard_OVERRIDE { return mySurf->FirstUParameter(); }
virtual Standard_Real LastUParameter() const Standard_OVERRIDE { return mySurf.LastUParameter(); }
virtual Standard_Real LastUParameter() const Standard_OVERRIDE { return mySurf->LastUParameter(); }
virtual Standard_Real FirstVParameter() const Standard_OVERRIDE { return mySurf.FirstVParameter(); }
virtual Standard_Real FirstVParameter() const Standard_OVERRIDE { return mySurf->FirstVParameter(); }
virtual Standard_Real LastVParameter() const Standard_OVERRIDE { return mySurf.LastVParameter(); }
virtual Standard_Real LastVParameter() const Standard_OVERRIDE { return mySurf->LastVParameter(); }
virtual GeomAbs_Shape UContinuity() const Standard_OVERRIDE { return mySurf.UContinuity(); }
virtual GeomAbs_Shape UContinuity() const Standard_OVERRIDE { return mySurf->UContinuity(); }
virtual GeomAbs_Shape VContinuity() const Standard_OVERRIDE { return mySurf.VContinuity(); }
virtual GeomAbs_Shape VContinuity() const Standard_OVERRIDE { return mySurf->VContinuity(); }
//! If necessary, breaks the surface in U intervals of
//! continuity <S>. And returns the number of
//! intervals.
virtual Standard_Integer NbUIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf.NbUIntervals (theSh); }
virtual Standard_Integer NbUIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf->NbUIntervals (theSh); }
//! If necessary, breaks the surface in V intervals of
//! continuity <S>. And returns the number of
//! intervals.
virtual Standard_Integer NbVIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf.NbVIntervals (theSh); }
virtual Standard_Integer NbVIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf->NbVIntervals (theSh); }
//! Returns the intervals with the requested continuity
//! in the U direction.
@@ -128,17 +125,17 @@ public:
//! If <First> >= <Last>
Standard_EXPORT Handle(Adaptor3d_Surface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
virtual Standard_Boolean IsUClosed() const Standard_OVERRIDE { return mySurf.IsUClosed(); }
virtual Standard_Boolean IsUClosed() const Standard_OVERRIDE { return mySurf->IsUClosed(); }
virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE { return mySurf.IsVClosed(); }
virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE { return mySurf->IsVClosed(); }
virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE { return mySurf.IsUPeriodic(); }
virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE { return mySurf->IsUPeriodic(); }
virtual Standard_Real UPeriod() const Standard_OVERRIDE { return mySurf.UPeriod(); }
virtual Standard_Real UPeriod() const Standard_OVERRIDE { return mySurf->UPeriod(); }
virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE { return mySurf.IsVPeriodic(); }
virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE { return mySurf->IsVPeriodic(); }
virtual Standard_Real VPeriod() const Standard_OVERRIDE { return mySurf.VPeriod(); }
virtual Standard_Real VPeriod() const Standard_OVERRIDE { return mySurf->VPeriod(); }
//! Computes the point of parameters U,V on the surface.
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
@@ -174,17 +171,17 @@ public:
//! Returns the parametric U resolution corresponding
//! to the real space resolution <R3d>.
virtual Standard_Real UResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf.UResolution (theR3d); }
virtual Standard_Real UResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf->UResolution (theR3d); }
//! Returns the parametric V resolution corresponding
//! to the real space resolution <R3d>.
virtual Standard_Real VResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf.VResolution (theR3d); }
virtual Standard_Real VResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf->VResolution (theR3d); }
//! Returns the type of the surface : Plane, Cylinder,
//! Cone, Sphere, Torus, BezierSurface,
//! BSplineSurface, SurfaceOfRevolution,
//! SurfaceOfExtrusion, OtherSurface
virtual GeomAbs_SurfaceType GetType() const Standard_OVERRIDE { return mySurf.GetType(); }
virtual GeomAbs_SurfaceType GetType() const Standard_OVERRIDE { return mySurf->GetType(); }
Standard_EXPORT gp_Pln Plane() const Standard_OVERRIDE;
@@ -196,21 +193,21 @@ public:
Standard_EXPORT gp_Torus Torus() const Standard_OVERRIDE;
virtual Standard_Integer UDegree() const Standard_OVERRIDE { return mySurf.UDegree(); }
virtual Standard_Integer UDegree() const Standard_OVERRIDE { return mySurf->UDegree(); }
virtual Standard_Integer NbUPoles() const Standard_OVERRIDE { return mySurf.NbUPoles(); }
virtual Standard_Integer NbUPoles() const Standard_OVERRIDE { return mySurf->NbUPoles(); }
virtual Standard_Integer VDegree() const Standard_OVERRIDE { return mySurf.VDegree(); }
virtual Standard_Integer VDegree() const Standard_OVERRIDE { return mySurf->VDegree(); }
virtual Standard_Integer NbVPoles() const Standard_OVERRIDE { return mySurf.NbVPoles(); }
virtual Standard_Integer NbVPoles() const Standard_OVERRIDE { return mySurf->NbVPoles(); }
virtual Standard_Integer NbUKnots() const Standard_OVERRIDE { return mySurf.NbUKnots(); }
virtual Standard_Integer NbUKnots() const Standard_OVERRIDE { return mySurf->NbUKnots(); }
virtual Standard_Integer NbVKnots() const Standard_OVERRIDE { return mySurf.NbVKnots(); }
virtual Standard_Integer NbVKnots() const Standard_OVERRIDE { return mySurf->NbVKnots(); }
virtual Standard_Boolean IsURational() const Standard_OVERRIDE { return mySurf.IsURational(); }
virtual Standard_Boolean IsURational() const Standard_OVERRIDE { return mySurf->IsURational(); }
virtual Standard_Boolean IsVRational() const Standard_OVERRIDE { return mySurf.IsVRational(); }
virtual Standard_Boolean IsVRational() const Standard_OVERRIDE { return mySurf->IsVRational(); }
Standard_EXPORT Handle(Geom_BezierSurface) Bezier() const Standard_OVERRIDE;
@@ -236,7 +233,7 @@ public:
private:
GeomAdaptor_Surface mySurf;
Handle(GeomAdaptor_Surface) mySurf;
gp_Trsf myTrsf;
TopoDS_Face myFace;

View File

@@ -244,7 +244,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
for(i = 1; i <= NbEdges; i++){
DescenList.Clear();
Handle(BRepAdaptor_Curve) hcur = new BRepAdaptor_Curve (TopoDS::Edge(Edges->Value(i)));
Elementary = IsElementary(*hcur);
Elementary = IsElementary(hcur);
for(j = 1; j <= NbFaces; j++){
Handle(BRepAdaptor_Surface) hsur = new BRepAdaptor_Surface (TopoDS::Face(Faces->Value(j)));
@@ -627,10 +627,10 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
//purpose :
//=======================================================================
Standard_Boolean BRepAlgo_NormalProjection::IsElementary(const Adaptor3d_Curve& C) const
Standard_Boolean BRepAlgo_NormalProjection::IsElementary(const Handle(Adaptor3d_Curve)& C) const
{
GeomAbs_CurveType type;
type = C.GetType();
type = C->GetType();
switch(type) {
case GeomAbs_Line:
case GeomAbs_Circle:

View File

@@ -92,7 +92,7 @@ public:
//! shape <S>.
Standard_EXPORT const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
Standard_EXPORT Standard_Boolean IsElementary (const Adaptor3d_Curve& C) const;
Standard_EXPORT Standard_Boolean IsElementary (const Handle(Adaptor3d_Curve)& C) const;
//! build the result as a list of wire if possible in --
//! a first returns a wire only if there is only a wire.

View File

@@ -79,7 +79,7 @@ public:
Standard_EXPORT BRepApprox_Approx();
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
Standard_EXPORT void Perform (const Handle(BRepAdaptor_Surface)& Surf1, const Handle(BRepAdaptor_Surface)& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
Standard_EXPORT void Perform (const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
@@ -120,7 +120,7 @@ protected:
private:
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const Handle(BRepAdaptor_Surface)& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
Standard_EXPORT void UpdateTolReached();

View File

@@ -37,7 +37,7 @@
#include <AppParCurves_MultiBSpCurve.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -19,24 +19,24 @@
#include <BRepAdaptor_Surface.hxx>
#include <Geom_BezierSurface.hxx>
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&)
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const Handle(BRepAdaptor_Surface)&)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&)
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const Handle(BRepAdaptor_Surface)&)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&,
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const Handle(BRepAdaptor_Surface)&,
const Standard_Real,
const Standard_Real)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&,
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const Handle(BRepAdaptor_Surface)&,
const Standard_Real,
const Standard_Real)
{

View File

@@ -41,85 +41,85 @@ public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstUParameter (const BRepAdaptor_Surface& S);
static Standard_Real FirstUParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real FirstVParameter (const BRepAdaptor_Surface& S);
static Standard_Real FirstVParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real LastUParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastUParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real LastVParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastVParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Integer NbUIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbUIntervals (const Handle(BRepAdaptor_Surface)& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const Handle(BRepAdaptor_Surface)& S, const GeomAbs_Shape Sh);
static void UIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void UIntervals (const Handle(BRepAdaptor_Surface)& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const Handle(BRepAdaptor_Surface)& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) UTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) UTrim (const Handle(BRepAdaptor_Surface)& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) VTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) VTrim (const Handle(BRepAdaptor_Surface)& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Standard_Boolean IsUClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUClosed (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsVClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVClosed (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsUPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real UPeriod (const BRepAdaptor_Surface& S);
static Standard_Real UPeriod (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsVPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real VPeriod (const BRepAdaptor_Surface& S);
static Standard_Real VPeriod (const Handle(BRepAdaptor_Surface)& S);
static gp_Pnt Value (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v);
static gp_Pnt Value (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v);
static void D0 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D0 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D1 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D1 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D2 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D2 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D3 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static void D3 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static gp_Vec DN (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static gp_Vec DN (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static Standard_Real UResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real UResolution (const Handle(BRepAdaptor_Surface)& S, const Standard_Real R3d);
static Standard_Real VResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real VResolution (const Handle(BRepAdaptor_Surface)& S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType (const BRepAdaptor_Surface& S);
static GeomAbs_SurfaceType GetType (const Handle(BRepAdaptor_Surface)& S);
static gp_Pln Plane (const BRepAdaptor_Surface& S);
static gp_Pln Plane (const Handle(BRepAdaptor_Surface)& S);
static gp_Cylinder Cylinder (const BRepAdaptor_Surface& S);
static gp_Cylinder Cylinder (const Handle(BRepAdaptor_Surface)& S);
static gp_Cone Cone (const BRepAdaptor_Surface& S);
static gp_Cone Cone (const Handle(BRepAdaptor_Surface)& S);
static gp_Torus Torus (const BRepAdaptor_Surface& S);
static gp_Torus Torus (const Handle(BRepAdaptor_Surface)& S);
static gp_Sphere Sphere (const BRepAdaptor_Surface& S);
static gp_Sphere Sphere (const Handle(BRepAdaptor_Surface)& S);
static Handle(Geom_BezierSurface) Bezier (const BRepAdaptor_Surface& S);
static Handle(Geom_BezierSurface) Bezier (const Handle(BRepAdaptor_Surface)& S);
static Handle(Geom_BSplineSurface) BSpline (const BRepAdaptor_Surface& S);
static Handle(Geom_BSplineSurface) BSpline (const Handle(BRepAdaptor_Surface)& S);
static gp_Ax1 AxeOfRevolution (const BRepAdaptor_Surface& S);
static gp_Ax1 AxeOfRevolution (const Handle(BRepAdaptor_Surface)& S);
static gp_Dir Direction (const BRepAdaptor_Surface& S);
static gp_Dir Direction (const Handle(BRepAdaptor_Surface)& S);
static Handle(Adaptor3d_Curve) BasisCurve (const BRepAdaptor_Surface& S);
static Handle(Adaptor3d_Curve) BasisCurve (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S, const Standard_Real v1, const Standard_Real v2);
Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(BRepAdaptor_Surface)& S, const Standard_Real v1, const Standard_Real v2);

View File

@@ -28,107 +28,107 @@
#include <Adaptor3d_Surface.hxx>
#include <Adaptor3d_Curve.hxx>
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastUParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->LastUParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->LastVParameter();}
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf,
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const Handle(BRepAdaptor_Surface)& Surf,
const GeomAbs_Shape S){
return Surf.NbUIntervals(S);
return Surf->NbUIntervals(S);
}
inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf,
inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const Handle(BRepAdaptor_Surface)& Surf,
const GeomAbs_Shape S){
return Surf.NbVIntervals(S);
return Surf->NbVIntervals(S);
}
inline void BRepApprox_SurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf,
inline void BRepApprox_SurfaceTool::UIntervals(const Handle(BRepAdaptor_Surface)& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
Surf.UIntervals(Tab,S);
Surf->UIntervals(Tab,S);
}
inline void BRepApprox_SurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf,
inline void BRepApprox_SurfaceTool::VIntervals(const Handle(BRepAdaptor_Surface)& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
Surf.VIntervals(Tab,S);
Surf->VIntervals(Tab,S);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::UTrim(const BRepAdaptor_Surface& Surf,
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::UTrim(const Handle(BRepAdaptor_Surface)& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return Surf.UTrim(F,L,Tol);
return Surf->UTrim(F,L,Tol);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::VTrim(const BRepAdaptor_Surface& Surf,
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::VTrim(const Handle(BRepAdaptor_Surface)& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return Surf.VTrim(F,L,Tol);
return Surf->VTrim(F,L,Tol);
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsUClosed();
return S->IsUClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsVClosed();
return S->IsVClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsUPeriodic();
return S->IsUPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const Handle(BRepAdaptor_Surface)& S)
{
return S.UPeriod();
return S->UPeriod();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsVPeriodic();
return S->IsVPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const BRepAdaptor_Surface& S)
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const Handle(BRepAdaptor_Surface)& S)
{
return S.VPeriod();
return S->VPeriod();
}
inline gp_Pnt BRepApprox_SurfaceTool::Value(const BRepAdaptor_Surface& S,
inline gp_Pnt BRepApprox_SurfaceTool::Value(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V )
{
return S.Value(U,V);
return S->Value(U,V);
}
inline void BRepApprox_SurfaceTool::D0(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D0(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{
S.D0(U,V,P);
S->D0(U,V,P);
}
inline void BRepApprox_SurfaceTool::D1(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D1(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{
S.D1(U,V,P,D1U,D1V);
S->D1(U,V,P,D1U,D1V);
}
inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D2(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
@@ -138,10 +138,10 @@ inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
gp_Vec& D2V,
gp_Vec& D2UV)
{
S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
S->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
}
inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D3(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
@@ -155,78 +155,78 @@ inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
gp_Vec& D3UUV,
gp_Vec& D3UVV)
{
S.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
S->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
}
inline gp_Vec BRepApprox_SurfaceTool::DN(const BRepAdaptor_Surface& S,
inline gp_Vec BRepApprox_SurfaceTool::DN(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{
return S.DN(U,V,Nu,Nv);
return S->DN(U,V,Nu,Nv);
}
inline Standard_Real BRepApprox_SurfaceTool::UResolution(const BRepAdaptor_Surface& S,
inline Standard_Real BRepApprox_SurfaceTool::UResolution(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real R3d)
{
return S.UResolution(R3d);
return S->UResolution(R3d);
}
inline Standard_Real BRepApprox_SurfaceTool::VResolution(const BRepAdaptor_Surface& S,
inline Standard_Real BRepApprox_SurfaceTool::VResolution(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real R3d)
{
return S.VResolution(R3d);
return S->VResolution(R3d);
}
inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const BRepAdaptor_Surface& S )
inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const Handle(BRepAdaptor_Surface)& S )
{
return S.GetType();
return S->GetType();
}
inline gp_Pln BRepApprox_SurfaceTool::Plane(const BRepAdaptor_Surface& S)
inline gp_Pln BRepApprox_SurfaceTool::Plane(const Handle(BRepAdaptor_Surface)& S)
{
return S.Plane();
return S->Plane();
}
inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const BRepAdaptor_Surface& S)
inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const Handle(BRepAdaptor_Surface)& S)
{
return S.Cylinder();
return S->Cylinder();
}
inline gp_Cone BRepApprox_SurfaceTool::Cone(const BRepAdaptor_Surface& S)
inline gp_Cone BRepApprox_SurfaceTool::Cone(const Handle(BRepAdaptor_Surface)& S)
{
return S.Cone();
return S->Cone();
}
inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const BRepAdaptor_Surface& S)
inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const Handle(BRepAdaptor_Surface)& S)
{
return S.Sphere();
return S->Sphere();
}
inline gp_Torus BRepApprox_SurfaceTool::Torus(const BRepAdaptor_Surface& S)
inline gp_Torus BRepApprox_SurfaceTool::Torus(const Handle(BRepAdaptor_Surface)& S)
{
return S.Torus();
return S->Torus();
}
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const BRepAdaptor_Surface& S) {
return(S.Bezier());
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const Handle(BRepAdaptor_Surface)& S) {
return(S->Bezier());
}
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const BRepAdaptor_Surface& S) {
return(S.BSpline());
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const Handle(BRepAdaptor_Surface)& S) {
return(S->BSpline());
}
inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S) {
return(S.AxeOfRevolution());
inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const Handle(BRepAdaptor_Surface)& S) {
return(S->AxeOfRevolution());
}
inline gp_Dir BRepApprox_SurfaceTool::Direction(const BRepAdaptor_Surface& S) {
return(S.Direction());
inline gp_Dir BRepApprox_SurfaceTool::Direction(const Handle(BRepAdaptor_Surface)& S) {
return(S->Direction());
}
inline Handle(Adaptor3d_Curve) BRepApprox_SurfaceTool::BasisCurve(const BRepAdaptor_Surface& S) {
return(S.BasisCurve());
inline Handle(Adaptor3d_Curve) BRepApprox_SurfaceTool::BasisCurve(const Handle(BRepAdaptor_Surface)& S) {
return(S->BasisCurve());
}

View File

@@ -42,7 +42,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2);
Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2);
Standard_EXPORT Standard_Integer NbVariables() const;
@@ -69,9 +69,9 @@ public:
gp_Dir2d DirectionOnS2() const;
const BRepAdaptor_Surface& AuxillarSurface1() const;
const Handle(BRepAdaptor_Surface) AuxillarSurface1() const;
const BRepAdaptor_Surface& AuxillarSurface2() const;
const Handle(BRepAdaptor_Surface) AuxillarSurface2() const;
@@ -113,7 +113,7 @@ private:
};
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -23,7 +23,7 @@
#include <math_Matrix.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -47,9 +47,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const IntSurf_Quadric& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& Surf1, const IntSurf_Quadric& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const Handle(BRepAdaptor_Surface)& Surf2);
//! returns True if Tg,Tguv1 Tguv2 can be computed.
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,

View File

@@ -27,7 +27,7 @@
#include <gp_Vec2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -47,7 +47,7 @@ public:
DEFINE_STANDARD_ALLOC
//! compute the solution point with the close point
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency);
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2, const Standard_Real TolTangency);
//! initialize the parameters to compute the solution point
//! it 's possible to write to optimize:
@@ -59,7 +59,7 @@ public:
//! param(3)=...
//! inter.Perform(Param,rsnld);
//! }
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency);
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2, const Standard_Real TolTangency);
//! returns the best constant isoparametric to find
//! the next intersection's point +stores the solution

View File

@@ -29,7 +29,7 @@
#include <gp_Dir2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -46,7 +46,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2);
Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& Surf1, const Handle(BRepAdaptor_Surface)& Surf2);
//! returns True if Tg,Tguv1 Tguv2 can be computed.
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,

View File

@@ -26,7 +26,7 @@
#include <gp_Vec2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -46,11 +46,11 @@ public:
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox();
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& PS, const IntSurf_Quadric& IS);
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& PS, const IntSurf_Quadric& IS);
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& IS);
void Set (const BRepAdaptor_Surface& PS);
void Set (const Handle(BRepAdaptor_Surface)& PS);
void SetImplicitSurface (const IntSurf_Quadric& IS);
@@ -80,7 +80,7 @@ public:
const gp_Dir2d& Direction2d();
const BRepAdaptor_Surface& PSurface() const;
const Handle(BRepAdaptor_Surface) PSurface() const;
const IntSurf_Quadric& ISurface() const;
@@ -118,7 +118,7 @@ private:
};
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -27,7 +27,7 @@
#include <gp_Dir2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -56,7 +56,7 @@ Standard_Boolean BRepBlend_BlendTool::Project(const gp_Pnt2d& P,
const Standard_Real epsX = 1.e-8;
const Standard_Integer Nbu = 20;
const Standard_Real Tol = 1.e-5;
Extrema_EPCOfExtPC2d extrema(P, *C, Nbu, epsX, Tol);
Extrema_EPCOfExtPC2d extrema(P, C, Nbu, epsX, Tol);
if (!extrema.IsDone())
return Standard_True;
@@ -91,9 +91,9 @@ Standard_Boolean BRepBlend_BlendTool::Inters(const gp_Pnt2d& P1,
gp_Dir2d d(v);
Handle(Geom2d_Line) bid = new Geom2d_Line(P1,d);
Geom2dAdaptor_Curve seg(bid,-0.01*mag,1.01*mag);
Handle(Geom2dAdaptor_Curve) seg = new Geom2dAdaptor_Curve(bid,-0.01*mag,1.01*mag);
Geom2dInt_GInter inter (seg, *C, Tol, Tol);
Geom2dInt_GInter inter (seg, C, Tol, Tol);
if (!inter.IsDone())
return Standard_False;

View File

@@ -45,7 +45,7 @@
#include <Extrema_ExtSS.hxx>
#include <GeomAdaptor_Surface.hxx>
//
static Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS);
static Standard_Boolean CanUseEdges(const Handle(Adaptor3d_Surface)& BS);
//
static void FindExactUVBounds(const TopoDS_Face F,
Standard_Real& umin, Standard_Real& umax,
@@ -53,13 +53,13 @@ static void FindExactUVBounds(const TopoDS_Face F,
const Standard_Real Tol,
Standard_Boolean& isNaturalRestriction);
//
static void AdjustFaceBox(const BRepAdaptor_Surface& BS,
static void AdjustFaceBox(const Handle(BRepAdaptor_Surface)& BS,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
Bnd_Box& FaceBox,
const Bnd_Box& EdgeBox, const Standard_Real Tol);
//
static Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
static Standard_Boolean IsModifySize(const Handle(BRepAdaptor_Surface)& theBS,
const gp_Pln& thePln, const gp_Pnt& theP,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
@@ -76,10 +76,10 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
TopExp_Explorer ex;
// Add the faces
BRepAdaptor_Surface BS;
Handle(BRepAdaptor_Surface) BS = new BRepAdaptor_Surface();
TopLoc_Location l, aDummyLoc;
Standard_Integer i, nbNodes;
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) {
const TopoDS_Face& F = TopoDS::Face(ex.Current());
@@ -92,16 +92,16 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
} else
{
if (!GS.IsNull()) {
BS.Initialize(F, Standard_False);
if (BS.GetType() != GeomAbs_Plane) {
BS.Initialize(F);
BS->Initialize(F, Standard_False);
if (BS->GetType() != GeomAbs_Plane) {
BS->Initialize(F);
BndLib_AddSurface::Add(BS, BRep_Tool::Tolerance(F), B);
}
else {
// on travaille directement sur les courbes 3d.
TopExp_Explorer ex2(F, TopAbs_EDGE);
if (!ex2.More()) {
BS.Initialize(F);
BS->Initialize(F);
BndLib_AddSurface::Add(BS, BRep_Tool::Tolerance(F), B);
}
else {
@@ -109,7 +109,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
const TopoDS_Edge& anEdge = TopoDS::Edge(ex2.Current());
if (BRep_Tool::IsGeometric (anEdge))
{
BC.Initialize (anEdge);
BC->Initialize (anEdge);
BndLib_Add3dCurve::Add (BC, BRep_Tool::Tolerance (anEdge), B);
}
}
@@ -167,7 +167,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
else {
if (BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BC->Initialize(E);
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
}
}
@@ -197,13 +197,13 @@ void BRepBndLib::AddClose(const TopoDS_Shape& S, Bnd_Box& B)
// Add the edges
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
const TopoDS_Edge& anEdge = TopoDS::Edge (ex.Current());
if (BRep_Tool::IsGeometric (anEdge))
{
BC.Initialize (anEdge);
BC->Initialize (anEdge);
BndLib_Add3dCurve::Add(BC,0.,B);
}
}
@@ -226,11 +226,11 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
TopExp_Explorer ex;
// Add the faces
BRepAdaptor_Surface BS;
Handle(BRepAdaptor_Surface) BS = new BRepAdaptor_Surface();
Handle(Poly_Triangulation) T;
TopLoc_Location l;
Standard_Integer i, nbNodes;
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) {
const TopoDS_Face& F = TopoDS::Face(ex.Current());
@@ -248,11 +248,11 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
const Handle(Geom_Surface)& GS = BRep_Tool::Surface(F, l);
if (!GS.IsNull()) {
BS.Initialize(F, Standard_False);
BS->Initialize(F, Standard_False);
if (CanUseEdges(BS)) {
TopExp_Explorer ex2(F, TopAbs_EDGE);
if (!ex2.More()) {
BS.Initialize(F);
BS->Initialize(F);
Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(F) : 0.;
BndLib_AddSurface::AddOptimal(BS, Tol, aLocBox);
}
@@ -266,7 +266,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
continue;
}
BC.Initialize(anE);
BC->Initialize(anE);
Tol = useShapeTolerance? BRep_Tool::Tolerance(anE) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, anEBox);
aLocBox.Add(anEBox);
@@ -293,7 +293,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
continue;
}
BC.Initialize(anE);
BC->Initialize(anE);
Tol = useShapeTolerance? BRep_Tool::Tolerance(anE) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, anEBox);
EBox.Add(anEBox);
@@ -359,7 +359,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
else {
if (BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BC->Initialize(E);
Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(E) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, aLocBox);
}
@@ -392,9 +392,9 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
//purpose : Define is it possible using only edges bnd boxes
// to get face bnd box
//=======================================================================
Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
Standard_Boolean CanUseEdges(const Handle(Adaptor3d_Surface)& BS)
{
GeomAbs_SurfaceType aST = BS.GetType();
GeomAbs_SurfaceType aST = BS->GetType();
if(aST == GeomAbs_Plane ||
aST == GeomAbs_Cylinder ||
aST == GeomAbs_Cone ||
@@ -404,7 +404,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_SurfaceOfRevolution)
{
const Handle(Adaptor3d_Curve)& aBC = BS.BasisCurve();
const Handle(Adaptor3d_Curve)& aBC = BS->BasisCurve();
if(aBC->GetType() == GeomAbs_Line)
{
return Standard_True;
@@ -416,12 +416,12 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_OffsetSurface)
{
const Handle(Adaptor3d_Surface)& aS = BS.BasisSurface();
return CanUseEdges (*aS);
const Handle(Adaptor3d_Surface)& aS = BS->BasisSurface();
return CanUseEdges (aS);
}
else if(aST == GeomAbs_BSplineSurface)
{
Handle(Geom_BSplineSurface) aBSpl = BS.BSpline();
Handle(Geom_BSplineSurface) aBSpl = BS->BSpline();
if((aBSpl->UDegree() == 1 && aBSpl->NbUKnots() == 2) ||
(aBSpl->VDegree() == 1 && aBSpl->NbVKnots() == 2))
{
@@ -434,7 +434,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_BezierSurface)
{
Handle(Geom_BezierSurface) aBz = BS.Bezier();
Handle(Geom_BezierSurface) aBz = BS->Bezier();
if((aBz->UDegree() == 1 ) ||
(aBz->VDegree() == 1 ))
{
@@ -637,7 +637,7 @@ inline void Reorder(Standard_Real& a, Standard_Real& b)
//function : IsModifySize
//purpose :
//=======================================================================
Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
Standard_Boolean IsModifySize(const Handle(BRepAdaptor_Surface)& theBS,
const gp_Pln& thePln, const gp_Pnt& theP,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
@@ -649,7 +649,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
Reorder(pu1, pu2);
Reorder(pv1, pv2);
Handle(Geom_Plane) aPlane = new Geom_Plane(thePln);
GeomAdaptor_Surface aGAPln(aPlane, pu1, pu2, pv1, pv2);
Handle(GeomAdaptor_Surface) aGAPln = new GeomAdaptor_Surface(aPlane, pu1, pu2, pv1, pv2);
Extrema_ExtSS anExtr(aGAPln, theBS, pu1, pu2, pv1, pv2, umin, umax, vmin, vmax, theTolU, theTolV);
if(anExtr.IsDone())
{
@@ -698,7 +698,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
//function : AdjustFaceBox
//purpose :
//=======================================================================
void AdjustFaceBox(const BRepAdaptor_Surface& BS,
void AdjustFaceBox(const Handle(BRepAdaptor_Surface)& BS,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
Bnd_Box& FaceBox,
@@ -720,9 +720,9 @@ void AdjustFaceBox(const BRepAdaptor_Surface& BS,
FaceBox.Get(fxmin, fymin, fzmin, fxmax, fymax, fzmax);
EdgeBox.Get(exmin, eymin, ezmin, exmax, eymax, ezmax);
//
Standard_Real TolU = Max(BS.UResolution(Tol), Precision::PConfusion());
Standard_Real TolV = Max(BS.VResolution(Tol), Precision::PConfusion());
BRepTopAdaptor_FClass2d FClass(BS.Face(), Max(TolU, TolV));
Standard_Real TolU = Max(BS->UResolution(Tol), Precision::PConfusion());
Standard_Real TolV = Max(BS->VResolution(Tol), Precision::PConfusion());
BRepTopAdaptor_FClass2d FClass(BS->Face(), Max(TolU, TolV));
//
Standard_Boolean isModified = Standard_False;
if(exmin > fxmin)

View File

@@ -35,12 +35,12 @@
// Function : IsLinear
// purpose : Returns TRUE if theC is line-like.
//=======================================================================
static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
static Standard_Boolean IsLinear(const Handle(Adaptor3d_Curve)& theC)
{
const GeomAbs_CurveType aCT = theC.GetType();
const GeomAbs_CurveType aCT = theC->GetType();
if(aCT == GeomAbs_OffsetCurve)
{
return IsLinear(GeomAdaptor_Curve(theC.OffsetCurve()->BasisCurve()));
return IsLinear(new GeomAdaptor_Curve(theC->OffsetCurve()->BasisCurve()));
}
if((aCT == GeomAbs_BSplineCurve) || (aCT == GeomAbs_BezierCurve))
@@ -49,8 +49,8 @@ static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
// represented with set of points. It will be possible made
// in the future.
return ((theC.Degree() == 1) &&
(theC.Continuity() != GeomAbs_C0));
return ((theC->Degree() == 1) &&
(theC->Continuity() != GeomAbs_C0));
}
if(aCT == GeomAbs_Line)
@@ -65,29 +65,29 @@ static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
// Function : IsPlanar
// purpose : Returns TRUE if theS is plane-like.
//=======================================================================
static Standard_Boolean IsPlanar(const Adaptor3d_Surface& theS)
static Standard_Boolean IsPlanar(const Handle(Adaptor3d_Surface)& theS)
{
const GeomAbs_SurfaceType aST = theS.GetType();
const GeomAbs_SurfaceType aST = theS->GetType();
if(aST == GeomAbs_OffsetSurface)
{
return IsPlanar (*theS.BasisSurface());
return IsPlanar (theS->BasisSurface());
}
if(aST == GeomAbs_SurfaceOfExtrusion)
{
return IsLinear (*theS.BasisCurve());
return IsLinear (theS->BasisCurve());
}
if((aST == GeomAbs_BSplineSurface) || (aST == GeomAbs_BezierSurface))
{
if((theS.UDegree() != 1) || (theS.VDegree() != 1))
if((theS->UDegree() != 1) || (theS->VDegree() != 1))
return Standard_False;
// Indeed, surfaces with C0-continuity and degree==1, may be
// represented with set of points. It will be possible made
// in the future.
return ((theS.UContinuity() != GeomAbs_C0) && (theS.VContinuity() != GeomAbs_C0));
return ((theS->UContinuity() != GeomAbs_C0) && (theS->VContinuity() != GeomAbs_C0));
}
if(aST == GeomAbs_Plane)
@@ -157,7 +157,7 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
if (BRep_Tool::IsGeometric (anE))
{
const BRepAdaptor_Curve anAC(anE);
Handle(BRepAdaptor_Curve) anAC = new BRepAdaptor_Curve(anE);
if (!IsLinear(anAC))
{
if (!theIsTriangulationUsed)
@@ -210,7 +210,7 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
if (BRep_Tool::IsGeometric (anE))
{
const BRepAdaptor_Curve anAC(anE);
Handle(BRepAdaptor_Curve) anAC = new BRepAdaptor_Curve(anE);
if (IsLinear(anAC))
{
// skip linear edge as its vertices have already been added

View File

@@ -174,7 +174,7 @@ static Standard_Boolean IsClosedShape(const TopoDS_Shape& theshape,
Standard_Real first,last;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(aedge), first, last);
if (!c3d.IsNull()) {
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
Standard_Real length = GCPnts_AbscissaPoint::Length(cAdapt, first, last);
TotLength += length;
if (ve2.IsSame(v1) || ve2.IsSame(v2)) break;
@@ -444,10 +444,10 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge,
return Standard_False;
Standard_Real first, last;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(theEdge,first, last);
GeomAdaptor_Curve GAC(c3d);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(c3d);
Extrema_ExtPC locProj;
locProj.Initialize(GAC, first, last);
gp_Pnt pfirst = GAC.Value(first), plast = GAC.Value(last);
gp_Pnt pfirst = GAC->Value(first), plast = GAC->Value(last);
for (Standard_Integer i = 1; i <= nbV; i++) {
@@ -574,10 +574,10 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
// Take the longest edge as first
Standard_Real f, l;
Handle(Geom_Curve) c3d1 = BRep_Tool::Curve(TopoDS::Edge(edgeFirst), f, l);
GeomAdaptor_Curve cAdapt1(c3d1);
Handle(GeomAdaptor_Curve) cAdapt1 = new GeomAdaptor_Curve(c3d1);
Standard_Real len1 = GCPnts_AbscissaPoint::Length(cAdapt1, f, l);
Handle(Geom_Curve) c3d2 = BRep_Tool::Curve(TopoDS::Edge(edgeLast), f, l);
GeomAdaptor_Curve cAdapt2(c3d2);
Handle(GeomAdaptor_Curve) cAdapt2 = new GeomAdaptor_Curve(c3d2);
Standard_Real len2 = GCPnts_AbscissaPoint::Length(cAdapt2, f, l);
if (len1 < len2) {
edge1 = edgeLast;
@@ -1017,7 +1017,7 @@ void BRepBuilderAPI_Sewing::EvaluateAngulars(TopTools_SequenceOfShape& sequenceS
c3d->Transform(loc.Transformation());
}
GeomAdaptor_Curve adapt(c3d);
Handle(GeomAdaptor_Curve) adapt = new GeomAdaptor_Curve(c3d);
GCPnts_UniformAbscissa uniAbs(adapt, npt, first, last);
Standard_Real cumulateAngular = 0.0;
@@ -1283,7 +1283,8 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1,
Standard_Real C2Umin, C2Vmin, C2Umax, C2Vmax;
{ //szv: Use brackets to destroy local variables
Bnd_Box2d B1, B2;
Geom2dAdaptor_Curve aC2d1(C2d1), aC2d2(C2d2);
Handle(Geom2dAdaptor_Curve) aC2d1 = new Geom2dAdaptor_Curve(C2d1);
Handle(Geom2dAdaptor_Curve) aC2d2 = new Geom2dAdaptor_Curve(C2d2);
BndLib_Add2dCurve::Add(aC2d1,first2d1,last2d1,Precision::PConfusion(),B1);
BndLib_Add2dCurve::Add(aC2d2,first2d2,last2d2,Precision::PConfusion(),B2);
B1.Get(C1Umin,C1Vmin,C1Umax,C1Vmax);
@@ -3559,7 +3560,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
for (i = 1; i <= nbSection; i++) {
Standard_Real f, l;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(seqEdges(i)), f, l);
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
Standard_Real len = GCPnts_AbscissaPoint::Length(cAdapt, f, l);
if (len > lenRef) { indRef = i; lenRef = len; }
}
@@ -3646,7 +3647,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress)
{ //szv: Use brackets to destroy local variables
// Create bounding box around curve
Bnd_Box aGlobalBox;
GeomAdaptor_Curve adptC(c3d,first,last);
Handle(GeomAdaptor_Curve) adptC = new GeomAdaptor_Curve(c3d,first,last);
BndLib_Add3dCurve::Add(adptC,myTolerance,aGlobalBox);
// Sort vertices to find candidates
aSelector.SetCurrent (aGlobalBox);
@@ -3848,7 +3849,7 @@ static Standard_Boolean IsDegeneratedWire(const TopoDS_Shape& wire)
length = pfirst.Distance(plast);
}
else {
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
length = GCPnts_AbscissaPoint::Length(cAdapt, first, last);
}
Standard_Real tole = BRep_Tool::Tolerance(Ve1)+BRep_Tool::Tolerance(Ve2);
@@ -4288,10 +4289,10 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
{
arrDist.Init(-1.0);
GeomAdaptor_Curve GAC(c3d);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(c3d);
Extrema_ExtPC locProj;
locProj.Initialize(GAC, first, last);
gp_Pnt pfirst = GAC.Value(first), plast = GAC.Value(last);
gp_Pnt pfirst = GAC->Value(first), plast = GAC->Value(last);
Standard_Integer find = 1;//(isConsiderEnds ? 1 : 2);
Standard_Integer lind = arrPnt.Length();//(isConsiderEnds ? arrPnt.Length() : arrPnt.Length() -1);
@@ -4316,7 +4317,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
isProjected = Standard_True;
Extrema_POnCurv pOnC = locProj.Point(indMin);
Standard_Real paramProj = pOnC.Parameter();
gp_Pnt ptProj = GAC.Value(paramProj);
gp_Pnt ptProj = GAC->Value(paramProj);
Standard_Real distProj2 = ptProj.SquareDistance(pt);
if (!locProj.IsMin(indMin)) {
if (Min(distF2,distL2) < dist2Min) {

View File

@@ -67,15 +67,15 @@ Standard_Boolean BRepCheck::SelfIntersection(const TopoDS_Wire& W,
//function : PrecCurve
//purpose :
//=======================================================================
Standard_Real BRepCheck::PrecCurve(const Adaptor3d_Curve& aAC3D)
Standard_Real BRepCheck::PrecCurve(const Handle(Adaptor3d_Curve)& aAC3D)
{
Standard_Real aXEmax = RealEpsilon();
//
GeomAbs_CurveType aCT = aAC3D.GetType();
GeomAbs_CurveType aCT = aAC3D->GetType();
if (aCT==GeomAbs_Ellipse) {
Standard_Real aX[5];
//
gp_Elips aEL3D=aAC3D.Ellipse();
gp_Elips aEL3D=aAC3D->Ellipse();
aEL3D.Location().Coord(aX[0], aX[1], aX[2]);
aX[3]=aEL3D.MajorRadius();
aX[4]=aEL3D.MinorRadius();

View File

@@ -44,7 +44,7 @@ public:
Standard_EXPORT static Standard_Boolean SelfIntersection (const TopoDS_Wire& W, const TopoDS_Face& F, TopoDS_Edge& E1, TopoDS_Edge& E2);
//! Returns the resolution on the 3d curve
Standard_EXPORT static Standard_Real PrecCurve(const Adaptor3d_Curve& aAC3D);
Standard_EXPORT static Standard_Real PrecCurve(const Handle(Adaptor3d_Curve)& aAC3D);
//! Returns the resolution on the surface
Standard_EXPORT static Standard_Real PrecSurface(const Handle(Adaptor3d_Surface)& aAHSurf);

View File

@@ -454,7 +454,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Handle(GeomAdaptor_Curve) aHCurve =
new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(ProjLib_ProjectedCurve) proj = new ProjLib_ProjectedCurve(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_Curve) GHPC =
new Geom2dAdaptor_Curve(PC,

View File

@@ -216,7 +216,7 @@ BRepCheck_Status BRepCheck_Face::IntersectWires(const Standard_Boolean Update)
exp1.Next();
}
Geom2dAdaptor_Curve aC;
Handle(Geom2dAdaptor_Curve) aC = new Geom2dAdaptor_Curve();
Standard_Real aFirst, aLast;
DataMapOfShapeBox2d aMapShapeBox2d;
for (exp1.Init (myShape, TopAbs_WIRE); exp1.More(); exp1.Next())
@@ -227,15 +227,15 @@ BRepCheck_Status BRepCheck_Face::IntersectWires(const Standard_Boolean Update)
for (exp2.Init (aWire, TopAbs_EDGE); exp2.More(); exp2.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (exp2.Current());
aC.Load (BRep_Tool::CurveOnSurface (anEdge, TopoDS::Face (myShape), aFirst, aLast));
aC->Load (BRep_Tool::CurveOnSurface (anEdge, TopoDS::Face (myShape), aFirst, aLast));
// To avoid exception in Segment if C1 is BSpline
if (aC.FirstParameter() > aFirst)
if (aC->FirstParameter() > aFirst)
{
aFirst = aC.FirstParameter();
aFirst = aC->FirstParameter();
}
if (aC.LastParameter() < aLast)
if (aC->LastParameter() < aLast)
{
aLast = aC.LastParameter();
aLast = aC->LastParameter();
}
Bnd_Box2d aBoxE;
BndLib_Add2dCurve::Add (aC, aFirst, aLast, 0., aBoxE);
@@ -644,7 +644,8 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1,
PntSeq.Append( P );
}
Geom2dAdaptor_Curve C1,C2;
Handle(Geom2dAdaptor_Curve) C1 = new Geom2dAdaptor_Curve();
Handle(Geom2dAdaptor_Curve) C2 = new Geom2dAdaptor_Curve();
gp_Pnt2d pfirst1,plast1,pfirst2,plast2;
Standard_Real first1,last1,first2,last2;
Geom2dInt_GInter Inter;
@@ -655,10 +656,10 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1,
{
const TopoDS_Edge& edg1 = TopoDS::Edge(exp1.Current());
// cur1.Initialize(edg1,F);
C1.Load( BRep_Tool::CurveOnSurface(edg1,F,first1,last1) );
C1->Load( BRep_Tool::CurveOnSurface(edg1,F,first1,last1) );
// To avoid exception in Segment if C1 is BSpline - IFV
if(C1.FirstParameter() > first1) first1 = C1.FirstParameter();
if(C1.LastParameter() < last1 ) last1 = C1.LastParameter();
if(C1->FirstParameter() > first1) first1 = C1->FirstParameter();
if(C1->LastParameter() < last1 ) last1 = C1->LastParameter();
Box1.SetVoid();
if (theMapEdgeBox.IsBound (edg1))
@@ -675,10 +676,10 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1,
if (!edg1.IsSame(edg2))
{
//cur2.Initialize(edg2,F);
C2.Load( BRep_Tool::CurveOnSurface(edg2,F,first2,last2) );
C2->Load( BRep_Tool::CurveOnSurface(edg2,F,first2,last2) );
// To avoid exception in Segment if C2 is BSpline - IFV
if(C2.FirstParameter() > first2) first2 = C2.FirstParameter();
if(C2.LastParameter() < last2 ) last2 = C2.LastParameter();
if(C2->FirstParameter() > first2) first2 = C2->FirstParameter();
if(C2->LastParameter() < last2 ) last2 = C2->LastParameter();
Box2.SetVoid();
if (theMapEdgeBox.IsBound (edg2))

View File

@@ -98,7 +98,7 @@ inline Standard_Boolean IsOriented(const TopoDS_Shape& S)
}
static
void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
void CurveDirForParameter(const Handle(Geom2dAdaptor_Curve)& aC2d,
const Standard_Real aPrm,
gp_Pnt2d& Pnt,
gp_Vec2d& aVec2d);
@@ -415,7 +415,7 @@ Standard_Boolean IsDistanceIn3DTolerance (const gp_Pnt& thePnt_f,
//purpose :
//=======================================================================
static
Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurface,
Standard_Boolean IsDistanceIn2DTolerance (const Handle(BRepAdaptor_Surface)& aFaceSurface,
const gp_Pnt2d& thePnt,
const gp_Pnt2d& thePntRef,
const Standard_Real aTol3d,
@@ -425,8 +425,8 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
const Standard_Boolean = Standard_True)
#endif
{
Standard_Real dumax = 0.01 * (aFaceSurface.LastUParameter() - aFaceSurface.FirstUParameter());
Standard_Real dvmax = 0.01 * (aFaceSurface.LastVParameter() - aFaceSurface.FirstVParameter());
Standard_Real dumax = 0.01 * (aFaceSurface->LastUParameter() - aFaceSurface->FirstUParameter());
Standard_Real dvmax = 0.01 * (aFaceSurface->LastVParameter() - aFaceSurface->FirstVParameter());
Standard_Real dumin = Abs(thePnt.X() - thePntRef.X());
Standard_Real dvmin = Abs(thePnt.Y() - thePntRef.Y());
@@ -451,13 +451,13 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
std::cout << "; VLast = " << aFaceSurface.LastVParameter() << std::endl;
}
#endif
dumax = aFaceSurface.UResolution(aTol3d);
dvmax = aFaceSurface.VResolution(aTol3d);
dumax = aFaceSurface->UResolution(aTol3d);
dvmax = aFaceSurface->VResolution(aTol3d);
gp_Pnt aP;
gp_Vec aDU, aDV;
Standard_Real um = (thePnt.X() + thePntRef.X()) / 2.;
Standard_Real vm = (thePnt.Y() + thePntRef.Y()) / 2.;
aFaceSurface.D1(um, vm, aP, aDU, aDV);
aFaceSurface->D1(um, vm, aP, aDU, aDV);
Standard_Real aMDU = aDU.Magnitude();
if (aMDU > Precision::Confusion())
{
@@ -539,7 +539,7 @@ BRepCheck_Status BRepCheck_Wire::Closed2d(const TopoDS_Face& theFace,
// 20/03/02 akm vvv : (OCC234) Hence this method will be used to check
// both periodic and non-periodic faces
// // this check is for periodic faces
BRepAdaptor_Surface aFaceSurface (theFace, Standard_False);
Handle(BRepAdaptor_Surface) aFaceSurface = new BRepAdaptor_Surface(theFace, Standard_False);
// if (!aFaceSurface.IsUPeriodic() && !aFaceSurface.IsVPeriodic())
// {
// if (Update)
@@ -1004,7 +1004,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
gp_Pnt2d pfirst1,plast1,pfirst2,plast2;
gp_Pnt P3d, P3d2;
Handle(BRepAdaptor_Surface) HS;
Geom2dAdaptor_Curve C1, C2;
Handle(Geom2dAdaptor_Curve) C1 = new Geom2dAdaptor_Curve();
Handle(Geom2dAdaptor_Curve) C2 = new Geom2dAdaptor_Curve();
Geom2dInt_GInter Inter;
IntRes2d_Domain myDomain1;
TopTools_IndexedMapOfOrientedShape EMap;
@@ -1051,14 +1052,14 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
return(BRepCheck_SelfIntersectingWire);
}
//
C1.Load(pcu);
C1->Load(pcu);
// To avoid exception in Segment if C1 is BSpline - IFV
if(!C1.IsPeriodic()) {
if(C1.FirstParameter() > first1) {
first1 = C1.FirstParameter();
if(!C1->IsPeriodic()) {
if(C1->FirstParameter() > first1) {
first1 = C1->FirstParameter();
}
if(C1.LastParameter() < last1 ){
last1 = C1.LastParameter();
if(C1->LastParameter() < last1 ){
last1 = C1->LastParameter();
}
}
//
@@ -1068,7 +1069,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
BndLib_Add2dCurve::Add(C1, first1, last1, Precision::PConfusion(), boxes(i));
}//if (i == 1) {
else {
C1.Load(tabCur(i));
C1->Load(tabCur(i));
myDomain1 = tabDom[i-1];
}
//
@@ -1099,7 +1100,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin
}
else {
gp_Pnt2d aP2d = C1.Value(IP.ParamOnFirst());
gp_Pnt2d aP2d = C1->Value(IP.ParamOnFirst());
P3d = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1141,14 +1142,14 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
if (i == 1) {
tabCur(j) = BRep_Tool::CurveOnSurface(E2,F,first2,last2);
if (!tabCur(j).IsNull() && last2 > first2) {
C2.Load(tabCur(j));
C2->Load(tabCur(j));
// To avoid exception in Segment if C2 is BSpline - IFV
if(!C2.IsPeriodic()) {
if(C2.FirstParameter() > first2) {
first2 = C2.FirstParameter();
if(!C2->IsPeriodic()) {
if(C2->FirstParameter() > first2) {
first2 = C2->FirstParameter();
}
if(C2.LastParameter() < last2 ) {
last2 = C2.LastParameter();
if(C2->LastParameter() < last2 ) {
last2 = C2->LastParameter();
}
}
//
@@ -1169,7 +1170,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
}
}// if (i == 1) {
else {
C2.Load(tabCur(j));
C2->Load(tabCur(j));
}
//
if (boxes(i).IsOut( boxes(j))) {
@@ -1243,7 +1244,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P3d.Transform(L.Transformation());
}
else {
gp_Pnt2d aP2d = C1.Value(IP_ParamOnFirst);
gp_Pnt2d aP2d = C1->Value(IP_ParamOnFirst);
P3d = HS->Value(aP2d.X(), aP2d.Y());
}
//
@@ -1252,7 +1253,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P3d2.Transform(L2.Transformation());
}
else {
gp_Pnt2d aP2d = C2.Value(IP_ParamOnSecond);
gp_Pnt2d aP2d = C2->Value(IP_ParamOnSecond);
P3d2 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1346,7 +1347,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P1.Transform(L.Transformation());
}
else {
gp_Pnt2d aP2d = C1.Value(u);
gp_Pnt2d aP2d = C1->Value(u);
P1 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1374,7 +1375,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P2.Transform(L2.Transformation());
}
else {
gp_Pnt2d aP2d = C2.Value(u);
gp_Pnt2d aP2d = C2->Value(u);
P2 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1448,8 +1449,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
if(aPCR1!=IntRes2d_Middle && aPCR2!=IntRes2d_Middle) {
GeomAbs_CurveType aCT1, aCT2;
//ZZ
aCT1=C1.GetType();
aCT2=C2.GetType();
aCT1=C1->GetType();
aCT2=C2->GetType();
if (aCT1==GeomAbs_Line && aCT2==GeomAbs_Line) {
// check for the two lines coincidence
Standard_Real aPAR_T, aT11, aT12, aT21, aT22, aT1m, aT2m;
@@ -1464,8 +1465,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
aTol2=aTolE1+aTolE2;
aTol2=aTol2*aTol2;
//
aL1=C1.Line();
aL2=C2.Line();
aL1=C1->Line();
aL2=C2->Line();
//
aT11=PSeg[0].ParamOnFirst();
aT12=PSeg[1].ParamOnFirst();
@@ -1473,7 +1474,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
aT22=PSeg[1].ParamOnSecond();
//
aT1m=(1.-aPAR_T)*aT11 + aPAR_T*aT12;
aP1m=C1.Value(aT1m);
aP1m=C1->Value(aT1m);
//
aD2=aL2.SquareDistance(aP1m);
if (aD2<aTol2) {
@@ -1503,14 +1504,14 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P3d = ConS->Value(IP_ParamOnFirst);
P3d.Transform(L.Transformation());
} else {
gp_Pnt2d aP2d = C1.Value(IP_ParamOnFirst);
gp_Pnt2d aP2d = C1->Value(IP_ParamOnFirst);
P3d = HS->Value(aP2d.X(), aP2d.Y());
}
if (!ConS2.IsNull()) {
P3d2 = ConS2->Value(IP_ParamOnSecond);
P3d2.Transform(L2.Transformation());
} else {
gp_Pnt2d aP2d = C2.Value(IP_ParamOnSecond);
gp_Pnt2d aP2d = C2->Value(IP_ParamOnSecond);
P3d2 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1692,7 +1693,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
Standard_Real a_gpResolution=gp::Resolution();
TopAbs_Orientation aVOrientation, anEdgOrientation;
Standard_Real aParam = 0.0, aFirstParam = 0.0, aLastParam = 0.0, aParPiv = 0.0;
BRepAdaptor_Surface aFaceSurface(theFace,Standard_False); // no restriction
Handle(BRepAdaptor_Surface) aFaceSurface = new BRepAdaptor_Surface(theFace, Standard_False); // no restriction
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirstParam, aLastParam);
if (C2d.IsNull())// JAG 10.12.96
@@ -1705,7 +1706,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
aMinAngle = RealLast();
aMaxAngle = RealFirst();
CurveDirForParameter(C2d, aParPiv, aPntRef, aDerRef);
CurveDirForParameter(new Geom2dAdaptor_Curve(C2d), aParPiv, aPntRef, aDerRef);
if (aVOrientation != anEdgOrientation)
aDerRef.Reverse();
@@ -1727,7 +1728,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
if(!IsDistanceIn2DTolerance(aFaceSurface, aPnt, aPntRef, aTol3d, Standard_False))
continue;
CurveDirForParameter(aCA, aParam, aPnt, aDer);
CurveDirForParameter(new Geom2dAdaptor_Curve(aCA), aParam, aPnt, aDer);
if (aVOrientation == anE.Orientation())
aDer.Reverse();
@@ -1820,7 +1821,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
//function : CurveDirForParameter
//purpose :
//=======================================================================
void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
void CurveDirForParameter(const Handle(Geom2dAdaptor_Curve)& aC2d,
const Standard_Real aPrm,
gp_Pnt2d& Pnt,
gp_Vec2d& aVec2d)
@@ -1828,11 +1829,11 @@ void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
Standard_Real aTol=gp::Resolution();
Standard_Integer i;
aC2d.D1(aPrm, Pnt, aVec2d);
aC2d->D1(aPrm, Pnt, aVec2d);
//
if (aVec2d.Magnitude() <= aTol) {
for (i = 2; i <= 100; i++){
aVec2d = aC2d.DN(aPrm, i);
aVec2d = aC2d->DN(aPrm, i);
if (aVec2d.Magnitude() > aTol) {
break;
}

View File

@@ -105,7 +105,7 @@ void BRepClass_FaceClassifier::Perform(const TopoDS_Face& theF,
aMaxDist=RealLast();
aIndice=0;
//
BRepAdaptor_Surface aSurf(theF, Standard_False);
Handle(BRepAdaptor_Surface) aSurf = new BRepAdaptor_Surface(theF, Standard_False);
BRepTools::UVBounds(theF, aU1, aU2, aV1, aV2);
aExtrema.Initialize(aSurf, aU1, aU2, aV1, aV2, theTol, theTol);
//

View File

@@ -47,7 +47,7 @@ void GetTangentAsChord(const Handle(Geom2d_Curve)& thePCurve,
static
void RefineTolerance(const TopoDS_Face& aF,
const Geom2dAdaptor_Curve& aC,
const Handle(Geom2dAdaptor_Curve)& aC,
const Standard_Real aT,
Standard_Real& aTolZ);
@@ -55,7 +55,7 @@ static
Standard_Boolean CheckOn(IntRes2d_IntersectionPoint& thePntInter,
const TopoDS_Face& theF,
const gp_Lin2d& theL,
const Geom2dAdaptor_Curve& theCur,
const Handle(Geom2dAdaptor_Curve)& theCur,
Standard_Real& theTolZ,
const Standard_Real theFin,
const Standard_Real theDeb);
@@ -66,8 +66,8 @@ void CheckSkip(Geom2dInt_GInter& theInter,
const BRepClass_Edge& theE,
const Handle(Geom2d_Curve)& theC2D,
const IntRes2d_Domain& theDL,
Geom2dAdaptor_Curve& theCur,
const Geom2dAdaptor_Curve& theCGA,
Handle(Geom2dAdaptor_Curve)& theCur,
const Handle(Geom2dAdaptor_Curve)& theCGA,
Standard_Real& theFin,
Standard_Real& theDeb,
const Standard_Real theMaxTol,
@@ -162,7 +162,7 @@ Standard_Boolean IsInter(Bnd_Box2d& theBox,
Standard_Boolean CheckOn(IntRes2d_IntersectionPoint& thePntInter,
const TopoDS_Face& theF,
const gp_Lin2d& theL,
const Geom2dAdaptor_Curve& theCur,
const Handle(Geom2dAdaptor_Curve)& theCur,
Standard_Real& theTolZ,
const Standard_Real theFin,
const Standard_Real theDeb)
@@ -224,8 +224,8 @@ void CheckSkip(Geom2dInt_GInter& theInter,
const BRepClass_Edge& theE,
const Handle(Geom2d_Curve)& theC2D,
const IntRes2d_Domain& theDL,
Geom2dAdaptor_Curve& theCur,
const Geom2dAdaptor_Curve& theCGA,
Handle(Geom2dAdaptor_Curve)& theCur,
const Handle(Geom2dAdaptor_Curve)& theCGA,
Standard_Real& theFin,
Standard_Real& theDeb,
const Standard_Real theMaxTol,
@@ -313,26 +313,26 @@ void CheckSkip(Geom2dInt_GInter& theInter,
return;
}
// if we got
theCur.Load(aSkipC2D);
if (theCur.Curve().IsNull())
theCur->Load(aSkipC2D);
if (theCur->Curve().IsNull())
{
return;
}
Standard_Real atoldeb = 1.e-5, atolfin = 1.e-5;
theDeb = theCur.FirstParameter();
theFin = theCur.LastParameter();
theCur.D0(theDeb, thePdeb);
theCur.D0(theFin, thePfin);
theDeb = theCur->FirstParameter();
theFin = theCur->LastParameter();
theCur->D0(theDeb, thePdeb);
theCur->D0(theFin, thePfin);
IntRes2d_Domain aDE(thePdeb, theDeb, atoldeb, thePfin, theFin, atolfin);
// temporary periodic domain
if (theCur.Curve()->IsPeriodic())
if (theCur->Curve()->IsPeriodic())
{
aDE.SetEquivalentParameters(theCur.FirstParameter(),
theCur.FirstParameter() +
theCur.Curve()->LastParameter() -
theCur.Curve()->FirstParameter());
aDE.SetEquivalentParameters(theCur->FirstParameter(),
theCur->FirstParameter() +
theCur->Curve()->LastParameter() -
theCur->Curve()->FirstParameter());
}
theInter = Geom2dInt_GInter(theCGA, theDL, theCur, aDE,
@@ -373,7 +373,7 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
aPntF = L.Location();
}
//
Geom2dAdaptor_Curve C(aC2D, deb, fin);
Handle(Geom2dAdaptor_Curve) C = new Geom2dAdaptor_Curve(aC2D, deb, fin);
//
// Case of "ON": direct check of belonging to edge
// taking into account the tolerance
@@ -406,8 +406,8 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
}
}
gp_Pnt2d pdeb, pfin;
C.D0(deb, pdeb);
C.D0(fin, pfin);
C->D0(deb, pdeb);
C->D0(fin, pfin);
Standard_Real toldeb = 1.e-5, tolfin = 1.e-5;
IntRes2d_Domain DL;
@@ -421,15 +421,15 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
IntRes2d_Domain DE(pdeb, deb, toldeb, pfin, fin, tolfin);
// temporary periodic domain
if (C.Curve()->IsPeriodic()) {
DE.SetEquivalentParameters(C.FirstParameter(),
C.FirstParameter() +
C.Curve()->LastParameter() -
C.Curve()->FirstParameter());
if (C->Curve()->IsPeriodic()) {
DE.SetEquivalentParameters(C->FirstParameter(),
C->FirstParameter() +
C->Curve()->LastParameter() -
C->Curve()->FirstParameter());
}
Handle(Geom2d_Line) GL = new Geom2d_Line(L);
Geom2dAdaptor_Curve CGA(GL);
Handle(Geom2dAdaptor_Curve) CGA = new Geom2dAdaptor_Curve(GL);
Geom2dInt_GInter Inter(CGA, DL, C, DE,
Precision::PConfusion(),
Precision::PIntersection());
@@ -481,7 +481,7 @@ void BRepClass_Intersector::LocalGeometry(const BRepClass_Edge& E,
//purpose :
//=======================================================================
void RefineTolerance(const TopoDS_Face& aF,
const Geom2dAdaptor_Curve& aC,
const Handle(Geom2dAdaptor_Curve)& aC,
const Standard_Real aT,
Standard_Real& aTolZ)
{
@@ -498,7 +498,7 @@ void RefineTolerance(const TopoDS_Face& aF,
aURes=aBAS.UResolution(aTolZ);
aVRes=aBAS.VResolution(aTolZ);
//
aC.D1(aT, aP2D, aV2D);
aC->D1(aT, aP2D, aV2D);
gp_Dir2d aD2D(aV2D);
//
aTolX=aURes*aD2D.Y()+aVRes*aD2D.X();

View File

@@ -38,7 +38,7 @@ Standard_Boolean BRepClass3d_BndBoxTreeSelectorPoint::Accept (const Standard_Int
Standard_Real EdgeTSq = BRep_Tool::Tolerance(E);
EdgeTSq *= EdgeTSq;
Standard_Real f, l;
BRepAdaptor_Curve C(E);
Handle(BRepAdaptor_Curve) C = new BRepAdaptor_Curve(E);
BRep_Tool::Range(E,f,l);
// Edge-Point interference.
@@ -86,11 +86,11 @@ Standard_Boolean BRepClass3d_BndBoxTreeSelectorLine::Accept (const Standard_Inte
Standard_Real EdgeTSq = BRep_Tool::Tolerance(E);
EdgeTSq *= EdgeTSq;
Standard_Real f, l;
BRepAdaptor_Curve C(E);
Handle(BRepAdaptor_Curve) C = new BRepAdaptor_Curve(E);
BRep_Tool::Range(E, f, l);
// Edge-Line interference.
Extrema_ExtCC ExtCC(C, myLC, f, l, myLC.FirstParameter(), myLC.LastParameter());
Extrema_ExtCC ExtCC(C, myLC, f, l, myLC->FirstParameter(), myLC->LastParameter());
if (ExtCC.IsDone())
{
if (ExtCC.IsParallel())

View File

@@ -83,6 +83,7 @@ public:
BRepClass3d_BndBoxTreeSelectorLine(const TopTools_IndexedMapOfShape& theMapOfShape)
: BRepClass3d_BndBoxTreeSelectorLine::Selector(),
myMapOfShape(theMapOfShape),
myLC(new GeomAdaptor_Curve()),
myIsValid(Standard_True)
{}
@@ -98,7 +99,7 @@ public:
const Standard_Real theMaxParam)
{
myL = theL;
myLC.Load(new Geom_Line(theL), -Precision::PConfusion(), theMaxParam);
myLC->Load(new Geom_Line(theL), -Precision::PConfusion(), theMaxParam);
}
void GetEdgeParam(const Standard_Integer i,
@@ -153,7 +154,7 @@ private:
gp_Lin myL;
NCollection_Sequence<EdgeParam> myEP; //output result (edge vs line)
NCollection_Sequence<VertParam> myVP; //output result (vertex vs line)
GeomAdaptor_Curve myLC;
Handle(GeomAdaptor_Curve) myLC;
Standard_Boolean myIsValid;
};

View File

@@ -376,7 +376,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer,
if (Intersector3d.IsParallel())
{
//Check distance between surface and point
BRepAdaptor_Surface aBAS(f, Standard_False);
Handle(BRepAdaptor_Surface) aBAS = new BRepAdaptor_Surface(f, Standard_False);
Extrema_ExtPS aProj(P, aBAS, Precision::PConfusion(), Precision::PConfusion());
if (aProj.IsDone() && aProj.NbExt() > 0)
{

View File

@@ -515,7 +515,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
_u = (U1 + U2) * 0.5;
_v = (V1 + V2) * 0.5;
GeomAdaptor_Surface GA(BRep_Tool::Surface(face));
Handle(GeomAdaptor_Surface) GA = new GeomAdaptor_Surface(BRep_Tool::Surface(face));
Extrema_ExtPS Ext(P, GA, TolU, TolV);
//
if (Ext.IsDone() && Ext.NbExt() > 0) {

View File

@@ -47,7 +47,7 @@ void BRepExtrema_ExtCC::Initialize(const TopoDS_Edge& E2)
Standard_Real Tol = Min(BRep_Tool::Tolerance(E2), Precision::Confusion());
Tol = Max(Curv.Resolution(Tol), Precision::PConfusion());
BRep_Tool::Range(E2,V1,V2);
myExtCC.SetCurve (2, *myHC, V1, V2);
myExtCC.SetCurve (2, myHC, V1, V2);
myExtCC.SetTolerance(2, Tol);
}
@@ -66,7 +66,7 @@ void BRepExtrema_ExtCC::Perform(const TopoDS_Edge& E1)
Standard_Real Tol = Min(BRep_Tool::Tolerance(E1), Precision::Confusion());
Tol = Max(Curv.Resolution(Tol), Precision::PConfusion());
BRep_Tool::Range(E1,U1,U2);
myExtCC.SetCurve (1, *HC, U1, U2);
myExtCC.SetCurve (1, HC, U1, U2);
myExtCC.SetTolerance(1, Tol);
// If we enable SetSingleSolutionFlag Extrema will run much quicker on almost parallel curves
// (e.g. bug 27665), however some solutions will be lost, e.g. see bug 28183.

View File

@@ -59,7 +59,7 @@ void BRepExtrema_ExtCF::Initialize(const TopoDS_Edge& E, const TopoDS_Face& F)
//
Standard_Real U1, U2, V1, V2;
BRepTools::UVBounds(F, U1, U2, V1, V2);
myExtCS.Initialize (*myHS, U1, U2, V1, V2, aTolC, aTolS);
myExtCS.Initialize (myHS, U1, U2, V1, V2, aTolC, aTolS);
}
//=======================================================================
@@ -81,7 +81,7 @@ void BRepExtrema_ExtCF::Perform(const TopoDS_Edge& E, const TopoDS_Face& F2)
BRepAdaptor_Curve Curv(E);
Handle(BRepAdaptor_Curve) HC = new BRepAdaptor_Curve(Curv);
myExtCS.Perform(*HC, U1, U2);
myExtCS.Perform(HC, U1, U2);
if(!myExtCS.IsDone())
return;

View File

@@ -54,7 +54,7 @@ void BRepExtrema_ExtFF::Initialize(const TopoDS_Face& F2)
Tol = Max(Tol, Precision::PConfusion());
Standard_Real U1, U2, V1, V2;
BRepTools::UVBounds(F2, U1, U2, V1, V2);
myExtSS.Initialize (*myHS, U1, U2, V1, V2, Tol);
myExtSS.Initialize (myHS, U1, U2, V1, V2, Tol);
}
//=======================================================================
@@ -78,7 +78,7 @@ void BRepExtrema_ExtFF::Perform(const TopoDS_Face& F1, const TopoDS_Face& F2)
Tol1 = Max(Tol1, Precision::PConfusion());
Standard_Real U1, U2, V1, V2;
BRepTools::UVBounds(F1, U1, U2, V1, V2);
myExtSS.Perform (*HS1, U1, U2, V1, V2, Tol1);
myExtSS.Perform (HS1, U1, U2, V1, V2, Tol1);
if (!myExtSS.IsDone())
return;

View File

@@ -45,7 +45,7 @@ void BRepExtrema_ExtPC::Initialize(const TopoDS_Edge& E)
Standard_Real Tol = Min(BRep_Tool::Tolerance(E), Precision::Confusion());
Tol = Max(myHC->Resolution(Tol), Precision::PConfusion());
BRep_Tool::Range(E,U1,U2);
myExtPC.Initialize (*myHC, U1, U2, Tol);
myExtPC.Initialize (myHC, U1, U2, Tol);
}
//=======================================================================

View File

@@ -48,15 +48,15 @@ void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace,
{
// cette surface doit etre en champ. Extrema ne fait
// pas de copie et prend seulement un pointeur dessus.
mySurf.Initialize(TheFace, Standard_False);
mySurf = new BRepAdaptor_Surface(TheFace, Standard_False);
if (mySurf.GetType() == GeomAbs_OtherSurface)
if (mySurf->GetType() == GeomAbs_OtherSurface)
return; // protect against non-geometric type (e.g. triangulation)
Standard_Real Tol = Min(BRep_Tool::Tolerance(TheFace), Precision::Confusion());
Standard_Real aTolU, aTolV;
aTolU = Max(mySurf.UResolution(Tol), Precision::PConfusion());
aTolV = Max(mySurf.VResolution(Tol), Precision::PConfusion());
aTolU = Max(mySurf->UResolution(Tol), Precision::PConfusion());
aTolV = Max(mySurf->VResolution(Tol), Precision::PConfusion());
Standard_Real U1, U2, V1, V2;
BRepTools::UVBounds(TheFace, U1, U2, V1, V2);
myExtPS.SetFlag(TheFlag);
@@ -75,7 +75,7 @@ void BRepExtrema_ExtPF::Perform(const TopoDS_Vertex& TheVertex, const TopoDS_Fac
myPoints.Clear();
const gp_Pnt P = BRep_Tool::Pnt(TheVertex);
if (mySurf.GetType() == GeomAbs_OtherSurface)
if (mySurf->GetType() == GeomAbs_OtherSurface)
return; // protect against non-geometric type (e.g. triangulation)
myExtPS.Perform(P);

View File

@@ -86,7 +86,7 @@ class BRepExtrema_ExtPF
Extrema_ExtPS myExtPS;
TColStd_SequenceOfReal mySqDist;
Extrema_SequenceOfPOnSurf myPoints;
BRepAdaptor_Surface mySurf;
Handle(BRepAdaptor_Surface) mySurf;
};
#endif

View File

@@ -126,7 +126,7 @@ Standard_Real BRepFeat::ParametricBarycenter(const TopoDS_Shape& S,
Handle(Geom_Curve) C;
Standard_Real f,l,prm;
Standard_Integer i, nbp= 0;
GeomAdaptor_Curve TheCurve(CC);
Handle(GeomAdaptor_Curve) TheCurve = new GeomAdaptor_Curve(CC);
Extrema_ExtPC extpc;
extpc.Initialize(TheCurve,CC->FirstParameter(),CC->LastParameter());
Standard_Real parbar = 0;
@@ -236,9 +236,9 @@ void BRepFeat::ParametricMinMax(const TopoDS_Shape& S,
Standard_Real f,l,prm;
// Standard_Integer i, nbp= 0;
Standard_Integer i;
GeomAdaptor_Curve TheCurve(CC);
Handle(GeomAdaptor_Curve) TheCurve = new GeomAdaptor_Curve(CC);
Extrema_ExtPC extpc;
extpc.Initialize(TheCurve,CC->FirstParameter(),CC->LastParameter());
extpc.Initialize(TheCurve, CC->FirstParameter(),CC->LastParameter());
prbmin = RealLast();
prbmax = RealFirst();
for (; exp.More(); exp.Next()) {
@@ -312,13 +312,13 @@ void BRepFeat::ParametricMinMax(const TopoDS_Shape& S,
//=======================================================================
static Standard_Boolean IsIn (BRepTopAdaptor_FClass2d& FC,
Geom2dAdaptor_Curve AC)
const Handle(Geom2dAdaptor_Curve)& AC)
{
Standard_Real Def = 100*Precision::Confusion();
GCPnts_QuasiUniformDeflection QU(AC,Def);
for (Standard_Integer i = 1; i <= QU.NbPoints(); i++) {
gp_Pnt2d P = AC.Value(QU.Parameter(i));
gp_Pnt2d P = AC->Value(QU.Parameter(i));
if (FC.Perform(P, Standard_False) == TopAbs_OUT) {
return Standard_False;
}
@@ -462,8 +462,8 @@ Standard_Boolean BRepFeat::IsInside(const TopoDS_Face& F1,
if(flagu == 1) PutInBoundsU(umin, umax, eps, uperiod, f1, l1, C);
if(flagv == 1) PutInBoundsV(vmin, vmax, eps, vperiod, f1, l1, C);
}
Geom2dAdaptor_Curve AC(C,f1,l1);
if (!IsIn(FC,AC)) {
Handle(Geom2dAdaptor_Curve) AC = new Geom2dAdaptor_Curve(C,f1,l1);
if (!IsIn(FC, AC)) {
return Standard_False;
}
}

View File

@@ -97,7 +97,7 @@ public:
Standard_EXPORT static Standard_Boolean IsInside (const TopoDS_Face& F1, const TopoDS_Face& F2);
Standard_EXPORT static Standard_Boolean IsInOut (const BRepTopAdaptor_FClass2d& FC, const Geom2dAdaptor_Curve& AC);
Standard_EXPORT static Standard_Boolean IsInOut (const BRepTopAdaptor_FClass2d& FC, const Handle(Geom2dAdaptor_Curve)& AC);
Standard_EXPORT static void FaceUntil (const TopoDS_Shape& S, TopoDS_Face& F);

View File

@@ -925,7 +925,7 @@ void BRepFill::ComputeACR(const TopoDS_Wire& wire,
TopoDS_Edge Ecur = TopoDS::Edge(anExp.Current());
ACR(nbEdges) = ACR(nbEdges-1);
if (!BRep_Tool::Degenerated(Ecur)) {
BRepAdaptor_Curve anEcur(Ecur);
Handle(BRepAdaptor_Curve) anEcur = new BRepAdaptor_Curve(Ecur);
ACR(nbEdges) += GCPnts_AbscissaPoint::Length(anEcur);
}
}

View File

@@ -1085,7 +1085,7 @@ void BRepFill_AdvancedEvolved::RemoveExcessSolids(const TopTools_ListOfShape& th
class NormalFunc : public math_MultipleVarFunctionWithGradient
{
public:
NormalFunc(const Adaptor3d_CurveOnSurface& theCOS) :myCOnS(theCOS)
NormalFunc(const Handle(Adaptor3d_CurveOnSurface)& theCOS) :myCOnS(theCOS)
{
}
@@ -1144,7 +1144,7 @@ protected:
NormalFunc& operator=(NormalFunc&);
private:
const Adaptor3d_CurveOnSurface& myCOnS;
const Handle(Adaptor3d_CurveOnSurface)& myCOnS;
};
//=======================================================================

View File

@@ -310,12 +310,12 @@ static void WireContinuity (const TopoDS_Wire& W,
TopExp::Vertices(Edge2,V2,Vbid,Standard_True);
Standard_Real U1 = BRep_Tool::Parameter(V1,Edge1);
Standard_Real U2 = BRep_Tool::Parameter(V2,Edge2);
BRepAdaptor_Curve Curve1(Edge1);
BRepAdaptor_Curve Curve2(Edge2);
Handle(BRepAdaptor_Curve) Curve1 = new BRepAdaptor_Curve(Edge1);
Handle(BRepAdaptor_Curve) Curve2 = new BRepAdaptor_Curve(Edge2);
Standard_Real Eps = BRep_Tool::Tolerance(V2) + BRep_Tool::Tolerance(V1);
if(j == nbEdges)
testconti = Curve1.Value(U1).IsEqual(Curve2.Value(U2), Eps);
testconti = Curve1->Value(U1).IsEqual(Curve2->Value(U2), Eps);
if(testconti) {
cont = BRepLProp::Continuity(Curve1,Curve2,U1,U2,

View File

@@ -97,7 +97,7 @@ static void ComputeTrsf(const TopoDS_Wire& W,
// Calculate the Transformation
gp_Ax3 N(Bary, D);
Tf.SetTransformation(N);
BRepAdaptor_Curve AC;
Handle(BRepAdaptor_Curve) AC = new BRepAdaptor_Curve();
// BndLib_Add3dCurve BC;
// transformation to the wire
@@ -109,7 +109,7 @@ static void ComputeTrsf(const TopoDS_Wire& W,
// Calculate the box
Box.SetVoid();
for (Exp.Init(TheW); Exp.More(); Exp.Next()) {
AC.Initialize(Exp.Current());
AC->Initialize(Exp.Current());
// BC.Add(AC, 0.1, Box);
BndLib_Add3dCurve::Add(AC, 0.1, Box);
}
@@ -348,7 +348,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
// box with bounds of the stop surface
Handle(Geom_Surface) Surf;
Surf = Handle(Geom_Surface)::DownCast(Surface->Transformed(Trsf));
GeomAdaptor_Surface S1 (Surf);
Handle(GeomAdaptor_Surface) S1 = new GeomAdaptor_Surface(Surf);
// BndLib_AddSurface AS;
// AS.Add(S1, 0.1, SBox);
BndLib_AddSurface::Add(S1, 0.1, SBox);
@@ -395,7 +395,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
Surf = Handle(Geom_Surface)::DownCast(
// BT.Surface(TopoDS::Face(Ex.Current()))->Transformed(Trsf) );
BRep_Tool::Surface(TopoDS::Face(Ex.Current()))->Transformed(Trsf) );
GeomAdaptor_Surface S1 (Surf);
Handle(GeomAdaptor_Surface) S1 = new GeomAdaptor_Surface(Surf);
// bounding box of the current face
// AS.Add(S1, Umin, Umax, Vmin, Vmax, 0.1, BSurf);
BndLib_AddSurface::Add(S1, Umin, Umax, Vmin, Vmax, 0.1, BSurf);

View File

@@ -2427,8 +2427,8 @@ void BRepFill_Evolved::ContinuityOnOffsetEdge (const TopTools_ListOfShape&)
// the regularities are already coded on the edges of elementary volevos
Standard_Real U1 = BRep_Tool::Parameter(V,CurE);
Standard_Real U2 = BRep_Tool::Parameter(V,PrecE);
BRepAdaptor_Curve Curve1(CurE);
BRepAdaptor_Curve Curve2(PrecE);
Handle(BRepAdaptor_Curve) Curve1 = new BRepAdaptor_Curve(CurE);
Handle(BRepAdaptor_Curve) Curve2 = new BRepAdaptor_Curve(PrecE);
GeomAbs_Shape Continuity = BRepLProp::Continuity(Curve1,Curve2,U1,U2);
if (Continuity >=1) {
@@ -2459,8 +2459,8 @@ void BRepFill_Evolved::ContinuityOnOffsetEdge (const TopTools_ListOfShape&)
//Closed profile.
Standard_Real U1 = BRep_Tool::Parameter(VF,CurE);
Standard_Real U2 = BRep_Tool::Parameter(VF,FirstE);
BRepAdaptor_Curve Curve1(CurE);
BRepAdaptor_Curve Curve2(FirstE);
Handle(BRepAdaptor_Curve) Curve1 = new BRepAdaptor_Curve(CurE);
Handle(BRepAdaptor_Curve) Curve2 = new BRepAdaptor_Curve(FirstE);
GeomAbs_Shape Continuity = BRepLProp::Continuity(Curve1,Curve2,U1,U2);
if (Continuity >=1) {
@@ -3053,7 +3053,7 @@ void CutEdgeProf (const TopoDS_Edge& E,
l= C2d->LastParameter();
Bnd_Box2d B;
Geom2dAdaptor_Curve AC2d(C2d);
Handle(Geom2dAdaptor_Curve) AC2d = new Geom2dAdaptor_Curve(C2d);
BndLib_Add2dCurve::Add(AC2d,BRepFill_Confusion(),B);
Standard_Real xmin,xmax;
B.Get(xmin,U1,xmax,U2);
@@ -3072,7 +3072,7 @@ void CutEdgeProf (const TopoDS_Edge& E,
// modified by NIZHNY-EAP Wed Feb 2 16:33:05 2000 ___END___
// On calcule les intersection avec Oy.
Geom2dAdaptor_Curve ALine(Line);
Handle(Geom2dAdaptor_Curve) ALine = new Geom2dAdaptor_Curve(Line);
Standard_Real Tol = Precision::Intersection();
Standard_Real TolC = 0.;

View File

@@ -437,7 +437,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
for (ii=1, Length=0.; ii<=NbE; ii++) {
myLaws->Value(ii)->GetDomain(f, l);
Length += AbsC.Length(*myLaws->Value(ii)->GetCurve(), myTol);
Length += AbsC.Length(myLaws->Value(ii)->GetCurve(), myTol);
myLength->SetValue(ii+1, Length);
}
@@ -582,7 +582,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
else {
GCPnts_AbscissaPoint
AbsC(myTol,
*myLaws->Value(iedge)->GetCurve(),
myLaws->Value(iedge)->GetCurve(),
Abcissa-myLength->Value(iedge), f);
U = AbsC.Parameter();
}
@@ -642,7 +642,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
CurvilinearBounds(Index, bid, Length);
}
Length += AbsC.Length(*myLaws->Value(Index)->GetCurve(),
Length += AbsC.Length(myLaws->Value(Index)->GetCurve(),
myLaws->Value(Index)->GetCurve()->FirstParameter(),
Param, myTol);
return Length;

View File

@@ -88,6 +88,11 @@ BRepFill_MultiLine::BRepFill_MultiLine()
{
myNbPnt2d = 2;
myNbPnt = 1;
myU1 = new Geom2dAdaptor_Curve();
myV1 = new Geom2dAdaptor_Curve();
myU2 = new Geom2dAdaptor_Curve();
myV2 = new Geom2dAdaptor_Curve();
myBis = new Geom2dAdaptor_Curve();
}
@@ -105,7 +110,7 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
const Handle(Geom2d_Curve)& Bissec)
: myFace1(Face1 ),
myFace2(Face2 ),
myBis (Bissec),
myBis(new Geom2dAdaptor_Curve(Bissec)),
myKPart(0)
{
//
@@ -228,13 +233,13 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
}
// end try duplication
myU1 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU1, BasisPlane),
myU1 = new Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU1, BasisPlane),
Umin, Umax);
UU1->D1(Umin, P, DZ);
RefPlane = new Geom_Plane(gp_Ax3(P,DZ,gp::DZ()));
myV1 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(VV1, RefPlane),
myV1 = new Geom2dAdaptor_Curve(GeomProjLib::Curve2d(VV1, RefPlane),
Vmin, Vmax);
@@ -334,12 +339,12 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
}
// end try duplication
myU2 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU2, BasisPlane),
myU2 = new Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU2, BasisPlane),
Umin, Umax);
UU2->D1(Umin, P, DZ);
RefPlane = new Geom_Plane(gp_Ax3(P,DZ,gp::DZ()));
myV2 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(VV2, RefPlane),
myV2 = new Geom2dAdaptor_Curve(GeomProjLib::Curve2d(VV2, RefPlane),
Vmin, Vmax);
// eval if in a particular case.
@@ -351,10 +356,10 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
// - 2 surfaces are planes.
myCont = GeomAbs_C0;
if ( myBis.GetType() == GeomAbs_Line) {
Standard_Real DeltaU = myBis.LastParameter() - myBis.FirstParameter();
gp_Pnt2d aPnt1 = ValueOnF1(myBis.FirstParameter() + 0.1*DeltaU);
gp_Pnt2d aPnt2 = ValueOnF1(myBis.FirstParameter() + 0.9*DeltaU);
if ( myBis->GetType() == GeomAbs_Line) {
Standard_Real DeltaU = myBis->LastParameter() - myBis->FirstParameter();
gp_Pnt2d aPnt1 = ValueOnF1(myBis->FirstParameter() + 0.1*DeltaU);
gp_Pnt2d aPnt2 = ValueOnF1(myBis->FirstParameter() + 0.9*DeltaU);
if ( myIsoU1) {
if ( Abs(aPnt1.Y() - aPnt2.Y()) < eps)
myKPart = 1;
@@ -398,13 +403,13 @@ void BRepFill_MultiLine::Curves(Handle(Geom_Curve)& Curve,
gp_Pnt2d P1,P2,PMil;
Standard_Real f,l;
P1 = ValueOnF1(myBis.FirstParameter());
P2 = ValueOnF1(myBis.LastParameter());
P1 = ValueOnF1(myBis->FirstParameter());
P2 = ValueOnF1(myBis->LastParameter());
// find value of the with medium point
// the ends can be degenerated points.
PMil = ValueOnF1(0.5*(myBis.FirstParameter() + myBis.LastParameter()));
PMil = ValueOnF1(0.5*(myBis->FirstParameter() + myBis->LastParameter()));
TopLoc_Location L;
Handle(Geom_Surface) S = BRep_Tool::Surface(myFace1,L);
@@ -445,9 +450,9 @@ void BRepFill_MultiLine::Curves(Handle(Geom_Curve)& Curve,
PCurve1 = new Geom2d_TrimmedCurve( PCurve1 ,f ,l);
}
P1 = ValueOnF2(myBis.FirstParameter());
P2 = ValueOnF2(myBis.LastParameter());
PMil = ValueOnF2(0.5*(myBis.FirstParameter() + myBis.LastParameter()));
P1 = ValueOnF2(myBis->FirstParameter());
P2 = ValueOnF2(myBis->LastParameter());
PMil = ValueOnF2(0.5*(myBis->FirstParameter() + myBis->LastParameter()));
if (!myIsoU2) {
Sens = P1.Y() < P2.Y();
@@ -477,13 +482,13 @@ void BRepFill_MultiLine::Curves(Handle(Geom_Curve)& Curve,
Handle(Geom_Plane) Plane = Handle(Geom_Plane)::DownCast(S);
// eval the 3d curve corresponding to the bissectrice.
gp_Pnt2d P = myBis.Line().Location();
gp_Dir2d D = myBis.Line().Direction();
gp_Pnt2d P = myBis->Line().Location();
gp_Dir2d D = myBis->Line().Direction();
Handle(Geom_Line) Line = new Geom_Line(gp_Pnt(P.X(),P.Y(),0.),
gp_Dir(D.X(),D.Y(),0.) );
Handle(Geom_TrimmedCurve) TLine =
new Geom_TrimmedCurve(Line, myBis.FirstParameter(),
myBis.LastParameter());
new Geom_TrimmedCurve(Line, myBis->FirstParameter(),
myBis->LastParameter());
Curve = GeomProjLib::ProjectOnPlane(TLine, Plane,
gp::DZ(), Standard_False);
@@ -522,7 +527,7 @@ void BRepFill_MultiLine::Curves(Handle(Geom_Curve)& Curve,
Standard_Real BRepFill_MultiLine::FirstParameter() const
{
return myBis.FirstParameter();
return myBis->FirstParameter();
}
@@ -533,7 +538,7 @@ Standard_Real BRepFill_MultiLine::FirstParameter() const
Standard_Real BRepFill_MultiLine::LastParameter() const
{
return myBis.LastParameter();
return myBis->LastParameter();
}
@@ -564,23 +569,23 @@ gp_Pnt BRepFill_MultiLine::Value(const Standard_Real U) const
//=======================================================================
static gp_Pnt2d ValueOnFace(const Standard_Real U,
const Geom2dAdaptor_Curve& TheBis,
const Geom2dAdaptor_Curve& TheU,
const Geom2dAdaptor_Curve& TheV,
const Handle(Geom2dAdaptor_Curve)& TheBis,
const Handle(Geom2dAdaptor_Curve)& TheU,
const Handle(Geom2dAdaptor_Curve)& TheV,
const Standard_Boolean IsIsoU)
{
gp_Pnt2d P = TheBis.Value(U);
gp_Pnt2d P = TheBis->Value(U);
Geom2dAPI_ProjectPointOnCurve Ext(P,TheU.Curve(),
TheU.FirstParameter(),
TheU.LastParameter());
Geom2dAPI_ProjectPointOnCurve Ext(P,TheU->Curve(),
TheU->FirstParameter(),
TheU->LastParameter());
#ifdef DRAW
if (AffichCurve) {
char* TheUname = "TheU";
char* PP1name = "PP1";
DrawTrSurf::Set(TheUname,TheU.Curve());
DrawTrSurf::Set(TheUname,TheU->Curve());
DrawTrSurf::Set(PP1name,P);
// DrawTrSurf::Set("TheU",TheU.Curve());
// DrawTrSurf::Set("TheU",TheU->Curve());
// DrawTrSurf::Set("PP1",P);
}
#endif
@@ -595,19 +600,19 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
Dist = Ext.LowerDistance();
}
// Control with `ends`
D1 = P.Distance(TheU.Value(TheU.FirstParameter()));
D2 = P.Distance(TheU.Value(TheU.LastParameter()));
D1 = P.Distance(TheU->Value(TheU->FirstParameter()));
D2 = P.Distance(TheU->Value(TheU->LastParameter()));
if (D1 < Dist || D2 < Dist || Abs(D1 - Dist) < eps || Abs(D2 - Dist) < eps) {
if ( Abs( D1 - D2) < eps) {
if ( TheU.GetType() == GeomAbs_Circle) {
gp_Vec2d Axis = TheU.Circle().XAxis().Direction();
gp_Vec2d D12d = TheBis.DN(TheBis.FirstParameter(),1);
if ( TheU->GetType() == GeomAbs_Circle) {
gp_Vec2d Axis = TheU->Circle().XAxis().Direction();
gp_Vec2d D12d = TheBis->DN(TheBis->FirstParameter(),1);
Standard_Real Ang = Axis.Angle(D12d);
if ( !TheU.Circle().IsDirect()) Ang = -Ang;
UU = ElCLib::InPeriod( Ang, TheU.FirstParameter(),
TheU.FirstParameter() + 2*M_PI);
Dist = TheU.Circle().Radius();
if ( !TheU->Circle().IsDirect()) Ang = -Ang;
UU = ElCLib::InPeriod( Ang, TheU->FirstParameter(),
TheU->FirstParameter() + 2*M_PI);
Dist = TheU->Circle().Radius();
}
else {
#ifdef OCCT_DEBUG
@@ -619,25 +624,25 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
}
else if ( D1 < D2) {
Dist = D1;
UU = TheU.FirstParameter();
UU = TheU->FirstParameter();
}
else {
Dist = D2;
UU = TheU.LastParameter();
UU = TheU->LastParameter();
}
}
const Standard_Real Tol = Precision::Confusion();
Standard_Real VV;
gp_Pnt2d PF = TheV.Value(TheV.FirstParameter());
gp_Pnt2d PL = TheV.Value(TheV.LastParameter());
gp_Pnt2d PF = TheV->Value(TheV->FirstParameter());
gp_Pnt2d PL = TheV->Value(TheV->LastParameter());
if (Abs(Dist - Abs(PF.Y())) < Tol) {
VV = TheV.FirstParameter();
VV = TheV->FirstParameter();
}
else if (Abs(Dist - Abs(PL.Y())) < Tol) {
VV = TheV.LastParameter();
VV = TheV->LastParameter();
}
else {
// test if the curve is at the side `negative Y`.
@@ -649,14 +654,14 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
#ifdef DRAW
if (AffichCurve) {
static Standard_CString aTheV = "TheV" ;
DrawTrSurf::Set(aTheV,TheV.Curve());
DrawTrSurf::Set(aTheV,TheV->Curve());
static Standard_CString aLINF1 = "LINF1" ;
DrawTrSurf::Set(aLINF1,Line);
}
#endif
Geom2dAdaptor_Curve Cu1 = TheV;
Geom2dAdaptor_Curve Cu2( Line);
Handle(Geom2dAdaptor_Curve) Cu1 = Handle(Geom2dAdaptor_Curve)::DownCast(TheV->ShallowCopy());
Handle(Geom2dAdaptor_Curve) Cu2 = new Geom2dAdaptor_Curve(Line);
Standard_Real TolConf = 0.;
@@ -677,8 +682,8 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
IntRes2d_IntersectionSegment Seg = Intersector.Segment(1);
Standard_Real VS1 = Seg.FirstPoint().ParamOnFirst();
Standard_Real VS2 = Seg.LastPoint().ParamOnFirst();
gp_Pnt2d PS1 = TheV.Value(VS1);
gp_Pnt2d PS2 = TheV.Value(VS2);
gp_Pnt2d PS1 = TheV->Value(VS1);
gp_Pnt2d PS2 = TheV->Value(VS2);
Standard_Real Alp = (Dist - PS1.Y())/(PS2.Y() - PS1.Y());
VV = Alp*(VS2 - VS1) + VS1;
}
@@ -688,9 +693,9 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
std::cout << " ---> ValueonFace failed at parameter U = " << U << std::endl;
#endif
if (Abs(Dist - PL.Y()) < Abs(Dist - PF.Y()))
VV = TheV.LastParameter();
VV = TheV->LastParameter();
else
VV = TheV.FirstParameter();
VV = TheV->FirstParameter();
}
}
}

View File

@@ -98,13 +98,13 @@ public:
private:
TopoDS_Face myFace1;
TopoDS_Face myFace2;
Geom2dAdaptor_Curve myU1;
Geom2dAdaptor_Curve myV1;
Geom2dAdaptor_Curve myU2;
Geom2dAdaptor_Curve myV2;
Handle(Geom2dAdaptor_Curve) myU1;
Handle(Geom2dAdaptor_Curve) myV1;
Handle(Geom2dAdaptor_Curve) myU2;
Handle(Geom2dAdaptor_Curve) myV2;
Standard_Boolean myIsoU1;
Standard_Boolean myIsoU2;
Geom2dAdaptor_Curve myBis;
Handle(Geom2dAdaptor_Curve) myBis;
Standard_Integer myKPart;
GeomAbs_Shape myCont;
};

View File

@@ -780,8 +780,8 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
{
Standard_Real U1 = BRep_Tool::Parameter(V1,Edge1);
Standard_Real U2 = BRep_Tool::Parameter(V2,Edge2);
BRepAdaptor_Curve Curve1(Edge1);
BRepAdaptor_Curve Curve2(Edge2);
Handle(BRepAdaptor_Curve) Curve1 = new BRepAdaptor_Curve(Edge1);
Handle(BRepAdaptor_Curve) Curve2 = new BRepAdaptor_Curve(Edge2);
Standard_Real Eps = BRep_Tool::Tolerance(V2) +
BRep_Tool::Tolerance(V1);
cont_jj = BRepLProp::Continuity(Curve1,Curve2,U1,U2, Eps, TolAngular);

View File

@@ -104,7 +104,7 @@ static Standard_Integer NbBISSEC = 0;
// Modified by Sergey KHROMOV - Thu Nov 16 17:24:39 2000 Begin
static void QuasiFleche(const Adaptor3d_Curve& C,
static void QuasiFleche(const Handle(Adaptor3d_Curve)& C,
const Standard_Real Deflection2,
const Standard_Real Udeb,
const gp_Pnt& Pdeb,
@@ -119,7 +119,7 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters,
TColgp_SequenceOfPnt& Points,
const Adaptor3d_Curve& C,
const Handle(Adaptor3d_Curve)& C,
const Standard_Real Deflection,
const Standard_Real U1,
const Standard_Real U2,
@@ -517,7 +517,7 @@ void BRepFill_OffsetWire::Perform (const Standard_Real Offset,
Standard_Real f, l;
Handle(Geom_Curve) G3d = BRep_Tool::Curve(TopoDS::Edge(anE),f,l);
GeomAdaptor_Curve AC(G3d,f,l);
Handle(GeomAdaptor_Curve) AC = new GeomAdaptor_Curve(G3d,f,l);
PerformCurve(Parameters, Points, AC, aDefl, f,
l, Precision::Confusion(), 2);
@@ -2600,7 +2600,7 @@ static void CheckBadEdges(const TopoDS_Face& Spine, const Standard_Real Offset,
static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters,
TColgp_SequenceOfPnt& Points,
const Adaptor3d_Curve& C,
const Handle(Adaptor3d_Curve)& C,
const Standard_Real Deflection,
const Standard_Real U1,
const Standard_Real U2,
@@ -2612,11 +2612,11 @@ static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters,
gp_Pnt Pdeb, Pfin;
gp_Vec Ddeb,Dfin;
C.D1(UU1,Pdeb,Ddeb);
C->D1(UU1,Pdeb,Ddeb);
Parameters.Append(UU1);
Points.Append(Pdeb);
C.D1(UU2,Pfin,Dfin);
C->D1(UU2,Pfin,Dfin);
const Standard_Real aDelta = UU2 - UU1;
const Standard_Real aDist = Pdeb.Distance(Pfin);
@@ -2641,7 +2641,7 @@ static Standard_Boolean PerformCurve (TColStd_SequenceOfReal& Parameters,
//purpose :
//=======================================================================
static void QuasiFleche(const Adaptor3d_Curve& C,
static void QuasiFleche(const Handle(Adaptor3d_Curve)& C,
const Standard_Real Deflection2,
const Standard_Real Udeb,
@@ -2661,7 +2661,7 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
gp_Vec Vdelta;
if (Nbmin > 2) {
Udelta /=(Nbmin-1);
C.D1(Udeb+Udelta,Pdelta,Vdelta);
C->D1(Udeb+Udelta,Pdelta,Vdelta);
}
else {
Pdelta = Pfin;
@@ -2689,7 +2689,7 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
}
if (!flecheok) {
gp_Pnt Pmid((Pdeb.XYZ()+Pdelta.XYZ())/2.);
gp_Pnt Pverif(C.Value(Udeb+Udelta/2.));
gp_Pnt Pverif(C->Value(Udeb+Udelta/2.));
theFleche = Pmid.SquareDistance(Pverif);
}

View File

@@ -424,8 +424,8 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
Standard_Real U1 = BRep_Tool::Parameter(V1,Edge1);
Standard_Real U2 = BRep_Tool::Parameter(V2,Edge2);
BRepAdaptor_Curve Curve1(Edge1);
BRepAdaptor_Curve Curve2(Edge2);
Handle(BRepAdaptor_Curve) Curve1 = new BRepAdaptor_Curve(Edge1);
Handle(BRepAdaptor_Curve) Curve2 = new BRepAdaptor_Curve(Edge2);
Standard_Real Eps = BRep_Tool::Tolerance(V2) +
BRep_Tool::Tolerance(V1);
GeomAbs_Shape cont;

View File

@@ -1454,7 +1454,7 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
Iso->D0((Iso->FirstParameter()+Iso->LastParameter())/2, P);
// if (P.Distance(BT.Pnt(V)) < tol) {
if (P.Distance(BRep_Tool::Pnt(V)) < tol) {
GeomAdaptor_Curve AC(Iso);
Handle(GeomAdaptor_Curve) AC = new GeomAdaptor_Curve(Iso);
sing = GCPnts_AbscissaPoint::Length(AC, tol/4) < tol;
}
}
@@ -1616,7 +1616,7 @@ static void UpdateEdge(TopoDS_Edge& E,
Standard_Real tol = BRep_Tool::Tolerance(Vf);
Iso->D0((Iso->FirstParameter()+Iso->LastParameter())/2, Pmid);
if (Pmid.Distance(BRep_Tool::Pnt(Vf)) < tol) {
GeomAdaptor_Curve AC(Iso);
Handle(GeomAdaptor_Curve) AC = new GeomAdaptor_Curve(Iso);
sing = GCPnts_AbscissaPoint::Length(AC, tol/4) < tol;
}
}
@@ -1759,7 +1759,7 @@ static Standard_Boolean IsDegen(const Handle(Geom_Surface)& S,
for (ii=1, dt = (Umax-Umin)/(Nb+1); B && (ii<=Nb); ii++) {
t = Umin + ii*dt;
Iso = S->UIso(t);
GeomAdaptor_Curve AC(Iso);
Handle(GeomAdaptor_Curve) AC = new GeomAdaptor_Curve(Iso);
l = GC.Length(AC, Tol/4);
B = (l <= Tol);
}
@@ -1777,7 +1777,7 @@ static Standard_Boolean IsDegen(const Handle(Geom_Surface)& S,
for (ii=1, dt = (Vmax-Vmin)/(Nb+1); B && (ii<=Nb); ii++) {
t = Vmin + ii*dt;
Iso = S->VIso(t);
GeomAdaptor_Curve AC(Iso);
Handle(GeomAdaptor_Curve) AC = new GeomAdaptor_Curve(Iso);
l = GC.Length(AC, Tol/4);
B = (l <= Tol);
}

View File

@@ -83,6 +83,7 @@ static void SimpleExpression (const Bisector_Bisec& B,
BRepFill_TrimEdgeTool::BRepFill_TrimEdgeTool()
{
myBis = new Geom2dAdaptor_Curve();
}
@@ -134,7 +135,7 @@ myOffset(Offset),
// return the simple expression of the bissectrice
Handle(Geom2d_Curve) Bis;
SimpleExpression(myBisec, Bis);
myBis = Geom2dAdaptor_Curve(Bis);
myBis = new Geom2dAdaptor_Curve(Bis);
#ifdef DRAW
if ( Affich) {
char* myBisname = "myBis";
@@ -172,16 +173,16 @@ static void Bubble(TColgp_SequenceOfPnt& Seq)
//purpose :
//=======================================================================
static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
const Geom2dAdaptor_Curve& AC,
static void EvalParameters(const Handle(Geom2dAdaptor_Curve)& Bis,
const Handle(Geom2dAdaptor_Curve)& AC,
TColgp_SequenceOfPnt& Params)
{
Geom2dInt_GInter Intersector;
Standard_Real Tol = Precision::Confusion();
// Standard_Real TolC = 1.e-9;
Geom2dAdaptor_Curve CBis(Bis);
Geom2dAdaptor_Curve CAC (AC);
Handle(Geom2dAdaptor_Curve) CBis = Handle(Geom2dAdaptor_Curve)::DownCast(Bis->ShallowCopy());
Handle(Geom2dAdaptor_Curve) CAC = Handle(Geom2dAdaptor_Curve)::DownCast(AC->ShallowCopy());
//Intersector = Geom2dInt_GInter(CBis, CAC, TolC, Tol);
Intersector = Geom2dInt_GInter(CAC, CBis, Tol, Tol);
@@ -214,8 +215,8 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
Seg = Intersector.Segment(i);
U1 = Seg.FirstPoint().ParamOnSecond();
Standard_Real Ulast = Seg.LastPoint().ParamOnSecond();
if ( Abs(U1 - CBis.FirstParameter()) <= Tol &&
Abs(Ulast - CBis.LastParameter()) <= Tol ) {
if ( Abs(U1 - CBis->FirstParameter()) <= Tol &&
Abs(Ulast - CBis->LastParameter()) <= Tol ) {
P = gp_Pnt(U1,Seg.FirstPoint().ParamOnFirst(),0.);
Params.Append(P);
P = gp_Pnt(Ulast,Seg.LastPoint().ParamOnFirst(),0.);
@@ -237,16 +238,16 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
Bubble( Params);
}
static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
const Geom2dAdaptor_Curve& AC,
static void EvalParametersBis(const Handle(Geom2dAdaptor_Curve)& Bis,
const Handle(Geom2dAdaptor_Curve)& AC,
TColgp_SequenceOfPnt& Params,
const Standard_Real Tol)
{
Geom2dInt_GInter Intersector;
Standard_Real TolC = Tol;
Geom2dAdaptor_Curve CBis(Bis);
Geom2dAdaptor_Curve CAC (AC);
Handle(Geom2dAdaptor_Curve) CBis = Handle(Geom2dAdaptor_Curve)::DownCast(Bis->ShallowCopy());
Handle(Geom2dAdaptor_Curve) CAC = Handle(Geom2dAdaptor_Curve)::DownCast(AC->ShallowCopy());
Intersector = Geom2dInt_GInter(CAC, CBis, TolC, Tol);
@@ -278,8 +279,8 @@ static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
Seg = Intersector.Segment(i);
U1 = Seg.FirstPoint().ParamOnSecond();
Standard_Real Ulast = Seg.LastPoint().ParamOnSecond();
if ( Abs(U1 - CBis.FirstParameter()) <= Tol &&
Abs(Ulast - CBis.LastParameter()) <= Tol ) {
if ( Abs(U1 - CBis->FirstParameter()) <= Tol &&
Abs(Ulast - CBis->LastParameter()) <= Tol ) {
P = gp_Pnt(U1,Seg.FirstPoint().ParamOnFirst(),0.);
Params.Append(P);
P = gp_Pnt(Ulast,Seg.LastPoint().ParamOnFirst(),0.);
@@ -326,27 +327,27 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
Handle(Geom2d_Curve) C1;
BRep_Tool::CurveOnSurface(Edge1,C1,Surf,L,f,l);
Geom2dAdaptor_Curve AC1(C1,f,l);
Handle(Geom2dAdaptor_Curve) AC1 = new Geom2dAdaptor_Curve(C1,f,l);
Handle(Geom2d_Curve) C2;
BRep_Tool::CurveOnSurface(Edge2,C2,Surf,L,f,l);
Geom2dAdaptor_Curve AC2(C2,f,l);
Handle(Geom2dAdaptor_Curve) AC2 = new Geom2dAdaptor_Curve(C2,f,l);
#ifdef DRAW
if ( AffichInt) {
f = AC1.FirstParameter();
l = AC1.LastParameter();
f = AC1->FirstParameter();
l = AC1->LastParameter();
char name[32];
sprintf(name,"C1_%d", ++intind);
DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(C1,f,l));
f = AC2.FirstParameter();
l = AC2.LastParameter();
f = AC2->FirstParameter();
l = AC2->LastParameter();
sprintf(name,"C2_%d", intind);
DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(C2,f,l));
f = myBis.FirstParameter();
l = myBis.LastParameter();
f = myBis->FirstParameter();
l = myBis->LastParameter();
sprintf(name,"BIS%d", intind);
DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(myBis.Curve(),f,l));
DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(myBis->Curve(),f,l));
sprintf(name,"E1_%d", intind);
DBRep::Set(name, Edge1);
sprintf(name,"E2_%d", intind);
@@ -368,8 +369,8 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
Standard_Real TolInit= 1.e-9;
Standard_Integer nn = 7;
if((AC1.GetType() != GeomAbs_Circle && AC1.GetType() != GeomAbs_Line) ||
(AC2.GetType() != GeomAbs_Circle && AC2.GetType() != GeomAbs_Line)) {
if((AC1->GetType() != GeomAbs_Circle && AC1->GetType() != GeomAbs_Line) ||
(AC2->GetType() != GeomAbs_Circle && AC2->GetType() != GeomAbs_Line)) {
TolInit = 1.e-8;
nn = 6;
@@ -379,7 +380,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
{
//Check, may be there are no intersections at all
// for case myBis == Line
if(myBis.GetType() == GeomAbs_Line)
if(myBis->GetType() == GeomAbs_Line)
{
Standard_Real dmax = TolInit;
Standard_Integer n = 0;
@@ -390,36 +391,36 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
}
dmax *= dmax;
//
gp_Lin2d anL = myBis.Line();
gp_Lin2d anL = myBis->Line();
Standard_Boolean isFar1 = Standard_True;
Standard_Boolean isFar2 = Standard_True;
gp_Pnt2d aP;
//
Standard_Real d = RealLast();
AC1.D0(AC1.FirstParameter(), aP);
AC1->D0(AC1->FirstParameter(), aP);
Standard_Real par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
if(par >= myBis->FirstParameter() && par <= myBis->LastParameter())
{
d = anL.SquareDistance(aP);
}
AC1.D0(AC1.LastParameter(), aP);
AC1->D0(AC1->LastParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
if(par >= myBis->FirstParameter() && par <= myBis->LastParameter())
{
d = Min(anL.SquareDistance(aP), d);
}
isFar1 = d > dmax;
//
d = RealLast();
AC2.D0(AC2.FirstParameter(), aP);
AC2->D0(AC2->FirstParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
if(par >= myBis->FirstParameter() && par <= myBis->LastParameter())
{
d = anL.SquareDistance(aP);
}
AC2.D0(AC2.LastParameter(), aP);
AC2->D0(AC2->LastParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
if(par >= myBis->FirstParameter() && par <= myBis->LastParameter())
{
d = Min(anL.SquareDistance(aP), d);
}
@@ -463,10 +464,10 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
//std::cout << "Params.Length() == 0 && Points2.Length() == 1" << std::endl;
Standard_Real dmin, dmax = 0.25*myOffset*myOffset;
Standard_Real tBis = Points2(1).X();
gp_Pnt2d PBis = myBis.Value(tBis);
gp_Pnt2d PBis = myBis->Value(tBis);
Standard_Real t = AC1.FirstParameter();
gp_Pnt2d PC = AC1.Value(t);
Standard_Real t = AC1->FirstParameter();
gp_Pnt2d PC = AC1->Value(t);
dmin = PC.SquareDistance(PBis);
gp_Pnt P(tBis, t, 0.);
if(dmin < dmax)
@@ -474,8 +475,8 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
Params.Append(P);
}
t = AC1.LastParameter();
PC = AC1.Value(t);
t = AC1->LastParameter();
PC = AC1->Value(t);
Standard_Real dmin1 = PC.SquareDistance(PBis);
if(dmin > dmin1 && dmin1 < dmax ) {
P.SetY(t);
@@ -490,10 +491,10 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
//std::cout << "Params.Length() == 1 && Points2.Length() == 0" << std::endl;
Standard_Real dmin, dmax = 0.25*myOffset*myOffset;
Standard_Real tBis = Params(1).X();
gp_Pnt2d PBis = myBis.Value(tBis);
gp_Pnt2d PBis = myBis->Value(tBis);
Standard_Real t = AC2.FirstParameter();
gp_Pnt2d PC = AC2.Value(t);
Standard_Real t = AC2->FirstParameter();
gp_Pnt2d PC = AC2->Value(t);
dmin = PC.SquareDistance(PBis);
gp_Pnt P(tBis, t, 0.);
if(dmin < dmax)
@@ -501,8 +502,8 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
Points2.Append(P);
}
t = AC2.LastParameter();
PC = AC2.Value(t);
t = AC2->LastParameter();
PC = AC2->Value(t);
Standard_Real dmin1 = PC.SquareDistance(PBis);
if(dmin > dmin1 && dmin1 < dmax ) {
P.SetY(t);
@@ -596,11 +597,11 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
{
Standard_Real Delta = 2*M_PI - IC1.LastParameter() + IC1.FirstParameter();
if (ToExtendFirstPar && ToExtendLastPar)
init_fpar = AC1.FirstParameter() + Delta/2;
init_fpar = AC1->FirstParameter() + Delta/2;
else if (ToExtendFirstPar)
init_fpar = AC1.FirstParameter() + Delta;
init_fpar = AC1->FirstParameter() + Delta;
else if (ToExtendLastPar)
init_fpar = AC1.FirstParameter();
init_fpar = AC1->FirstParameter();
init_lpar = init_fpar + IC1.LastParameter() - IC1.FirstParameter();
}
}
@@ -672,8 +673,8 @@ void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start,
Geom2dAdaptor_Curve AC1(C1,f,l);
if (Start) PBis = myBis.Value(myBis.FirstParameter());
else PBis = myBis.Value(myBis.LastParameter ());
if (Start) PBis = myBis->Value(myBis->FirstParameter());
else PBis = myBis->Value(myBis->LastParameter ());
// Test if the end of the bissectrice is in the set of intersection points.
if (!Params.IsEmpty()) {
@@ -725,11 +726,11 @@ void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start,
Projector1.LowerDistanceParameter(),
Projector2.LowerDistanceParameter());
if (Start) {
PInt.SetX (myBis.FirstParameter());
PInt.SetX (myBis->FirstParameter());
Params.Prepend(PInt);
}
else {
PInt.SetX (myBis.LastParameter());
PInt.SetX (myBis->LastParameter());
Params.Append(PInt);
}
}

View File

@@ -72,7 +72,7 @@ private:
Handle(Geom2d_Curve) myC2;
Standard_Real myOffset;
Bisector_Bisec myBisec;
Geom2dAdaptor_Curve myBis;
Handle(Geom2dAdaptor_Curve) myBis;
};

View File

@@ -2262,12 +2262,12 @@ static Standard_Real ComputeAveragePlaneAndMaxDeviation(const TopoDS_Shape& aWir
for (TopoDS_Iterator iter (aWire); iter.More(); iter.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge( iter.Value() );
BRepAdaptor_Curve aCurve(anEdge);
Handle(BRepAdaptor_Curve) aCurve = new BRepAdaptor_Curve(anEdge);
GCPnts_UniformAbscissa Distribution( aCurve, N+1 );
for (i = 1; i <= N; i++)
{
Standard_Real par = Distribution.Parameter(i);
Pnts( ind++ ) = aCurve.Value(par);
Pnts( ind++ ) = aCurve->Value(par);
}
}

View File

@@ -209,8 +209,8 @@ static void EvalParameters(const TopoDS_Edge& Edge,
// projection of 3d curves in the plane xOy
Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(CT,Plane);
Geom2dAdaptor_Curve AC(C2d);
Geom2dAdaptor_Curve ABis(Bis);
Handle(Geom2dAdaptor_Curve) AC = new Geom2dAdaptor_Curve(C2d);
Handle(Geom2dAdaptor_Curve) ABis = new Geom2dAdaptor_Curve(Bis);
Intersector = Geom2dInt_GInter(ABis, AC, TolC, Tol);
@@ -226,7 +226,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
// don't do it rightaway from the beginning in order not to get
// extra solutions those would cause *Exception*: incoherent intersection
GeomAbs_CurveType CType = AC.GetType(), BisType = ABis.GetType();
GeomAbs_CurveType CType = AC->GetType(), BisType = ABis->GetType();
Standard_Boolean canElongateC = !(CType == GeomAbs_BezierCurve ||
CType == GeomAbs_BSplineCurve ||
CType == GeomAbs_OffsetCurve ||
@@ -241,11 +241,11 @@ static void EvalParameters(const TopoDS_Edge& Edge,
if (canElongateC) {
TC2d->SetTrim(TC2d->FirstParameter() - Tol, TC2d->LastParameter() + Tol);
AC.Load(TC2d);
AC->Load(TC2d);
}
if (canElongateBis) {
TBis->SetTrim(TBis->FirstParameter() - Tol, TBis->LastParameter() + Tol);
ABis.Load(TBis);
ABis->Load(TBis);
}
Intersector = Geom2dInt_GInter(ABis, AC, TolC, Tol*10);

View File

@@ -75,7 +75,7 @@ void BRepGProp::LinearProperties(const TopoDS_Shape& S, GProp_GProps& SProps, c
P.Transform(S.Location());
SProps = GProp_GProps(P);
BRepAdaptor_Curve BAC;
Handle(BRepAdaptor_Curve) BAC = new BRepAdaptor_Curve();
TopTools_MapOfShape anEMap;
TopExp_Explorer ex;
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
@@ -102,7 +102,7 @@ void BRepGProp::LinearProperties(const TopoDS_Shape& S, GProp_GProps& SProps, c
{
if (IsGeom)
{
BAC.Initialize(aE);
BAC->Initialize(aE);
BRepGProp_Cinert CG(BAC, P);
SProps.Add(CG);
}

View File

@@ -27,7 +27,7 @@ void BRepGProp_Cinert::SetLocation(const gp_Pnt& CLocation)
loc = CLocation;
}
void BRepGProp_Cinert::Perform (const BRepAdaptor_Curve& C)
void BRepGProp_Cinert::Perform (const Handle(BRepAdaptor_Curve)& C)
{
Standard_Real Ix, Iy, Iz, Ixx, Iyy, Izz, Ixy, Ixz, Iyz;
@@ -148,7 +148,7 @@ void BRepGProp_Cinert::Perform (const BRepAdaptor_Curve& C)
}
BRepGProp_Cinert::BRepGProp_Cinert (const BRepAdaptor_Curve& C,
BRepGProp_Cinert::BRepGProp_Cinert (const Handle(BRepAdaptor_Curve)& C,
const gp_Pnt& CLocation)
{
SetLocation(CLocation);

View File

@@ -41,11 +41,11 @@ public:
Standard_EXPORT BRepGProp_Cinert();
Standard_EXPORT BRepGProp_Cinert(const BRepAdaptor_Curve& C, const gp_Pnt& CLocation);
Standard_EXPORT BRepGProp_Cinert(const Handle(BRepAdaptor_Curve)& C, const gp_Pnt& CLocation);
Standard_EXPORT void SetLocation (const gp_Pnt& CLocation);
Standard_EXPORT void Perform (const BRepAdaptor_Curve& C);
Standard_EXPORT void Perform (const Handle(BRepAdaptor_Curve)& C);

View File

@@ -22,19 +22,19 @@
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
Standard_Real BRepGProp_EdgeTool::FirstParameter(const BRepAdaptor_Curve& C)
Standard_Real BRepGProp_EdgeTool::FirstParameter(const Handle(BRepAdaptor_Curve)& C)
{
return C.FirstParameter();
return C->FirstParameter();
}
Standard_Real BRepGProp_EdgeTool::LastParameter(const BRepAdaptor_Curve& C)
Standard_Real BRepGProp_EdgeTool::LastParameter(const Handle(BRepAdaptor_Curve)& C)
{
return C.LastParameter();
return C->LastParameter();
}
Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve& BAC)
Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const Handle(BRepAdaptor_Curve)& BAC)
{
switch (BAC.GetType()) {
switch (BAC->GetType()) {
case GeomAbs_Line :
return 2;
@@ -44,8 +44,8 @@ Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
case GeomAbs_BezierCurve :
{
const GeomAdaptor_Curve& GAC = BAC.Curve();
const Handle(Geom_Curve)& GC = GAC.Curve();
const Handle(GeomAdaptor_Curve)& GAC = BAC->Curve();
const Handle(Geom_Curve)& GC = GAC->Curve();
Handle(Geom_BezierCurve) GBZC (Handle(Geom_BezierCurve)::DownCast (GC));
Standard_Integer n = 2*(GBZC->NbPoles()) - 1;
return n;
@@ -53,8 +53,8 @@ Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
break;
case GeomAbs_BSplineCurve :
{
const GeomAdaptor_Curve& GAC = BAC.Curve();
const Handle(Geom_Curve)& GC = GAC.Curve();
const Handle(GeomAdaptor_Curve)& GAC = BAC->Curve();
const Handle(Geom_Curve)& GC = GAC->Curve();
Handle(Geom_BSplineCurve) GBSC (Handle(Geom_BSplineCurve)::DownCast (GC));
Standard_Integer n = 2*(GBSC->NbPoles()) - 1;
return n;
@@ -66,29 +66,25 @@ Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
}
}
gp_Pnt BRepGProp_EdgeTool::Value(const BRepAdaptor_Curve& C, const Standard_Real U)
gp_Pnt BRepGProp_EdgeTool::Value(const Handle(BRepAdaptor_Curve)& C, const Standard_Real U)
{
return C.Value(U);
return C->Value(U);
}
void BRepGProp_EdgeTool::D1(const BRepAdaptor_Curve& C,
void BRepGProp_EdgeTool::D1(const Handle(BRepAdaptor_Curve)& C,
const Standard_Real U, gp_Pnt& P, gp_Vec& V1)
{
C.D1(U,P,V1);
C->D1(U,P,V1);
}
// modified by NIZHNY-MKK Thu Jun 9 12:15:15 2005.BEGIN
Standard_Integer BRepGProp_EdgeTool::NbIntervals(const BRepAdaptor_Curve& C,const GeomAbs_Shape S)
Standard_Integer BRepGProp_EdgeTool::NbIntervals(const Handle(BRepAdaptor_Curve)& C,const GeomAbs_Shape S)
{
BRepAdaptor_Curve* pC = (BRepAdaptor_Curve*) &C; // at the moment actually NbIntervals() does not modify the
// object "C". So it is safe to do such a cast.
return pC->NbIntervals(S);
return C->NbIntervals(S);
}
void BRepGProp_EdgeTool::Intervals(const BRepAdaptor_Curve& C,TColStd_Array1OfReal& T,const GeomAbs_Shape S)
void BRepGProp_EdgeTool::Intervals(const Handle(BRepAdaptor_Curve)& C,TColStd_Array1OfReal& T,const GeomAbs_Shape S)
{
BRepAdaptor_Curve* pC = (BRepAdaptor_Curve*) &C; // at the moment actually Intervals() does not modify the
// object "C". So it is safe to do such a cast.
pC->Intervals(T, S);
C->Intervals(T, S);
}
// modified by NIZHNY-MKK Thu Jun 9 12:15:18 2005.END

View File

@@ -41,13 +41,13 @@ public:
//! Returns the parametric value of the start point of
//! the curve. The curve is oriented from the start point
//! to the end point.
Standard_EXPORT static Standard_Real FirstParameter (const BRepAdaptor_Curve& C);
Standard_EXPORT static Standard_Real FirstParameter (const Handle(BRepAdaptor_Curve)& C);
//! Returns the parametric value of the end point of
//! the curve. The curve is oriented from the start point
//! to the end point.
Standard_EXPORT static Standard_Real LastParameter (const BRepAdaptor_Curve& C);
Standard_EXPORT static Standard_Real LastParameter (const Handle(BRepAdaptor_Curve)& C);
//! Returns the number of Gauss points required to do
@@ -55,26 +55,26 @@ public:
//! Gauss method. For a polynomial curve of degree n
//! the maxima of accuracy is obtained with an order
//! of integration equal to 2*n-1.
Standard_EXPORT static Standard_Integer IntegrationOrder (const BRepAdaptor_Curve& C);
Standard_EXPORT static Standard_Integer IntegrationOrder (const Handle(BRepAdaptor_Curve)& C);
//! Returns the point of parameter U on the loaded curve.
Standard_EXPORT static gp_Pnt Value (const BRepAdaptor_Curve& C, const Standard_Real U);
Standard_EXPORT static gp_Pnt Value (const Handle(BRepAdaptor_Curve)& C, const Standard_Real U);
//! Returns the point of parameter U and the first derivative
//! at this point.
Standard_EXPORT static void D1 (const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1);
Standard_EXPORT static void D1 (const Handle(BRepAdaptor_Curve)& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1);
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT static Standard_Integer NbIntervals (const BRepAdaptor_Curve& C, const GeomAbs_Shape S);
Standard_EXPORT static Standard_Integer NbIntervals (const Handle(BRepAdaptor_Curve)& C, const GeomAbs_Shape S);
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT static void Intervals (const BRepAdaptor_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
Standard_EXPORT static void Intervals (const Handle(BRepAdaptor_Curve)& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);

View File

@@ -42,7 +42,7 @@ static const Standard_Real Epsilon1 = Epsilon(1.);
Standard_Integer BRepGProp_Face::UIntegrationOrder() const {
Standard_Integer Nu;
switch (mySurface.GetType())
switch (mySurface->GetType())
{
case GeomAbs_Plane :
@@ -51,14 +51,14 @@ Standard_Integer BRepGProp_Face::UIntegrationOrder() const {
case GeomAbs_BezierSurface :
{
Nu = (*((Handle(Geom_BezierSurface)*)&((mySurface.Surface()).Surface())))->UDegree()+1;
Nu = (*((Handle(Geom_BezierSurface)*)&((mySurface->Surface())->Surface())))->UDegree()+1;
Nu = Max(4,Nu);
}
break;
case GeomAbs_BSplineSurface :
{
Standard_Integer a = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UDegree()+1;
Standard_Integer b = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->NbUKnots()-1;
Standard_Integer a = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->UDegree()+1;
Standard_Integer b = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->NbUKnots()-1;
Nu = Max(4,a*b);
}
break;
@@ -78,7 +78,7 @@ Standard_Integer BRepGProp_Face::UIntegrationOrder() const {
Standard_Integer BRepGProp_Face::VIntegrationOrder() const
{
Standard_Integer Nv;
switch (mySurface.GetType()) {
switch (mySurface->GetType()) {
case GeomAbs_Plane :
Nv = 4;
@@ -86,15 +86,15 @@ Standard_Integer BRepGProp_Face::VIntegrationOrder() const
case GeomAbs_BezierSurface :
{
Nv = (*((Handle(Geom_BezierSurface)*)&((mySurface.Surface()).Surface())))->VDegree()+1;
Nv = (*((Handle(Geom_BezierSurface)*)&((mySurface->Surface())->Surface())))->VDegree()+1;
Nv = Max(4,Nv);
}
break;
case GeomAbs_BSplineSurface :
{
Standard_Integer a = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VDegree()+1;
Standard_Integer b = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->NbVKnots()-1;
Standard_Integer a = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->VDegree()+1;
Standard_Integer b = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->NbVKnots()-1;
Nv = Max(4,a*b);
}
break;
@@ -115,7 +115,7 @@ Standard_Integer BRepGProp_Face::IntegrationOrder() const
{
Standard_Integer N;
switch (myCurve.GetType()) {
switch (myCurve->GetType()) {
case GeomAbs_Line :
N = 2;
@@ -133,14 +133,14 @@ Standard_Integer BRepGProp_Face::IntegrationOrder() const
case GeomAbs_BezierCurve :
{
N = (*((Handle(Geom2d_BezierCurve)*)&(myCurve.Curve())))->Degree() + 1;
N = (*((Handle(Geom2d_BezierCurve)*)&(myCurve->Curve())))->Degree() + 1;
}
break;
case GeomAbs_BSplineCurve :
{
Standard_Integer a = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve.Curve())))->Degree() + 1;
Standard_Integer b = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve.Curve())))->NbKnots() - 1;
Standard_Integer a = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve->Curve())))->Degree() + 1;
Standard_Integer b = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve->Curve())))->NbKnots() - 1;
N = a * b;
}
break;
@@ -163,10 +163,10 @@ void BRepGProp_Face::Bounds(Standard_Real& U1,
Standard_Real& V1,
Standard_Real& V2)const
{
U1 = mySurface.FirstUParameter();
U2 = mySurface.LastUParameter();
V1 = mySurface.FirstVParameter();
V2 = mySurface.LastVParameter();
U1 = mySurface->FirstUParameter();
U2 = mySurface->LastUParameter();
V1 = mySurface->FirstVParameter();
V2 = mySurface->LastVParameter();
}
//=======================================================================
@@ -177,7 +177,7 @@ void BRepGProp_Face::Bounds(Standard_Real& U1,
bool BRepGProp_Face::Load(const TopoDS_Edge& E)
{
Standard_Real a,b;
Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(E, mySurface.Face(), a,b);
Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(E, mySurface->Face(), a,b);
if (C.IsNull())
{
return false;
@@ -188,7 +188,7 @@ bool BRepGProp_Face::Load(const TopoDS_Edge& E)
b = C->ReversedParameter(x);
C = C->Reversed();
}
myCurve.Load(C,a,b);
myCurve->Load(C,a,b);
return true;
}
@@ -200,8 +200,8 @@ bool BRepGProp_Face::Load(const TopoDS_Edge& E)
void BRepGProp_Face::Load(const TopoDS_Face& F)
{
TopoDS_Shape aLocalShape = F.Oriented(TopAbs_FORWARD);
mySurface.Initialize(TopoDS::Face(aLocalShape));
// mySurface.Initialize(TopoDS::Face(F.Oriented(TopAbs_FORWARD)));
mySurface->Initialize(TopoDS::Face(aLocalShape));
// mySurface->Initialize(TopoDS::Face(F.Oriented(TopAbs_FORWARD)));
mySReverse = (F.Orientation() == TopAbs_REVERSED);
}
@@ -216,7 +216,7 @@ void BRepGProp_Face::Normal (const Standard_Real U,
gp_Vec &VNor) const
{
gp_Vec D1U,D1V;
mySurface.D1(U,V,P,D1U,D1V);
mySurface->D1(U,V,P,D1U,D1V);
VNor = D1U.Crossed(D1V);
if (mySReverse) VNor.Reverse();
@@ -241,7 +241,7 @@ static inline Standard_Real LCoeff(const Standard_Real Eps){
Standard_Integer BRepGProp_Face::SIntOrder(const Standard_Real Eps) const
{
Standard_Integer Nv, Nu;
switch (mySurface.GetType()) {
switch (mySurface->GetType()) {
case GeomAbs_Plane:
Nu = 1; Nv = 1; break;
case GeomAbs_Cylinder:
@@ -253,12 +253,12 @@ Standard_Integer BRepGProp_Face::SIntOrder(const Standard_Real Eps) const
case GeomAbs_Torus:
Nu = 2; Nv = 2; break;
case GeomAbs_BezierSurface:
Nv = (*((Handle(Geom_BezierSurface)*)&((mySurface.Surface()).Surface())))->VDegree();
Nu = (*((Handle(Geom_BezierSurface)*)&((mySurface.Surface()).Surface())))->UDegree();
Nv = (*((Handle(Geom_BezierSurface)*)&((mySurface->Surface())->Surface())))->VDegree();
Nu = (*((Handle(Geom_BezierSurface)*)&((mySurface->Surface())->Surface())))->UDegree();
break;
case GeomAbs_BSplineSurface:
Nv = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VDegree();
Nu = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UDegree();
Nv = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->VDegree();
Nu = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->UDegree();
break;
default:
Nu = 2; Nv = 2; break;
@@ -274,7 +274,7 @@ Standard_Integer BRepGProp_Face::SIntOrder(const Standard_Real Eps) const
Standard_Integer BRepGProp_Face::SUIntSubs() const
{
Standard_Integer N;
switch (mySurface.GetType()) {
switch (mySurface->GetType()) {
case GeomAbs_Plane:
N = 2; break;
case GeomAbs_Cylinder:
@@ -288,7 +288,7 @@ Standard_Integer BRepGProp_Face::SUIntSubs() const
case GeomAbs_BezierSurface:
N = 2; break;
case GeomAbs_BSplineSurface:
N = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->NbUKnots(); break;
N = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->NbUKnots(); break;
default:
N = 2; break;
}
@@ -303,7 +303,7 @@ Standard_Integer BRepGProp_Face::SUIntSubs() const
Standard_Integer BRepGProp_Face::SVIntSubs() const
{
Standard_Integer N;
switch (mySurface.GetType()) {
switch (mySurface->GetType()) {
case GeomAbs_Plane:
N = 2; break;
case GeomAbs_Cylinder:
@@ -317,7 +317,7 @@ Standard_Integer BRepGProp_Face::SVIntSubs() const
case GeomAbs_BezierSurface:
N = 2; break;
case GeomAbs_BSplineSurface:
N = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->NbVKnots();
N = (*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->NbVKnots();
break;
default:
N = 2; break;
@@ -332,9 +332,9 @@ Standard_Integer BRepGProp_Face::SVIntSubs() const
void BRepGProp_Face::UKnots(TColStd_Array1OfReal& Knots) const
{
switch (mySurface.GetType()) {
switch (mySurface->GetType()) {
case GeomAbs_Plane:
Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter();
Knots(1) = mySurface->FirstUParameter(); Knots(2) = mySurface->LastUParameter();
break;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
@@ -343,10 +343,10 @@ void BRepGProp_Face::UKnots(TColStd_Array1OfReal& Knots) const
Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(4) = M_PI*6.0/3.0;
break;
case GeomAbs_BSplineSurface:
(*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UKnots(Knots);
(*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->UKnots(Knots);
break;
default:
Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter();
Knots(1) = mySurface->FirstUParameter(); Knots(2) = mySurface->LastUParameter();
break;
}
}
@@ -358,11 +358,11 @@ void BRepGProp_Face::UKnots(TColStd_Array1OfReal& Knots) const
void BRepGProp_Face::VKnots(TColStd_Array1OfReal& Knots) const
{
switch (mySurface.GetType()) {
switch (mySurface->GetType()) {
case GeomAbs_Plane:
case GeomAbs_Cylinder:
case GeomAbs_Cone:
Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter();
Knots(1) = mySurface->FirstUParameter(); Knots(2) = mySurface->LastUParameter();
break;
case GeomAbs_Sphere:
Knots(1) = -M_PI/2.0; Knots(2) = 0.0; Knots(3) = +M_PI/2.0;
@@ -371,10 +371,10 @@ void BRepGProp_Face::VKnots(TColStd_Array1OfReal& Knots) const
Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(4) = M_PI*6.0/3.0;
break;
case GeomAbs_BSplineSurface:
(*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VKnots(Knots);
(*((Handle(Geom_BSplineSurface)*)&((mySurface->Surface())->Surface())))->VKnots(Knots);
break;
default:
Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter();
Knots(1) = mySurface->FirstUParameter(); Knots(2) = mySurface->LastUParameter();
break;
}
}
@@ -391,8 +391,8 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const
BndLib_Add2dCurve::Add(myCurve, 1.e-7, aBox);
Standard_Real aXmin, aXmax, aYmin, aYmax;
aBox.Get(aXmin, aYmin, aXmax, aYmax);
Standard_Real aVmin = mySurface.FirstVParameter();
Standard_Real aVmax = mySurface.LastVParameter();
Standard_Real aVmin = mySurface->FirstVParameter();
Standard_Real aVmax = mySurface->LastVParameter();
Standard_Real dv = (aVmax-aVmin);
Standard_Real anR = (dv > Epsilon1 ? Min ((aYmax - aYmin) / dv, 1.) : 1.);
@@ -404,7 +404,7 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const
// Standard_Real NL, NS = Max(SIntOrder(1.0)*anRInt/LIntSubs(), 1);
Standard_Real NL, NS = Max(SIntOrder(1.)*anRInt/aLSubs, 1);
switch (myCurve.GetType()) {
switch (myCurve->GetType()) {
case GeomAbs_Line:
NL = 1; break;
case GeomAbs_Circle:
@@ -416,10 +416,10 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const
case GeomAbs_Hyperbola:
NL = 3 * 3; break;
case GeomAbs_BezierCurve:
NL = (*((Handle(Geom2d_BezierCurve)*)&(myCurve.Curve())))->Degree();
NL = (*((Handle(Geom2d_BezierCurve)*)&(myCurve->Curve())))->Degree();
break;
case GeomAbs_BSplineCurve:
NL = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve.Curve())))->Degree();
NL = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve->Curve())))->Degree();
break;
default:
NL = 3 * 3; break;
@@ -442,7 +442,7 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const
Standard_Integer BRepGProp_Face::LIntSubs() const
{
Standard_Integer N;
switch (myCurve.GetType()) {
switch (myCurve->GetType()) {
case GeomAbs_Line:
N = 2; break;
case GeomAbs_Circle:
@@ -452,7 +452,7 @@ Standard_Integer BRepGProp_Face::LIntSubs() const
case GeomAbs_Hyperbola:
N = 2; break;
case GeomAbs_BSplineCurve:
N = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve.Curve())))->NbKnots();
N = (*((Handle(Geom2d_BSplineCurve)*)&(myCurve->Curve())))->NbKnots();
break;
default:
N = 2; break;
@@ -467,9 +467,9 @@ Standard_Integer BRepGProp_Face::LIntSubs() const
void BRepGProp_Face::LKnots(TColStd_Array1OfReal& Knots) const
{
switch (myCurve.GetType()) {
switch (myCurve->GetType()) {
case GeomAbs_Line:
Knots(1) = myCurve.FirstParameter(); Knots(2) = myCurve.LastParameter();
Knots(1) = myCurve->FirstParameter(); Knots(2) = myCurve->LastParameter();
break;
case GeomAbs_Circle:
case GeomAbs_Ellipse:
@@ -477,13 +477,13 @@ void BRepGProp_Face::LKnots(TColStd_Array1OfReal& Knots) const
break;
case GeomAbs_Parabola:
case GeomAbs_Hyperbola:
Knots(1) = myCurve.FirstParameter(); Knots(2) = myCurve.LastParameter();
Knots(1) = myCurve->FirstParameter(); Knots(2) = myCurve->LastParameter();
break;
case GeomAbs_BSplineCurve:
(*((Handle(Geom2d_BSplineCurve)*)&(myCurve.Curve())))->Knots(Knots);
(*((Handle(Geom2d_BSplineCurve)*)&(myCurve->Curve())))->Knots(Knots);
break;
default:
Knots(1) = myCurve.FirstParameter(); Knots(2) = myCurve.LastParameter();
Knots(1) = myCurve->FirstParameter(); Knots(2) = myCurve->LastParameter();
break;
}
}
@@ -531,7 +531,7 @@ void BRepGProp_Face::Load(const Standard_Boolean IsFirstParam,
Handle(Geom2d_Curve) aLin = new Geom2d_Line(aLoc, aDir);
myCurve.Load(aLin, 0., aLen);
myCurve->Load(aLin, 0., aLen);
}
//=======================================================================
@@ -583,17 +583,17 @@ static void GetRealKnots(const Standard_Real theMin,
static void GetCurveKnots(const Standard_Real theMin,
const Standard_Real theMax,
const Geom2dAdaptor_Curve &theCurve,
const Handle(Geom2dAdaptor_Curve) &theCurve,
Handle(TColStd_HArray1OfReal) &theKnots)
{
Standard_Boolean isSBSpline = theCurve.GetType() == GeomAbs_BSplineCurve;
Standard_Boolean isSBSpline = theCurve->GetType() == GeomAbs_BSplineCurve;
if (isSBSpline) {
Handle(Geom2d_BSplineCurve) aCrv;
Standard_Integer aNbKnots;
Handle(TColStd_HArray1OfReal) aCrvKnots;
aCrv = Handle(Geom2d_BSplineCurve)::DownCast(theCurve.Curve());
aCrv = Handle(Geom2d_BSplineCurve)::DownCast(theCurve->Curve());
aNbKnots = aCrv->NbKnots();
aCrvKnots = new TColStd_HArray1OfReal(1, aNbKnots);
aCrv->Knots(aCrvKnots->ChangeArray1());
@@ -615,14 +615,14 @@ void BRepGProp_Face::GetUKnots
const Standard_Real theUMax,
Handle(TColStd_HArray1OfReal) &theUKnots) const
{
Standard_Boolean isSBSpline = mySurface.GetType() == GeomAbs_BSplineSurface;
Standard_Boolean isSBSpline = mySurface->GetType() == GeomAbs_BSplineSurface;
Standard_Boolean isCBSpline = Standard_False;
if (!isSBSpline) {
// Check the basis curve of the surface of linear extrusion.
if (mySurface.GetType() == GeomAbs_SurfaceOfExtrusion) {
if (mySurface->GetType() == GeomAbs_SurfaceOfExtrusion) {
GeomAdaptor_Curve aCurve;
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
Handle(Geom_Surface) aSurf = mySurface->Surface()->Surface();
aCurve.Load(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (aSurf)->BasisCurve());
isCBSpline = aCurve.GetType() == GeomAbs_BSplineCurve;
@@ -636,7 +636,7 @@ void BRepGProp_Face::GetUKnots
if (isSBSpline) {
// Get U knots of BSpline surface.
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
Handle(Geom_Surface) aSurf = mySurface->Surface()->Surface();
Handle(Geom_BSplineSurface) aBSplSurf;
aBSplSurf = Handle(Geom_BSplineSurface)::DownCast(aSurf);
@@ -647,7 +647,7 @@ void BRepGProp_Face::GetUKnots
// Get U knots of BSpline curve - basis curve of
// the surface of linear extrusion.
GeomAdaptor_Curve aCurve;
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
Handle(Geom_Surface) aSurf = mySurface->Surface()->Surface();
Handle(Geom_BSplineCurve) aBSplCurve;
aCurve.Load(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (aSurf)->BasisCurve());
@@ -677,7 +677,7 @@ void BRepGProp_Face::GetTKnots
const Standard_Real theTMax,
Handle(TColStd_HArray1OfReal) &theTKnots) const
{
Standard_Boolean isBSpline = mySurface.GetType() == GeomAbs_BSplineSurface;
Standard_Boolean isBSpline = mySurface->GetType() == GeomAbs_BSplineSurface;
if (myIsUseSpan && isBSpline) {
// Using span decomposition for BSpline.
@@ -685,7 +685,7 @@ void BRepGProp_Face::GetTKnots
Standard_Integer aNbKnots;
// Get V knots of BSpline surface.
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
Handle(Geom_Surface) aSurf = mySurface->Surface()->Surface();
Handle(Geom_BSplineSurface) aBSplSurf;
aBSplSurf = Handle(Geom_BSplineSurface)::DownCast(aSurf);

View File

@@ -161,8 +161,8 @@ private:
BRepAdaptor_Surface mySurface;
Geom2dAdaptor_Curve myCurve;
Handle(BRepAdaptor_Surface) mySurface;
Handle(Geom2dAdaptor_Curve) myCurve;
Standard_Boolean mySReverse;
Standard_Boolean myIsUseSpan;

View File

@@ -24,6 +24,8 @@ inline BRepGProp_Face::BRepGProp_Face(const Standard_Boolean IsUseSpan)
: mySReverse (Standard_False),
myIsUseSpan(IsUseSpan)
{
mySurface = new BRepAdaptor_Surface();
myCurve = new Geom2dAdaptor_Curve();
}
//=======================================================================
@@ -36,6 +38,8 @@ inline BRepGProp_Face::BRepGProp_Face(const TopoDS_Face &F,
const Standard_Boolean IsUseSpan)
: myIsUseSpan(IsUseSpan)
{
mySurface = new BRepAdaptor_Surface();
myCurve = new Geom2dAdaptor_Curve();
Load(F);
}
@@ -46,7 +50,7 @@ inline BRepGProp_Face::BRepGProp_Face(const TopoDS_Face &F,
inline Standard_Boolean BRepGProp_Face::NaturalRestriction() const
{
return BRep_Tool::NaturalRestriction(mySurface.Face());
return BRep_Tool::NaturalRestriction(mySurface->Face());
}
//
//=======================================================================
@@ -56,7 +60,7 @@ inline Standard_Boolean BRepGProp_Face::NaturalRestriction() const
inline const TopoDS_Face& BRepGProp_Face::GetFace() const
{
return mySurface.Face();
return mySurface->Face();
}
//=======================================================================
@@ -66,7 +70,7 @@ inline const TopoDS_Face& BRepGProp_Face::GetFace() const
inline gp_Pnt2d BRepGProp_Face::Value2d(const Standard_Real U) const
{
return myCurve.Value(U);
return myCurve->Value(U);
}
//=======================================================================
@@ -79,7 +83,7 @@ inline void BRepGProp_Face::D12d(const Standard_Real U,
gp_Pnt2d &P,
gp_Vec2d &V1) const
{
myCurve.D1(U,P,V1);
myCurve->D1(U,P,V1);
}
//=======================================================================
@@ -90,7 +94,7 @@ inline void BRepGProp_Face::D12d(const Standard_Real U,
inline Standard_Real BRepGProp_Face::FirstParameter() const
{
return myCurve.FirstParameter();
return myCurve->FirstParameter();
}
//=======================================================================
@@ -101,5 +105,5 @@ inline Standard_Real BRepGProp_Face::FirstParameter() const
inline Standard_Real BRepGProp_Face::LastParameter() const
{
return myCurve.LastParameter();
return myCurve->LastParameter();
}

Some files were not shown because too many files have changed in this diff Show More