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

@@ -41,11 +41,12 @@
// Purpose:
// Declarations:
#include <Adaptor2d_HCurve2d.hxx>
#include <GeomLib.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_CurveOnSurface.hxx>
#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <Adaptor3d_Surface.hxx>
#include <AdvApprox_ApproxAFunction.hxx>
#include <AdvApprox_PrefAndRec.hxx>
#include <Approx_CurveOnSurface.hxx>
@@ -65,8 +66,6 @@
#include <Geom2d_Parabola.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dAdaptor_GHCurve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dConvert.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BezierSurface.hxx>
@@ -85,12 +84,10 @@
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomConvert.hxx>
#include <GeomConvert_ApproxSurface.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomLib.hxx>
#include <GeomLib_DenominatorMultiplier.hxx>
#include <GeomLib_DenominatorMultiplierPtr.hxx>
#include <GeomLib_LogSample.hxx>
@@ -1032,7 +1029,7 @@ class GeomLib_CurveOnSurfaceEvaluator : public AdvApprox_EvaluatorFunction
Standard_Real FirstParam;
Standard_Real LastParam;
Handle(Adaptor3d_HCurve) TrimCurve;
Handle(Adaptor3d_Curve) TrimCurve;
};
void GeomLib_CurveOnSurfaceEvaluator::Evaluate (Standard_Integer *,/*Dimension*/
@@ -1098,18 +1095,15 @@ void GeomLib::BuildCurve3d(const Standard_Real Tolerance,
MaxDeviation = 0.0e0 ;
AverageDeviation = 0.0e0 ;
Handle(GeomAdaptor_HSurface) geom_adaptor_surface_ptr (Handle(GeomAdaptor_HSurface)::DownCast(Curve.GetSurface()) );
Handle(Geom2dAdaptor_HCurve) geom_adaptor_curve_ptr (Handle(Geom2dAdaptor_HCurve)::DownCast(Curve.GetCurve()) );
Handle(GeomAdaptor_Surface) geom_adaptor_surface_ptr (Handle(GeomAdaptor_Surface)::DownCast(Curve.GetSurface()) );
Handle(Geom2dAdaptor_Curve) geom_adaptor_curve_ptr (Handle(Geom2dAdaptor_Curve)::DownCast(Curve.GetCurve()) );
if (! geom_adaptor_curve_ptr.IsNull() &&
! geom_adaptor_surface_ptr.IsNull()) {
Handle(Geom_Plane) P ;
const GeomAdaptor_Surface & geom_surface =
* (GeomAdaptor_Surface *) &geom_adaptor_surface_ptr->Surface() ;
const GeomAdaptor_Surface& geom_surface = *geom_adaptor_surface_ptr;
Handle(Geom_RectangularTrimmedSurface) RT =
Handle(Geom_RectangularTrimmedSurface)::
DownCast(geom_surface.Surface());
Handle(Geom_RectangularTrimmedSurface) RT = Handle(Geom_RectangularTrimmedSurface)::DownCast(geom_surface.Surface());
if ( RT.IsNull()) {
P = Handle(Geom_Plane)::DownCast(geom_surface.Surface());
}
@@ -1121,8 +1115,7 @@ void GeomLib::BuildCurve3d(const Standard_Real Tolerance,
if (! P.IsNull()) {
// compute the 3d curve
gp_Ax2 axes = P->Position().Ax2();
const Geom2dAdaptor_Curve & geom2d_curve =
* (Geom2dAdaptor_Curve *) & geom_adaptor_curve_ptr->Curve2d() ;
const Geom2dAdaptor_Curve& geom2d_curve = *geom_adaptor_curve_ptr;
NewCurvePtr =
GeomLib::To3d(axes,
geom2d_curve.Curve());
@@ -1130,7 +1123,7 @@ void GeomLib::BuildCurve3d(const Standard_Real Tolerance,
}
Handle(Adaptor2d_HCurve2d) TrimmedC2D = geom_adaptor_curve_ptr->Trim (FirstParameter, LastParameter, Precision::PConfusion());
Handle(Adaptor2d_Curve2d) TrimmedC2D = geom_adaptor_curve_ptr->Trim (FirstParameter, LastParameter, Precision::PConfusion());
Standard_Boolean isU, isForward;
Standard_Real aParam;
@@ -2799,7 +2792,7 @@ static Standard_Boolean CompareWeightPoles(const TColgp_Array1OfPnt& thePoles1,
//function : isIsoLine
//purpose :
//=============================================================================
Standard_Boolean GeomLib::isIsoLine (const Handle(Adaptor2d_HCurve2d) theC2D,
Standard_Boolean GeomLib::isIsoLine (const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean& theIsU,
Standard_Real& theParam,
Standard_Boolean& theIsForward)
@@ -2879,8 +2872,8 @@ Standard_Boolean GeomLib::isIsoLine (const Handle(Adaptor2d_HCurve2d) theC2D,
//function : buildC3dOnIsoLine
//purpose :
//=============================================================================
Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine (const Handle(Adaptor2d_HCurve2d) theC2D,
const Handle(Adaptor3d_HSurface) theSurf,
Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine (const Handle(Adaptor2d_Curve2d) theC2D,
const Handle(Adaptor3d_Surface) theSurf,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theTolerance,
@@ -2889,7 +2882,7 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine (const Handle(Adaptor2d_HCurve2d)
const Standard_Boolean theIsForward)
{
// Convert adapter to the appropriate type.
Handle(GeomAdaptor_HSurface) aGeomAdapter = Handle(GeomAdaptor_HSurface)::DownCast(theSurf);
Handle(GeomAdaptor_Surface) aGeomAdapter = Handle(GeomAdaptor_Surface)::DownCast(theSurf);
if (aGeomAdapter.IsNull())
return Handle(Geom_Curve)();
@@ -2897,7 +2890,7 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine (const Handle(Adaptor2d_HCurve2d)
return Handle(Geom_Curve)();
// Extract isoline
Handle(Geom_Surface) aSurf = aGeomAdapter->ChangeSurface().Surface();
Handle(Geom_Surface) aSurf = aGeomAdapter->Surface();
Handle(Geom_Curve) aC3d;
gp_Pnt2d aF2d = theC2D->Value(theC2D->FirstParameter());

View File

@@ -17,25 +17,18 @@
#ifndef _GeomLib_HeaderFile
#define _GeomLib_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Adaptor3d_Surface.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_SequenceOfReal.hxx>
class Geom_Curve;
class gp_Ax2;
class Geom2d_Curve;
class gp_GTrsf2d;
class Adaptor3d_CurveOnSurface;
class Adaptor2d_HCurve2d;
class Adaptor3d_HSurface;
class Geom_BoundedCurve;
class gp_Pnt;
class gp_Vec;
@@ -56,6 +49,7 @@ class GeomLib_Tool;
class GeomLib_PolyFunc;
class GeomLib_LogSample;
typedef class Adaptor2d_Curve2d Adaptor2d_Curve2d;
//! Geom Library. This package provides an
//! implementation of functions for basic computation
@@ -232,7 +226,7 @@ public:
//! @param theParam Line parameter.
//! @param theIsForward Flag indicating forward parameterization on a isoline.
//! @return Standard_True when 2d curve is a line and Standard_False otherwise.
Standard_EXPORT static Standard_Boolean isIsoLine (const Handle(Adaptor2d_HCurve2d) theC2D,
Standard_EXPORT static Standard_Boolean isIsoLine (const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean& theIsU,
Standard_Real& theParam,
Standard_Boolean& theIsForward);
@@ -244,8 +238,8 @@ public:
//! @param theParam Line parameter.
//! @param theIsForward Flag indicating forward parameterization on a isoline.
//! @return Standard_True when 3d curve is built and Standard_False otherwise.
Standard_EXPORT static Handle(Geom_Curve) buildC3dOnIsoLine (const Handle(Adaptor2d_HCurve2d) theC2D,
const Handle(Adaptor3d_HSurface) theSurf,
Standard_EXPORT static Handle(Geom_Curve) buildC3dOnIsoLine (const Handle(Adaptor2d_Curve2d) theC2D,
const Handle(Adaptor3d_Surface) theSurf,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theTolerance,

View File

@@ -12,18 +12,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Adaptor2d_HCurve2d.hxx>
#include <GeomLib_CheckCurveOnSurface.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_CurveOnSurface.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <Adaptor3d_Surface.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dAdaptor_GHCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomLib_CheckCurveOnSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <gp_Pnt.hxx>
#include <math_Matrix.hxx>
#include <math_MultipleVarFunctionWithHessian.hxx>
@@ -261,8 +262,8 @@ public:
//identificator of the current interval in mySubIntervals array) cell of
//myArrOfDist and myArrOfParam arrays.
const GeomAdaptor_Curve anAC(myCurve3D);
const Handle(Adaptor2d_HCurve2d) anAd2dC = new Geom2dAdaptor_GHCurve(myCurve2D);
const Handle(Adaptor3d_HSurface) anAdS = new GeomAdaptor_HSurface(mySurface);
const Handle(Adaptor2d_Curve2d) anAd2dC = new Geom2dAdaptor_Curve(myCurve2D);
const Handle(Adaptor3d_Surface) anAdS = new GeomAdaptor_Surface(mySurface);
const Adaptor3d_CurveOnSurface anACS(anAd2dC, anAdS);