From 5201d3e66cb30a87ed0ffcb3dc500076b3b3233f Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 2 Nov 2015 12:03:23 +0300 Subject: [PATCH] 0026255: Adaptor3d_OffsetCurve is misleading 1. Rename Adaptor3d_OffsetCurve to Adaptor2d_OffsetCurve and relative classes 2. Remove redundant class Geom2dGcc_CurveToolGeo --- CMakeLists.txt | 1 + .../Adaptor2d_HOffsetCurve.hxx} | 38 ++--- .../Adaptor2d_HOffsetCurve_0.cxx} | 14 +- .../Adaptor2d_OffsetCurve.cxx} | 112 ++++++------- .../Adaptor2d_OffsetCurve.hxx} | 18 +-- .../Adaptor2d_OffsetCurve.lxx} | 8 +- src/Adaptor2d/FILES | 5 + src/Adaptor3d/FILES | 5 - src/BRepFill/BRepFill_OffsetWire.cxx | 8 +- src/Geom2dGcc/FILES | 2 - src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx | 63 ++++---- src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx | 81 +++++----- src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx | 43 +++-- src/Geom2dGcc/Geom2dGcc_CurveToolGeo.cxx | 152 ------------------ src/Geom2dGcc/Geom2dGcc_CurveToolGeo.hxx | 126 --------------- src/MAT2d/MAT2d_Circuit.cxx | 6 +- 16 files changed, 197 insertions(+), 485 deletions(-) rename src/{Adaptor3d/Adaptor3d_HOffsetCurve.hxx => Adaptor2d/Adaptor2d_HOffsetCurve.hxx} (62%) rename src/{Adaptor3d/Adaptor3d_HOffsetCurve_0.cxx => Adaptor2d/Adaptor2d_HOffsetCurve_0.cxx} (73%) rename src/{Adaptor3d/Adaptor3d_OffsetCurve.cxx => Adaptor2d/Adaptor2d_OffsetCurve.cxx} (83%) rename src/{Adaptor3d/Adaptor3d_OffsetCurve.hxx => Adaptor2d/Adaptor2d_OffsetCurve.hxx} (93%) rename src/{Adaptor3d/Adaptor3d_OffsetCurve.lxx => Adaptor2d/Adaptor2d_OffsetCurve.lxx} (85%) delete mode 100644 src/Geom2dGcc/Geom2dGcc_CurveToolGeo.cxx delete mode 100644 src/Geom2dGcc/Geom2dGcc_CurveToolGeo.hxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 755ad03ba0..a140de8c88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,6 +239,7 @@ endif() OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS) if (NOT DEFINED ANDROID AND CAN_USE_GL2PS) +message(STATUS "USE_GL2PS = $ENV{USE_GL2PS} or ${USE_GL2PS}") set (USE_GL2PS OFF CACHE BOOL "${USE_GL2PS_DESCR}") if (USE_GL2PS) diff --git a/src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx b/src/Adaptor2d/Adaptor2d_HOffsetCurve.hxx similarity index 62% rename from src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx rename to src/Adaptor2d/Adaptor2d_HOffsetCurve.hxx index 210f893938..e613cb8740 100644 --- a/src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx +++ b/src/Adaptor2d/Adaptor2d_HOffsetCurve.hxx @@ -14,56 +14,56 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _Adaptor3d_HOffsetCurve_HeaderFile -#define _Adaptor3d_HOffsetCurve_HeaderFile +#ifndef _Adaptor2d_HOffsetCurve_HeaderFile +#define _Adaptor2d_HOffsetCurve_HeaderFile #include #include -#include +#include #include class Standard_OutOfRange; class Standard_NoSuchObject; class Standard_DomainError; -class Adaptor3d_OffsetCurve; +class Adaptor2d_OffsetCurve; class Adaptor2d_Curve2d; -class Adaptor3d_HOffsetCurve; -DEFINE_STANDARD_HANDLE(Adaptor3d_HOffsetCurve, Adaptor2d_HCurve2d) +class Adaptor2d_HOffsetCurve; +DEFINE_STANDARD_HANDLE(Adaptor2d_HOffsetCurve, Adaptor2d_HCurve2d) -class Adaptor3d_HOffsetCurve : public Adaptor2d_HCurve2d +class Adaptor2d_HOffsetCurve : public Adaptor2d_HCurve2d { public: //! Creates an empty GenHCurve2d. - Standard_EXPORT Adaptor3d_HOffsetCurve(); + Standard_EXPORT Adaptor2d_HOffsetCurve(); //! Creates a GenHCurve2d from a Curve - Standard_EXPORT Adaptor3d_HOffsetCurve(const Adaptor3d_OffsetCurve& C); + Standard_EXPORT Adaptor2d_HOffsetCurve(const Adaptor2d_OffsetCurve& C); //! Sets the field of the GenHCurve2d. - Standard_EXPORT void Set (const Adaptor3d_OffsetCurve& C); + Standard_EXPORT void Set (const Adaptor2d_OffsetCurve& C); //! Returns the curve used to create the GenHCurve2d. //! This is redefined from HCurve2d, cannot be inline. Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const; //! Returns the curve used to create the GenHCurve. - Adaptor3d_OffsetCurve& ChangeCurve2d(); + Adaptor2d_OffsetCurve& ChangeCurve2d(); - DEFINE_STANDARD_RTTI(Adaptor3d_HOffsetCurve,Adaptor2d_HCurve2d) + DEFINE_STANDARD_RTTI(Adaptor2d_HOffsetCurve,Adaptor2d_HCurve2d) protected: - Adaptor3d_OffsetCurve myCurve; + Adaptor2d_OffsetCurve myCurve; private: @@ -73,11 +73,11 @@ private: }; -#define TheCurve Adaptor3d_OffsetCurve -#define TheCurve_hxx -#define Adaptor2d_GenHCurve2d Adaptor3d_HOffsetCurve -#define Adaptor2d_GenHCurve2d_hxx -#define Handle_Adaptor2d_GenHCurve2d Handle(Adaptor3d_HOffsetCurve) +#define TheCurve Adaptor2d_OffsetCurve +#define TheCurve_hxx +#define Adaptor2d_GenHCurve2d Adaptor2d_HOffsetCurve +#define Adaptor2d_GenHCurve2d_hxx +#define Handle_Adaptor2d_GenHCurve2d Handle(Adaptor2d_HOffsetCurve) #include @@ -90,4 +90,4 @@ private: -#endif // _Adaptor3d_HOffsetCurve_HeaderFile +#endif // _Adaptor2d_HOffsetCurve_HeaderFile diff --git a/src/Adaptor3d/Adaptor3d_HOffsetCurve_0.cxx b/src/Adaptor2d/Adaptor2d_HOffsetCurve_0.cxx similarity index 73% rename from src/Adaptor3d/Adaptor3d_HOffsetCurve_0.cxx rename to src/Adaptor2d/Adaptor2d_HOffsetCurve_0.cxx index 2c05465472..47a5b1a984 100644 --- a/src/Adaptor3d/Adaptor3d_HOffsetCurve_0.cxx +++ b/src/Adaptor2d/Adaptor2d_HOffsetCurve_0.cxx @@ -14,14 +14,14 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include #include #include #include #include -#include +#include #include @@ -33,10 +33,10 @@ -#define TheCurve Adaptor3d_OffsetCurve -#define TheCurve_hxx -#define Adaptor2d_GenHCurve2d Adaptor3d_HOffsetCurve -#define Adaptor2d_GenHCurve2d_hxx -#define Handle_Adaptor2d_GenHCurve2d Handle(Adaptor3d_HOffsetCurve) +#define TheCurve Adaptor2d_OffsetCurve +#define TheCurve_hxx +#define Adaptor2d_GenHCurve2d Adaptor2d_HOffsetCurve +#define Adaptor2d_GenHCurve2d_hxx +#define Handle_Adaptor2d_GenHCurve2d Handle(Adaptor2d_HOffsetCurve) #include diff --git a/src/Adaptor3d/Adaptor3d_OffsetCurve.cxx b/src/Adaptor2d/Adaptor2d_OffsetCurve.cxx similarity index 83% rename from src/Adaptor3d/Adaptor3d_OffsetCurve.cxx rename to src/Adaptor2d/Adaptor2d_OffsetCurve.cxx index 93b88ba7e5..fc18a6d633 100644 --- a/src/Adaptor3d/Adaptor3d_OffsetCurve.cxx +++ b/src/Adaptor2d/Adaptor2d_OffsetCurve.cxx @@ -13,8 +13,8 @@ #include -#include -#include +#include +#include #include #include #include @@ -37,10 +37,10 @@ #include //======================================================================= -//function : Adaptor3d_OffsetCurve +//function : Adaptor2d_OffsetCurve //purpose : //======================================================================= -Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve() +Adaptor2d_OffsetCurve::Adaptor2d_OffsetCurve() : myOffset(0.0), myFirst (0.0), myLast (0.0) @@ -48,11 +48,11 @@ Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve() } //======================================================================= -//function : Adaptor3d_OffsetCurve +//function : Adaptor2d_OffsetCurve //purpose : //======================================================================= -Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& theCurve) +Adaptor2d_OffsetCurve::Adaptor2d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& theCurve) : myCurve (theCurve), myOffset(0.0), myFirst (0.0), @@ -61,11 +61,11 @@ Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& t } //======================================================================= -//function : Adaptor3d_OffsetCurve +//function : Adaptor2d_OffsetCurve //purpose : //======================================================================= -Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve +Adaptor2d_OffsetCurve::Adaptor2d_OffsetCurve (const Handle(Adaptor2d_HCurve2d)& theCurve, const Standard_Real theOffset) : myCurve (theCurve), myOffset(theOffset), @@ -75,11 +75,11 @@ Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve } //======================================================================= -//function : Adaptor3d_OffsetCurve +//function : Adaptor2d_OffsetCurve //purpose : //======================================================================= -Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve( +Adaptor2d_OffsetCurve::Adaptor2d_OffsetCurve( const Handle(Adaptor2d_HCurve2d)& theCurve, const Standard_Real theOffset, const Standard_Real theWFirst, @@ -96,7 +96,7 @@ Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve( //purpose : //======================================================================= -void Adaptor3d_OffsetCurve::Load(const Handle(Adaptor2d_HCurve2d)& C ) +void Adaptor2d_OffsetCurve::Load(const Handle(Adaptor2d_HCurve2d)& C ) { myCurve = C; myOffset = 0.; @@ -107,7 +107,7 @@ void Adaptor3d_OffsetCurve::Load(const Handle(Adaptor2d_HCurve2d)& C ) //purpose : //======================================================================= -void Adaptor3d_OffsetCurve::Load( const Standard_Real Offset) +void Adaptor2d_OffsetCurve::Load( const Standard_Real Offset) { myOffset = Offset; myFirst = myCurve->FirstParameter(); @@ -120,7 +120,7 @@ void Adaptor3d_OffsetCurve::Load( const Standard_Real Offset) //purpose : //======================================================================= -void Adaptor3d_OffsetCurve::Load(const Standard_Real Offset, +void Adaptor2d_OffsetCurve::Load(const Standard_Real Offset, const Standard_Real WFirst, const Standard_Real WLast) { @@ -134,7 +134,7 @@ void Adaptor3d_OffsetCurve::Load(const Standard_Real Offset, //purpose : //======================================================================= -GeomAbs_Shape Adaptor3d_OffsetCurve::Continuity() const +GeomAbs_Shape Adaptor2d_OffsetCurve::Continuity() const { switch (myCurve->Continuity()) { case GeomAbs_CN: return GeomAbs_CN; @@ -145,7 +145,7 @@ GeomAbs_Shape Adaptor3d_OffsetCurve::Continuity() const case GeomAbs_G1: return GeomAbs_C0; case GeomAbs_C0: // No Continuity !! - Standard_TypeMismatch::Raise("Adaptor3d_OffsetCurve::IntervalContinuity"); + Standard_TypeMismatch::Raise("Adaptor2d_OffsetCurve::IntervalContinuity"); break; } @@ -158,7 +158,7 @@ GeomAbs_Shape Adaptor3d_OffsetCurve::Continuity() const //purpose : //======================================================================= -Standard_Integer Adaptor3d_OffsetCurve::NbIntervals(const GeomAbs_Shape S) const +Standard_Integer Adaptor2d_OffsetCurve::NbIntervals(const GeomAbs_Shape S) const { GeomAbs_Shape Sh; if ( S >= GeomAbs_C2) Sh = GeomAbs_CN; @@ -185,7 +185,7 @@ Standard_Integer Adaptor3d_OffsetCurve::NbIntervals(const GeomAbs_Shape S) const //purpose : //======================================================================= -void Adaptor3d_OffsetCurve::Intervals(TColStd_Array1OfReal& TI, +void Adaptor2d_OffsetCurve::Intervals(TColStd_Array1OfReal& TI, const GeomAbs_Shape S) const { GeomAbs_Shape Sh; @@ -227,12 +227,12 @@ void Adaptor3d_OffsetCurve::Intervals(TColStd_Array1OfReal& TI, //purpose : //======================================================================= -Handle(Adaptor2d_HCurve2d) Adaptor3d_OffsetCurve::Trim +Handle(Adaptor2d_HCurve2d) Adaptor2d_OffsetCurve::Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real) const { - Handle(Adaptor3d_HOffsetCurve) HO = new Adaptor3d_HOffsetCurve(*this); + Handle(Adaptor2d_HOffsetCurve) HO = new Adaptor2d_HOffsetCurve(*this); HO->ChangeCurve2d().Load(myOffset,First,Last); return HO; } @@ -243,7 +243,7 @@ Handle(Adaptor2d_HCurve2d) Adaptor3d_OffsetCurve::Trim //purpose : //======================================================================= -Standard_Boolean Adaptor3d_OffsetCurve::IsClosed() const +Standard_Boolean Adaptor2d_OffsetCurve::IsClosed() const { if ( myOffset == 0.) { return myCurve->IsClosed(); @@ -276,7 +276,7 @@ Standard_Boolean Adaptor3d_OffsetCurve::IsClosed() const //purpose : //======================================================================= -Standard_Boolean Adaptor3d_OffsetCurve::IsPeriodic() const +Standard_Boolean Adaptor2d_OffsetCurve::IsPeriodic() const { return myCurve->IsPeriodic(); } @@ -286,7 +286,7 @@ Standard_Boolean Adaptor3d_OffsetCurve::IsPeriodic() const //purpose : //======================================================================= -Standard_Real Adaptor3d_OffsetCurve::Period() const +Standard_Real Adaptor2d_OffsetCurve::Period() const { return myCurve->Period(); } @@ -296,7 +296,7 @@ Standard_Real Adaptor3d_OffsetCurve::Period() const //purpose : //======================================================================= -gp_Pnt2d Adaptor3d_OffsetCurve::Value(const Standard_Real U) const +gp_Pnt2d Adaptor2d_OffsetCurve::Value(const Standard_Real U) const { if ( myOffset != 0.) { gp_Pnt2d P; @@ -309,7 +309,7 @@ gp_Pnt2d Adaptor3d_OffsetCurve::Value(const Standard_Real U) const return gp_Pnt2d(P.XY()+myOffset*V.XY()/Norme); } else { - gp_VectorWithNullMagnitude::Raise("Adaptor3d_OffsetCurve::Value"); + gp_VectorWithNullMagnitude::Raise("Adaptor2d_OffsetCurve::Value"); return gp_Pnt2d(); } } @@ -323,7 +323,7 @@ gp_Pnt2d Adaptor3d_OffsetCurve::Value(const Standard_Real U) const //purpose : //======================================================================= -void Adaptor3d_OffsetCurve::D0(const Standard_Real U, gp_Pnt2d& P) const +void Adaptor2d_OffsetCurve::D0(const Standard_Real U, gp_Pnt2d& P) const { P = Value( U); } @@ -333,7 +333,7 @@ void Adaptor3d_OffsetCurve::D0(const Standard_Real U, gp_Pnt2d& P) const //purpose : //======================================================================= -void Adaptor3d_OffsetCurve::D1 +void Adaptor2d_OffsetCurve::D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const { gp_Vec2d V1,V2,V3; @@ -351,7 +351,7 @@ void Adaptor3d_OffsetCurve::D1 (V2.XY()*V3.XY())/(Norme*Norme))); } else { - gp_VectorWithNullMagnitude::Raise("Adaptor3d_OffsetCurve::D1"); + gp_VectorWithNullMagnitude::Raise("Adaptor2d_OffsetCurve::D1"); } } else { @@ -364,7 +364,7 @@ void Adaptor3d_OffsetCurve::D1 //purpose : //======================================================================= -void Adaptor3d_OffsetCurve::D2 +void Adaptor2d_OffsetCurve::D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const { if ( myOffset != 0.) { @@ -392,7 +392,7 @@ void Adaptor3d_OffsetCurve::D2 D1( U,P,V1); } else { - gp_VectorWithNullMagnitude::Raise("Adaptor3d_OffsetCurve::D2"); + gp_VectorWithNullMagnitude::Raise("Adaptor2d_OffsetCurve::D2"); } } else { @@ -405,14 +405,14 @@ void Adaptor3d_OffsetCurve::D2 //purpose : //======================================================================= -//void Adaptor3d_OffsetCurve::D3 +//void Adaptor2d_OffsetCurve::D3 // (const Standard_Real T, // gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const -void Adaptor3d_OffsetCurve::D3 +void Adaptor2d_OffsetCurve::D3 (const Standard_Real , gp_Pnt2d& , gp_Vec2d& , gp_Vec2d& , gp_Vec2d& ) const { - Standard_NotImplemented::Raise("Adaptor3d_OffsetCurve::D3"); + Standard_NotImplemented::Raise("Adaptor2d_OffsetCurve::D3"); } //======================================================================= @@ -420,11 +420,11 @@ void Adaptor3d_OffsetCurve::D3 //purpose : //======================================================================= -gp_Vec2d Adaptor3d_OffsetCurve::DN +gp_Vec2d Adaptor2d_OffsetCurve::DN // (const Standard_Real T, const Standard_Integer N) const (const Standard_Real , const Standard_Integer ) const { - Standard_NotImplemented::Raise("Adaptor3d_OffsetCurve::DN"); + Standard_NotImplemented::Raise("Adaptor2d_OffsetCurve::DN"); return gp_Vec2d(); } @@ -434,7 +434,7 @@ gp_Vec2d Adaptor3d_OffsetCurve::DN //purpose : //======================================================================= -Standard_Real Adaptor3d_OffsetCurve::Resolution(const Standard_Real R3d) const +Standard_Real Adaptor2d_OffsetCurve::Resolution(const Standard_Real R3d) const { return Precision::PConfusion(R3d); } @@ -445,7 +445,7 @@ Standard_Real Adaptor3d_OffsetCurve::Resolution(const Standard_Real R3d) const //purpose : //======================================================================= -GeomAbs_CurveType Adaptor3d_OffsetCurve::GetType() const { +GeomAbs_CurveType Adaptor2d_OffsetCurve::GetType() const { if ( myOffset == 0.) { return myCurve->GetType(); @@ -471,7 +471,7 @@ GeomAbs_CurveType Adaptor3d_OffsetCurve::GetType() const { //purpose : //======================================================================= -gp_Lin2d Adaptor3d_OffsetCurve::Line() const +gp_Lin2d Adaptor2d_OffsetCurve::Line() const { if ( GetType() == GeomAbs_Line) { gp_Pnt2d P; @@ -480,7 +480,7 @@ gp_Lin2d Adaptor3d_OffsetCurve::Line() const return gp_Lin2d(P,V); } else { - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::Line"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Line"); return gp_Lin2d(); } } @@ -491,7 +491,7 @@ gp_Lin2d Adaptor3d_OffsetCurve::Line() const //purpose : //======================================================================= -gp_Circ2d Adaptor3d_OffsetCurve::Circle() const +gp_Circ2d Adaptor2d_OffsetCurve::Circle() const { if ( GetType() == GeomAbs_Circle) { if (myOffset == 0.) { @@ -516,12 +516,12 @@ gp_Circ2d Adaptor3d_OffsetCurve::Circle() const return gp_Circ2d( axes,radius); } else { // Cercle de rayon Nul - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::Circle"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Circle"); } } } else { - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::Circle"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Circle"); } // portage WNT return gp_Circ2d(); @@ -532,13 +532,13 @@ gp_Circ2d Adaptor3d_OffsetCurve::Circle() const //purpose : //======================================================================= -gp_Elips2d Adaptor3d_OffsetCurve::Ellipse() const +gp_Elips2d Adaptor2d_OffsetCurve::Ellipse() const { if (myCurve->GetType() == GeomAbs_Ellipse && myOffset == 0.) { return myCurve->Ellipse();; } else { - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve:Ellipse"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve:Ellipse"); } // portage WNT return gp_Elips2d(); @@ -549,13 +549,13 @@ gp_Elips2d Adaptor3d_OffsetCurve::Ellipse() const //purpose : //======================================================================= -gp_Hypr2d Adaptor3d_OffsetCurve::Hyperbola() const +gp_Hypr2d Adaptor2d_OffsetCurve::Hyperbola() const { if (myCurve->GetType()==GeomAbs_Hyperbola && myOffset==0.) { return myCurve->Hyperbola(); } else { - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve:Hyperbola"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve:Hyperbola"); } // portage WNT return gp_Hypr2d(); @@ -566,13 +566,13 @@ gp_Hypr2d Adaptor3d_OffsetCurve::Hyperbola() const //purpose : //======================================================================= -gp_Parab2d Adaptor3d_OffsetCurve::Parabola() const +gp_Parab2d Adaptor2d_OffsetCurve::Parabola() const { if (myCurve->GetType() == GeomAbs_Parabola && myOffset == 0.) { return myCurve->Parabola(); } else { - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve:Parabola"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve:Parabola"); } // portage WNT return gp_Parab2d(); @@ -582,7 +582,7 @@ gp_Parab2d Adaptor3d_OffsetCurve::Parabola() const //purpose : //======================================================================= -Standard_Integer Adaptor3d_OffsetCurve::Degree() const +Standard_Integer Adaptor2d_OffsetCurve::Degree() const { GeomAbs_CurveType type = myCurve->GetType(); if ( (type==GeomAbs_BezierCurve || type==GeomAbs_BSplineCurve) @@ -590,7 +590,7 @@ Standard_Integer Adaptor3d_OffsetCurve::Degree() const return myCurve->Degree(); } else { - Standard_NoSuchObject::Raise("Adaptor3d_offsetCurve::Degree"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Degree"); return 0; } } @@ -599,7 +599,7 @@ Standard_Integer Adaptor3d_OffsetCurve::Degree() const //purpose : //======================================================================= -Standard_Boolean Adaptor3d_OffsetCurve::IsRational() const +Standard_Boolean Adaptor2d_OffsetCurve::IsRational() const { if ( myOffset == 0.) { return myCurve->IsRational(); @@ -611,7 +611,7 @@ Standard_Boolean Adaptor3d_OffsetCurve::IsRational() const //purpose : //======================================================================= -Standard_Integer Adaptor3d_OffsetCurve::NbPoles() const +Standard_Integer Adaptor2d_OffsetCurve::NbPoles() const { GeomAbs_CurveType type = myCurve->GetType(); if ( (type==GeomAbs_BezierCurve || type==GeomAbs_BSplineCurve) @@ -619,7 +619,7 @@ Standard_Integer Adaptor3d_OffsetCurve::NbPoles() const return myCurve->NbPoles(); } else { - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::NbPoles"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::NbPoles"); return 0; } } @@ -629,13 +629,13 @@ Standard_Integer Adaptor3d_OffsetCurve::NbPoles() const //purpose : //======================================================================= -Standard_Integer Adaptor3d_OffsetCurve::NbKnots() const +Standard_Integer Adaptor2d_OffsetCurve::NbKnots() const { if( myOffset == 0.) { return myCurve->NbKnots(); } else { - Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::NbKnots"); + Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::NbKnots"); return 0; } } @@ -645,7 +645,7 @@ Standard_Integer Adaptor3d_OffsetCurve::NbKnots() const //purpose : //======================================================================= -Handle(Geom2d_BezierCurve) Adaptor3d_OffsetCurve::Bezier() const +Handle(Geom2d_BezierCurve) Adaptor2d_OffsetCurve::Bezier() const { Standard_NoSuchObject_Raise_if ( myOffset != 0.0e0 || GetType() != GeomAbs_BezierCurve, ""); @@ -658,7 +658,7 @@ Handle(Geom2d_BezierCurve) Adaptor3d_OffsetCurve::Bezier() const //purpose : //======================================================================= -Handle(Geom2d_BSplineCurve) Adaptor3d_OffsetCurve::BSpline() const +Handle(Geom2d_BSplineCurve) Adaptor2d_OffsetCurve::BSpline() const { Standard_NoSuchObject_Raise_if ( myOffset != 0.0e0 || GetType() != GeomAbs_BSplineCurve, ""); diff --git a/src/Adaptor3d/Adaptor3d_OffsetCurve.hxx b/src/Adaptor2d/Adaptor2d_OffsetCurve.hxx similarity index 93% rename from src/Adaptor3d/Adaptor3d_OffsetCurve.hxx rename to src/Adaptor2d/Adaptor2d_OffsetCurve.hxx index 6b692cd402..b1b1c356f3 100644 --- a/src/Adaptor3d/Adaptor3d_OffsetCurve.hxx +++ b/src/Adaptor2d/Adaptor2d_OffsetCurve.hxx @@ -14,8 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _Adaptor3d_OffsetCurve_HeaderFile -#define _Adaptor3d_OffsetCurve_HeaderFile +#ifndef _Adaptor2d_OffsetCurve_HeaderFile +#define _Adaptor2d_OffsetCurve_HeaderFile #include #include @@ -45,7 +45,7 @@ class Geom2d_BSplineCurve; //! Defines an Offset curve (algorithmic 2d curve). -class Adaptor3d_OffsetCurve : public Adaptor2d_Curve2d +class Adaptor2d_OffsetCurve : public Adaptor2d_Curve2d { public: @@ -53,18 +53,18 @@ public: //! The Offset is set to 0. - Standard_EXPORT Adaptor3d_OffsetCurve(); + Standard_EXPORT Adaptor2d_OffsetCurve(); //! The curve is loaded. The Offset is set to 0. - Standard_EXPORT Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C); + Standard_EXPORT Adaptor2d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C); //! Creates an OffsetCurve curve. //! The Offset is set to Offset. - Standard_EXPORT Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C, const Standard_Real Offset); + Standard_EXPORT Adaptor2d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C, const Standard_Real Offset); //! Create an Offset curve. //! WFirst,WLast define the bounds of the Offset curve. - Standard_EXPORT Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C, const Standard_Real Offset, const Standard_Real WFirst, const Standard_Real WLast); + Standard_EXPORT Adaptor2d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C, const Standard_Real Offset, const Standard_Real WFirst, const Standard_Real WLast); //! Changes the curve. The Offset is reset to 0. Standard_EXPORT void Load (const Handle(Adaptor2d_HCurve2d)& S); @@ -196,10 +196,10 @@ private: }; -#include +#include -#endif // _Adaptor3d_OffsetCurve_HeaderFile +#endif // _Adaptor2d_OffsetCurve_HeaderFile diff --git a/src/Adaptor3d/Adaptor3d_OffsetCurve.lxx b/src/Adaptor2d/Adaptor2d_OffsetCurve.lxx similarity index 85% rename from src/Adaptor3d/Adaptor3d_OffsetCurve.lxx rename to src/Adaptor2d/Adaptor2d_OffsetCurve.lxx index a975eac02b..d088c4bfad 100644 --- a/src/Adaptor3d/Adaptor3d_OffsetCurve.lxx +++ b/src/Adaptor2d/Adaptor2d_OffsetCurve.lxx @@ -16,7 +16,7 @@ //purpose : //======================================================================= -inline const Handle(Adaptor2d_HCurve2d)& Adaptor3d_OffsetCurve::Curve() const +inline const Handle(Adaptor2d_HCurve2d)& Adaptor2d_OffsetCurve::Curve() const { return myCurve; } @@ -27,7 +27,7 @@ inline const Handle(Adaptor2d_HCurve2d)& Adaptor3d_OffsetCurve::Curve() const //purpose : //======================================================================= -inline Standard_Real Adaptor3d_OffsetCurve::Offset() const +inline Standard_Real Adaptor2d_OffsetCurve::Offset() const { return myOffset; } @@ -38,7 +38,7 @@ inline Standard_Real Adaptor3d_OffsetCurve::Offset() const //purpose : //======================================================================= -inline Standard_Real Adaptor3d_OffsetCurve::FirstParameter() const +inline Standard_Real Adaptor2d_OffsetCurve::FirstParameter() const { return myFirst; } @@ -48,7 +48,7 @@ inline Standard_Real Adaptor3d_OffsetCurve::FirstParameter() const //purpose : //======================================================================= -inline Standard_Real Adaptor3d_OffsetCurve::LastParameter() const +inline Standard_Real Adaptor2d_OffsetCurve::LastParameter() const { return myLast; } diff --git a/src/Adaptor2d/FILES b/src/Adaptor2d/FILES index 842fa8a602..c202b55999 100644 --- a/src/Adaptor2d/FILES +++ b/src/Adaptor2d/FILES @@ -8,5 +8,10 @@ Adaptor2d_HCurve2d.hxx Adaptor2d_HCurve2d.lxx Adaptor2d_HLine2d.hxx Adaptor2d_HLine2d_0.cxx +Adaptor2d_HOffsetCurve.hxx +Adaptor2d_HOffsetCurve_0.cxx Adaptor2d_Line2d.cxx Adaptor2d_Line2d.hxx +Adaptor2d_OffsetCurve.cxx +Adaptor2d_OffsetCurve.hxx +Adaptor2d_OffsetCurve.lxx diff --git a/src/Adaptor3d/FILES b/src/Adaptor3d/FILES index 01b7dc9043..ed0771ffd9 100644 --- a/src/Adaptor3d/FILES +++ b/src/Adaptor3d/FILES @@ -15,8 +15,6 @@ Adaptor3d_HCurveOnSurface.hxx Adaptor3d_HCurveOnSurface_0.cxx Adaptor3d_HIsoCurve.hxx Adaptor3d_HIsoCurve_0.cxx -Adaptor3d_HOffsetCurve.hxx -Adaptor3d_HOffsetCurve_0.cxx Adaptor3d_HSurface.cxx Adaptor3d_HSurface.hxx Adaptor3d_HSurface.lxx @@ -34,9 +32,6 @@ Adaptor3d_InterFunc.hxx Adaptor3d_IsoCurve.cxx Adaptor3d_IsoCurve.hxx Adaptor3d_IsoCurve.lxx -Adaptor3d_OffsetCurve.cxx -Adaptor3d_OffsetCurve.hxx -Adaptor3d_OffsetCurve.lxx Adaptor3d_Surface.cxx Adaptor3d_Surface.hxx Adaptor3d_SurfaceOfLinearExtrusion.cxx diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx index 06a2b5b322..3e03686bd5 100644 --- a/src/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/BRepFill/BRepFill_OffsetWire.cxx @@ -17,7 +17,7 @@ // Modified by skv - Fri Jul 8 11:21:38 2005 OCC9145 #include -#include +#include #include #include #include @@ -269,7 +269,7 @@ static Standard_Boolean KPartCircle { if (E.Orientation() == TopAbs_REVERSED) anOffset *= -1; - Adaptor3d_OffsetCurve Off(AHC,anOffset); + Adaptor2d_OffsetCurve Off(AHC,anOffset); OC = new Geom2d_Line(Off.Line()); } else if (AHC->GetType() == GeomAbs_Circle) @@ -2089,7 +2089,7 @@ void MakeOffset (const TopoDS_Edge& E, Handle(Geom2dAdaptor_HCurve) AHC = new Geom2dAdaptor_HCurve(G2d); - Adaptor3d_OffsetCurve Off(AHC,-anOffset); + Adaptor2d_OffsetCurve Off(AHC,-anOffset); Handle(Geom2d_Circle) CC = new Geom2d_Circle(Off.Circle()); Standard_Real Delta = 2*M_PI - l + f; @@ -2124,7 +2124,7 @@ void MakeOffset (const TopoDS_Edge& E, else if (AC.GetType() == GeomAbs_Line) { Handle(Geom2dAdaptor_HCurve) AHC = new Geom2dAdaptor_HCurve(G2d); - Adaptor3d_OffsetCurve Off(AHC,anOffset); + Adaptor2d_OffsetCurve Off(AHC,anOffset); Handle(Geom2d_Line) CC = new Geom2d_Line(Off.Line()); Standard_Real Delta = (l - f); if (ToExtendFirstPar) diff --git a/src/Geom2dGcc/FILES b/src/Geom2dGcc/FILES index fcdb9874a0..6462c74c4f 100644 --- a/src/Geom2dGcc/FILES +++ b/src/Geom2dGcc/FILES @@ -24,8 +24,6 @@ Geom2dGcc_Circ2dTanOnRadGeo.cxx Geom2dGcc_Circ2dTanOnRadGeo.hxx Geom2dGcc_CurveTool.cxx Geom2dGcc_CurveTool.hxx -Geom2dGcc_CurveToolGeo.cxx -Geom2dGcc_CurveToolGeo.hxx Geom2dGcc_FunctionTanCirCu.cxx Geom2dGcc_FunctionTanCirCu.hxx Geom2dGcc_FunctionTanCuCu.cxx diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx index 3e9260fdef..bf0a226d61 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx @@ -24,7 +24,7 @@ // Courbes. + //========================================================================= -#include +#include #include #include #include @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -95,11 +94,11 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedCirc& Qualified1 , Geom2dInt_TheIntConicCurveOfGInter Intp; Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv); - Adaptor3d_OffsetCurve Cu2(HCu2,0.); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(Cu2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(Cu2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(Cu2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(Cu2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve Cu2(HCu2,0.); + firstparam = Max(Cu2.FirstParameter(),thefirst); + lastparam = Min(Cu2.LastParameter(),thelast); + IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol, + Cu2.Value(lastparam), lastparam, Tol); Standard_Real Tol1 = Abs(Tolerance); Standard_Real Tol2 = Tol1; for (Standard_Integer i = 1 ; i <= nbsolution; i++) { @@ -323,11 +322,11 @@ parcen3(1,8) Geom2dInt_TheIntConicCurveOfGInter Intp; Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv); - Adaptor3d_OffsetCurve C2(HCu2,0.); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu2,0.); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); for (Standard_Integer i = 1 ; i <= nbsolution; i++) { Handle(GccInt_Bisec) Sol = Bis.ThisSolution(i); GccInt_IType type = Sol->ArcType(); @@ -501,11 +500,11 @@ parcen3(1,8) Geom2dInt_TheIntConicCurveOfGInter Intp; Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv); - Adaptor3d_OffsetCurve C2(HCu2,0.); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu2,0.); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); IntRes2d_Domain D1; for (Standard_Integer i = 1 ; i <= nbsolution; i++) { Intp.Perform(Bis.ThisSolution(i),D1,C2,D2,Tol1,Tol2); @@ -649,11 +648,11 @@ parcen3(1,8) Geom2dInt_TheIntConicCurveOfGInter Intp; Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv); - Adaptor3d_OffsetCurve C2(HCu2,0.); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu2,0.); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); for (Standard_Integer i = 1 ; i <= nbsolution; i++) { Handle(GccInt_Bisec) Sol = Bis.ThisSolution(i); GccInt_IType type = Sol->ArcType(); @@ -810,11 +809,11 @@ parcen3(1,8) Standard_Real Tol2 = Tol1; Geom2dInt_TheIntConicCurveOfGInter Intp; Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv); - Adaptor3d_OffsetCurve C2(HCu2,0.); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu2,0.); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); Handle(GccInt_Bisec) Sol = Bis.ThisSolution(); GccInt_IType type = Sol->ArcType(); switch (type) { @@ -938,11 +937,11 @@ parcen3(1,8) Standard_Real Tol2 = Tol1; Geom2dInt_TheIntConicCurveOfGInter Intp; Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv); - Adaptor3d_OffsetCurve Cu2(HCu2,0.); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(Cu2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(Cu2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(Cu2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(Cu2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve Cu2(HCu2,0.); + firstparam = Max(Cu2.FirstParameter(),thefirst); + lastparam = Min(Cu2.LastParameter(),thelast); + IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol, + Cu2.Value(lastparam), lastparam, Tol); IntRes2d_Domain D1; if (Bis.HasSolution()) { Intp.Perform(Bis.ThisSolution(),D1,Cu2,D2,Tol1,Tol2); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx index bc5f03352c..529157bb0f 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx @@ -13,7 +13,7 @@ // commercial license or contractual agreement. -#include +#include #include #include #include @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -184,11 +183,11 @@ pararg2(1,aNbSolMAX) IntRes2d_Domain D1; for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) { Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2); - Adaptor3d_OffsetCurve C2(HCu2,cote2(jcote2)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2)); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); Geom2dInt_TheIntConicCurveOfGInter Intp(Line,D1,C2,D2,Tol,Tol); if (Intp.IsDone()) { if (!Intp.IsEmpty()) { @@ -368,11 +367,11 @@ pararg2(1,aNbSolMAX) D1.SetEquivalentParameters(0.,2.*M_PI); for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) { Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2); - Adaptor3d_OffsetCurve C2(HCu2,cote2(jcote2)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2)); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); Intp.Perform(Circ,D1,C2,D2,Tol,Tol); if (Intp.IsDone()) { if (!Intp.IsEmpty()) { @@ -500,11 +499,11 @@ pararg2(1,aNbSolMAX) Geom2dInt_TheIntConicCurveOfGInter Intp; for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1); - Adaptor3d_OffsetCurve Cu2(HCu1,cote1(jcote1)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(Cu2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(Cu2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(Cu2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(Cu2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve Cu2(HCu1,cote1(jcote1)); + firstparam = Max(Cu2.FirstParameter(),thefirst); + lastparam = Min(Cu2.LastParameter(),thelast); + IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol, + Cu2.Value(lastparam), lastparam, Tol); Intp.Perform(Circ,D1,Cu2,D2,Tol,Tol); if (Intp.IsDone()) { if (!Intp.IsEmpty()) { @@ -541,8 +540,8 @@ pararg2(1,aNbSolMAX) // tangent vector and vector between points in two curves must // be equal to zero). //======================================================================= -static void PrecRoot(const Adaptor3d_OffsetCurve& theC1, - const Adaptor3d_OffsetCurve& theC2, +static void PrecRoot(const Adaptor2d_OffsetCurve& theC1, + const Adaptor2d_OffsetCurve& theC2, const Standard_Real theU0, const Standard_Real theV0, Standard_Real& theUfinal, @@ -597,8 +596,8 @@ where u_{0} and v_{0} are initial values or values computed on previous iteratio Standard_Real aSQDistPrev = RealFirst(); - Geom2dGcc_CurveToolGeo::D2(theC1, aU, aPu, aD1u, aD2u); - Geom2dGcc_CurveToolGeo::D2(theC2, aV, aPv, aD1v, aD2v); + theC1.D2(aU, aPu, aD1u, aD2u); + theC2.D2(aV, aPv, aD1v, aD2v); const Standard_Real aCrProd = Abs(aD1u.Crossed(aD1v)); if(aCrProd*aCrProd > 1.0e-6* @@ -690,8 +689,8 @@ where u_{0} and v_{0} are initial values or values computed on previous iteratio aV += aStepV; } - Geom2dGcc_CurveToolGeo::D2(theC1, aU, aPu, aD1u, aD2u); - Geom2dGcc_CurveToolGeo::D2(theC2, aV, aPv, aD1v, aD2v); + theC1.D2(aU, aPu, aD1u, aD2u); + theC2.D2(aV, aPv, aD1v, aD2v); } while(aNbIter <= aNbIterMax); } @@ -739,10 +738,10 @@ pararg2(1,aNbSolMAX) //======================================================================== Standard_Real Tol = Abs(Tolerance); - Standard_Real thefirst = -100000.; - Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; +#ifdef OCCT_DEBUG + const Standard_Real thefirst = -100000.; + const Standard_Real thelast = 100000.; +#endif gp_Dir2d dirx(1.,0.); TColStd_Array1OfReal cote1(1,2); TColStd_Array1OfReal cote2(1,2); @@ -833,27 +832,21 @@ pararg2(1,aNbSolMAX) Geom2dInt_GInter Intp; for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1); - Adaptor3d_OffsetCurve C1(HCu1,cote1(jcote1)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C1),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C1),thelast); + Adaptor2d_OffsetCurve C1(HCu1,cote1(jcote1)); #ifdef OCCT_DEBUG + Standard_Real firstparam = Max(C1.FirstParameter(), thefirst); + Standard_Real lastparam = Min(C1.LastParameter(), thelast); IntRes2d_Domain D2C1(Geom2dGcc_CurveToolGeo::Value(C1,firstparam),firstparam,Tol, Geom2dGcc_CurveToolGeo::Value(C1,lastparam),lastparam,Tol); -#else - Geom2dGcc_CurveToolGeo::Value(C1,firstparam); - Geom2dGcc_CurveToolGeo::Value(C1,lastparam); #endif for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) { Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2); - Adaptor3d_OffsetCurve C2(HCu2,cote2(jcote2)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); + Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2)); #ifdef OCCT_DEBUG + firstparam = Max(C2.FirstParameter(), thefirst); + lastparam = Min(C2.LastParameter(),thelast); IntRes2d_Domain D2C2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); -#else - Geom2dGcc_CurveToolGeo::Value(C2,firstparam); - Geom2dGcc_CurveToolGeo::Value(C2,lastparam); #endif Intp.Perform(C1,C2,Tol,Tol); if (Intp.IsDone()) { @@ -871,10 +864,10 @@ pararg2(1,aNbSolMAX) Standard_Real aU2 = aU0+Precision::PApproximation(); Standard_Real aV2 = aV0+Precision::PApproximation(); - gp_Pnt2d P11 = Geom2dGcc_CurveToolGeo::Value(C1,aU1); - gp_Pnt2d P12 = Geom2dGcc_CurveToolGeo::Value(C2,aV1); - gp_Pnt2d P21 = Geom2dGcc_CurveToolGeo::Value(C1,aU2); - gp_Pnt2d P22 = Geom2dGcc_CurveToolGeo::Value(C2,aV2); + gp_Pnt2d P11 = C1.Value(aU1); + gp_Pnt2d P12 = C2.Value(aV1); + gp_Pnt2d P21 = C1.Value(aU2); + gp_Pnt2d P22 = C2.Value(aV2); Standard_Real aDist1112 = P11.SquareDistance(P12); Standard_Real aDist1122 = P11.SquareDistance(P22); @@ -889,7 +882,7 @@ pararg2(1,aNbSolMAX) } NbrSol++; - gp_Pnt2d Center(Geom2dGcc_CurveToolGeo::Value(C1, aU0)); + gp_Pnt2d Center(C1.Value(aU0)); cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius); // ======================================================= qualifier1(NbrSol) = Qualified1.Qualifier(); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx index 7e677e4aa9..44cb1b9515 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx @@ -21,7 +21,7 @@ // de rayon donne : Radius. + //======================================================================== -#include +#include #include #include #include @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -124,11 +123,11 @@ parcen3(1,8) Geom2dInt_TheIntConicCurveOfGInter Intp; for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1); - Adaptor3d_OffsetCurve C2(HCu1,Coef(jcote1)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu1,Coef(jcote1)); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); Intp.Perform(OnLine,D1,C2,D2,Tol,Tol); if (Intp.IsDone()) { if (!Intp.IsEmpty()) { @@ -237,11 +236,11 @@ parcen3(1,8) Geom2dInt_TheIntConicCurveOfGInter Intp; for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1); - Adaptor3d_OffsetCurve C2(HCu1,cote1(jcote1)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HCu1,cote1(jcote1)); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam),firstparam,Tol, + C2.Value(lastparam),lastparam,Tol); Intp.Perform(OnCirc,D1,C2,D2,Tol,Tol); if (Intp.IsDone()) { if (!Intp.IsEmpty()) { @@ -592,17 +591,17 @@ parcen3(1,8) Geom2dInt_GInter Intp; for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1); - Adaptor3d_OffsetCurve C1(HCu1,cote1(jcote1)); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C1),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C1),thelast); - IntRes2d_Domain D1(Geom2dGcc_CurveToolGeo::Value(C1,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C1,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C1(HCu1,cote1(jcote1)); + firstparam = Max(C1.FirstParameter(),thefirst); + lastparam = Min(C1.LastParameter(),thelast); + IntRes2d_Domain D1(C1.Value(firstparam), firstparam, Tol, + C1.Value(lastparam), lastparam, Tol); Handle(Geom2dAdaptor_HCurve) HOnCurv = new Geom2dAdaptor_HCurve(OnCurv); - Adaptor3d_OffsetCurve C2(HOnCurv); - firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst); - lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast); - IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol, - Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol); + Adaptor2d_OffsetCurve C2(HOnCurv); + firstparam = Max(C2.FirstParameter(),thefirst); + lastparam = Min(C2.LastParameter(),thelast); + IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, + C2.Value(lastparam), lastparam, Tol); Intp.Perform(C1,D1,C2,D2,Tol,Tol); if (Intp.IsDone()) { if (!Intp.IsEmpty()) { diff --git a/src/Geom2dGcc/Geom2dGcc_CurveToolGeo.cxx b/src/Geom2dGcc/Geom2dGcc_CurveToolGeo.cxx deleted file mode 100644 index 351847de43..0000000000 --- a/src/Geom2dGcc/Geom2dGcc_CurveToolGeo.cxx +++ /dev/null @@ -1,152 +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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -GeomAbs_CurveType Geom2dGcc_CurveToolGeo:: -TheType(const Adaptor3d_OffsetCurve& ) { - return GeomAbs_OtherCurve; -} - -gp_Lin2d Geom2dGcc_CurveToolGeo:: -Line (const Adaptor3d_OffsetCurve& ) { - cout << "Not implemented" << endl; - return gp_Lin2d(); -} - -gp_Circ2d Geom2dGcc_CurveToolGeo:: -Circle (const Adaptor3d_OffsetCurve& ) { - cout << "Not implemented" << endl; - return gp_Circ2d(); -} - -gp_Elips2d Geom2dGcc_CurveToolGeo:: -Ellipse (const Adaptor3d_OffsetCurve& ) { - cout << "Not implemented" << endl; - return gp_Elips2d(); -} - -gp_Parab2d Geom2dGcc_CurveToolGeo:: -Parabola (const Adaptor3d_OffsetCurve& ) { - cout << "Not implemented" << endl; - return gp_Parab2d(); -} - -gp_Hypr2d Geom2dGcc_CurveToolGeo:: -Hyperbola (const Adaptor3d_OffsetCurve& ) { - cout << "Not implemented" << endl; - return gp_Hypr2d(); -} - -Standard_Real -Geom2dGcc_CurveToolGeo::EpsX (const Adaptor3d_OffsetCurve& /*C*/, - const Standard_Real Tol) { - return Tol; -} - -Standard_Integer -Geom2dGcc_CurveToolGeo::NbSamples (const Adaptor3d_OffsetCurve& C) { - GeomAbs_CurveType typC = C.GetType(); - Standard_Integer nbs = 20; - if(typC == GeomAbs_Line) - nbs = 2; - else if(typC == GeomAbs_BezierCurve) - nbs = 3 + C.Bezier()->NbPoles(); - else if(typC == GeomAbs_BSplineCurve) { - Handle(Geom2d_BSplineCurve) BSC = C.BSpline(); - nbs = BSC->NbKnots(); - nbs*= BSC->Degree(); - if(nbs < 2) nbs=2; - } - return(nbs); -} - -Standard_Real -Geom2dGcc_CurveToolGeo::FirstParameter (const Adaptor3d_OffsetCurve& C) { - return C.FirstParameter(); -} - -Standard_Real -Geom2dGcc_CurveToolGeo::LastParameter (const Adaptor3d_OffsetCurve& C) { - return C.LastParameter(); -} - -gp_Pnt2d -Geom2dGcc_CurveToolGeo::Value (const Adaptor3d_OffsetCurve& C, - const Standard_Real U) { - - return C.Value(U); -} - -void Geom2dGcc_CurveToolGeo::D1(const Adaptor3d_OffsetCurve& C, - const Standard_Real U, - gp_Pnt2d& P, - gp_Vec2d& T) { - C.D1(U,P,T); -} - -void Geom2dGcc_CurveToolGeo::D2(const Adaptor3d_OffsetCurve& C, - const Standard_Real U, - gp_Pnt2d& P, - gp_Vec2d& T, - gp_Vec2d& N) { - C.D2(U,P,T,N); -} - -Standard_Boolean Geom2dGcc_CurveToolGeo:: -IsComposite (const Adaptor3d_OffsetCurve& ) { - return Standard_False; -} - -Standard_Integer Geom2dGcc_CurveToolGeo:: -GetIntervals (const Adaptor3d_OffsetCurve& ) { - cout << "Not implemented" << endl; - return 0; -} - -void Geom2dGcc_CurveToolGeo:: -GetInterval (const Adaptor3d_OffsetCurve& , - const Standard_Integer , - Standard_Real& , - Standard_Real& ) { - cout << "Not implemented" << endl; -} - -void Geom2dGcc_CurveToolGeo:: -SetCurrentInterval ( Adaptor3d_OffsetCurve& , - const Standard_Integer ) { - cout << "Not implemented" << endl; -} - diff --git a/src/Geom2dGcc/Geom2dGcc_CurveToolGeo.hxx b/src/Geom2dGcc/Geom2dGcc_CurveToolGeo.hxx deleted file mode 100644 index 334d6ca753..0000000000 --- a/src/Geom2dGcc/Geom2dGcc_CurveToolGeo.hxx +++ /dev/null @@ -1,126 +0,0 @@ -// Created on: 1992-06-04 -// Created by: Jacques GOUSSARD -// Copyright (c) 1992-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. - -#ifndef _Geom2dGcc_CurveToolGeo_HeaderFile -#define _Geom2dGcc_CurveToolGeo_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -class Adaptor3d_OffsetCurve; -class gp_Lin2d; -class gp_Circ2d; -class gp_Elips2d; -class gp_Parab2d; -class gp_Hypr2d; -class gp_Pnt2d; -class gp_Vec2d; - - - -class Geom2dGcc_CurveToolGeo -{ -public: - - DEFINE_STANDARD_ALLOC - - - Standard_EXPORT static GeomAbs_CurveType TheType (const Adaptor3d_OffsetCurve& C); - - //! Returns the Lin2d from gp corresponding to the curve C. - //! This method is called only when TheType returns - //! IntCurve_Lin. - Standard_EXPORT static gp_Lin2d Line (const Adaptor3d_OffsetCurve& C); - - //! Returns the Circ2d from gp corresponding to the curve C. - //! This method is called only when TheType returns - //! IntCurve_Cir. - Standard_EXPORT static gp_Circ2d Circle (const Adaptor3d_OffsetCurve& C); - - //! Returns the Elips2d from gp corresponding to the curve C. - //! This method is called only when TheType returns - //! IntCurve_Eli. - Standard_EXPORT static gp_Elips2d Ellipse (const Adaptor3d_OffsetCurve& C); - - //! Returns the Parab2d from gp corresponding to the curve C. - //! This method is called only when TheType returns - //! IntCurve_Prb. - Standard_EXPORT static gp_Parab2d Parabola (const Adaptor3d_OffsetCurve& C); - - //! Returns the Hypr2d from gp corresponding to the curve C. - //! This method is called only when TheType returns - //! IntCurve_Hpr. - Standard_EXPORT static gp_Hypr2d Hyperbola (const Adaptor3d_OffsetCurve& C); - - Standard_EXPORT static Standard_Real FirstParameter (const Adaptor3d_OffsetCurve& C); - - Standard_EXPORT static Standard_Real LastParameter (const Adaptor3d_OffsetCurve& C); - - Standard_EXPORT static Standard_Real EpsX (const Adaptor3d_OffsetCurve& C, const Standard_Real Tol); - - Standard_EXPORT static Standard_Integer NbSamples (const Adaptor3d_OffsetCurve& C); - - Standard_EXPORT static gp_Pnt2d Value (const Adaptor3d_OffsetCurve& C, const Standard_Real X); - - Standard_EXPORT static void D1 (const Adaptor3d_OffsetCurve& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T); - - Standard_EXPORT static void D2 (const Adaptor3d_OffsetCurve& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T, gp_Vec2d& N); - - Standard_EXPORT static Standard_Boolean IsComposite (const Adaptor3d_OffsetCurve& C); - - //! Outputs the number of interval of continuity C1 of - //! the curve - //! used if Type == Composite. - Standard_EXPORT static Standard_Integer GetIntervals (const Adaptor3d_OffsetCurve& C); - - //! Outputs the bounds of interval of index - //! used if Type == Composite. - Standard_EXPORT static void GetInterval (const Adaptor3d_OffsetCurve& C, const Standard_Integer Index, Standard_Real& U1, Standard_Real& U2); - - //! Set the current valid interval of index - //! inside which the computations will be done - //! (used if Type == Composite). - Standard_EXPORT static void SetCurrentInterval (Adaptor3d_OffsetCurve& C, const Standard_Integer Index); - - - - -protected: - - - - - -private: - - - - - -}; - - - - - - - -#endif // _Geom2dGcc_CurveToolGeo_HeaderFile diff --git a/src/MAT2d/MAT2d_Circuit.cxx b/src/MAT2d/MAT2d_Circuit.cxx index c529e1f256..60287e1481 100644 --- a/src/MAT2d/MAT2d_Circuit.cxx +++ b/src/MAT2d/MAT2d_Circuit.cxx @@ -31,7 +31,7 @@ #endif -#include +#include #include #include #include @@ -273,8 +273,8 @@ Standard_Boolean MAT2d_Circuit::IsSharpCorner(const Handle(Geom2d_Geometry)& Geo Handle(Geom2dAdaptor_HCurve) HC1 = new Geom2dAdaptor_HCurve(C1); Handle(Geom2dAdaptor_HCurve) HC2 = new Geom2dAdaptor_HCurve(C2); - Adaptor3d_OffsetCurve OC1(HC1,D,MilC1,C1->LastParameter()); - Adaptor3d_OffsetCurve OC2(HC2,D,C2->FirstParameter(),MilC2); + Adaptor2d_OffsetCurve OC1(HC1,D,MilC1,C1->LastParameter()); + Adaptor2d_OffsetCurve OC2(HC2,D,C2->FirstParameter(),MilC2); Geom2dInt_GInter Intersect; Intersect.Perform(OC1,OC2,Tol,Tol);