1 // Created on: 1991-04-03
2 // Created by: Remi GILET
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GccAna_Lin2dTanPar_HeaderFile
18 #define _GccAna_Lin2dTanPar_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TColgp_Array1OfLin2d.hxx>
27 #include <GccEnt_Array1OfPosition.hxx>
28 #include <TColgp_Array1OfPnt2d.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <GccEnt_Position.hxx>
31 #include <Standard_Real.hxx>
32 class Standard_OutOfRange;
33 class GccEnt_BadQualifier;
34 class StdFail_NotDone;
37 class GccEnt_QualifiedCirc;
40 //! This class implements the algorithms used to create 2d
41 //! line tangent to a circle or a point and parallel to
43 //! The solution has the same orientation as the
45 //! Describes functions for building a 2D line parallel to a line and:
46 //! - tangential to a circle, or
47 //! - passing through a point.
48 //! A Lin2dTanPar object provides a framework for:
49 //! - defining the construction of 2D line(s),
50 //! - implementing the construction algorithm, and consulting the result(s).
51 class GccAna_Lin2dTanPar
58 //! This method implements the algorithms used to create a 2d
59 //! line passing through a point and parallel to
61 Standard_EXPORT GccAna_Lin2dTanPar(const gp_Pnt2d& ThePoint, const gp_Lin2d& Lin1);
63 //! This method implements the algorithms used to create a 2d
64 //! line tangent to a circle and parallel to another line.
65 //! It raises BadQualifier in case of EnclosedCirc.
67 //! GccEnt_BadQualifier if a qualifier is inconsistent with
68 //! the argument it qualifies (for example, enclosed for a circle).
69 Standard_EXPORT GccAna_Lin2dTanPar(const GccEnt_QualifiedCirc& Qualified1, const gp_Lin2d& Lin1);
71 //! Returns True if the algorithm succeeded.
72 Standard_EXPORT Standard_Boolean IsDone() const;
74 //! Returns the number of solutions.
75 //! Raises NotDone if the construction algorithm didn't succeed.
76 Standard_EXPORT Standard_Integer NbSolutions() const;
78 //! Returns the solution number Index and raises OutOfRange
79 //! exception if Index is greater than the number of solutions.
80 //! Be careful: the Index is only a way to get all the
81 //! solutions, but is not associated to those outside the
82 //! context of the algorithm-object.
83 //! raises NotDone if the construction algorithm
85 //! It raises OutOfRange if Index is greater than the
86 //! number of solutions.
87 Standard_EXPORT gp_Lin2d ThisSolution (const Standard_Integer Index) const;
89 //! Returns the informations about the qualifiers of the
90 //! tangency arguments concerning the solution number Index.
91 //! It returns the real qualifiers (the qualifiers given to the
92 //! constructor method in case of enclosed, enclosing and outside
93 //! and the qualifiers computed in case of unqualified).
94 //! Raises NotDone if the construction algorithm
96 //! It raises OutOfRange if Index is greater than the
97 //! number of solutions.
98 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
100 //! Returns informations about the tangency point between the
101 //! result number Index and the first argument.
102 //! ParSol is the intrinsic parameter of the point on the
104 //! ParArg is the intrinsic parameter of the point on the
106 //! ParArg is equal 0 when the solution is passing thrue
107 //! a point. Raises NotDone if the construction algorithm
109 //! It raises OutOfRange if Index is greater than the
110 //! number of solutions.
111 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& Pnt) const;
126 Standard_Boolean WellDone;
127 Standard_Integer NbrSol;
128 TColgp_Array1OfLin2d linsol;
129 GccEnt_Array1OfPosition qualifier1;
130 TColgp_Array1OfPnt2d pnttg1sol;
131 TColStd_Array1OfReal par1sol;
132 TColStd_Array1OfReal pararg1;
143 #endif // _GccAna_Lin2dTanPar_HeaderFile