ad626c1f0073733a9469dda04174e923edb4e34b
[occt.git] / src / GccAna / GccAna_Lin2dTanPar.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _GccAna_Lin2dTanPar_HeaderFile
18 #define _GccAna_Lin2dTanPar_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
35 class gp_Pnt2d;
36 class gp_Lin2d;
37 class GccEnt_QualifiedCirc;
38
39
40 //! This class implements the algorithms used to create 2d
41 //! line tangent to a circle or a point and parallel to
42 //! another line.
43 //! The solution has the same orientation as the
44 //! second argument.
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 
52 {
53 public:
54
55   DEFINE_STANDARD_ALLOC
56
57   
58   //! This method implements the algorithms used to create a 2d
59   //! line passing through a point and parallel to
60   //! another line.
61   Standard_EXPORT GccAna_Lin2dTanPar(const gp_Pnt2d& ThePoint, const gp_Lin2d& Lin1);
62   
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.
66   //! Exceptions
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);
70   
71   //! Returns True if the algorithm succeeded.
72   Standard_EXPORT Standard_Boolean IsDone() const;
73   
74   //! Returns the number of solutions.
75   //! Raises NotDone if the construction algorithm  didn't succeed.
76   Standard_EXPORT Standard_Integer NbSolutions() const;
77   
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
84   //! didn't succeed.
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;
88   
89   //! Returns the information 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
95   //! didn't succeed.
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;
99   
100   //! Returns information 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
103   //! solution curv.
104   //! ParArg is the intrinsic parameter of the point on the
105   //! argument curv.
106   //! ParArg is equal 0 when the solution is passing thrue
107   //! a point. Raises NotDone if the construction algorithm
108   //! didn't succeed.
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;
112
113
114
115
116 protected:
117
118
119
120
121
122 private:
123
124
125
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;
133
134
135 };
136
137
138
139
140
141
142
143 #endif // _GccAna_Lin2dTanPar_HeaderFile