42cf5bc1 |
1 | // Created on: 1991-05-15 |
2 | // Created by: Isabelle GRIGNON |
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 _IntAna_IntQuadQuad_HeaderFile |
18 | #define _IntAna_IntQuadQuad_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <IntAna_Curve.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <gp_Pnt.hxx> |
28 | #include <Standard_Real.hxx> |
29 | class Standard_OutOfRange; |
30 | class StdFail_NotDone; |
31 | class Standard_DomainError; |
32 | class gp_Cylinder; |
33 | class IntAna_Quadric; |
34 | class gp_Cone; |
35 | class IntAna_Curve; |
36 | class gp_Pnt; |
37 | |
38 | |
39 | //! This class provides the analytic intersection between a |
40 | //! cylinder or a cone from gp and another quadric, as defined |
41 | //! in the class Quadric from IntAna. |
42 | //! This algorithm is used when the geometric intersection |
43 | //! (class QuadQuadGeo from IntAna) returns no geometric |
44 | //! solution. |
45 | //! The result of the intersection may be |
46 | //! - Curves as defined in the class Curve from IntAna |
47 | //! - Points (Pnt from gp) |
48 | class IntAna_IntQuadQuad |
49 | { |
50 | public: |
51 | |
52 | DEFINE_STANDARD_ALLOC |
53 | |
54 | |
55 | //! Empty Constructor |
56 | Standard_EXPORT IntAna_IntQuadQuad(); |
57 | |
58 | //! Creates the intersection between a cylinder and a quadric . |
59 | //! Tol est a definir plus precisemment. |
60 | Standard_EXPORT IntAna_IntQuadQuad(const gp_Cylinder& C, const IntAna_Quadric& Q, const Standard_Real Tol); |
61 | |
62 | //! Creates the intersection between a cone and a quadric. |
63 | //! Tol est a definir plus precisemment. |
64 | Standard_EXPORT IntAna_IntQuadQuad(const gp_Cone& C, const IntAna_Quadric& Q, const Standard_Real Tol); |
65 | |
66 | //! Intersects a cylinder and a quadric . |
67 | //! Tol est a definir plus precisemment. |
68 | Standard_EXPORT void Perform (const gp_Cylinder& C, const IntAna_Quadric& Q, const Standard_Real Tol); |
69 | |
70 | //! Intersects a cone and a quadric. |
71 | //! Tol est a definir plus precisemment. |
72 | Standard_EXPORT void Perform (const gp_Cone& C, const IntAna_Quadric& Q, const Standard_Real Tol); |
73 | |
74 | //! Returns True if the computation was successful. |
75 | Standard_Boolean IsDone() const; |
76 | |
77 | //! Returns TRUE if the cylinder, the cone or the sphere |
78 | //! is identical to the quadric. |
79 | Standard_Boolean IdenticalElements() const; |
80 | |
81 | //! Returns the number of curves solution. |
82 | Standard_Integer NbCurve() const; |
83 | |
84 | //! Returns the curve of range N. |
85 | Standard_EXPORT const IntAna_Curve& Curve (const Standard_Integer N) const; |
86 | |
87 | //! Returns the number of contact point. |
88 | Standard_Integer NbPnt() const; |
89 | |
90 | //! Returns the point of range N. |
91 | Standard_EXPORT const gp_Pnt& Point (const Standard_Integer N) const; |
92 | |
93 | //! Returns the paramaters on the "explicit quadric" |
94 | //! (i.e the cylinder or the cone, the |
95 | //! first argument given to the constructor) of the |
96 | //! point of range N. |
97 | Standard_EXPORT void Parameters (const Standard_Integer N, Standard_Real& U1, Standard_Real& U2) const; |
98 | |
99 | //! Returns True if the Curve I shares its last bound |
100 | //! with another curve. |
101 | Standard_EXPORT Standard_Boolean HasNextCurve (const Standard_Integer I) const; |
102 | |
103 | //! If HasNextCurve(I) returns True, this function |
104 | //! returns the Index J of the curve which has a |
9fd2d2c3 |
105 | //! common bound with the curve I. If theOpposite == |
42cf5bc1 |
106 | //! True , then the last parameter of the curve I, and |
107 | //! the last parameter of the curve J give the same |
108 | //! point. Else the last parameter of the curve I and |
109 | //! the first parameter of the curve J are the same |
110 | //! point. |
9fd2d2c3 |
111 | Standard_EXPORT Standard_Integer NextCurve (const Standard_Integer I, Standard_Boolean& theOpposite) const; |
42cf5bc1 |
112 | |
113 | //! Returns True if the Curve I shares its first bound |
114 | //! with another curve. |
115 | Standard_EXPORT Standard_Boolean HasPreviousCurve (const Standard_Integer I) const; |
116 | |
117 | //! if HasPreviousCurve(I) returns True, this function |
118 | //! returns the Index J of the curve which has a |
9fd2d2c3 |
119 | //! common bound with the curve I. If theOpposite == |
42cf5bc1 |
120 | //! True , then the first parameter of the curve I, |
121 | //! and the first parameter of the curve J give the |
122 | //! same point. Else the first parameter of the curve |
123 | //! I and the last parameter of the curve J are the |
124 | //! same point. |
9fd2d2c3 |
125 | Standard_EXPORT Standard_Integer PreviousCurve (const Standard_Integer I, Standard_Boolean& theOpposite) const; |
42cf5bc1 |
126 | |
127 | |
128 | |
129 | |
130 | protected: |
131 | |
132 | |
133 | //! Set the next and previous fields. Private method. |
134 | Standard_EXPORT void InternalSetNextAndPrevious(); |
135 | |
136 | |
137 | Standard_Boolean done; |
138 | Standard_Boolean identical; |
139 | IntAna_Curve TheCurve[12]; |
140 | Standard_Integer previouscurve[12]; |
141 | Standard_Integer nextcurve[12]; |
142 | Standard_Integer NbCurves; |
143 | Standard_Integer Nbpoints; |
144 | gp_Pnt Thepoints[2]; |
145 | Standard_Integer myNbMaxCurves; |
146 | Standard_Real myEpsilon; |
147 | Standard_Real myEpsilonCoeffPolyNull; |
148 | |
149 | |
150 | private: |
151 | |
152 | |
153 | |
154 | |
155 | |
156 | }; |
157 | |
158 | |
159 | #include <IntAna_IntQuadQuad.lxx> |
160 | |
161 | |
162 | |
163 | |
164 | |
165 | #endif // _IntAna_IntQuadQuad_HeaderFile |