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
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 _IntAna_IntConicQuad_HeaderFile
18 #define _IntAna_IntConicQuad_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>
27 #include <Standard_Real.hxx>
28 class StdFail_NotDone;
29 class Standard_OutOfRange;
30 class Standard_DomainError;
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.
48 //! The result of the intersection are points (Pnt from
49 //! gp), associated with the parameter on the conic.
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))
55 //! IntAna_IntConicQuad Inter(L,SPH) (it is necessary
56 //! to include IntAna_Quadric.hxx in this case)
57 class IntAna_IntConicQuad
64 //! Empty constructor.
65 Standard_EXPORT IntAna_IntConicQuad();
67 //! Creates the intersection between a line and a quadric.
68 Standard_EXPORT IntAna_IntConicQuad(const gp_Lin& L, const IntAna_Quadric& Q);
70 //! Intersects a line and a quadric.
71 Standard_EXPORT void Perform (const gp_Lin& L, const IntAna_Quadric& Q);
73 //! Creates the intersection between a circle and a quadric.
74 Standard_EXPORT IntAna_IntConicQuad(const gp_Circ& C, const IntAna_Quadric& Q);
76 //! Intersects a circle and a quadric.
77 Standard_EXPORT void Perform (const gp_Circ& C, const IntAna_Quadric& Q);
79 //! Creates the intersection between an ellipse and a quadric.
80 Standard_EXPORT IntAna_IntConicQuad(const gp_Elips& E, const IntAna_Quadric& Q);
82 //! Intersects an ellipse and a quadric.
83 Standard_EXPORT void Perform (const gp_Elips& E, const IntAna_Quadric& Q);
85 //! Creates the intersection between a parabola and a quadric.
86 Standard_EXPORT IntAna_IntConicQuad(const gp_Parab& P, const IntAna_Quadric& Q);
88 //! Intersects a parabola and a quadric.
89 Standard_EXPORT void Perform (const gp_Parab& P, const IntAna_Quadric& Q);
91 //! Creates the intersection between an hyperbola and
93 Standard_EXPORT IntAna_IntConicQuad(const gp_Hypr& H, const IntAna_Quadric& Q);
95 //! Intersects an hyperbola and a quadric.
96 Standard_EXPORT void Perform (const gp_Hypr& H, const IntAna_Quadric& Q);
98 //! Intersection between a line and a plane.
99 //! Tolang is used to determine if the angle between two
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);
105 //! Intersects a line and a plane.
106 //! Tolang is used to determine if the angle between two
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);
112 //! Intersection between a circle and a plane.
113 //! Tolang is used to determine if the angle between two
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);
118 //! Intersects a circle and a plane.
119 //! Tolang is used to determine if the angle between two
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);
124 //! Intersection between an ellipse and a plane.
125 //! Tolang is used to determine if the angle between two
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);
130 //! Intersects an ellipse and a plane.
131 //! Tolang is used to determine if the angle between two
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);
136 //! Intersection between a parabola and a plane.
137 //! Tolang is used to determine if the angle between two
139 Standard_EXPORT IntAna_IntConicQuad(const gp_Parab& Pb, const gp_Pln& P, const Standard_Real Tolang);
141 //! Intersects a parabola and a plane.
142 //! Tolang is used to determine if the angle between two
144 Standard_EXPORT void Perform (const gp_Parab& Pb, const gp_Pln& P, const Standard_Real Tolang);
146 //! Intersection between an hyperbola and a plane.
147 //! Tolang is used to determine if the angle between two
149 Standard_EXPORT IntAna_IntConicQuad(const gp_Hypr& H, const gp_Pln& P, const Standard_Real Tolang);
151 //! Intersects an hyperbola and a plane.
152 //! Tolang is used to determine if the angle between two
154 Standard_EXPORT void Perform (const gp_Hypr& H, const gp_Pln& P, const Standard_Real Tolang);
156 //! Returns TRUE if the creation completed.
157 Standard_Boolean IsDone() const;
159 //! Returns TRUE if the conic is in the quadric.
160 Standard_Boolean IsInQuadric() const;
162 //! Returns TRUE if the line is in a quadric which
163 //! is parallel to the quadric.
164 Standard_Boolean IsParallel() const;
166 //! Returns the number of intersection point.
167 Standard_Integer NbPoints() const;
169 //! Returns the point of range N.
170 const gp_Pnt& Point (const Standard_Integer N) const;
172 //! Returns the parameter on the line of the intersection
173 //! point of range N.
174 Standard_Real ParamOnConic (const Standard_Integer N) const;
189 Standard_Boolean done;
190 Standard_Boolean parallel;
191 Standard_Boolean inquadric;
192 Standard_Integer nbpts;
194 Standard_Real paramonc[4];
200 #include <IntAna_IntConicQuad.lxx>
206 #endif // _IntAna_IntConicQuad_HeaderFile