Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-15 08:29:28

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_Lin2d2Tan_HeaderFile
0018 #define _Geom2dGcc_Lin2d2Tan_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <TColgp_Array1OfLin2d.hxx>
0025 #include <GccEnt_Array1OfPosition.hxx>
0026 #include <TColgp_Array1OfPnt2d.hxx>
0027 #include <TColStd_Array1OfReal.hxx>
0028 #include <GccEnt_Position.hxx>
0029 class Geom2dGcc_QualifiedCurve;
0030 class gp_Pnt2d;
0031 class gp_Lin2d;
0032 class Geom2dGcc_Lin2d2TanIter;
0033 class Geom2dAdaptor_Curve;
0034 
0035 //! This class implements the algorithms used to
0036 //! create 2d lines tangent to 2 other elements which
0037 //! can be circles, curves or points.
0038 //! More than one argument must be a curve.
0039 //! Describes functions for building a 2D line:
0040 //! -   tangential to 2 curves, or
0041 //! -   tangential to a curve and passing through a point.
0042 //! A Lin2d2Tan object provides a framework for:
0043 //! -   defining the construction of 2D line(s),
0044 //! -   implementing the construction algorithm, and
0045 //! -   consulting the result(s).
0046 //!
0047 //! Note: Some constructors may check the type of the qualified argument
0048 //! and raise BadQualifier Error in case of incorrect couple (qualifier, curv).
0049 class Geom2dGcc_Lin2d2Tan
0050 {
0051 public:
0052   DEFINE_STANDARD_ALLOC
0053 
0054   //! This class implements the algorithms used to create 2d
0055   //! line tangent to two curves.
0056   //! Tolang is used to determine the tolerance for the tangency points.
0057   Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1,
0058                                       const Geom2dGcc_QualifiedCurve& Qualified2,
0059                                       const Standard_Real             Tolang);
0060 
0061   //! This class implements the algorithms used to create 2d
0062   //! lines passing through a point and tangent to a curve.
0063   //! Tolang is used to determine the tolerance for the tangency points.
0064   Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1,
0065                                       const gp_Pnt2d&                 ThePoint,
0066                                       const Standard_Real             Tolang);
0067 
0068   //! This class implements the algorithms used to create 2d
0069   //! line tangent to two curves.
0070   //! Tolang is used to determine the tolerance for the tangency points.
0071   //! Param1 is used for the initial guess on the first curve.
0072   //! Param2 is used for the initial guess on the second curve.
0073   Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1,
0074                                       const Geom2dGcc_QualifiedCurve& Qualified2,
0075                                       const Standard_Real             Tolang,
0076                                       const Standard_Real             Param1,
0077                                       const Standard_Real             Param2);
0078 
0079   //! This class implements the algorithms used to create 2d
0080   //! lines passing through a point and tangent to a curve.
0081   //! Tolang is used to determine the tolerance for the tangency points.
0082   //! Param2 is used for the initial guess on the curve.
0083   Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1,
0084                                       const gp_Pnt2d&                 ThePoint,
0085                                       const Standard_Real             Tolang,
0086                                       const Standard_Real             Param1);
0087 
0088   //! Returns true if the construction algorithm does not fail
0089   //! (even if it finds no solution).
0090   //! Note: IsDone protects against a failure arising from a
0091   //! more internal intersection algorithm, which has
0092   //! reached its numeric limits.
0093   Standard_EXPORT Standard_Boolean IsDone() const;
0094 
0095   //! Returns the number of lines, representing solutions computed by this algorithm.
0096   //! Exceptions StdFail_NotDone if the construction fails.R
0097   Standard_EXPORT Standard_Integer NbSolutions() const;
0098 
0099   //! Returns a line, representing the solution of index Index computed by this algorithm.
0100   //! Warning
0101   //! This indexing simply provides a means of consulting the
0102   //! solutions. The index values are not associated with
0103   //! these solutions outside the context of the algorithm object.
0104   //! Exceptions
0105   //! Standard_OutOfRange if Index is less than zero or
0106   //! greater than the number of solutions computed by this algorithm.
0107   //! StdFail_NotDone if the construction fails.
0108   Standard_EXPORT gp_Lin2d ThisSolution(const Standard_Integer Index) const;
0109 
0110   //! Returns the qualifiers Qualif1 and Qualif2 of the
0111   //! tangency arguments for the solution of index Index
0112   //! computed by this algorithm.
0113   //! The returned qualifiers are:
0114   //! -   those specified at the start of construction when the
0115   //! solutions are defined as enclosing or outside with
0116   //! respect to the arguments, or
0117   //! -   those computed during construction (i.e. enclosing or
0118   //! outside) when the solutions are defined as unqualified
0119   //! with respect to the arguments, or
0120   //! -   GccEnt_noqualifier if the tangency argument is a   point.
0121   //! Exceptions
0122   //! Standard_OutOfRange if Index is less than zero or
0123   //! greater than the number of solutions computed by this algorithm.
0124   //! StdFail_NotDone if the construction fails.
0125   Standard_EXPORT void WhichQualifier(const Standard_Integer Index,
0126                                       GccEnt_Position&       Qualif1,
0127                                       GccEnt_Position&       Qualif2) const;
0128 
0129   //! Returns information about the tangency point between the
0130   //! result and the first argument.
0131   //! ParSol is the intrinsic parameter of the point PntSol on
0132   //! the solution curv.
0133   //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
0134   //! Exceptions
0135   //! Standard_OutOfRange if Index is less than zero or
0136   //! greater than the number of solutions computed by this algorithm.
0137   //! StdFail_NotDone if the construction fails.
0138   Standard_EXPORT void Tangency1(const Standard_Integer Index,
0139                                  Standard_Real&         ParSol,
0140                                  Standard_Real&         ParArg,
0141                                  gp_Pnt2d&              PntSol) const;
0142 
0143   //! Returns information about the tangency point between the
0144   //! result and the first argument.
0145   //! ParSol is the intrinsic parameter of the point PntSol on the solution curv.
0146   //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
0147   //! Exceptions
0148   //! Standard_OutOfRange if Index is less than zero or
0149   //! greater than the number of solutions computed by this algorithm.
0150   //! StdFail_NotDone if the construction fails.
0151   Standard_EXPORT void Tangency2(const Standard_Integer Index,
0152                                  Standard_Real&         ParSol,
0153                                  Standard_Real&         ParArg,
0154                                  gp_Pnt2d&              PntSol) const;
0155 
0156 protected:
0157 private:
0158   Standard_EXPORT Standard_Boolean Add(const Standard_Integer         theIndex,
0159                                        const Geom2dGcc_Lin2d2TanIter& theLin,
0160                                        const Standard_Real            theTol,
0161                                        const Geom2dAdaptor_Curve&     theC1,
0162                                        const Geom2dAdaptor_Curve&     theC2);
0163 
0164   Standard_Boolean        WellDone;
0165   Standard_Integer        NbrSol;
0166   TColgp_Array1OfLin2d    linsol;
0167   GccEnt_Array1OfPosition qualifier1;
0168   GccEnt_Array1OfPosition qualifier2;
0169   TColgp_Array1OfPnt2d    pnttg1sol;
0170   TColgp_Array1OfPnt2d    pnttg2sol;
0171   TColStd_Array1OfReal    par1sol;
0172   TColStd_Array1OfReal    par2sol;
0173   TColStd_Array1OfReal    pararg1;
0174   TColStd_Array1OfReal    pararg2;
0175 };
0176 
0177 #endif // _Geom2dGcc_Lin2d2Tan_HeaderFile