Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:36:00

0001 // Created on: 1992-10-20
0002 // Created by: Remi GILET
0003 // Copyright (c) 1992-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_Circ2d2TanOn_HeaderFile
0018 #define _Geom2dGcc_Circ2d2TanOn_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColgp_Array1OfCirc2d.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <GccEnt_Array1OfPosition.hxx>
0027 #include <TColStd_Array1OfInteger.hxx>
0028 #include <TColgp_Array1OfPnt2d.hxx>
0029 #include <TColStd_Array1OfReal.hxx>
0030 #include <GccEnt_Position.hxx>
0031 class Geom2dGcc_QualifiedCurve;
0032 class Geom2dAdaptor_Curve;
0033 class Geom2d_Point;
0034 class GccAna_Circ2d2TanOn;
0035 class Geom2dGcc_Circ2d2TanOnGeo;
0036 class gp_Circ2d;
0037 class gp_Pnt2d;
0038 
0039 //! This class implements the algorithms used to
0040 //! create 2d circles TANgent to 2 entities and
0041 //! having the center ON a curve.
0042 //! The order of the tangency argument is always
0043 //! QualifiedCirc, QualifiedLin, QualifiedCurv, Pnt2d.
0044 //! the arguments are :
0045 //! - The two tangency arguments.
0046 //! - The center line.
0047 //! - The parameter for each tangency argument which
0048 //! is a curve.
0049 //! - The tolerance.
0050 class Geom2dGcc_Circ2d2TanOn
0051 {
0052 public:
0053   DEFINE_STANDARD_ALLOC
0054 
0055   //! This method implements the algorithms used to
0056   //! create 2d circles TANgent to two curves and
0057   //! having the center ON a 2d curve.
0058   //! Param1 is the initial guess on the first curve QualifiedCurv.
0059   //! Param1 is the initial guess on the second curve QualifiedCurv.
0060   //! ParamOn is the initial guess on the center curve OnCurv.
0061   //! Tolerance is used for the limit cases.
0062   Standard_EXPORT Geom2dGcc_Circ2d2TanOn(const Geom2dGcc_QualifiedCurve& Qualified1,
0063                                          const Geom2dGcc_QualifiedCurve& Qualified2,
0064                                          const Geom2dAdaptor_Curve&      OnCurve,
0065                                          const Standard_Real             Tolerance,
0066                                          const Standard_Real             Param1,
0067                                          const Standard_Real             Param2,
0068                                          const Standard_Real             ParamOn);
0069 
0070   //! This method implements the algorithms used to
0071   //! create 2d circles TANgent to one curve and one point and
0072   //! having the center ON a 2d curve.
0073   //! Param1 is the initial guess on the first curve QualifiedCurv.
0074   //! ParamOn is the initial guess on the center curve OnCurv.
0075   //! Tolerance is used for the limit cases.
0076   Standard_EXPORT Geom2dGcc_Circ2d2TanOn(const Geom2dGcc_QualifiedCurve& Qualified1,
0077                                          const Handle(Geom2d_Point)&     Point,
0078                                          const Geom2dAdaptor_Curve&      OnCurve,
0079                                          const Standard_Real             Tolerance,
0080                                          const Standard_Real             Param1,
0081                                          const Standard_Real             ParamOn);
0082 
0083   //! This method implements the algorithms used to
0084   //! create 2d circles TANgent to two points and
0085   //! having the center ON a 2d curve.
0086   //! Tolerance is used for the limit cases.
0087   Standard_EXPORT Geom2dGcc_Circ2d2TanOn(const Handle(Geom2d_Point)& Point1,
0088                                          const Handle(Geom2d_Point)& Point2,
0089                                          const Geom2dAdaptor_Curve&  OnCurve,
0090                                          const Standard_Real         Tolerance);
0091 
0092   Standard_EXPORT void Results(const GccAna_Circ2d2TanOn& Circ);
0093 
0094   Standard_EXPORT void Results(const Geom2dGcc_Circ2d2TanOnGeo& Circ);
0095 
0096   //! Returns true if the construction algorithm does not fail
0097   //! (even if it finds no solution).
0098   //! Note: IsDone protects against a failure arising from a
0099   //! more internal intersection algorithm, which has
0100   //! reached its numeric limits.
0101   Standard_EXPORT Standard_Boolean IsDone() const;
0102 
0103   //! This method returns the number of solutions.
0104   //! NotDone is raised if the algorithm failed.
0105   Standard_EXPORT Standard_Integer NbSolutions() const;
0106 
0107   //! Returns the solution number Index and raises OutOfRange
0108   //! exception if Index is greater than the number of solutions.
0109   //! Be careful: the Index is only a way to get all the
0110   //! solutions, but is not associated to these outside the context
0111   //! of the algorithm-object.
0112   //! Exceptions
0113   //! Standard_OutOfRange if Index is less than or equal
0114   //! to zero or greater than the number of solutions
0115   //! computed by this algorithm.
0116   //! StdFail_NotDone if the construction fails.
0117   Standard_EXPORT gp_Circ2d ThisSolution(const Standard_Integer Index) const;
0118 
0119   //! It returns the information about the qualifiers of
0120   //! the tangency
0121   //! arguments concerning the solution number Index.
0122   //! It returns the real qualifiers (the qualifiers given to the
0123   //! constructor method in case of enclosed, enclosing and outside
0124   //! and the qualifiers computedin case of unqualified).
0125   //! Exceptions
0126   //! Standard_OutOfRange if Index is less than zero or
0127   //! greater than the number of solutions computed by this algorithm.
0128   //! StdFail_NotDone if the construction fails.
0129   Standard_EXPORT void WhichQualifier(const Standard_Integer Index,
0130                                       GccEnt_Position&       Qualif1,
0131                                       GccEnt_Position&       Qualif2) const;
0132 
0133   //! Returns information about the tangency point between the
0134   //! result and the first argument.
0135   //! ParSol is the intrinsic parameter of the point PntSol on the solution curv.
0136   //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
0137   Standard_EXPORT void Tangency1(const Standard_Integer Index,
0138                                  Standard_Real&         ParSol,
0139                                  Standard_Real&         ParArg,
0140                                  gp_Pnt2d&              PntSol) const;
0141 
0142   //! Returns information about the tangency point between the
0143   //! result and the second argument.
0144   //! ParSol is the intrinsic parameter of the point PntSol on the solution curv.
0145   //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
0146   Standard_EXPORT void Tangency2(const Standard_Integer Index,
0147                                  Standard_Real&         ParSol,
0148                                  Standard_Real&         ParArg,
0149                                  gp_Pnt2d&              PntSol) const;
0150 
0151   //! Returns the center PntSol of the solution of index Index
0152   //! computed by this algorithm.
0153   //! ParArg is the parameter of the point PntSol on the third argument.
0154   //! Exceptions
0155   //! Standard_OutOfRange if Index is less than zero or
0156   //! greater than the number of solutions computed by this algorithm.
0157   //! StdFail_NotDone if the construction fails.
0158   Standard_EXPORT void CenterOn3(const Standard_Integer Index,
0159                                  Standard_Real&         ParArg,
0160                                  gp_Pnt2d&              PntSol) const;
0161 
0162   //! Returns true if the solution of index Index and,
0163   //! respectively, the first or second argument of this
0164   //! algorithm are the same (i.e. there are 2 identical circles).
0165   //! If Rarg is the radius of the first or second argument,
0166   //! Rsol is the radius of the solution and dist is the
0167   //! distance between the two centers, we consider the two
0168   //! circles to be identical if |Rarg - Rsol| and dist
0169   //! are less than or equal to the tolerance criterion given at
0170   //! the time of construction of this algorithm.
0171   //! Exceptions
0172   //! Standard_OutOfRange if Index is less than zero or
0173   //! greater than the number of solutions computed by this algorithm.
0174   //! StdFail_NotDone if the construction fails.
0175   Standard_EXPORT Standard_Boolean IsTheSame1(const Standard_Integer Index) const;
0176 
0177   //! Returns true if the solution of index Index and,
0178   //! respectively, the first or second argument of this
0179   //! algorithm are the same (i.e. there are 2 identical circles).
0180   //! If Rarg is the radius of the first or second argument,
0181   //! Rsol is the radius of the solution and dist is the
0182   //! distance between the two centers, we consider the two
0183   //! circles to be identical if |Rarg - Rsol| and dist
0184   //! are less than or equal to the tolerance criterion given at
0185   //! the time of construction of this algorithm.
0186   //! Exceptions
0187   //! Standard_OutOfRange if Index is less than zero or
0188   //! greater than the number of solutions computed by this algorithm.
0189   //! StdFail_NotDone if the construction fails.
0190   Standard_EXPORT Standard_Boolean IsTheSame2(const Standard_Integer Index) const;
0191 
0192 protected:
0193 private:
0194   Standard_Boolean        WellDone;
0195   TColgp_Array1OfCirc2d   cirsol;
0196   Standard_Integer        NbrSol;
0197   GccEnt_Array1OfPosition qualifier1;
0198   GccEnt_Array1OfPosition qualifier2;
0199   TColStd_Array1OfInteger TheSame1;
0200   TColStd_Array1OfInteger TheSame2;
0201   TColgp_Array1OfPnt2d    pnttg1sol;
0202   TColgp_Array1OfPnt2d    pnttg2sol;
0203   TColgp_Array1OfPnt2d    pntcen;
0204   TColStd_Array1OfReal    par1sol;
0205   TColStd_Array1OfReal    par2sol;
0206   TColStd_Array1OfReal    pararg1;
0207   TColStd_Array1OfReal    pararg2;
0208   TColStd_Array1OfReal    parcen3;
0209   Standard_Boolean        Invert;
0210 };
0211 
0212 #endif // _Geom2dGcc_Circ2d2TanOn_HeaderFile