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

@@ -30,13 +30,13 @@
#include <Extrema_LocateExtPC.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
@@ -866,8 +866,8 @@ Standard_Boolean ShapeAnalysis_Edge::CheckSameParameter (const TopoDS_Edge& edge
DownCast(aS->Transformed(aLoc.Transformation()));
// Compute deviation between curves
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(aPC, f, l);
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(aST);
Handle(Geom2dAdaptor_Curve) GHPC = new Geom2dAdaptor_Curve(aPC, f, l);
Handle(GeomAdaptor_Surface) GAHS = new GeomAdaptor_Surface(aST);
Adaptor3d_CurveOnSurface ACS(GHPC, GAHS);
if (!ComputeDeviation(aGAC, ACS, SameParameter, maxdev, NbControl - 1))
@@ -884,11 +884,11 @@ Standard_Boolean ShapeAnalysis_Edge::CheckSameParameter (const TopoDS_Edge& edge
Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnPlane(edge, aFaceSurf, aFaceLoc, f, l);
if (!aPC.IsNull())
{
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(aPC, aFirst, aLast);
Handle(Geom2dAdaptor_Curve) GHPC = new Geom2dAdaptor_Curve(aPC, aFirst, aLast);
Handle(Geom_Surface) aST =
Handle(Geom_Surface)::DownCast(aFaceSurf->Transformed(aFaceLoc.Transformation()));
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(aST);
Handle(GeomAdaptor_Surface) GAHS = new GeomAdaptor_Surface(aST);
Adaptor3d_CurveOnSurface ACS(GHPC, GAHS);

View File

@@ -45,7 +45,7 @@
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <Precision.hxx>
@@ -105,7 +105,7 @@ ShapeAnalysis_Surface::ShapeAnalysis_Surface(const Handle(Geom_Surface)& S) :
myGap(0.), myUDelt(0.01), myVDelt(0.01), myUCloseVal(-1), myVCloseVal(-1)
{
mySurf->Bounds(myUF, myUL, myVF, myVL);
myAdSur = new GeomAdaptor_HSurface(mySurf);
myAdSur = new GeomAdaptor_Surface(mySurf);
}
//=======================================================================
@@ -121,7 +121,7 @@ void ShapeAnalysis_Surface::Init(const Handle(Geom_Surface)& S)
myNbDeg = -1;
myUCloseVal = myVCloseVal = -1; myGap = 0.;
mySurf->Bounds(myUF, myUL, myVF, myVL);
myAdSur = new GeomAdaptor_HSurface(mySurf);
myAdSur = new GeomAdaptor_Surface(mySurf);
myIsos = Standard_False;
myIsoBoxes = Standard_False;
myIsoUF.Nullify(); myIsoUL.Nullify(); myIsoVF.Nullify(); myIsoVL.Nullify();
@@ -147,7 +147,7 @@ void ShapeAnalysis_Surface::Init(const Handle(ShapeAnalysis_Surface)& other)
//purpose :
//=======================================================================
const Handle(GeomAdaptor_HSurface)& ShapeAnalysis_Surface::Adaptor3d()
const Handle(GeomAdaptor_Surface)& ShapeAnalysis_Surface::Adaptor3d()
{
return myAdSur;
}
@@ -478,7 +478,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt2d &p2d1,
Max(pm.Distance(p1), pm.Distance(p2)));
if (max3d > tol) return Standard_False;
GeomAdaptor_Surface& SA = Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& SA = *Adaptor3d();
Standard_Real RU = SA.UResolution(1.);
Standard_Real RV = SA.VResolution(1.);
@@ -583,7 +583,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
//Calculs adaptes
//#67 rln S4135
GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& SurfAdapt = *Adaptor3d();
GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
if (mySurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
{
@@ -796,7 +796,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
// Calculs adaptes
//#67 rln S4135
GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& SurfAdapt = *Adaptor3d();
GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
if (mySurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
{
@@ -982,7 +982,7 @@ Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev,
const Standard_Real preci,
gp_Pnt2d &sol)
{
GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& SurfAdapt = *Adaptor3d();
Standard_Real uf, ul, vf, vl;
Bounds(uf, ul, vf, vl);
Standard_Real du = SurfAdapt.UResolution(preci);
@@ -1062,7 +1062,7 @@ gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV(const gp_Pnt2d &p2dPrev,
const Standard_Real preci,
const Standard_Real maxpreci)
{
GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& SurfAdapt = *Adaptor3d();
GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
switch (surftype) {
@@ -1135,7 +1135,7 @@ gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV(const gp_Pnt2d &p2dPrev,
gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real preci)
{
GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& SurfAdapt = *Adaptor3d();
Standard_Real S = 0., T = 0.;
myGap = -1.; // devra etre calcule
Standard_Boolean computed = Standard_True; // a priori
@@ -1412,7 +1412,7 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard
for (Standard_Integer num = 0; num < 6; num++) {
UV = (num < 3); // 0-1-2 : iso-U 3-4-5 : iso-V
if (!(Adaptor3d()->Surface().GetType() == GeomAbs_OffsetSurface)) {
if (!(Adaptor3d()->GetType() == GeomAbs_OffsetSurface)) {
const Bnd_Box *anIsoBox = 0;
switch (num) {
case 0: par = myUF; iso = myIsoUF; anIsoBox = &myBndUF; break;
@@ -1470,7 +1470,7 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard
//added by rln on 04/12/97 iterational process
Standard_Real PrevU = U, PrevV = V;
Standard_Integer MaxIters = 5, Iters = 0;
if (!(Adaptor3d()->Surface().GetType() == GeomAbs_OffsetSurface)) {
if (!(Adaptor3d()->GetType() == GeomAbs_OffsetSurface)) {
while (((PrevU != UU) || (PrevV != VV)) && (Iters < MaxIters) && (theMin > preci)) {
PrevU = UU; PrevV = VV;
if (UV) { par = UU; iso = UIso(UU); }

View File

@@ -17,29 +17,17 @@
#ifndef _ShapeAnalysis_Surface_HeaderFile
#define _ShapeAnalysis_Surface_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Extrema_ExtPS.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <Bnd_Box.hxx>
#include <Standard_Transient.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColgp_SequenceOfPnt2d.hxx>
class Geom_Surface;
class GeomAdaptor_HSurface;
class Geom_Curve;
class gp_Pnt2d;
class gp_Pnt;
class Bnd_Box;
class ShapeAnalysis_Surface;
DEFINE_STANDARD_HANDLE(ShapeAnalysis_Surface, Standard_Transient)
//! Complements standard tool Geom_Surface by providing additional
@@ -90,10 +78,10 @@ public:
//! Returns the Adaptor.
//! Creates it if not yet done.
Standard_EXPORT const Handle(GeomAdaptor_HSurface)& Adaptor3d();
Standard_EXPORT const Handle(GeomAdaptor_Surface)& Adaptor3d();
//! Returns the Adaptor (may be Null if method Adaptor() was not called)
const Handle(GeomAdaptor_HSurface)& TrueAdaptor3d() const;
const Handle(GeomAdaptor_Surface)& TrueAdaptor3d() const;
//! Returns 3D distance found by one of the following methods.
//! IsDegenerated, DegeneratedValues, ProjectDegenerated
@@ -323,7 +311,7 @@ protected:
Handle(Geom_Surface) mySurf;
Handle(GeomAdaptor_HSurface) myAdSur;
Handle(GeomAdaptor_Surface) myAdSur;
Extrema_ExtPS myExtPS;
Standard_Boolean myExtOK;
Standard_Integer myNbDeg;

View File

@@ -12,7 +12,7 @@
// commercial license or contractual agreement.
#include <Geom_Surface.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
//=======================================================================
//function : Surface
@@ -30,7 +30,7 @@ inline const Handle(Geom_Surface)& ShapeAnalysis_Surface::Surface() const
//purpose :
//=======================================================================
inline const Handle(GeomAdaptor_HSurface)& ShapeAnalysis_Surface::TrueAdaptor3d() const
inline const Handle(GeomAdaptor_Surface)& ShapeAnalysis_Surface::TrueAdaptor3d() const
{
return myAdSur;
}

View File

@@ -30,11 +30,11 @@
#include <Geom2d_Curve.hxx>
#include <Geom2d_OffsetCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <Precision.hxx>
#include <ShapeAnalysis.hxx>
#include <ShapeAnalysis_Curve.hxx>
@@ -103,9 +103,9 @@ void ShapeAnalysis_TransferParametersProj::Init(const TopoDS_Edge& E,
ShapeAnalysis_Edge sae;
if(sae.PCurve (E, F, myCurve2d, f2d, l2d, Standard_False)) {
Handle(Geom2dAdaptor_HCurve) AC2d = new Geom2dAdaptor_HCurve(myCurve2d,f2d,l2d);
Handle(Geom2dAdaptor_Curve) AC2d = new Geom2dAdaptor_Curve(myCurve2d,f2d,l2d);
Handle(Geom_Surface) aSurface = BRep_Tool::Surface(F,myLocation);
Handle(GeomAdaptor_HSurface) AdS = new GeomAdaptor_HSurface(aSurface);
Handle(GeomAdaptor_Surface) AdS = new GeomAdaptor_Surface(aSurface);
Adaptor3d_CurveOnSurface Ad1(AC2d,AdS);
myAC3d = Ad1;//new Adaptor3d_CurveOnSurface(AC2d,AdS);
@@ -190,8 +190,8 @@ Standard_Real ShapeAnalysis_TransferParametersProj::PreformSegment(const Standar
Standard_Real ppar;
if(To2d) {
gp_Pnt p1 = myCurve->Value(Param).Transformed(myLocation.Inverted());
Handle(Adaptor3d_HSurface) AdS = myAC3d.GetSurface();
Handle(Geom2dAdaptor_HCurve) AC2d = new Geom2dAdaptor_HCurve(myCurve2d,First,Last);
Handle(Adaptor3d_Surface) AdS = myAC3d.GetSurface();
Handle(Geom2dAdaptor_Curve) AC2d = new Geom2dAdaptor_Curve(myCurve2d,First,Last);
Adaptor3d_CurveOnSurface Ad1(AC2d,AdS);
projDev = sac.Project(Ad1,p1,myPrecision,pproj,ppar);//pdn
linDev = p1.Distance(Ad1.Value(linPar));
@@ -407,8 +407,8 @@ void ShapeAnalysis_TransferParametersProj::TransferRange(TopoDS_Edge& newEdge,
Standard_Real first = toGC->First();
Standard_Real last = toGC->Last();
Standard_Real len = last -first;
Handle(Geom2dAdaptor_HCurve) AC2d = new Geom2dAdaptor_HCurve(toGC->PCurve(),first,last);
Handle(GeomAdaptor_HSurface) AdS = new GeomAdaptor_HSurface( toGC->Surface());
Handle(Geom2dAdaptor_Curve) AC2d = new Geom2dAdaptor_Curve(toGC->PCurve(),first,last);
Handle(GeomAdaptor_Surface) AdS = new GeomAdaptor_Surface( toGC->Surface());
Adaptor3d_CurveOnSurface Ad1(AC2d,AdS);
ShapeAnalysis_Curve sac1;

View File

@@ -44,13 +44,13 @@
#include <GCPnts_AbscissaPoint.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dInt_GInter.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <gp_Pnt2d.hxx>
#include <GProp_GProps.hxx>
#include <IntRes2d_Domain.hxx>
@@ -940,7 +940,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu
//added by rln 18/12/97 CSR# CTS18544 entity 13638
//the situation when degenerated edge already exists but flag is not set
//(i.e. the parametric space is closed)
GeomAdaptor_Surface& Ads = mySurf->Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& Ads = *mySurf->Adaptor3d();
Standard_Real max = Max ( Ads.UResolution(myPrecision),
Ads.VResolution(myPrecision) );
if ( p2d1.Distance (p2d2) /*Abs (par1 - par2)*/ <= max + gp::Resolution() ) return Standard_False;
@@ -1015,7 +1015,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu
gp_Pnt2d p1 = C1->Value (ul1);
gp_Pnt2d p2 = C2->Value (uf2);
myMin2d = myMax2d = p1.Distance (p2);
GeomAdaptor_Surface& SA = mySurf->Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& SA = *mySurf->Adaptor3d();
if (myMin2d > (Max (SA.UResolution (myPrecision), SA.VResolution (myPrecision)) + Precision::PConfusion()))
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE1);
return LastCheckStatus (ShapeExtend_DONE);
@@ -1044,8 +1044,8 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL1);
return Standard_False;
}
Handle(Geom2dAdaptor_HCurve) AC = new Geom2dAdaptor_HCurve(pc,pcuf,pcul);
Handle(GeomAdaptor_HSurface) AS = new GeomAdaptor_HSurface(mySurf->Surface());
Handle(Geom2dAdaptor_Curve) AC = new Geom2dAdaptor_Curve(pc,pcuf,pcul);
Handle(GeomAdaptor_Surface) AS = new GeomAdaptor_Surface(mySurf->Surface());
Adaptor3d_CurveOnSurface ACS(AC,AS);
gp_Pnt cpnt, pcpnt;
Standard_Integer nbp = 45;
@@ -1300,7 +1300,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges (const Standard_Inte
gp_Pnt2d end2 = Crv2->Value ( isForward2 ? a2 : b2 );
//:l0 Standard_Real distab2 = mySurf->Value ( end1 ).SquareDistance ( mySurf->Value ( end2 ) );
//:l0: test like in BRepCheck
GeomAdaptor_Surface& Ads = mySurf->Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& Ads = *mySurf->Adaptor3d();
Standard_Real tol2d = 2 * Max ( Ads.UResolution(tol), Ads.VResolution(tol) );
isLacking = ( end1.SquareDistance(end2) >= tol2d * tol2d );
}
@@ -1515,7 +1515,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckLacking (const Standard_Integer num,
// test like in BRepCheck
Standard_Real tol = Max ( BRep_Tool::Tolerance ( V1 ), BRep_Tool::Tolerance ( V2 ) );
tol = ( Tolerance > gp::Resolution() && Tolerance < tol ? Tolerance : tol );
GeomAdaptor_Surface& Ads = mySurf->Adaptor3d()->ChangeSurface();
GeomAdaptor_Surface& Ads = *mySurf->Adaptor3d();
Standard_Real tol2d = 2 * Max ( Ads.UResolution(tol), Ads.VResolution(tol) );
if ( // tol2d < gp::Resolution() || //#2 smh 26.03.99 S4163 Zero divide
myMax2d < tol2d * tol2d ) return Standard_False;
@@ -1659,12 +1659,12 @@ Standard_Boolean ShapeAnalysis_Wire::CheckNotchedEdges(const Standard_Integer nu
if ( Abs ( v2.Angle ( v1 ) ) > 0.1 || p2d1.Distance(p2d2) > Tolerance)
return Standard_False;
Handle(Geom2dAdaptor_HCurve) AC2d1 = new Geom2dAdaptor_HCurve(c2d1,a1,b1);
Handle(GeomAdaptor_HSurface) AdS1 = new GeomAdaptor_HSurface(new Geom_Plane(gp_Pln()));
Handle(Geom2dAdaptor_Curve) AC2d1 = new Geom2dAdaptor_Curve(c2d1,a1,b1);
Handle(GeomAdaptor_Surface) AdS1 = new GeomAdaptor_Surface(new Geom_Plane(gp_Pln()));
Adaptor3d_CurveOnSurface Ad1(AC2d1,AdS1);
Handle(Geom2dAdaptor_HCurve) AC2d2 = new Geom2dAdaptor_HCurve(c2d2,a2,b2);
Handle(GeomAdaptor_HSurface) AdS2 = new GeomAdaptor_HSurface(new Geom_Plane(gp_Pln()));
Handle(Geom2dAdaptor_Curve) AC2d2 = new Geom2dAdaptor_Curve(c2d2,a2,b2);
Handle(GeomAdaptor_Surface) AdS2 = new GeomAdaptor_Surface(new Geom_Plane(gp_Pln()));
Adaptor3d_CurveOnSurface Ad2(AC2d2,AdS2);
Adaptor3d_CurveOnSurface longAD, shortAD;