Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-07 08:45:04

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 _GccAna_Lin2dTanObl_HeaderFile
0018 #define _GccAna_Lin2dTanObl_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 gp_Pnt2d;
0030 class gp_Lin2d;
0031 class GccEnt_QualifiedCirc;
0032 
0033 //! This class implements the algorithms used to
0034 //! create 2d line tangent to a circle or a point and
0035 //! making an angle with a line.
0036 //! The angle is in radians.
0037 //! The origin of the solution is the tangency point
0038 //! with the first argument.
0039 //! Its direction is making an angle Angle with the
0040 //! second argument.
0041 class GccAna_Lin2dTanObl
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046   //! This class implements the algorithms used to
0047   //! create 2d line passing through a point and
0048   //! making an angle with a line.
0049   Standard_EXPORT GccAna_Lin2dTanObl(const gp_Pnt2d&     ThePoint,
0050                                      const gp_Lin2d&     TheLine,
0051                                      const Standard_Real TheAngle);
0052 
0053   //! This class implements the algorithms used to
0054   //! create 2d line tangent to a circle and
0055   //! making an angle with a line.
0056   //! Exceptions
0057   //! GccEnt_BadQualifier if a qualifier is inconsistent with
0058   //! the argument it qualifies (for example, enclosed for a circle).
0059   Standard_EXPORT GccAna_Lin2dTanObl(const GccEnt_QualifiedCirc& Qualified1,
0060                                      const gp_Lin2d&             TheLine,
0061                                      const Standard_Real         TheAngle);
0062 
0063   //! Returns True if the algorithm succeeded.
0064   //! Note: IsDone protects against a failure arising from a
0065   //! more internal intersection algorithm, which has reached
0066   //! its numeric limits.
0067   Standard_EXPORT Standard_Boolean IsDone() const;
0068 
0069   //! Returns the number of  of lines, representing solutions computed by this algorithm.
0070   //! Raises NotDone if the construction algorithm didn't succeed.
0071   Standard_EXPORT Standard_Integer NbSolutions() const;
0072 
0073   //! Returns the solution number Index.
0074   //! Be careful: the Index is only a way to get all the
0075   //! solutions, but is not associated to these outside the
0076   //! context of the algorithm-object.
0077   //! raises NotDone if the construction algorithm didn't succeed.
0078   //! It raises OutOfRange if Index is greater than the   number of solutions.
0079   Standard_EXPORT gp_Lin2d ThisSolution(const Standard_Integer Index) const;
0080 
0081   //! Returns the qualifier Qualif1 of the tangency argument
0082   //! for the solution of index Index computed by this algorithm.
0083   //! The returned qualifier is:
0084   //! -   that specified at the start of construction when the
0085   //! solutions are defined as enclosing or outside with
0086   //! respect to the argument, or
0087   //! -   that computed during construction (i.e. enclosing or
0088   //! outside) when the solutions are defined as unqualified
0089   //! with respect to the argument, or
0090   //! -   GccEnt_noqualifier if the tangency argument is a point.
0091   //! Exceptions
0092   //! Standard_OutOfRange if Index is less than zero or
0093   //! greater than the number of solutions computed by this algorithm.
0094   //! StdFail_NotDone if the construction fails.
0095   Standard_EXPORT void WhichQualifier(const Standard_Integer Index, GccEnt_Position& Qualif1) const;
0096 
0097   //! Returns information about the tangency point between the
0098   //! result number Index and the first argument.
0099   //! ParSol is the intrinsic parameter of the point ParSol on
0100   //! the solution curv.
0101   //! ParArg is the intrinsic parameter of the point ParArg on
0102   //! the argument curv. Raises NotDone if the construction algorithm
0103   //! didn't succeed.
0104   //! It raises OutOfRange if Index is greater than the  number of solutions.
0105   Standard_EXPORT void Tangency1(const Standard_Integer Index,
0106                                  Standard_Real&         ParSol,
0107                                  Standard_Real&         ParArg,
0108                                  gp_Pnt2d&              PntSol) const;
0109 
0110   //! Returns information about the intersection between the
0111   //! result number Index and the third argument.
0112   //! Raises NotDone if the construction algorithm  didn't succeed.
0113   //! It raises OutOfRange if Index is greater than the number of solutions.
0114   Standard_EXPORT void Intersection2(const Standard_Integer Index,
0115                                      Standard_Real&         ParSol,
0116                                      Standard_Real&         ParArg,
0117                                      gp_Pnt2d&              PntSol) const;
0118 
0119 protected:
0120 private:
0121   Standard_Boolean        WellDone;
0122   Standard_Integer        NbrSol;
0123   TColgp_Array1OfLin2d    linsol;
0124   GccEnt_Array1OfPosition qualifier1;
0125   TColgp_Array1OfPnt2d    pnttg1sol;
0126   TColgp_Array1OfPnt2d    pntint2sol;
0127   TColStd_Array1OfReal    par1sol;
0128   TColStd_Array1OfReal    par2sol;
0129   TColStd_Array1OfReal    pararg1;
0130   TColStd_Array1OfReal    pararg2;
0131 };
0132 
0133 #endif // _GccAna_Lin2dTanObl_HeaderFile