0031035: Coding - uninitialized class fields reported by Visual Studio Code Analysis
[occt.git] / src / Extrema / Extrema_ExtElCS.hxx
1 // Created on: 1992-07-22
2 // Created by: Laurent PAINNOT
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 _Extrema_ExtElCS_HeaderFile
18 #define _Extrema_ExtElCS_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 <TColStd_HArray1OfReal.hxx>
27 #include <Extrema_HArray1OfPOnCurv.hxx>
28 #include <Extrema_HArray1OfPOnSurf.hxx>
29 #include <Standard_Real.hxx>
30
31 class gp_Lin;
32 class gp_Pln;
33 class gp_Cylinder;
34 class gp_Cone;
35 class gp_Sphere;
36 class gp_Torus;
37 class gp_Circ;
38 class gp_Hypr;
39 class Extrema_POnCurv;
40 class Extrema_POnSurf;
41
42
43 //! It calculates all the distances between a curve and
44 //! a surface.
45 //! These distances can be maximum or minimum.
46 class Extrema_ExtElCS 
47 {
48 public:
49
50   DEFINE_STANDARD_ALLOC
51
52   
53   Standard_EXPORT Extrema_ExtElCS();
54   
55   //! Calculates the distances between a line and a
56   //! plane. The line can be on the plane or on a parallel
57   //! plane.
58   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Pln& S);
59   
60   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Pln& S);
61   
62   //! Calculates the distances between a line and a
63   //! cylinder.
64   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cylinder& S);
65   
66   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cylinder& S);
67   
68   //! Calculates the distances between a line and a cone.
69   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cone& S);
70   
71   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cone& S);
72   
73   //! Calculates the distances between a line and a
74   //! sphere.
75   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Sphere& S);
76   
77   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Sphere& S);
78   
79   //! Calculates the distances between a line and a
80   //! torus.
81   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Torus& S);
82   
83   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Torus& S);
84   
85   //! Calculates the distances between a circle and a
86   //! plane.
87   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Pln& S);
88   
89   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Pln& S);
90   
91   //! Calculates the distances between a circle and a
92   //! cylinder.
93   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cylinder& S);
94   
95   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cylinder& S);
96   
97   //! Calculates the distances between a circle and a
98   //! cone.
99   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cone& S);
100   
101   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cone& S);
102   
103   //! Calculates the distances between a circle and a
104   //! sphere.
105   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Sphere& S);
106   
107   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Sphere& S);
108   
109   //! Calculates the distances between a circle and a
110   //! torus.
111   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Torus& S);
112   
113   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Torus& S);
114   
115   //! Calculates the distances between a hyperbola and a
116   //! plane.
117   Standard_EXPORT Extrema_ExtElCS(const gp_Hypr& C, const gp_Pln& S);
118   
119   Standard_EXPORT void Perform (const gp_Hypr& C, const gp_Pln& S);
120   
121   //! Returns True if the distances are found.
122   Standard_EXPORT Standard_Boolean IsDone() const;
123   
124   //! Returns True if the curve is on a parallel surface.
125   Standard_EXPORT Standard_Boolean IsParallel() const;
126   
127   //! Returns the number of extremum distances.
128   Standard_EXPORT Standard_Integer NbExt() const;
129   
130   //! Returns the value of the Nth extremum square distance.
131   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
132   
133   //! Returns the points of the Nth extremum distance.
134   //! P1 is on the curve, P2 on the surface.
135   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
136
137
138
139
140 protected:
141
142
143
144
145
146 private:
147
148
149
150   Standard_Boolean myDone;
151   Standard_Integer myNbExt;
152   Standard_Boolean myIsPar;
153   Handle(TColStd_HArray1OfReal) mySqDist;
154   Handle(Extrema_HArray1OfPOnCurv) myPoint1;
155   Handle(Extrema_HArray1OfPOnSurf) myPoint2;
156
157
158 };
159
160
161
162
163
164
165
166 #endif // _Extrema_ExtElCS_HeaderFile