mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +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:
@@ -23,8 +23,8 @@
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <GCPnts_AbscissaPoint.hxx>
|
||||
|
||||
@@ -108,7 +108,7 @@ void BRepMesh_CurveTessellator::init()
|
||||
if (myCurve.IsCurveOnSurface())
|
||||
{
|
||||
const Adaptor3d_CurveOnSurface& aCurve = myCurve.CurveOnSurface();
|
||||
const Handle(Adaptor3d_HSurface)& aSurface = aCurve.GetSurface();
|
||||
const Handle(Adaptor3d_Surface)& aSurface = aCurve.GetSurface();
|
||||
|
||||
const Standard_Real aTol = Precision::Confusion();
|
||||
const Standard_Real aDu = aSurface->UResolution(aTol);
|
||||
@@ -238,7 +238,7 @@ Standard_Boolean BRepMesh_CurveTessellator::Value (
|
||||
// If point coordinates are out of surface range,
|
||||
// it is necessary to re-project point.
|
||||
const Adaptor3d_CurveOnSurface& aCurve = myCurve.CurveOnSurface();
|
||||
const Handle(Adaptor3d_HSurface)& aSurface = aCurve.GetSurface();
|
||||
const Handle(Adaptor3d_Surface)& aSurface = aCurve.GetSurface();
|
||||
if (aSurface->GetType() != GeomAbs_BSplineSurface &&
|
||||
aSurface->GetType() != GeomAbs_BezierSurface &&
|
||||
aSurface->GetType() != GeomAbs_OtherSurface)
|
||||
|
@@ -52,7 +52,7 @@ void BRepMesh_DefaultRangeSplitter::AddPoint(const gp_Pnt2d& thePoint)
|
||||
//=======================================================================
|
||||
void BRepMesh_DefaultRangeSplitter::AdjustRange()
|
||||
{
|
||||
const Handle(BRepAdaptor_HSurface)& aSurface = GetSurface();
|
||||
const Handle(BRepAdaptor_Surface)& aSurface = GetSurface();
|
||||
updateRange(aSurface->FirstUParameter(), aSurface->LastUParameter(),
|
||||
aSurface->IsUPeriodic(), myRangeU.first, myRangeU.second);
|
||||
|
||||
@@ -165,7 +165,7 @@ Standard_Real BRepMesh_DefaultRangeSplitter::computeLengthU()
|
||||
Standard_Real dfucur;
|
||||
Standard_Integer i1;
|
||||
|
||||
const Handle(BRepAdaptor_HSurface)& gFace = GetSurface();
|
||||
const Handle(BRepAdaptor_Surface)& gFace = GetSurface();
|
||||
gFace->D0(myRangeU.first, myRangeV.first, P11);
|
||||
gFace->D0(myRangeU.first, dfvave, P21);
|
||||
gFace->D0(myRangeU.first, myRangeV.second, P31);
|
||||
@@ -197,7 +197,7 @@ Standard_Real BRepMesh_DefaultRangeSplitter::computeLengthV()
|
||||
Standard_Real dfvcur;
|
||||
Standard_Integer i1;
|
||||
|
||||
const Handle(BRepAdaptor_HSurface)& gFace = GetSurface();
|
||||
const Handle(BRepAdaptor_Surface)& gFace = GetSurface();
|
||||
gFace->D0(myRangeU.first, myRangeV.first, P11);
|
||||
gFace->D0(dfuave, myRangeV.first, P21);
|
||||
gFace->D0(myRangeU.second, myRangeV.first, P31);
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
#include <IMeshData_Face.hxx>
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
}
|
||||
|
||||
//! Returns surface.
|
||||
const Handle(BRepAdaptor_HSurface)& GetSurface() const
|
||||
const Handle(BRepAdaptor_Surface)& GetSurface() const
|
||||
{
|
||||
return myDFace->GetSurface();
|
||||
}
|
||||
|
@@ -357,8 +357,7 @@ private:
|
||||
const gp_XY& /*theMidPoint*/)
|
||||
{
|
||||
gp_Dir aNorm1, aNorm2;
|
||||
const Handle(Geom_Surface)& aSurf =
|
||||
this->getDFace()->GetSurface()->ChangeSurface().Surface().Surface();
|
||||
const Handle(Geom_Surface)& aSurf = this->getDFace()->GetSurface()->Surface().Surface();
|
||||
|
||||
if ((GeomLib::NormEstim(aSurf, theNodeInfo1.Point2d, Precision::Confusion(), aNorm1) == 0) &&
|
||||
(GeomLib::NormEstim(aSurf, theNodeInfo2.Point2d, Precision::Confusion(), aNorm2) == 0))
|
||||
|
@@ -308,7 +308,7 @@ void BRepMesh_EdgeDiscret::Tessellate2d(
|
||||
BRepMesh_EdgeParameterProvider<IMeshData::ICurveArrayAdaptorHandle> aProvider(
|
||||
theDEdge, aPCurve->GetOrientation(), aDFace, aCurveArray);
|
||||
|
||||
const Handle(Adaptor2d_HCurve2d)& aGeomPCurve = aProvider.GetPCurve();
|
||||
const Handle(Adaptor2d_Curve2d)& aGeomPCurve = aProvider.GetPCurve();
|
||||
|
||||
Standard_Integer aParamIdx, aParamNb;
|
||||
if (theUpdateEnds)
|
||||
|
@@ -27,8 +27,8 @@
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
|
||||
class gp_Pnt;
|
||||
class TopoDS_Edge;
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
}
|
||||
|
||||
//! Returns pcurve used to compute parameters.
|
||||
const Handle(Adaptor2d_HCurve2d)& GetPCurve() const
|
||||
const Handle(Adaptor2d_Curve2d)& GetPCurve() const
|
||||
{
|
||||
return myCurveAdaptor.CurveOnSurface().GetCurve();
|
||||
}
|
||||
|
@@ -22,16 +22,16 @@
|
||||
#include <CSLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Adaptor3d_IsoCurve.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
namespace
|
||||
{
|
||||
void ComputeErrFactors (const Standard_Real theDeflection,
|
||||
const Handle(Adaptor3d_HSurface)& theFace,
|
||||
const Handle(Adaptor3d_Surface)& theFace,
|
||||
Standard_Real& theErrFactorU,
|
||||
Standard_Real& theErrFactorV)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
{
|
||||
Handle(Adaptor3d_HCurve) aCurve = theFace->BasisCurve ();
|
||||
Handle(Adaptor3d_Curve) aCurve = theFace->BasisCurve ();
|
||||
if (aCurve->GetType () == GeomAbs_BSplineCurve && aCurve->Degree () > 2)
|
||||
{
|
||||
theErrFactorV /= (aCurve->Degree () * aCurve->NbKnots ());
|
||||
@@ -87,7 +87,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void AdjustCellsCounts (const Handle(Adaptor3d_HSurface)& theFace,
|
||||
void AdjustCellsCounts (const Handle(Adaptor3d_Surface)& theFace,
|
||||
const Standard_Integer theNbVertices,
|
||||
Standard_Integer& theCellsCountU,
|
||||
Standard_Integer& theCellsCountV)
|
||||
@@ -111,7 +111,7 @@ namespace
|
||||
}
|
||||
else if (aType == GeomAbs_SurfaceOfExtrusion || aType == GeomAbs_SurfaceOfRevolution)
|
||||
{
|
||||
Handle (Adaptor3d_HCurve) aCurve = theFace->BasisCurve ();
|
||||
Handle (Adaptor3d_Curve) aCurve = theFace->BasisCurve ();
|
||||
if (aCurve->GetType () == GeomAbs_Line ||
|
||||
(aCurve->GetType () == GeomAbs_BSplineCurve && aCurve->Degree () < 2))
|
||||
{
|
||||
@@ -169,7 +169,7 @@ BRepMesh_GeomTool::BRepMesh_GeomTool(
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_GeomTool::BRepMesh_GeomTool(
|
||||
const Handle(BRepAdaptor_HSurface)& theSurface,
|
||||
const Handle(BRepAdaptor_Surface)& theSurface,
|
||||
const GeomAbs_IsoType theIsoType,
|
||||
const Standard_Real theParamIso,
|
||||
const Standard_Real theFirstParam,
|
||||
@@ -195,7 +195,7 @@ BRepMesh_GeomTool::BRepMesh_GeomTool(
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_GeomTool::Value(
|
||||
const Standard_Integer theIndex,
|
||||
const Handle(BRepAdaptor_HSurface)& theSurface,
|
||||
const Handle(BRepAdaptor_Surface)& theSurface,
|
||||
Standard_Real& theParam,
|
||||
gp_Pnt& thePoint,
|
||||
gp_Pnt2d& theUV) const
|
||||
@@ -209,7 +209,7 @@ Standard_Boolean BRepMesh_GeomTool::Value(
|
||||
thePoint = myDiscretTool.Value(theIndex);
|
||||
theParam = myDiscretTool.Parameter(theIndex);
|
||||
|
||||
const TopoDS_Face& aFace = ((BRepAdaptor_Surface*)&(theSurface->Surface()))->Face();
|
||||
const TopoDS_Face& aFace = theSurface->Face();
|
||||
|
||||
Standard_Real aFirst, aLast;
|
||||
Handle(Geom2d_Curve) aCurve =
|
||||
@@ -250,7 +250,7 @@ Standard_Boolean BRepMesh_GeomTool::Value(
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_GeomTool::Normal(
|
||||
const Handle(BRepAdaptor_HSurface)& theSurface,
|
||||
const Handle(BRepAdaptor_Surface)& theSurface,
|
||||
const Standard_Real theParamU,
|
||||
const Standard_Real theParamV,
|
||||
gp_Pnt& thePoint,
|
||||
@@ -275,7 +275,7 @@ Standard_Boolean BRepMesh_GeomTool::Normal(
|
||||
if (!isOK)
|
||||
return Standard_False;
|
||||
|
||||
const TopoDS_Face& aFace = ((BRepAdaptor_Surface*)&(theSurface->Surface()))->Face();
|
||||
const TopoDS_Face& aFace = theSurface->Face();
|
||||
TopAbs_Orientation aOri = aFace.Orientation();
|
||||
if (aOri == TopAbs_REVERSED)
|
||||
theNormal.Reverse();
|
||||
@@ -428,7 +428,7 @@ BRepMesh_GeomTool::IntFlag BRepMesh_GeomTool::IntSegSeg(
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
std::pair<Standard_Integer, Standard_Integer> BRepMesh_GeomTool::CellsCount (
|
||||
const Handle (Adaptor3d_HSurface)& theSurface,
|
||||
const Handle (Adaptor3d_Surface)& theSurface,
|
||||
const Standard_Integer theVerticesNb,
|
||||
const Standard_Real theDeflection,
|
||||
const BRepMesh_DefaultRangeSplitter* theRangeSplitter)
|
||||
|
@@ -14,21 +14,17 @@
|
||||
#ifndef _BRepMesh_GeomTool_HeaderFile
|
||||
#define _BRepMesh_GeomTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <GCPnts_TangentialDeflection.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
class BRepAdaptor_Curve;
|
||||
class BRepAdaptor_HSurface;
|
||||
class gp_Pnt;
|
||||
class gp_Pnt2d;
|
||||
class gp_Dir;
|
||||
class BRepMesh_DefaultRangeSplitter;
|
||||
class Adaptor3d_HSurface;
|
||||
|
||||
//! Tool class accumulating common geometrical functions as well as
|
||||
//! functionality using shape geometry to produce data necessary for
|
||||
@@ -83,7 +79,7 @@ public:
|
||||
//! @param theAngDeflection angular deflection.
|
||||
//! @param theMinPointsNb minimum nuber of points to be produced.
|
||||
Standard_EXPORT BRepMesh_GeomTool(
|
||||
const Handle(BRepAdaptor_HSurface)& theSurface,
|
||||
const Handle(BRepAdaptor_Surface)& theSurface,
|
||||
const GeomAbs_IsoType theIsoType,
|
||||
const Standard_Real theParamIso,
|
||||
const Standard_Real theFirstParam,
|
||||
@@ -134,7 +130,7 @@ public:
|
||||
//! @param theUV[out] discretization point in parametric space of the surface.
|
||||
//! @return TRUE on success, FALSE elsewhere.
|
||||
Standard_EXPORT Standard_Boolean Value(const Standard_Integer theIndex,
|
||||
const Handle(BRepAdaptor_HSurface)& theSurface,
|
||||
const Handle(BRepAdaptor_Surface)& theSurface,
|
||||
Standard_Real& theParam,
|
||||
gp_Pnt& thePoint,
|
||||
gp_Pnt2d& theUV) const;
|
||||
@@ -150,7 +146,7 @@ public: //! @name static API
|
||||
//! @param[out] theNormal normal vector at the point specified by the parameters.
|
||||
//! @return FALSE if the normal can not be computed, TRUE elsewhere.
|
||||
Standard_EXPORT static Standard_Boolean Normal(
|
||||
const Handle(BRepAdaptor_HSurface)& theSurface,
|
||||
const Handle(BRepAdaptor_Surface)& theSurface,
|
||||
const Standard_Real theParamU,
|
||||
const Standard_Real theParamV,
|
||||
gp_Pnt& thePoint,
|
||||
@@ -223,7 +219,7 @@ public: //! @name static API
|
||||
// For linear parametric direction we fall back to the initial vertex count:
|
||||
// cells_count = 2 ^ log10 ( initial_vertex_count )
|
||||
Standard_EXPORT static std::pair<Standard_Integer, Standard_Integer> CellsCount (
|
||||
const Handle (Adaptor3d_HSurface)& theSurface,
|
||||
const Handle (Adaptor3d_Surface)& theSurface,
|
||||
const Standard_Integer theVerticesNb,
|
||||
const Standard_Real theDeflection,
|
||||
const BRepMesh_DefaultRangeSplitter* theRangeSplitter);
|
||||
|
@@ -37,7 +37,7 @@ namespace
|
||||
const Handle(IMeshData::MapOfReal)& theParamsForbiddenToRemove,
|
||||
const Handle(IMeshData::MapOfReal)& theControlParamsForbiddenToRemove)
|
||||
: myDFace(theDFace),
|
||||
mySurface(myDFace->GetSurface()->ChangeSurface().Surface().Surface()),
|
||||
mySurface(myDFace->GetSurface()->Surface().Surface()),
|
||||
myIsoU(theIsoType == GeomAbs_IsoU),
|
||||
myParams(theParams),
|
||||
myControlParams(theControlParams),
|
||||
@@ -333,8 +333,8 @@ Handle(IMeshData::ListOfPnt2d) BRepMesh_NURBSRangeSplitter::GenerateSurfaceNodes
|
||||
const std::pair<Standard_Real, Standard_Real>& aDelta = GetDelta ();
|
||||
|
||||
const Standard_Real aDefFace = GetDFace()->GetDeflection();
|
||||
const Handle(BRepAdaptor_HSurface)& gFace = GetSurface();
|
||||
Handle(Geom_Surface) aSurface = gFace->ChangeSurface().Surface().Surface();
|
||||
const Handle(BRepAdaptor_Surface)& gFace = GetSurface();
|
||||
Handle(Geom_Surface) aSurface = gFace->Surface().Surface();
|
||||
|
||||
const Handle(NCollection_IncAllocator) aTmpAlloc =
|
||||
new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE);
|
||||
@@ -398,7 +398,7 @@ Handle(IMeshData::ListOfPnt2d) BRepMesh_NURBSRangeSplitter::GenerateSurfaceNodes
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_NURBSRangeSplitter::initParameters() const
|
||||
{
|
||||
const Handle(BRepAdaptor_HSurface)& aSurface = GetSurface();
|
||||
const Handle(BRepAdaptor_Surface)& aSurface = GetSurface();
|
||||
|
||||
const GeomAbs_Shape aContinuity = GeomAbs_CN;
|
||||
const std::pair<Standard_Integer, Standard_Integer> aIntervalsNb(
|
||||
@@ -414,8 +414,7 @@ Standard_Boolean BRepMesh_NURBSRangeSplitter::initParameters() const
|
||||
aSurface->UIntervals(aIntervals[0], aContinuity);
|
||||
aSurface->VIntervals(aIntervals[1], aContinuity);
|
||||
|
||||
const Standard_Boolean isSplitIntervals = toSplitIntervals (
|
||||
aSurface->ChangeSurface().Surface().Surface(), aIntervals);
|
||||
const Standard_Boolean isSplitIntervals = toSplitIntervals (aSurface->Surface().Surface(), aIntervals);
|
||||
|
||||
if (!initParamsFromIntervals(aIntervals[0], GetRangeU(), isSplitIntervals,
|
||||
const_cast<IMeshData::IMapOfReal&>(GetParametersU())))
|
||||
|
Reference in New Issue
Block a user