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

0028966: Coding Rules - remove Adaptor2d_HCurve2d, Adaptor3d_HCurve and Adaptor3d_HSurface classes

Adaptor2d_Curve2d, Adaptor3d_Curve and Adaptor3d_Surface now inherit Standard_Transient.
Interfaces Adaptor2d_HCurve2d, Adaptor3d_HCurve, Adaptor3d_HSurface and their subclasses
are now aliases to Adaptor2d_Curve2d, Adaptor3d_Curve and Adaptor3d_Surface.
Removed numerous unsafe reinterpret casts.

Generic classes Adaptor3d_GenHCurve, Adaptor3d_GenHSurface, Adaptor2d_GenHCurve2d have been removed.
Several redundant .lxx files have been merged into .hxx.

Removed obsolete adaptor classes with H suffix.
This commit is contained in:
kgv
2020-12-03 17:36:19 +03:00
committed by bugmaster
parent 266877a7c3
commit c22b52d60e
710 changed files with 6144 additions and 14175 deletions

View File

@@ -17,10 +17,10 @@
#ifndef GeomPlate_Array1OfHCurve_HeaderFile
#define GeomPlate_Array1OfHCurve_HeaderFile
#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_Curve.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<Handle(Adaptor3d_HCurve)> GeomPlate_Array1OfHCurve;
typedef NCollection_Array1<Handle(Adaptor3d_Curve)> GeomPlate_Array1OfHCurve;
#endif

View File

