diff --git a/src/GCPnts/FILES b/src/GCPnts/FILES index e5f0bedb74..29ead1dda0 100755 --- a/src/GCPnts/FILES +++ b/src/GCPnts/FILES @@ -1,29 +1,23 @@ GCPnts_AbscissaPoint.cxx -GCPnts_AbscissaPoint.gxx +GCPnts_AbscissaPoint.pxx GCPnts_AbscissaPoint.hxx -GCPnts_AbscissaPoint.lxx GCPnts_AbscissaType.hxx GCPnts_DeflectionType.hxx GCPnts_QuasiUniformAbscissa.cxx -GCPnts_QuasiUniformAbscissa.gxx +GCPnts_QuasiUniformAbscissa.pxx GCPnts_QuasiUniformAbscissa.hxx -GCPnts_QuasiUniformAbscissa.lxx GCPnts_QuasiUniformDeflection.cxx -GCPnts_QuasiUniformDeflection.gxx +GCPnts_QuasiUniformDeflection.pxx GCPnts_QuasiUniformDeflection.hxx -GCPnts_QuasiUniformDeflection.lxx GCPnts_TangentialDeflection.cxx -GCPnts_TangentialDeflection.gxx +GCPnts_TangentialDeflection.pxx GCPnts_TangentialDeflection.hxx -GCPnts_TangentialDeflection.lxx GCPnts_UniformAbscissa.cxx -GCPnts_UniformAbscissa.gxx +GCPnts_UniformAbscissa.pxx GCPnts_UniformAbscissa.hxx -GCPnts_UniformAbscissa.lxx GCPnts_UniformDeflection.cxx -GCPnts_UniformDeflection.gxx +GCPnts_UniformDeflection.pxx GCPnts_UniformDeflection.hxx -GCPnts_UniformDeflection.lxx GCPnts_DistFunction.hxx GCPnts_DistFunction.cxx GCPnts_DistFunction2d.hxx diff --git a/src/GCPnts/GCPnts_AbscissaPoint.cxx b/src/GCPnts/GCPnts_AbscissaPoint.cxx index 29c5ae5c28..a536647ae3 100644 --- a/src/GCPnts/GCPnts_AbscissaPoint.cxx +++ b/src/GCPnts/GCPnts_AbscissaPoint.cxx @@ -36,7 +36,7 @@ GCPnts_AbscissaPoint::GCPnts_AbscissaPoint() #define Handle_TheBezierCurve Handle(Geom_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve) -#include +#include "GCPnts_AbscissaPoint.pxx" #undef TheCurve #undef Handle_TheBezierCurve @@ -49,5 +49,4 @@ GCPnts_AbscissaPoint::GCPnts_AbscissaPoint() #define Handle_TheBezierCurve Handle(Geom2d_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve) -#include - +#include "GCPnts_AbscissaPoint.pxx" diff --git a/src/GCPnts/GCPnts_AbscissaPoint.hxx b/src/GCPnts/GCPnts_AbscissaPoint.hxx index 7a930ca7a8..6c4498cb4a 100644 --- a/src/GCPnts/GCPnts_AbscissaPoint.hxx +++ b/src/GCPnts/GCPnts_AbscissaPoint.hxx @@ -17,19 +17,13 @@ #ifndef _GCPnts_AbscissaPoint_HeaderFile #define _GCPnts_AbscissaPoint_HeaderFile -#include -#include -#include - #include -#include -#include + class StdFail_NotDone; class Standard_ConstructionError; class Adaptor3d_Curve; class Adaptor2d_Curve2d; - //! Provides an algorithm to compute a point on a curve //! situated at a given distance from another point on the //! curve, the distance being measured along the curve @@ -127,38 +121,23 @@ public: //! IsDone is a protection against: //! - non-convergence of the algorithm //! - querying the results before computation. - Standard_Boolean IsDone() const; + Standard_Boolean IsDone () const + { + return myComputer.IsDone (); + } //! Returns the parameter on the curve of the point //! solution of this algorithm. //! Exceptions //! StdFail_NotDone if the computation was not //! successful, or was not done. - Standard_Real Parameter() const; - - - - -protected: - - - - + Standard_Real Parameter () const + { + return myComputer.Parameter (); + } private: - - - CPnts_AbscissaPoint myComputer; - - }; - -#include - - - - - #endif // _GCPnts_AbscissaPoint_HeaderFile diff --git a/src/GCPnts/GCPnts_AbscissaPoint.lxx b/src/GCPnts/GCPnts_AbscissaPoint.lxx deleted file mode 100644 index d9d92736d5..0000000000 --- a/src/GCPnts/GCPnts_AbscissaPoint.lxx +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : IsDone -//purpose : -//======================================================================= - -inline Standard_Boolean GCPnts_AbscissaPoint::IsDone() const -{ - return myComputer.IsDone(); -} - -//======================================================================= -//function : Parameter -//purpose : -//======================================================================= - -inline Standard_Real GCPnts_AbscissaPoint::Parameter() const -{ - return myComputer.Parameter(); -} - - diff --git a/src/GCPnts/GCPnts_AbscissaPoint.gxx b/src/GCPnts/GCPnts_AbscissaPoint.pxx similarity index 100% rename from src/GCPnts/GCPnts_AbscissaPoint.gxx rename to src/GCPnts/GCPnts_AbscissaPoint.pxx diff --git a/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx b/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx index 4e3b0677be..3cf02a15ca 100644 --- a/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx +++ b/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx @@ -53,7 +53,7 @@ GCPnts_QuasiUniformAbscissa::GCPnts_QuasiUniformAbscissa () #define TheArray1OfPnt TColgp_Array1OfPnt #define ThePnt gp_Pnt -#include +#include "GCPnts_QuasiUniformAbscissa.pxx" #undef TheCurve #undef Handle_TheBezierCurve @@ -70,7 +70,7 @@ GCPnts_QuasiUniformAbscissa::GCPnts_QuasiUniformAbscissa () #define TheArray1OfPnt TColgp_Array1OfPnt2d #define ThePnt gp_Pnt2d -#include +#include "GCPnts_QuasiUniformAbscissa.pxx" diff --git a/src/GCPnts/GCPnts_QuasiUniformAbscissa.hxx b/src/GCPnts/GCPnts_QuasiUniformAbscissa.hxx index 47258423f6..a9dd598288 100644 --- a/src/GCPnts/GCPnts_QuasiUniformAbscissa.hxx +++ b/src/GCPnts/GCPnts_QuasiUniformAbscissa.hxx @@ -17,14 +17,9 @@ #ifndef _GCPnts_QuasiUniformAbscissa_HeaderFile #define _GCPnts_QuasiUniformAbscissa_HeaderFile -#include -#include -#include - -#include -#include +#include #include -#include + class Standard_DomainError; class Standard_ConstructionError; class Standard_OutOfRange; @@ -32,7 +27,6 @@ class StdFail_NotDone; class Adaptor3d_Curve; class Adaptor2d_Curve2d; - //! This class provides an algorithm to compute a uniform abscissa //! distribution of points on a curve, i.e. a sequence of //! equidistant points. The distance between two @@ -113,8 +107,10 @@ public: //! IsDone is a protection against: //! - non-convergence of the algorithm //! - querying the results before computation. - Standard_Boolean IsDone() const; - + Standard_Boolean IsDone () const + { + return myDone; + } //! Returns the number of points of the distribution //! computed by this algorithm. @@ -128,7 +124,11 @@ public: //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Integer NbPoints() const; + Standard_Integer NbPoints () const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_QuasiUniformAbscissa::NbPoints()"); + return myNbPoints; + } //! Returns the parameter of the point of index Index in //! the distribution computed by this algorithm. @@ -140,33 +140,16 @@ public: //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Real Parameter (const Standard_Integer Index) const; - - - - -protected: - - - - + Standard_Real Parameter (const Standard_Integer Index) const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_QuasiUniformAbscissa::Parameter()"); + return myParams->Value (Index); + } private: - - - Standard_Boolean myDone; Standard_Integer myNbPoints; Handle(TColStd_HArray1OfReal) myParams; - - }; - -#include - - - - - #endif // _GCPnts_QuasiUniformAbscissa_HeaderFile diff --git a/src/GCPnts/GCPnts_QuasiUniformAbscissa.lxx b/src/GCPnts/GCPnts_QuasiUniformAbscissa.lxx deleted file mode 100644 index 0201cae176..0000000000 --- a/src/GCPnts/GCPnts_QuasiUniformAbscissa.lxx +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include - -inline Standard_Boolean GCPnts_QuasiUniformAbscissa::IsDone () const -{ - return myDone; -} - - -inline Standard_Integer GCPnts_QuasiUniformAbscissa::NbPoints () const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_QuasiUniformAbscissa::NbPoints()"); - return myNbPoints; -} - - -inline Standard_Real GCPnts_QuasiUniformAbscissa::Parameter - (const Standard_Integer Index) const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_QuasiUniformAbscissa::Parameter()"); - return myParams->Value(Index) ; -} - - - - - - diff --git a/src/GCPnts/GCPnts_QuasiUniformAbscissa.gxx b/src/GCPnts/GCPnts_QuasiUniformAbscissa.pxx similarity index 100% rename from src/GCPnts/GCPnts_QuasiUniformAbscissa.gxx rename to src/GCPnts/GCPnts_QuasiUniformAbscissa.pxx diff --git a/src/GCPnts/GCPnts_QuasiUniformDeflection.cxx b/src/GCPnts/GCPnts_QuasiUniformDeflection.cxx index f0cce03465..b4dea426b2 100644 --- a/src/GCPnts/GCPnts_QuasiUniformDeflection.cxx +++ b/src/GCPnts/GCPnts_QuasiUniformDeflection.cxx @@ -91,7 +91,7 @@ GCPnts_QuasiUniformDeflection::GCPnts_QuasiUniformDeflection () #define Handle_TheBezierCurve Handle(Geom_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve) -#include +#include "GCPnts_QuasiUniformDeflection.pxx" #undef TheCurve #undef Handle_TheBezierCurve @@ -104,7 +104,7 @@ GCPnts_QuasiUniformDeflection::GCPnts_QuasiUniformDeflection () #define Handle_TheBezierCurve Handle(Geom2d_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve) -#include +#include "GCPnts_QuasiUniformDeflection.pxx" diff --git a/src/GCPnts/GCPnts_QuasiUniformDeflection.hxx b/src/GCPnts/GCPnts_QuasiUniformDeflection.hxx index c4165e9784..c9392c22dc 100644 --- a/src/GCPnts/GCPnts_QuasiUniformDeflection.hxx +++ b/src/GCPnts/GCPnts_QuasiUniformDeflection.hxx @@ -17,16 +17,11 @@ #ifndef _GCPnts_QuasiUniformDeflection_HeaderFile #define _GCPnts_QuasiUniformDeflection_HeaderFile -#include -#include -#include - -#include -#include +#include #include #include #include -#include + class Standard_DomainError; class Standard_ConstructionError; class Standard_OutOfRange; @@ -35,7 +30,6 @@ class Adaptor3d_Curve; class Adaptor2d_Curve2d; class gp_Pnt; - //! This class computes a distribution of points on a //! curve. The points may respect the deflection. The algorithm //! is not based on the classical prediction (with second @@ -186,15 +180,21 @@ public: //! IsDone is a protection against: //! - non-convergence of the algorithm //! - querying the results before computation. - Standard_Boolean IsDone() const; - + Standard_Boolean IsDone () const + { + return myDone; + } //! Returns the number of points of the distribution //! computed by this algorithm. //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Integer NbPoints() const; + Standard_Integer NbPoints () const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_QuasiUniformDeflection::NbPoints()"); + return myParams.Length (); + } //! Returns the parameter of the point of index Index in //! the distribution computed by this algorithm. @@ -206,7 +206,11 @@ public: //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Real Parameter (const Standard_Integer Index) const; + Standard_Real Parameter (const Standard_Integer Index) const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_QuasiUniformDeflection::Parameter()"); + return myParams (Index); + } //! Returns the point of index Index in the distribution //! computed by this algorithm. @@ -228,35 +232,18 @@ public: //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Real Deflection() const; - - - - -protected: - - - - + Standard_Real Deflection () const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_QuasiUniformDeflection::Deflection()"); + return myDeflection; + } private: - - - Standard_Boolean myDone; Standard_Real myDeflection; TColStd_SequenceOfReal myParams; TColgp_SequenceOfPnt myPoints; GeomAbs_Shape myCont; - - }; - -#include - - - - - #endif // _GCPnts_QuasiUniformDeflection_HeaderFile diff --git a/src/GCPnts/GCPnts_QuasiUniformDeflection.lxx b/src/GCPnts/GCPnts_QuasiUniformDeflection.lxx deleted file mode 100644 index 40edcd0672..0000000000 --- a/src/GCPnts/GCPnts_QuasiUniformDeflection.lxx +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -//======================================================================= -//function : IsDone -//purpose : -//======================================================================= - -inline Standard_Boolean GCPnts_QuasiUniformDeflection::IsDone () const -{ - return myDone; -} - -//======================================================================= -//function : Deflection -//purpose : -//======================================================================= - -inline Standard_Real GCPnts_QuasiUniformDeflection::Deflection () const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_QuasiUniformDeflection::Deflection()"); - return myDeflection; -} - -//======================================================================= -//function : NbPoints -//purpose : -//======================================================================= - -inline Standard_Integer GCPnts_QuasiUniformDeflection::NbPoints () const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_QuasiUniformDeflection::NbPoints()"); - return myParams.Length(); -} - -//======================================================================= -//function : Parameter -//purpose : -//======================================================================= - -inline Standard_Real GCPnts_QuasiUniformDeflection::Parameter - (const Standard_Integer Index) const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_QuasiUniformDeflection::Parameter()"); - return myParams(Index); -} - diff --git a/src/GCPnts/GCPnts_QuasiUniformDeflection.gxx b/src/GCPnts/GCPnts_QuasiUniformDeflection.pxx similarity index 100% rename from src/GCPnts/GCPnts_QuasiUniformDeflection.gxx rename to src/GCPnts/GCPnts_QuasiUniformDeflection.pxx diff --git a/src/GCPnts/GCPnts_TangentialDeflection.cxx b/src/GCPnts/GCPnts_TangentialDeflection.cxx index 6bb89e7aff..7019e58c9b 100644 --- a/src/GCPnts/GCPnts_TangentialDeflection.cxx +++ b/src/GCPnts/GCPnts_TangentialDeflection.cxx @@ -178,12 +178,13 @@ Standard_Real GCPnts_TangentialDeflection::ArcAngularStep( #include #include #include + #define TheCurve Adaptor3d_Curve #define Handle_TheBezierCurve Handle(Geom_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve) #define TheMaxCurvLinDist GCPnts_DistFunction #define TheMaxCurvLinDistMV GCPnts_DistFunctionMV -#include +#include "GCPnts_TangentialDeflection.pxx" #undef Handle_TheBezierCurve #undef Handle_TheBSplineCurve #undef TheCurve @@ -200,7 +201,7 @@ Standard_Real GCPnts_TangentialDeflection::ArcAngularStep( #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve) #define TheMaxCurvLinDist GCPnts_DistFunction2d #define TheMaxCurvLinDistMV GCPnts_DistFunction2dMV -#include +#include "GCPnts_TangentialDeflection.pxx" #undef Handle_TheBezierCurve #undef Handle_TheBSplineCurve #undef TheCurve diff --git a/src/GCPnts/GCPnts_TangentialDeflection.hxx b/src/GCPnts/GCPnts_TangentialDeflection.hxx index e95142d22c..0e66213137 100644 --- a/src/GCPnts/GCPnts_TangentialDeflection.hxx +++ b/src/GCPnts/GCPnts_TangentialDeflection.hxx @@ -17,21 +17,15 @@ #ifndef _GCPnts_TangentialDeflection_HeaderFile #define _GCPnts_TangentialDeflection_HeaderFile -#include -#include -#include - -#include -#include #include #include -#include #include #include #include #include #include #include + class Standard_ConstructionError; class Standard_OutOfRange; @@ -102,26 +96,25 @@ public: //! or founded with parametric tolerance (replaced if theIsReplace is true) Standard_EXPORT Standard_Integer AddPoint (const gp_Pnt& thePnt, const Standard_Real theParam, const Standard_Boolean theIsReplace = Standard_True); - Standard_Integer NbPoints() const; + Standard_Integer NbPoints () const + { + return parameters.Length (); + } - Standard_Real Parameter (const Standard_Integer I) const; + Standard_Real Parameter (const Standard_Integer I) const + { + return parameters.Value (I); + } - gp_Pnt Value (const Standard_Integer I) const; + gp_Pnt Value (const Standard_Integer I) const + { + return points.Value (I); + } //! Computes angular step for the arc using the given parameters. Standard_EXPORT static Standard_Real ArcAngularStep (const Standard_Real theRadius, const Standard_Real theLinearDeflection, const Standard_Real theAngularDeflection, const Standard_Real theMinLength); - - - -protected: - - - - - private: - Standard_EXPORT void PerformLinear (const Adaptor3d_Curve& C); @@ -145,6 +138,7 @@ private: Standard_EXPORT void EstimDefl (const Adaptor2d_Curve2d& C, const Standard_Real U1, const Standard_Real U2, Standard_Real& MaxDefl, Standard_Real& UMax); +private: Standard_Real angularDeflection; Standard_Real curvatureDeflection; Standard_Real uTol; @@ -154,15 +148,6 @@ private: Standard_Real firstu; TColgp_SequenceOfPnt points; TColStd_SequenceOfReal parameters; - - }; - -#include - - - - - #endif // _GCPnts_TangentialDeflection_HeaderFile diff --git a/src/GCPnts/GCPnts_TangentialDeflection.lxx b/src/GCPnts/GCPnts_TangentialDeflection.lxx deleted file mode 100644 index 6b80516957..0000000000 --- a/src/GCPnts/GCPnts_TangentialDeflection.lxx +++ /dev/null @@ -1,36 +0,0 @@ -// Created on: 1996-11-08 -// Created by: Jean Claude VAUTHIER -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -inline Standard_Integer GCPnts_TangentialDeflection::NbPoints () const -{ - return parameters.Length (); -} - -inline Standard_Real GCPnts_TangentialDeflection::Parameter (const Standard_Integer I) const -{ - return parameters.Value (I); -} - -inline gp_Pnt GCPnts_TangentialDeflection::Value (const Standard_Integer I) const -{ - return points.Value (I); -} - - - - diff --git a/src/GCPnts/GCPnts_TangentialDeflection.gxx b/src/GCPnts/GCPnts_TangentialDeflection.pxx similarity index 100% rename from src/GCPnts/GCPnts_TangentialDeflection.gxx rename to src/GCPnts/GCPnts_TangentialDeflection.pxx diff --git a/src/GCPnts/GCPnts_UniformAbscissa.cxx b/src/GCPnts/GCPnts_UniformAbscissa.cxx index 05b04fe822..75c50752e1 100644 --- a/src/GCPnts/GCPnts_UniformAbscissa.cxx +++ b/src/GCPnts/GCPnts_UniformAbscissa.cxx @@ -39,7 +39,7 @@ GCPnts_UniformAbscissa::GCPnts_UniformAbscissa () #define Handle_TheBezierCurve Handle(Geom_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve) -#include +#include "GCPnts_UniformAbscissa.pxx" #undef TheCurve #undef Handle_TheBezierCurve @@ -52,7 +52,7 @@ GCPnts_UniformAbscissa::GCPnts_UniformAbscissa () #define Handle_TheBezierCurve Handle(Geom2d_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve) -#include +#include "GCPnts_UniformAbscissa.pxx" diff --git a/src/GCPnts/GCPnts_UniformAbscissa.hxx b/src/GCPnts/GCPnts_UniformAbscissa.hxx index a95ed2cbfd..c3fc7eb9f6 100644 --- a/src/GCPnts/GCPnts_UniformAbscissa.hxx +++ b/src/GCPnts/GCPnts_UniformAbscissa.hxx @@ -17,14 +17,9 @@ #ifndef _GCPnts_UniformAbscissa_HeaderFile #define _GCPnts_UniformAbscissa_HeaderFile -#include -#include -#include - -#include -#include -#include +#include #include + class Standard_DomainError; class Standard_ConstructionError; class Standard_OutOfRange; @@ -32,7 +27,6 @@ class StdFail_NotDone; class Adaptor3d_Curve; class Adaptor2d_Curve2d; - //! This class allows to compute a uniform distribution of points //! on a curve (ie the points will all be equally distant). class GCPnts_UniformAbscissa @@ -121,43 +115,37 @@ public: //! , . Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbPoints, const Standard_Real U1, const Standard_Real U2, const Standard_Real Toler = -1); - Standard_Boolean IsDone() const; + Standard_Boolean IsDone () const + { + return myDone; + } - Standard_Integer NbPoints() const; + Standard_Integer NbPoints () const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_UniformAbscissa::NbPoints()"); + return myNbPoints; + } //! returns the computed Parameter of index . - Standard_Real Parameter (const Standard_Integer Index) const; + Standard_Real Parameter (const Standard_Integer Index) const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_UniformAbscissa::Parameter()"); + return myParams->Value (Index); + } //! returne the current abscissa //! ie the distance between two consecutive points - Standard_Real Abscissa() const; - - - - -protected: - - - - + Standard_Real Abscissa () const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_UniformAbscissa::Abscissa()"); + return myAbscissa; + } private: - - - Standard_Boolean myDone; Standard_Integer myNbPoints; Standard_Real myAbscissa; Handle(TColStd_HArray1OfReal) myParams; - - }; - -#include - - - - - #endif // _GCPnts_UniformAbscissa_HeaderFile diff --git a/src/GCPnts/GCPnts_UniformAbscissa.lxx b/src/GCPnts/GCPnts_UniformAbscissa.lxx deleted file mode 100644 index 1137886c7a..0000000000 --- a/src/GCPnts/GCPnts_UniformAbscissa.lxx +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include - -inline Standard_Boolean GCPnts_UniformAbscissa::IsDone () const -{ - return myDone; -} - -inline Standard_Real GCPnts_UniformAbscissa::Abscissa () const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_UniformAbscissa::Abscissa()"); - return myAbscissa; -} - -inline Standard_Integer GCPnts_UniformAbscissa::NbPoints () const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_UniformAbscissa::NbPoints()"); - return myNbPoints; -} - - -inline Standard_Real GCPnts_UniformAbscissa::Parameter - (const Standard_Integer Index) const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_UniformAbscissa::Parameter()"); - return myParams->Value(Index) ; -} - - - - - - diff --git a/src/GCPnts/GCPnts_UniformAbscissa.gxx b/src/GCPnts/GCPnts_UniformAbscissa.pxx similarity index 100% rename from src/GCPnts/GCPnts_UniformAbscissa.gxx rename to src/GCPnts/GCPnts_UniformAbscissa.pxx diff --git a/src/GCPnts/GCPnts_UniformDeflection.cxx b/src/GCPnts/GCPnts_UniformDeflection.cxx index 050823bb20..c0905ad9fb 100644 --- a/src/GCPnts/GCPnts_UniformDeflection.cxx +++ b/src/GCPnts/GCPnts_UniformDeflection.cxx @@ -65,10 +65,11 @@ GCPnts_UniformDeflection::GCPnts_UniformDeflection () #include #include + #define TheCurve Adaptor3d_Curve #define Handle_TheBezierCurve Handle(Geom_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve) -#include +#include "GCPnts_UniformDeflection.pxx" #undef TheCurve #undef Handle_TheBezierCurve #undef Handle_TheBSplineCurve @@ -78,7 +79,7 @@ GCPnts_UniformDeflection::GCPnts_UniformDeflection () #define TheCurve Adaptor2d_Curve2d #define Handle_TheBezierCurve Handle(Geom2d_BezierCurve) #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve) -#include +#include "GCPnts_UniformDeflection.pxx" #undef TheCurve #undef Handle_TheBezierCurve #undef Handle_TheBSplineCurve diff --git a/src/GCPnts/GCPnts_UniformDeflection.hxx b/src/GCPnts/GCPnts_UniformDeflection.hxx index 7cb692dd91..4cc8c4022a 100644 --- a/src/GCPnts/GCPnts_UniformDeflection.hxx +++ b/src/GCPnts/GCPnts_UniformDeflection.hxx @@ -17,15 +17,10 @@ #ifndef _GCPnts_UniformDeflection_HeaderFile #define _GCPnts_UniformDeflection_HeaderFile -#include -#include -#include - -#include -#include +#include #include #include -#include + class Standard_DomainError; class Standard_ConstructionError; class Standard_OutOfRange; @@ -34,7 +29,6 @@ class Adaptor3d_Curve; class Adaptor2d_Curve2d; class gp_Pnt; - //! Provides an algorithm to compute a distribution of //! points on a 'C2' continuous curve. The algorithm //! respects a criterion of maximum deflection between @@ -137,14 +131,21 @@ public: //! IsDone is a protection against: //! - non-convergence of the algorithm //! - querying the results before computation. - Standard_Boolean IsDone() const; + Standard_Boolean IsDone () const + { + return myDone; + } //! Returns the number of points of the distribution //! computed by this algorithm. //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Integer NbPoints() const; + Standard_Integer NbPoints () const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_UniformDeflection::NbPoints()"); + return myParams.Length (); + } //! Returns the parameter of the point of index Index in //! the distribution computed by this algorithm. @@ -156,7 +157,11 @@ public: //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Real Parameter (const Standard_Integer Index) const; + Standard_Real Parameter (const Standard_Integer Index) const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_UniformDeflection::Parameter()"); + return myParams (Index); + } //! Returns the point of index Index in the distribution //! computed by this algorithm. @@ -178,34 +183,17 @@ public: //! Exceptions //! StdFail_NotDone if this algorithm has not been //! initialized, or if the computation was not successful. - Standard_Real Deflection() const; - - - - -protected: - - - - + Standard_Real Deflection () const + { + StdFail_NotDone_Raise_if (!myDone, "GCPnts_UniformDeflection::Deflection()"); + return myDeflection; + } private: - - - Standard_Boolean myDone; Standard_Real myDeflection; TColStd_SequenceOfReal myParams; TColgp_SequenceOfPnt myPoints; - - }; - -#include - - - - - #endif // _GCPnts_UniformDeflection_HeaderFile diff --git a/src/GCPnts/GCPnts_UniformDeflection.lxx b/src/GCPnts/GCPnts_UniformDeflection.lxx deleted file mode 100644 index aa8fd2b291..0000000000 --- a/src/GCPnts/GCPnts_UniformDeflection.lxx +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -//======================================================================= -//function : IsDone -//purpose : -//======================================================================= - -inline Standard_Boolean GCPnts_UniformDeflection::IsDone () const -{ - return myDone; -} - -//======================================================================= -//function : Deflection -//purpose : -//======================================================================= - -inline Standard_Real GCPnts_UniformDeflection::Deflection () const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_UniformDeflection::Deflection()"); - return myDeflection; -} - -//======================================================================= -//function : NbPoints -//purpose : -//======================================================================= - -inline Standard_Integer GCPnts_UniformDeflection::NbPoints () const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_UniformDeflection::NbPoints()"); - return myParams.Length(); -} - -//======================================================================= -//function : Parameter -//purpose : -//======================================================================= - -inline Standard_Real GCPnts_UniformDeflection::Parameter - (const Standard_Integer Index) const -{ - StdFail_NotDone_Raise_if(!myDone, - "GCPnts_UniformDeflection::Parameter()"); - return myParams(Index); -} - diff --git a/src/GCPnts/GCPnts_UniformDeflection.gxx b/src/GCPnts/GCPnts_UniformDeflection.pxx similarity index 100% rename from src/GCPnts/GCPnts_UniformDeflection.gxx rename to src/GCPnts/GCPnts_UniformDeflection.pxx