0032137: Coding Rules - merge redundant .lxx files into header files within Package gp
[occt.git] / src / IntAna / IntAna_IntConicQuad.hxx
1 // Created on: 1992-08-06
2 // Created by: Laurent BUCHARD
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 _IntAna_IntConicQuad_HeaderFile
18 #define _IntAna_IntConicQuad_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 <gp_Pnt.hxx>
27 #include <Standard_Real.hxx>
28 class StdFail_NotDone;
29 class Standard_OutOfRange;
30 class Standard_DomainError;
31 class gp_Lin;
32 class IntAna_Quadric;
33 class gp_Circ;
34 class gp_Elips;
35 class gp_Parab;
36 class gp_Hypr;
37 class gp_Pln;
38 class gp_Pnt;
39
40
41 //! This class provides the analytic intersection between
42 //! a conic defined as an element of gp (Lin,Circ,Elips,
43 //! Parab,Hypr) and a quadric as defined in the class
44 //! Quadric from IntAna.
45 //! The intersection between a conic and a plane is treated
46 //! as a special case.
47 //!
48 //! The result of the intersection are points (Pnt from
49 //! gp), associated with the parameter on the conic.
50 //!
51 //! A call to an Intersection  L:Lin from gp and
52 //! SPH: Sphere from gp can be written either :
53 //! IntAna_IntConicQuad Inter(L,IntAna_Quadric(SPH))
54 //! or :
55 //! IntAna_IntConicQuad Inter(L,SPH) (it is necessary
56 //! to include IntAna_Quadric.hxx in this case)
57 class IntAna_IntConicQuad 
58 {
59 public:
60
61   DEFINE_STANDARD_ALLOC
62
63   
64   //! Empty constructor.
65   Standard_EXPORT IntAna_IntConicQuad();
66   
67   //! Creates the intersection between a line and a quadric.
68   Standard_EXPORT IntAna_IntConicQuad(const gp_Lin& L, const IntAna_Quadric& Q);
69   
70   //! Intersects a line and a quadric.
71   Standard_EXPORT void Perform (const gp_Lin& L, const IntAna_Quadric& Q);
72   
73   //! Creates the intersection between a circle and a quadric.
74   Standard_EXPORT IntAna_IntConicQuad(const gp_Circ& C, const IntAna_Quadric& Q);
75   
76   //! Intersects a circle and a quadric.
77   Standard_EXPORT void Perform (const gp_Circ& C, const IntAna_Quadric& Q);
78   
79   //! Creates the intersection between an ellipse and a quadric.
80   Standard_EXPORT IntAna_IntConicQuad(const gp_Elips& E, const IntAna_Quadric& Q);
81   
82   //! Intersects an ellipse and a quadric.
83   Standard_EXPORT void Perform (const gp_Elips& E, const IntAna_Quadric& Q);
84   
85   //! Creates the intersection between a parabola and a quadric.
86   Standard_EXPORT IntAna_IntConicQuad(const gp_Parab& P, const IntAna_Quadric& Q);
87   
88   //! Intersects a parabola and a quadric.
89   Standard_EXPORT void Perform (const gp_Parab& P, const IntAna_Quadric& Q);
90   
91   //! Creates the intersection between an hyperbola and
92   //! a quadric.
93   Standard_EXPORT IntAna_IntConicQuad(const gp_Hypr& H, const IntAna_Quadric& Q);
94   
95   //! Intersects an hyperbola and a quadric.
96   Standard_EXPORT void Perform (const gp_Hypr& H, const IntAna_Quadric& Q);
97   
98   //! Intersection between a line and a plane.
99   //! Tolang is used to determine if the angle between two
100   //! vectors is null.
101   //! Tol is used to check the distance between line and plane
102   //! on the distance <Len> from the origin of the line.
103   Standard_EXPORT IntAna_IntConicQuad(const gp_Lin& L, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol = 0, const Standard_Real Len = 0);
104   
105   //! Intersects a line and a plane.
106   //! Tolang is used to determine if the angle between two
107   //! vectors is null.
108   //! Tol is used to check the distance between line and plane
109   //! on the distance <Len> from the origin of the line.
110   Standard_EXPORT void Perform (const gp_Lin& L, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol = 0, const Standard_Real Len = 0);
111   
112   //! Intersection between a circle and a plane.
113   //! Tolang is used to determine if the angle between two
114   //! vectors is null.
115   //! Tol is used to determine if a distance is null.
116   Standard_EXPORT IntAna_IntConicQuad(const gp_Circ& C, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
117   
118   //! Intersects a circle and a plane.
119   //! Tolang is used to determine if the angle between two
120   //! vectors is null.
121   //! Tol is used to determine if a distance is null.
122   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
123   
124   //! Intersection between an ellipse and a plane.
125   //! Tolang is used to determine if the angle between two
126   //! vectors is null.
127   //! Tol is used to determine if a distance is null.
128   Standard_EXPORT IntAna_IntConicQuad(const gp_Elips& E, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
129   
130   //! Intersects an ellipse and a plane.
131   //! Tolang is used to determine if the angle between two
132   //! vectors is null.
133   //! Tol is used to determine if a distance is null.
134   Standard_EXPORT void Perform (const gp_Elips& E, const gp_Pln& P, const Standard_Real Tolang, const Standard_Real Tol);
135   
136   //! Intersection between a parabola and a plane.
137   //! Tolang is used to determine if the angle between two
138   //! vectors is null.
139   Standard_EXPORT IntAna_IntConicQuad(const gp_Parab& Pb, const gp_Pln& P, const Standard_Real Tolang);
140   
141   //! Intersects a parabola and a plane.
142   //! Tolang is used to determine if the angle between two
143   //! vectors is null.
144   Standard_EXPORT void Perform (const gp_Parab& Pb, const gp_Pln& P, const Standard_Real Tolang);
145   
146   //! Intersection between an hyperbola and a plane.
147   //! Tolang is used to determine if the angle between two
148   //! vectors is null.
149   Standard_EXPORT IntAna_IntConicQuad(const gp_Hypr& H, const gp_Pln& P, const Standard_Real Tolang);
150   
151   //! Intersects an hyperbola and a plane.
152   //! Tolang is used to determine if the angle between two
153   //! vectors is null.
154   Standard_EXPORT void Perform (const gp_Hypr& H, const gp_Pln& P, const Standard_Real Tolang);
155   
156   //! Returns TRUE if the creation completed.
157     Standard_Boolean IsDone() const;
158   
159   //! Returns TRUE if the conic is in the quadric.
160     Standard_Boolean IsInQuadric() const;
161   
162   //! Returns TRUE if the line is in a quadric which
163   //! is parallel to the quadric.
164     Standard_Boolean IsParallel() const;
165   
166   //! Returns the number of intersection point.
167     Standard_Integer NbPoints() const;
168   
169   //! Returns the point of range N.
170     const gp_Pnt& Point (const Standard_Integer N) const;
171   
172   //! Returns the parameter on the line of the intersection
173   //! point of range N.
174     Standard_Real ParamOnConic (const Standard_Integer N) const;
175
176
177
178
179 protected:
180
181
182
183
184
185 private:
186
187
188
189   Standard_Boolean done;
190   Standard_Boolean parallel;
191   Standard_Boolean inquadric;
192   Standard_Integer nbpts;
193   gp_Pnt pnts[4];
194   Standard_Real paramonc[4];
195
196
197 };
198
199
200 #include <IntAna_IntConicQuad.lxx>
201
202
203
204
205
206 #endif // _IntAna_IntConicQuad_HeaderFile