@@ -14,8 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Adaptor2d_HCurve2d.hxx>
#include <Adaptor3d_HCurve.hxx>
#include <GeomPlate_BuildPlateSurface.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_CurveOnSurface.hxx>
#include <Approx_CurveOnSurface.hxx>
#include <Extrema_ExtPS.hxx>
@@ -31,11 +33,9 @@
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomLProp_SLProps.hxx>
#include <GeomPlate_BuildAveragePlane.hxx>
#include <GeomPlate_BuildPlateSurface.hxx>
#include <GeomPlate_CurveConstraint.hxx>
#include <GeomPlate_HArray1OfSequenceOfReal.hxx>
#include <GeomPlate_MakeApprox.hxx>
@@ -257,25 +257,25 @@ static void TrierTab(Handle(TColStd_HArray1OfInteger)& Tab)
//---------------------------------------------------------
// Function : ProjectCurve
//---------------------------------------------------------
Handle(Geom2d_Curve) GeomPlate_BuildPlateSurface::ProjectCurve(const Handle(Adaptor3d_HCurve)& Curv)
Handle(Geom2d_Curve) GeomPlate_BuildPlateSurface::ProjectCurve(const Handle(Adaptor3d_Curve)& Curv)
{
// Project a curve on a plane
Handle(Geom2d_Curve) Curve2d ;
Handle(GeomAdaptor_HSurface) hsur = new GeomAdaptor_HSurface(mySurfInit);
Handle(GeomAdaptor_Surface) hsur = new GeomAdaptor_Surface(mySurfInit);
gp_Pnt2d P2d;
ProjLib_CompProjectedCurve Projector(hsur, Curv, myTol3d/10, myTol3d/10);
Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve (hsur, Curv, myTol3d/10, myTol3d/10);
Standard_Real UdebCheck, UfinCheck, ProjUdeb, ProjUfin;
UdebCheck = Curv->FirstParameter();
UfinCheck = Curv->LastParameter();
Projector.Bounds( 1, ProjUdeb, ProjUfin );
HProjector->Bounds( 1, ProjUdeb, ProjUfin );
if (Projector.NbCurves() != 1 ||
if (HProjector->NbCurves() != 1 ||
Abs( UdebCheck -ProjUdeb ) > Precision::PConfusion() ||
Abs( UfinCheck -ProjUfin ) > Precision::PConfusion())
{
if (Projector.IsSinglePnt(1, P2d))
if (HProjector->IsSinglePnt(1, P2d))
{
// solution in a point
TColgp_Array1OfPnt2d poles(1, 2);
@@ -294,10 +294,7 @@ Handle(Geom2d_Curve) GeomPlate_BuildPlateSurface::ProjectCurve(const Handle(Ada
GeomAbs_Shape Continuity = GeomAbs_C1;
Standard_Integer MaxDegree = 10, MaxSeg;
Standard_Real Udeb, Ufin;
Handle(ProjLib_HCompProjectedCurve) HProjector =
new ProjLib_HCompProjectedCurve();
HProjector->Set(Projector);
Projector.Bounds(1, Udeb, Ufin);
HProjector->Bounds(1, Udeb, Ufin);
MaxSeg = 20 + HProjector->NbIntervals(GeomAbs_C3);
Approx_CurveOnSurface appr(HProjector, hsur, Udeb, Ufin, myTol3d);
@@ -317,18 +314,15 @@ Handle(Geom2d_Curve) GeomPlate_BuildPlateSurface::ProjectCurve(const Handle(Ada
//---------------------------------------------------------
// Function : ProjectedCurve
//---------------------------------------------------------
Handle(Adaptor2d_HCurve2d) GeomPlate_BuildPlateSurface::ProjectedCurve( Handle(Adaptor3d_HCurve)& Curv)
Handle(Adaptor2d_Curve2d) GeomPlate_BuildPlateSurface::ProjectedCurve( Handle(Adaptor3d_Curve)& Curv)
{
// Projection of a curve on the initial surface
Handle(GeomAdaptor_HSurface) hsur = new GeomAdaptor_HSurface(mySurfInit);
Handle(GeomAdaptor_Surface) hsur = new GeomAdaptor_Surface(mySurfInit);
ProjLib_CompProjectedCurve Projector(hsur, Curv, myTolU/10, myTolV/10);
Handle(ProjLib_HCompProjectedCurve) HProjector =
new ProjLib_HCompProjectedCurve();
if (Projector.NbCurves() != 1) {
Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve (hsur, Curv, myTolU/10, myTolV/10);
if (HProjector->NbCurves() != 1)
{
HProjector.Nullify(); // No continuous solution
#ifdef OCCT_DEBUG
std::cout << "BuildPlateSurace :: No continuous projection" << std::endl;
@@ -339,15 +333,12 @@ Handle(Adaptor2d_HCurve2d) GeomPlate_BuildPlateSurface::ProjectedCurve( Handle(
Standard_Real First1,Last1,First2,Last2;
First1=Curv->FirstParameter();
Last1 =Curv->LastParameter();
Projector.Bounds(1,First2,Last2);
HProjector->Bounds(1,First2,Last2);
if (Abs(First1-First2) <= Max(myTolU,myTolV) &&
Abs(Last1-Last2) <= Max(myTolU,myTolV))
{
HProjector->Set(Projector);
HProjector = Handle(ProjLib_HCompProjectedCurve)::
DownCast(HProjector->Trim(First2,Last2,Precision::PConfusion()));
HProjector = Handle(ProjLib_HCompProjectedCurve)::DownCast(HProjector->Trim(First2,Last2,Precision::PConfusion()));
}
else
{
@@ -1608,8 +1599,8 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t
(Handle( Geom_RectangularTrimmedSurface )::DownCast(mySurfInit))->BasisSurface();
Standard_Real Ratio = 0., R1 = 2., R2 = 0.6; //R1 = 3, R2 = 0.5;//R1 = 1.4, R2 = 0.8; //R1 = 5., R2 = 0.2;
Handle( GeomAdaptor_HSurface ) hsur =
new GeomAdaptor_HSurface( InitPlane );
Handle( GeomAdaptor_Surface ) hsur =
new GeomAdaptor_Surface( InitPlane );
Standard_Integer NbPoint = 20;
// gp_Pnt P;
// gp_Vec DerC, DerCproj, DU, DV;
@@ -1623,11 +1614,8 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t
Standard_Real LastPar = myLinCont->Value(i)->LastParameter();
Standard_Real Uif = (LastPar - FirstPar)/(NbPoint);
Handle( Adaptor3d_HCurve ) Curve = myLinCont->Value(i)->Curve3d();
ProjLib_CompProjectedCurve Projector( hsur, Curve, myTol3d, myTol3d );
Handle( ProjLib_HCompProjectedCurve ) ProjCurve =
new ProjLib_HCompProjectedCurve();
ProjCurve->Set( Projector );
Handle( Adaptor3d_Curve ) Curve = myLinCont->Value(i)->Curve3d();
Handle( ProjLib_HCompProjectedCurve ) ProjCurve = new ProjLib_HCompProjectedCurve (hsur, Curve, myTol3d, myTol3d);
Adaptor3d_CurveOnSurface AProj(ProjCurve, hsur);
gp_Pnt P;
@@ -1890,13 +1878,13 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
gp_Vec vec, vecU, vecV, N;
if (myLinCont->Value(i)->Order() == 0)
{
Handle( Adaptor3d_HCurve ) theCurve = myLinCont->Value(i)->Curve3d();
Handle( Adaptor3d_Curve ) theCurve = myLinCont->Value(i)->Curve3d();
theCurve->D1( int2d.ParamOnFirst(), P1, vec );
myLinCont->Value(j)->D1( int2d.ParamOnSecond(), P2, vecU, vecV );
}
else
{
Handle( Adaptor3d_HCurve ) theCurve = myLinCont->Value(j)->Curve3d();
Handle( Adaptor3d_Curve ) theCurve = myLinCont->Value(j)->Curve3d();
theCurve->D1( int2d.ParamOnSecond(), P2, vec );
myLinCont->Value(i)->D1( int2d.ParamOnFirst(), P1, vecU, vecV );
}

View File

@@ -44,9 +44,6 @@ class GeomPlate_PointConstraint;
class gp_Pnt2d;
class gp_Pnt;
class Geom2d_Curve;
class Adaptor3d_HCurve;
class Adaptor2d_HCurve2d;
//! This class provides an algorithm for constructing such a plate surface that
@@ -213,9 +210,9 @@ private:
Standard_EXPORT gp_Pnt2d ProjectPoint (const gp_Pnt& P);
Standard_EXPORT Handle(Geom2d_Curve) ProjectCurve (const Handle(Adaptor3d_HCurve)& Curv);
Standard_EXPORT Handle(Geom2d_Curve) ProjectCurve (const Handle(Adaptor3d_Curve)& Curv);
Standard_EXPORT Handle(Adaptor2d_HCurve2d) ProjectedCurve (Handle(Adaptor3d_HCurve)& Curv);
Standard_EXPORT Handle(Adaptor2d_Curve2d) ProjectedCurve (Handle(Adaptor3d_Curve)& Curv);
Standard_EXPORT void ComputeSurfInit(const Message_ProgressRange& theProgress);

View File

@@ -18,19 +18,19 @@
// ne traite que les GeomAdaptor_Surface;
// plus de reference a BRepAdaptor
#include <Adaptor2d_HCurve2d.hxx>
#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_HCurveOnSurface.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_CurveOnSurface.hxx>
#include <Adaptor3d_Surface.hxx>
#include <Approx_Curve2d.hxx>
#include <BRepAdaptor_HSurface.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Curve.hxx>
#include <GeomAbs_Shape.hxx>
#include <GeomAdaptor.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomLProp_SLProps.hxx>
#include <GeomPlate_CurveConstraint.hxx>
#include <gp_Pnt.hxx>
@@ -65,7 +65,7 @@ GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint ()
//---------------------------------------------------------
// Constructeurs avec courbe sur surface
//---------------------------------------------------------
GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_HCurve)& Boundary,
GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_Curve)& Boundary,
const Standard_Integer Tang,
const Standard_Integer NPt,
const Standard_Real TolDist,
@@ -85,7 +85,7 @@ myTolCurv(TolCurv)
myConstG1=Standard_True;
myConstG2=Standard_True;
myFrontiere = Handle(Adaptor3d_HCurveOnSurface)::DownCast(Boundary);
myFrontiere = Handle(Adaptor3d_CurveOnSurface)::DownCast(Boundary);
if (myFrontiere.IsNull())
{
@@ -94,15 +94,14 @@ myTolCurv(TolCurv)
else
{
Handle(Geom_Surface) Surf;
Handle(GeomAdaptor_HSurface) GS1 = Handle(GeomAdaptor_HSurface)::
DownCast(myFrontiere->ChangeCurve().GetSurface());
Handle(GeomAdaptor_Surface) GS1 = Handle(GeomAdaptor_Surface)::DownCast(myFrontiere->GetSurface());
if (!GS1.IsNull()) {
Surf=GS1->ChangeSurface().Surface();
Surf=GS1->Surface();
}
else {
// Handle(BRepAdaptor_HSurface) BS1;
// BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->
// Handle(BRepAdaptor_Surface) BS1;
// BS1=Handle(BRepAdaptor_Surface)::DownCast(myFrontiere->
// ChangeCurve().GetSurface());
// Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face());
throw Standard_Failure(
@@ -154,7 +153,7 @@ Standard_Real GeomPlate_CurveConstraint :: Length() const
{// GCPnts_AbscissaPoint A(myFrontiere->Curve(),AP.Length(myFrontiere->Curve())/2,myFrontiere->FirstParameter());
// Standard_Real toto=A.Parameter();
//std::cout<<toto<<std::endl;
return AP.Length(myFrontiere->GetCurve());
return AP.Length (*myFrontiere);
}
else
@@ -162,7 +161,7 @@ return AP.Length(myFrontiere->GetCurve());
// Standard_Real toto=A.Parameter();
//std::cout<<toto<<std::endl;
return AP.Length(my3dCurve->GetCurve());
return AP.Length (*my3dCurve);
}
@@ -176,8 +175,8 @@ void GeomPlate_CurveConstraint :: D0(const Standard_Real U,gp_Pnt& P) const
{ gp_Pnt2d P2d;
if (my3dCurve.IsNull())
{ P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D0(P2d.Coord(1),P2d.Coord(2),P);
{ P2d = myFrontiere->GetCurve()->Value(U);
myFrontiere->GetSurface()->D0(P2d.Coord(1),P2d.Coord(2),P);
}
else
my3dCurve->D0(U,P);
@@ -191,8 +190,8 @@ void GeomPlate_CurveConstraint :: D1(const Standard_Real U,
if (!my3dCurve.IsNull())
throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D1(P2d.Coord(1),P2d.Coord(2),P,V1,V2);
P2d = myFrontiere->GetCurve()->Value(U);
myFrontiere->GetSurface()->D1(P2d.Coord(1),P2d.Coord(2),P,V1,V2);
}
@@ -206,8 +205,8 @@ void GeomPlate_CurveConstraint :: D2(const Standard_Real U,
if (!my3dCurve.IsNull())
throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D2(P2d.Coord(1),P2d.Coord(2),P,V1,V2,V3,V4,V5);
P2d = myFrontiere->GetCurve()->Value(U);
myFrontiere->GetSurface()->D2(P2d.Coord(1),P2d.Coord(2),P,V1,V2,V3,V4,V5);
}
//---------------------------------------------------------
@@ -293,14 +292,14 @@ void GeomPlate_CurveConstraint :: SetCurve2dOnSurf (const Handle(Geom2d_Curve) &
//---------------------------------------------------------
// Fonction : ProjectedCurve
//---------------------------------------------------------
Handle(Adaptor2d_HCurve2d) GeomPlate_CurveConstraint :: ProjectedCurve () const
Handle(Adaptor2d_Curve2d) GeomPlate_CurveConstraint :: ProjectedCurve () const
{
return myHCurve2d;
}
//---------------------------------------------------------
// Fonction : SetProjectedCurve
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetProjectedCurve (const Handle(Adaptor2d_HCurve2d) &Curve,
void GeomPlate_CurveConstraint :: SetProjectedCurve (const Handle(Adaptor2d_Curve2d) &Curve,
const Standard_Real TolU,const Standard_Real TolV)
{ myHCurve2d=Curve;
myTolU=TolU;
@@ -310,9 +309,9 @@ void GeomPlate_CurveConstraint :: SetProjectedCurve (const Handle(Adaptor2d_HCur
//---------------------------------------------------------
// Fonction : Curve3d
//---------------------------------------------------------
Handle(Adaptor3d_HCurve) GeomPlate_CurveConstraint :: Curve3d () const
Handle(Adaptor3d_Curve) GeomPlate_CurveConstraint :: Curve3d () const
{ if (my3dCurve.IsNull())
return Handle(Adaptor3d_HCurve) (myFrontiere);
return Handle(Adaptor3d_Curve) (myFrontiere);
else
return my3dCurve;
}
@@ -350,7 +349,7 @@ myOrder = Order;
GeomLProp_SLProps &GeomPlate_CurveConstraint::LPropSurf(const Standard_Real U)
{ if (myFrontiere.IsNull())
throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
gp_Pnt2d P2d= myFrontiere->ChangeCurve().GetCurve()->Value(U);
gp_Pnt2d P2d= myFrontiere->GetCurve()->Value(U);
myLProp.SetParameters(P2d.X(),P2d.Y());
return myLProp;
}

View File

@@ -17,25 +17,16 @@
#ifndef _GeomPlate_CurveConstraint_HeaderFile
#define _GeomPlate_CurveConstraint_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Adaptor3d_CurveOnSurface.hxx>
#include <GeomLProp_SLProps.hxx>
#include <Standard_Real.hxx>
#include <Standard_Transient.hxx>
class Adaptor3d_HCurveOnSurface;
class Adaptor3d_HCurve;
class Geom2d_Curve;
class Adaptor2d_HCurve2d;
class Law_Function;
class Standard_ConstructionError;
class GeomLProp_SLProps;
class gp_Pnt;
class gp_Vec;
class GeomPlate_CurveConstraint;
DEFINE_STANDARD_HANDLE(GeomPlate_CurveConstraint, Standard_Transient)
@@ -60,7 +51,7 @@ public:
//! TolCurv is the maximum error to satisfy for G2 constraints
//! These errors can be replaced by laws of criterion.
//! Raises ConstructionError if Order is not -1 , 0, 1, 2
Standard_EXPORT GeomPlate_CurveConstraint(const Handle(Adaptor3d_HCurve)& Boundary, const Standard_Integer Order, const Standard_Integer NPt = 10, const Standard_Real TolDist = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1);
Standard_EXPORT GeomPlate_CurveConstraint(const Handle(Adaptor3d_Curve)& Boundary, const Standard_Integer Order, const Standard_Integer NPt = 10, const Standard_Real TolDist = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1);
//! Allows you to set the order of continuity required for
//! the constraints: G0, G1, and G2, controlled
@@ -132,7 +123,7 @@ public:
Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3, gp_Vec& V4, gp_Vec& V5) const;
Standard_EXPORT Handle(Adaptor3d_HCurve) Curve3d() const;
Standard_EXPORT Handle(Adaptor3d_Curve) Curve3d() const;
//! loads a 2d curve associated the surface resulting of the constraints
Standard_EXPORT void SetCurve2dOnSurf (const Handle(Geom2d_Curve)& Curve2d);
@@ -142,11 +133,11 @@ public:
//! loads a 2d curve resulting from the normal projection of
//! the curve on the initial surface
Standard_EXPORT void SetProjectedCurve (const Handle(Adaptor2d_HCurve2d)& Curve2d, const Standard_Real TolU, const Standard_Real TolV);
Standard_EXPORT void SetProjectedCurve (const Handle(Adaptor2d_Curve2d)& Curve2d, const Standard_Real TolU, const Standard_Real TolV);
//! Returns the projected curve resulting from the normal projection of the
//! curve on the initial surface
Standard_EXPORT Handle(Adaptor2d_HCurve2d) ProjectedCurve() const;
Standard_EXPORT Handle(Adaptor2d_Curve2d) ProjectedCurve() const;
@@ -156,13 +147,13 @@ public:
protected:
Handle(Adaptor3d_HCurveOnSurface) myFrontiere;
Handle(Adaptor3d_CurveOnSurface) myFrontiere;
Standard_Integer myNbPoints;
Standard_Integer myOrder;
Handle(Adaptor3d_HCurve) my3dCurve;
Handle(Adaptor3d_Curve) my3dCurve;
Standard_Integer myTang;
Handle(Geom2d_Curve) my2dCurve;
Handle(Adaptor2d_HCurve2d) myHCurve2d;
Handle(Adaptor2d_Curve2d) myHCurve2d;
Handle(Law_Function) myG0Crit;
Handle(Law_Function) myG1Crit;
Handle(Law_Function) myG2Crit;
@@ -176,18 +167,6 @@ protected:
Standard_Real myTolU;
Standard_Real myTolV;
private:
};
#endif // _GeomPlate_CurveConstraint_HeaderFile

View File

@@ -17,7 +17,7 @@
#ifndef GeomPlate_HArray1OfHCurve_HeaderFile
#define GeomPlate_HArray1OfHCurve_HeaderFile
#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_Curve.hxx>
#include <GeomPlate_Array1OfHCurve.hxx>
#include <NCollection_DefineHArray1.hxx>