0032630: Coding - get rid of unsused forward declarations [BinMDF to IFSelect]
[occt.git] / src / Geom2dGcc / Geom2dGcc_Lin2dTanObl.hxx
1 // Created on: 1992-10-20
2 // Created by: Remi GILET
3 // Copyright (c) 1992-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 _Geom2dGcc_Lin2dTanObl_HeaderFile
18 #define _Geom2dGcc_Lin2dTanObl_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 <Standard_Real.hxx>
31 #include <GccEnt_Position.hxx>
32 class Geom2dGcc_QualifiedCurve;
33 class gp_Lin2d;
34 class gp_Pnt2d;
35 class Geom2dGcc_Lin2dTanOblIter;
36 class Geom2dAdaptor_Curve;
37
38
39 //! This class implements the algorithms used to
40 //! create 2d line tangent to a curve QualifiedCurv and
41 //! doing an angle Angle with a line TheLin.
42 //! The angle must be in Radian.
43 //! Describes functions for building a 2D line making a given
44 //! angle with a line and tangential to a curve.
45 //! A Lin2dTanObl object provides a framework for:
46 //! -   defining the construction of 2D line(s),
47 //! -   implementing the construction algorithm, and
48 //! -   consulting the result(s).
49 class Geom2dGcc_Lin2dTanObl 
50 {
51 public:
52
53   DEFINE_STANDARD_ALLOC
54
55   
56   //! This class implements the algorithm used to
57   //! create 2d line tangent to a curve and doing an
58   //! angle Angle with the line TheLin.
59   //! Angle must be in Radian.
60   //! Tolang is the angular tolerance.
61   Standard_EXPORT Geom2dGcc_Lin2dTanObl(const Geom2dGcc_QualifiedCurve& Qualified1, const gp_Lin2d& TheLin, const Standard_Real TolAng, const Standard_Real Angle);
62   
63   //! This class implements the algorithm used to
64   //! create 2d line tangent to a curve and doing an
65   //! angle Angle with the line TheLin.
66   //! Angle must be in Radian.
67   //! Param2 is the initial guess on the curve QualifiedCurv.
68   //! Tolang is the angular tolerance.
69   //! Warning
70   //! An iterative algorithm is used if Qualified1 is more
71   //! complex than a line or a circle. In such cases, the
72   //! algorithm constructs only one solution.
73   //! Exceptions
74   //! GccEnt_BadQualifier if a qualifier is inconsistent with
75   //! the argument it qualifies (for example, enclosed for a circle).
76   Standard_EXPORT Geom2dGcc_Lin2dTanObl(const Geom2dGcc_QualifiedCurve& Qualified1, const gp_Lin2d& TheLin, const Standard_Real TolAng, const Standard_Real Param1, const Standard_Real Angle);
77   
78   //! Returns true if the construction algorithm does not fail
79   //! (even if it finds no solution).
80   //! Note: IsDone protects against a failure arising from a
81   //! more internal intersection algorithm, which has reached its numeric limits.
82   Standard_EXPORT Standard_Boolean IsDone() const;
83   
84   //! Returns the number of lines, representing solutions computed by this algorithm.
85   //! Exceptions
86   //! StdFail_NotDone if the construction fails.
87   Standard_EXPORT Standard_Integer NbSolutions() const;
88   
89   //! Returns a line, representing the solution of index Index
90   //! computed by this algorithm.
91   //! Exceptions
92   //! Standard_OutOfRange if Index is less than zero or
93   //! greater than the number of solutions computed by this algorithm.
94   //! StdFail_NotDone if the construction fails.
95   Standard_EXPORT gp_Lin2d ThisSolution (const Standard_Integer Index) const;
96   
97   //! Returns the qualifier Qualif1 of the tangency argument
98   //! for the solution of index Index computed by this algorithm.
99   //! The returned qualifier is:
100   //! -   that specified at the start of construction when the
101   //! solutions are defined as enclosing or outside with
102   //! respect to the argument, or
103   //! -   that computed during construction (i.e. enclosing or
104   //! outside) when the solutions are defined as unqualified
105   //! with respect to the argument, or
106   //! -   GccEnt_noqualifier if the tangency argument is a point.
107   //! Exceptions
108   //! Standard_OutOfRange if Index is less than zero or
109   //! greater than the number of solutions computed by this algorithm.
110   //! StdFail_NotDone if the construction fails.
111   Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
112   
113   //! Returns information about the tangency point between the
114   //! result and the first argument.
115   //! ParSol is the intrinsic parameter of the point PntSol on
116   //! the solution curv.
117   //! ParArg is the intrinsic parameter of the point PntSol on
118   //! the argument curv.
119   Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
120   
121   //! Returns the point of intersection PntSol between the
122   //! solution of index Index and the second argument (the line) of this algorithm.
123   //! ParSol is the parameter of the point PntSol on the
124   //! solution. ParArg is the parameter of the point PntSol on the second argument (the line).
125   //! Exceptions
126   //! StdFail_NotDone if the construction fails.
127   //! Geom2dGcc_IsParallel if the solution and the second
128   //! argument (the line) are parallel.
129   //! Standard_OutOfRange if Index is less than zero or
130   //! greater than the number of solutions computed by this algorithm.
131   Standard_EXPORT void Intersection2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
132   
133   //! Returns true if the line and the solution are parallel. This
134   //! is the case when the angle given at the time of
135   //! construction is equal to 0 or Pi.
136   //! Exceptions StdFail_NotDone if the construction fails.
137   Standard_EXPORT Standard_Boolean IsParallel2() const;
138
139
140
141
142 protected:
143
144
145
146
147
148 private:
149
150   
151   Standard_EXPORT Standard_Boolean Add (const Standard_Integer theIndex, const Geom2dGcc_Lin2dTanOblIter& theLin, const Standard_Real theTol, const Geom2dAdaptor_Curve& theC1);
152
153
154   Standard_Boolean WellDone;
155   Standard_Boolean Paral2;
156   Standard_Integer NbrSol;
157   TColgp_Array1OfLin2d linsol;
158   GccEnt_Array1OfPosition qualifier1;
159   TColgp_Array1OfPnt2d pnttg1sol;
160   TColgp_Array1OfPnt2d pntint2sol;
161   TColStd_Array1OfReal par1sol;
162   TColStd_Array1OfReal par2sol;
163   TColStd_Array1OfReal pararg1;
164   TColStd_Array1OfReal pararg2;
165
166
167 };
168
169
170
171
172
173
174
175 #endif // _Geom2dGcc_Lin2dTanObl_HeaderFile