Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:20:24

0001 // Created on: 1991-04-24
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_Lin2d2TanIter_HeaderFile
0018 #define _Geom2dGcc_Lin2d2TanIter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <gp_Lin2d.hxx>
0024 #include <GccEnt_Position.hxx>
0025 #include <gp_Pnt2d.hxx>
0026 class Geom2dGcc_QCurve;
0027 class GccEnt_QualifiedCirc;
0028 
0029 //! This class implements the algorithms used to
0030 //! create 2d lines tangent to 2 other elements which
0031 //! can be circles, curves or points.
0032 //! More than one argument must be a curve.
0033 //!
0034 //! Note: Some constructors may check the type of the qualified argument
0035 //! and raise BadQualifier Error in case of incorrect couple (qualifier,
0036 //! curv).
0037 //! For example: "EnclosedCirc".
0038 class Geom2dGcc_Lin2d2TanIter
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   //! This class implements the algorithms used to create 2d
0044   //! lines passing through a point and tangent to a curve.
0045   //! Tolang is used to determine the tolerance for the
0046   //! tangency points.
0047   //! Param2 is used for the initial guess on the curve.
0048   Standard_EXPORT Geom2dGcc_Lin2d2TanIter(const Geom2dGcc_QCurve& Qualified1,
0049                                           const gp_Pnt2d&         ThePoint,
0050                                           const double            Param1,
0051                                           const double            Tolang);
0052 
0053   //! This class implements the algorithms used to create 2d
0054   //! line tangent to a circle and to a curve.
0055   //! Tolang is used to determine the tolerance for the
0056   //! tangency points.
0057   //! Param2 is used for the initial guess on the curve.
0058   //! Exception BadQualifier is raised in the case of
0059   //! EnclosedCirc
0060   Standard_EXPORT Geom2dGcc_Lin2d2TanIter(const GccEnt_QualifiedCirc& Qualified1,
0061                                           const Geom2dGcc_QCurve&     Qualified2,
0062                                           const double                Param2,
0063                                           const double                Tolang);
0064 
0065   //! This class implements the algorithms used to create 2d
0066   //! line tangent to two curves.
0067   //! Tolang is used to determine the tolerance for the
0068   //! tangency points.
0069   //! Param1 is used for the initial guess on the first curve.
0070   //! Param2 is used for the initial guess on the second curve.
0071   Standard_EXPORT Geom2dGcc_Lin2d2TanIter(const Geom2dGcc_QCurve& Qualified1,
0072                                           const Geom2dGcc_QCurve& Qualified2,
0073                                           const double            Param1,
0074                                           const double            Param2,
0075                                           const double            Tolang);
0076 
0077   //! This methode returns true when there is a solution
0078   //! and false in the other cases.
0079   Standard_EXPORT bool IsDone() const;
0080 
0081   //! Returns the solution.
0082   Standard_EXPORT gp_Lin2d ThisSolution() const;
0083 
0084   Standard_EXPORT void WhichQualifier(GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const;
0085 
0086   //! Returns information about the tangency point between the
0087   //! result and the first argument.
0088   //! ParSol is the intrinsic parameter of the point PntSol on
0089   //! the solution curv.
0090   //! ParArg is the intrinsic parameter of the point PntSol on
0091   //! the argument curv.
0092   Standard_EXPORT void Tangency1(double& ParSol, double& ParArg, gp_Pnt2d& PntSol) const;
0093 
0094   Standard_EXPORT void Tangency2(double& ParSol, double& ParArg, gp_Pnt2d& PntSol) const;
0095 
0096 private:
0097   bool            WellDone;
0098   gp_Lin2d        linsol;
0099   GccEnt_Position qualifier1;
0100   GccEnt_Position qualifier2;
0101   gp_Pnt2d        pnttg1sol;
0102   gp_Pnt2d        pnttg2sol;
0103   double          par1sol;
0104   double          par2sol;
0105   double          pararg1;
0106   double          pararg2;
0107 };
0108 
0109 #endif // _Geom2dGcc_Lin2d2TanIter_HeaderFile