Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-09 08:50:36

0001 // Created on: 1991-04-03
0002 // Created by: Remi GILET
0003 // Copyright (c) 1991-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile
0018 #define _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <TColgp_Array1OfCirc2d.hxx>
0025 #include <GccEnt_Array1OfPosition.hxx>
0026 #include <TColStd_Array1OfInteger.hxx>
0027 #include <TColgp_Array1OfPnt2d.hxx>
0028 #include <TColStd_Array1OfReal.hxx>
0029 #include <GccEnt_Position.hxx>
0030 class Geom2dGcc_QCurve;
0031 class gp_Lin2d;
0032 class gp_Circ2d;
0033 class GccEnt_QualifiedCirc;
0034 class Geom2dAdaptor_Curve;
0035 class GccEnt_QualifiedLin;
0036 class gp_Pnt2d;
0037 
0038 //! This class implements the algorithms used to
0039 //! create a 2d circle tangent to a 2d entity,
0040 //! centered on a 2d entity and with a given radius.
0041 //! More than one argument must be a curve.
0042 //! The arguments of all construction methods are :
0043 //! - The qualified element for the tangency constrains
0044 //! (QualifiedCirc, QualifiedLin, QualifiedCurvPoints).
0045 //! - The Center element (circle, line, curve).
0046 //! - A real Tolerance.
0047 //! Tolerance is only used in the limits cases.
0048 //! For example :
0049 //! We want to create a circle tangent to an OutsideCurv Cu1
0050 //! centered on a line OnLine with a radius Radius and with
0051 //! a tolerance Tolerance.
0052 //! If we did not use Tolerance it is impossible to
0053 //! find a solution in the following case : OnLine is
0054 //! outside Cu1. There is no intersection point between Cu1
0055 //! and OnLine. The distance between the line and the
0056 //! circle is greater than Radius.
0057 //! With Tolerance we will give a solution if the
0058 //! distance between Cu1 and OnLine is lower than or
0059 //! equal Tolerance.
0060 class Geom2dGcc_Circ2dTanOnRadGeo
0061 {
0062 public:
0063   DEFINE_STANDARD_ALLOC
0064 
0065   //! This methods implements the algorithms used to create
0066   //! 2d Circles tangent to a curve and centered on a 2d Line
0067   //! with a given radius.
0068   //! Tolerance is used to find solution in every limit cases.
0069   //! raises NegativeValue in case of NegativeRadius.
0070   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1,
0071                                               const gp_Lin2d&         OnLine,
0072                                               const Standard_Real     Radius,
0073                                               const Standard_Real     Tolerance);
0074 
0075   //! This methods implements the algorithms used to create
0076   //! 2d Circles tangent to a curve and centered on a 2d Circle
0077   //! with a given radius.
0078   //! Tolerance is used to find solution in every limit cases.
0079   //! raises NegativeValue in case of NegativeRadius.
0080   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1,
0081                                               const gp_Circ2d&        OnCirc,
0082                                               const Standard_Real     Radius,
0083                                               const Standard_Real     Tolerance);
0084 
0085   //! This methods implements the algorithms used to create
0086   //! 2d Circles tangent to a circle and centered on a 2d curve
0087   //! with a given radius.
0088   //! Tolerance is used to find solution in every limit cases.
0089   //! raises NegativeValue in case of NegativeRadius.
0090   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedCirc& Qualified1,
0091                                               const Geom2dAdaptor_Curve&  OnCurv,
0092                                               const Standard_Real         Radius,
0093                                               const Standard_Real         Tolerance);
0094 
0095   //! This methods implements the algorithms used to create
0096   //! 2d Circles tangent to a 2d Line and centered on a 2d curve
0097   //! with a given radius.
0098   //! Tolerance is used to find solution in every limit cases.
0099   //! raises NegativeValue in case of NegativeRadius.
0100   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedLin& Qualified1,
0101                                               const Geom2dAdaptor_Curve& OnCurv,
0102                                               const Standard_Real        Radius,
0103                                               const Standard_Real        Tolerance);
0104 
0105   //! This methods implements the algorithms used to create
0106   //! 2d Circles tangent to a 2d curve and centered on a 2d curve
0107   //! with a given radius.
0108   //! Tolerance is used to find solution in every limit cases.
0109   //! raises NegativeValue in case of NegativeRadius.
0110   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve&    Qualified1,
0111                                               const Geom2dAdaptor_Curve& OnCurv,
0112                                               const Standard_Real        Radius,
0113                                               const Standard_Real        Tolerance);
0114 
0115   //! This methods implements the algorithms used to create
0116   //! 2d Circles passing through a 2d point and centered on a
0117   //! 2d curve with a given radius.
0118   //! Tolerance is used to find solution in every limit cases.
0119   //! raises NegativeValue in case of NegativeRadius.
0120   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const gp_Pnt2d&            Point1,
0121                                               const Geom2dAdaptor_Curve& OnCurv,
0122                                               const Standard_Real        Radius,
0123                                               const Standard_Real        Tolerance);
0124 
0125   //! This method returns True if the construction
0126   //! algorithm succeeded.
0127   Standard_EXPORT Standard_Boolean IsDone() const;
0128 
0129   //! This method returns the number of solutions.
0130   //! It raises NotDone if the construction algorithm
0131   //! didn't succeed.
0132   Standard_EXPORT Standard_Integer NbSolutions() const;
0133 
0134   //! Returns the solution number Index and raises OutOfRange
0135   //! exception if Index is greater than the number of solutions.
0136   //! Be careful: the Index is only a way to get all the
0137   //! solutions, but is not associated to these outside the
0138   //! context of the algorithm-object.
0139   //! It raises NotDone if the construction algorithm
0140   //! didn't succeed.
0141   //! It raises OutOfRange if Index is greater than the
0142   //! number of solutions.
0143   Standard_EXPORT gp_Circ2d ThisSolution(const Standard_Integer Index) const;
0144 
0145   Standard_EXPORT void WhichQualifier(const Standard_Integer Index, GccEnt_Position& Qualif1) const;
0146 
0147   //! Returns information about the tangency point between the
0148   //! result number Index and the first argument.
0149   //! ParSol is the intrinsic parameter of the point on the
0150   //! solution curv.
0151   //! ParArg is the intrinsic parameter of the point on the
0152   //! argument curv.
0153   //! PntSol is the tangency point on the solution curv.
0154   //! PntArg is the tangency point on the argument curv.
0155   //! It raises NotDone if the construction algorithm
0156   //! didn't succeed.
0157   //! It raises OutOfRange if Index is greater than the
0158   //! number of solutions.
0159   Standard_EXPORT void Tangency1(const Standard_Integer Index,
0160                                  Standard_Real&         ParSol,
0161                                  Standard_Real&         ParArg,
0162                                  gp_Pnt2d&              PntSol) const;
0163 
0164   //! Returns information about the center (on the curv)
0165   //! of the result.
0166   //! ParArg is the intrinsic parameter of the point on
0167   //! the argument curv.
0168   //! PntSol is the center point of the solution curv.
0169   //! It raises NotDone if the construction algorithm
0170   //! didn't succeed.
0171   //! It raises OutOfRange if Index is greater than the
0172   //! number of solutions.
0173   Standard_EXPORT void CenterOn3(const Standard_Integer Index,
0174                                  Standard_Real&         ParArg,
0175                                  gp_Pnt2d&              PntSol) const;
0176 
0177   //! Returns True if the solution number Index is equal to
0178   //! the first argument and False in the other cases.
0179   //! It raises NotDone if the construction algorithm
0180   //! didn't succeed.
0181   //! It raises OutOfRange if Index is greater than the
0182   //! number of solutions.
0183   Standard_EXPORT Standard_Boolean IsTheSame1(const Standard_Integer Index) const;
0184 
0185 protected:
0186 private:
0187   Standard_Boolean        WellDone;
0188   Standard_Integer        NbrSol;
0189   TColgp_Array1OfCirc2d   cirsol;
0190   GccEnt_Array1OfPosition qualifier1;
0191   TColStd_Array1OfInteger TheSame1;
0192   TColgp_Array1OfPnt2d    pnttg1sol;
0193   TColgp_Array1OfPnt2d    pntcen3;
0194   TColStd_Array1OfReal    par1sol;
0195   TColStd_Array1OfReal    pararg1;
0196   TColStd_Array1OfReal    parcen3;
0197 };
0198 
0199 #endif // _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile