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