Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:20:16

0001 // Created on: 1991-03-29
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_Circ2d2TanRadGeo_HeaderFile
0018 #define _Geom2dGcc_Circ2d2TanRadGeo_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <gp_Circ2d.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <GccEnt_Position.hxx>
0027 #include <gp_Pnt2d.hxx>
0028 class GccEnt_QualifiedCirc;
0029 class Geom2dGcc_QCurve;
0030 class GccEnt_QualifiedLin;
0031 class gp_Pnt2d;
0032 class gp_Circ2d;
0033 
0034 //! This class implements the algorithms used to
0035 //! create 2d circles tangent to one curve and a
0036 //! point/line/circle/curv and with a given radius.
0037 //! For each construction methods arguments are:
0038 //! - Two Qualified elements for tangency constrains.
0039 //! (for example EnclosedCirc if we want the
0040 //! solution inside the argument EnclosedCirc).
0041 //! - Two Reals. One (Radius) for the radius and the
0042 //! other (Tolerance) for the tolerance.
0043 //! Tolerance is only used for the limit cases.
0044 //! For example :
0045 //! We want to create a circle inside a circle C1 and
0046 //! inside a curve Cu2 with a radius Radius and a
0047 //! tolerance Tolerance.
0048 //! If we did not used Tolerance it is impossible to
0049 //! find a solution in the following case : Cu2 is
0050 //! inside C1 and there is no intersection point
0051 //! between the two elements.
0052 //! With Tolerance we will get a solution if the
0053 //! lowest distance between C1 and Cu2 is lower than or
0054 //! equal Tolerance.
0055 class Geom2dGcc_Circ2d2TanRadGeo
0056 {
0057 public:
0058   DEFINE_STANDARD_ALLOC
0059 
0060   //! This method implements the algorithms used to
0061   //! create 2d circles TANgent to a 2d circle and a curve
0062   //! with a radius of Radius.
0063   //! It raises NegativeValue if Radius is lower than zero.
0064   Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedCirc& Qualified1,
0065                                              const Geom2dGcc_QCurve&     Qualified2,
0066                                              const double                Radius,
0067                                              const double                Tolerance);
0068 
0069   //! This method implements the algorithms used to
0070   //! create 2d circles TANgent to a 2d line and a curve
0071   //! with a radius of Radius.
0072   //! It raises NegativeValue if Radius is lower than zero.
0073   Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedLin& Qualified1,
0074                                              const Geom2dGcc_QCurve&    Qualified2,
0075                                              const double               Radius,
0076                                              const double               Tolerance);
0077 
0078   //! This method implements the algorithms used to
0079   //! create 2d circles TANgent to two curves with
0080   //! a radius of Radius.
0081   //! It raises NegativeValue if Radius is lower than zero.
0082   Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Qualified1,
0083                                              const Geom2dGcc_QCurve& Qualified2,
0084                                              const double            Radius,
0085                                              const double            Tolerance);
0086 
0087   //! This method implements the algorithms used to
0088   //! create 2d circles TANgent to a curve and a point
0089   //! with a radius of Radius.
0090   //! It raises NegativeValue if Radius is lower than zero.
0091   Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Qualified1,
0092                                              const gp_Pnt2d&         Point2,
0093                                              const double            Radius,
0094                                              const double            Tolerance);
0095 
0096   //! This method returns True if the algorithm succeeded.
0097   Standard_EXPORT bool IsDone() const;
0098 
0099   //! This method returns the number of solutions.
0100   //! It raises NotDone if the algorithm failed.
0101   Standard_EXPORT int NbSolutions() const;
0102 
0103   //! Returns the solution number Index.
0104   //! Be careful: the Index is only a way to get all the
0105   //! solutions, but is not associated to those outside the context
0106   //! of the algorithm-object.
0107   //! It raises OutOfRange exception if Index is greater
0108   //! than the number of solutions.
0109   //! It raises NotDone if the construction algorithm did not
0110   //! succeed.
0111   Standard_EXPORT gp_Circ2d ThisSolution(const int Index) const;
0112 
0113   //! It returns the information about the qualifiers of
0114   //! the tangency arguments concerning the solution number Index.
0115   //! It returns the real qualifiers (the qualifiers given to the
0116   //! constructor method in case of enclosed, enclosing and outside
0117   //! and the qualifiers computedin case of unqualified).
0118   Standard_EXPORT void WhichQualifier(const int        Index,
0119                                       GccEnt_Position& Qualif1,
0120                                       GccEnt_Position& Qualif2) const;
0121 
0122   //! Returns information about the tangency point between the
0123   //! result number Index and the first argument.
0124   //! ParSol is the intrinsic parameter of the point PntSol on the solution.
0125   //! ParArg is the intrinsic parameter of the point PntSol on the first
0126   //! argument.
0127   //! It raises OutOfRange if Index is greater than the number
0128   //! of solutions.
0129   //! It raises NotDone if the construction algorithm did not
0130   //! succeed.
0131   Standard_EXPORT void Tangency1(const int Index,
0132                                  double&   ParSol,
0133                                  double&   ParArg,
0134                                  gp_Pnt2d& PntSol) const;
0135 
0136   //! Returns information about the tangency point between the
0137   //! result number Index and the second argument.
0138   //! ParSol is the intrinsic parameter of the point PntSol on
0139   //! the solution.
0140   //! ParArg is the intrinsic parameter of the point PntArg on
0141   //! the second argument.
0142   //! It raises OutOfRange if Index is greater than the number
0143   //! of solutions.
0144   //! It raises NotDone if the construction algorithm did not
0145   //! succeed.
0146   Standard_EXPORT void Tangency2(const int Index,
0147                                  double&   ParSol,
0148                                  double&   ParArg,
0149                                  gp_Pnt2d& PntSol) const;
0150 
0151   //! Returns True if the solution number Index is equal to
0152   //! the first argument.
0153   //! It raises OutOfRange if Index is greater than the number
0154   //! of solutions.
0155   //! It raises NotDone if the construction algorithm did not
0156   //! succeed.
0157   Standard_EXPORT bool IsTheSame1(const int Index) const;
0158 
0159   //! Returns True if the solution number Index is equal to
0160   //! the second argument.
0161   //! It raises OutOfRange if Index is greater than the number
0162   //! of solutions.
0163   //! It raises NotDone if the construction algorithm did not
0164   //! succeed.
0165   Standard_EXPORT bool IsTheSame2(const int Index) const;
0166 
0167 private:
0168   bool                                WellDone;
0169   int                                 NbrSol;
0170   NCollection_Array1<gp_Circ2d>       cirsol;
0171   NCollection_Array1<GccEnt_Position> qualifier1;
0172   NCollection_Array1<GccEnt_Position> qualifier2;
0173   NCollection_Array1<int>             TheSame1;
0174   NCollection_Array1<int>             TheSame2;
0175   NCollection_Array1<gp_Pnt2d>        pnttg1sol;
0176   NCollection_Array1<gp_Pnt2d>        pnttg2sol;
0177   NCollection_Array1<double>          par1sol;
0178   NCollection_Array1<double>          par2sol;
0179   NCollection_Array1<double>          pararg1;
0180   NCollection_Array1<double>          pararg2;
0181 };
0182 
0183 #endif // _Geom2dGcc_Circ2d2TanRadGeo_HeaderFile