mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +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:
@@ -14,21 +14,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_HCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_OffsetCurve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
@@ -44,7 +41,9 @@
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <Geom_OffsetCurve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(BRepAdaptor_Curve, Adaptor3d_Curve)
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepAdaptor_Curve
|
||||
@@ -108,12 +107,12 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E)
|
||||
Handle(Geom_Surface) S;
|
||||
BRep_Tool::CurveOnSurface(E,PC,S,L,pf,pl);
|
||||
if (!PC.IsNull()) {
|
||||
Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface();
|
||||
HS->ChangeSurface().Load(S);
|
||||
Handle(Geom2dAdaptor_HCurve) HC = new Geom2dAdaptor_HCurve();
|
||||
HC->ChangeCurve2d().Load(PC,pf,pl);
|
||||
myConSurf = new Adaptor3d_HCurveOnSurface();
|
||||
myConSurf->ChangeCurve().Load(HC, HS);
|
||||
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
|
||||
HS->Load(S);
|
||||
Handle(Geom2dAdaptor_Curve) HC = new Geom2dAdaptor_Curve();
|
||||
HC->Load(PC,pf,pl);
|
||||
myConSurf = new Adaptor3d_CurveOnSurface();
|
||||
myConSurf->Load(HC, HS);
|
||||
}
|
||||
else {
|
||||
throw Standard_NullObject("BRepAdaptor_Curve::No geometry");
|
||||
@@ -138,12 +137,12 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E,
|
||||
Handle(Geom_Surface) S = BRep_Tool::Surface(F,L);
|
||||
Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(E,F,pf,pl);
|
||||
|
||||
Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface();
|
||||
HS->ChangeSurface().Load(S);
|
||||
Handle(Geom2dAdaptor_HCurve) HC = new Geom2dAdaptor_HCurve();
|
||||
HC->ChangeCurve2d().Load(PC,pf,pl);
|
||||
myConSurf = new Adaptor3d_HCurveOnSurface();
|
||||
myConSurf->ChangeCurve().Load(HC, HS);
|
||||
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
|
||||
HS->Load(S);
|
||||
Handle(Geom2dAdaptor_Curve) HC = new Geom2dAdaptor_Curve();
|
||||
HC->Load(PC,pf,pl);
|
||||
myConSurf = new Adaptor3d_CurveOnSurface();
|
||||
myConSurf->Load(HC, HS);
|
||||
|
||||
myTrsf = L.Transformation();
|
||||
}
|
||||
@@ -195,7 +194,7 @@ const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
|
||||
|
||||
const Adaptor3d_CurveOnSurface& BRepAdaptor_Curve::CurveOnSurface() const
|
||||
{
|
||||
return *((Adaptor3d_CurveOnSurface*)&(myConSurf->Curve()));
|
||||
return *myConSurf;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -300,25 +299,24 @@ void BRepAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) BRepAdaptor_Curve::Trim(const Standard_Real First,
|
||||
Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
// On fait une copie de this pour garder la trsf.
|
||||
Handle(BRepAdaptor_HCurve) res = new BRepAdaptor_HCurve();
|
||||
Handle(BRepAdaptor_Curve) res;
|
||||
if (myConSurf.IsNull()){
|
||||
Standard_Real pf = FirstParameter(), pl = LastParameter();
|
||||
Handle(Geom_Curve) C = myCurve.Curve();
|
||||
((GeomAdaptor_Curve*) (void*) &myCurve)->Load(C,First,Last);
|
||||
res->ChangeCurve() = *this;
|
||||
((GeomAdaptor_Curve*) (void*) &myCurve)->Load(C,pf,pl);
|
||||
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,First,Last);
|
||||
res = new BRepAdaptor_Curve (*this);
|
||||
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,pf,pl);
|
||||
}
|
||||
else {
|
||||
Handle(Adaptor3d_HCurveOnSurface) sav = myConSurf;
|
||||
*((Handle(Adaptor3d_HCurveOnSurface)*) (void*) &myConSurf) =
|
||||
Handle(Adaptor3d_HCurveOnSurface)::DownCast(myConSurf->Trim(First,Last,Tol));
|
||||
res->ChangeCurve() = *this;
|
||||
*((Handle(Adaptor3d_HCurveOnSurface)*) (void*) &myConSurf) = sav;
|
||||
Handle(Adaptor3d_CurveOnSurface) sav = myConSurf;
|
||||
const_cast<Handle(Adaptor3d_CurveOnSurface)&>(myConSurf) = Handle(Adaptor3d_CurveOnSurface)::DownCast(myConSurf->Trim(First,Last,Tol));
|
||||
res = new BRepAdaptor_Curve (*this);
|
||||
const_cast<Handle(Adaptor3d_CurveOnSurface)&>(myConSurf) = sav;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user