0026595: Lost some comments in OCCT-code after cdl elimination
[occt.git] / src / BRepLProp / BRepLProp_SLProps.hxx
1 // Created on: 1994-02-24
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1994-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 _BRepLProp_SLProps_HeaderFile
18 #define _BRepLProp_SLProps_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <BRepAdaptor_Surface.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Integer.hxx>
27 #include <gp_Pnt.hxx>
28 #include <gp_Vec.hxx>
29 #include <gp_Dir.hxx>
30 #include <LProp_Status.hxx>
31 #include <Standard_Boolean.hxx>
32 class LProp_BadContinuity;
33 class Standard_DomainError;
34 class Standard_OutOfRange;
35 class LProp_NotDefined;
36 class BRepAdaptor_Surface;
37 class BRepLProp_SurfaceTool;
38 class gp_Pnt;
39 class gp_Vec;
40 class gp_Dir;
41
42
43
44 class BRepLProp_SLProps 
45 {
46 public:
47
48   DEFINE_STANDARD_ALLOC
49
50   
51   //! Initializes the local properties of the surface <S>
52   //! for the parameter values (<U>, <V>).
53   //! The current point and the derivatives are
54   //! computed at the same time, which allows an
55   //! optimization of the computation time.
56   //! <N> indicates the maximum number of derivations to
57   //! be done (0, 1, or 2). For example, to compute
58   //! only the tangent, N should be equal to 1.
59   //! <Resolution> is the linear tolerance (it is used to test
60   //! if a vector is null).
61   Standard_EXPORT BRepLProp_SLProps(const BRepAdaptor_Surface& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution);
62   
63   //! idem as previous constructor but without setting the value
64   //! of parameters <U> and <V>.
65   Standard_EXPORT BRepLProp_SLProps(const BRepAdaptor_Surface& S, const Standard_Integer N, const Standard_Real Resolution);
66   
67   //! idem as previous constructor but without setting the value
68   //! of parameters <U> and <V> and the surface.
69   //! the surface can have an empty constructor.
70   Standard_EXPORT BRepLProp_SLProps(const Standard_Integer N, const Standard_Real Resolution);
71   
72   //! Initializes the local properties of the surface S
73   //! for the new surface.
74   Standard_EXPORT void SetSurface (const BRepAdaptor_Surface& S);
75   
76   //! Initializes the local properties of the surface S
77   //! for the new parameter values (<U>, <V>).
78   Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V);
79   
80   //! Returns the point.
81   Standard_EXPORT const gp_Pnt& Value() const;
82   
83   //! Returns the first U derivative.
84   //! The derivative is computed if it has not been yet.
85   Standard_EXPORT const gp_Vec& D1U();
86   
87   //! Returns the first V derivative.
88   //! The derivative is computed if it has not been yet.
89   Standard_EXPORT const gp_Vec& D1V();
90   
91   //! Returns the second U derivatives
92   //! The derivative is computed if it has not been yet.
93   Standard_EXPORT const gp_Vec& D2U();
94   
95   //! Returns the second V derivative.
96   //! The derivative is computed if it has not been yet.
97   Standard_EXPORT const gp_Vec& D2V();
98   
99   //! Returns the second UV cross-derivative.
100   //! The derivative is computed if it has not been yet.
101   Standard_EXPORT const gp_Vec& DUV();
102   
103   //! returns True if the U tangent is defined.
104   //! For example, the tangent is not defined if the
105   //! two first U derivatives are null.
106   Standard_EXPORT Standard_Boolean IsTangentUDefined();
107   
108   //! Returns the tangent direction <D> on the iso-V.
109   Standard_EXPORT void TangentU (gp_Dir& D);
110   
111   //! returns if the V tangent is defined.
112   //! For example, the tangent is not defined if the
113   //! two first V derivatives are null.
114   Standard_EXPORT Standard_Boolean IsTangentVDefined();
115   
116   //! Returns the tangent direction <D> on the iso-V.
117   Standard_EXPORT void TangentV (gp_Dir& D);
118   
119   //! Tells if the normal is defined.
120   Standard_EXPORT Standard_Boolean IsNormalDefined();
121   
122   //! Returns the normal direction.
123   Standard_EXPORT const gp_Dir& Normal();
124   
125   //! returns True if the curvature is defined.
126   Standard_EXPORT Standard_Boolean IsCurvatureDefined();
127   
128   //! returns True if the point is umbilic (i.e. if the
129   //! curvature is constant).
130   Standard_EXPORT Standard_Boolean IsUmbilic();
131   
132   //! Returns the maximum curvature
133   Standard_EXPORT Standard_Real MaxCurvature();
134   
135   //! Returns the minimum curvature
136   Standard_EXPORT Standard_Real MinCurvature();
137   
138   //! Returns the direction of the maximum and minimum curvature
139   //! <MaxD> and <MinD>
140   Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD);
141   
142   //! Returns the mean curvature.
143   Standard_EXPORT Standard_Real MeanCurvature();
144   
145   //! Returns the Gaussian curvature
146   Standard_EXPORT Standard_Real GaussianCurvature();
147
148
149
150
151 protected:
152
153
154
155
156
157 private:
158
159
160
161   BRepAdaptor_Surface mySurf;
162   Standard_Real myU;
163   Standard_Real myV;
164   Standard_Integer myDerOrder;
165   Standard_Integer myCN;
166   Standard_Real myLinTol;
167   gp_Pnt myPnt;
168   gp_Vec myD1u;
169   gp_Vec myD1v;
170   gp_Vec myD2u;
171   gp_Vec myD2v;
172   gp_Vec myDuv;
173   gp_Dir myNormal;
174   Standard_Real myMinCurv;
175   Standard_Real myMaxCurv;
176   gp_Dir myDirMinCurv;
177   gp_Dir myDirMaxCurv;
178   Standard_Real myMeanCurv;
179   Standard_Real myGausCurv;
180   Standard_Integer mySignificantFirstDerivativeOrderU;
181   Standard_Integer mySignificantFirstDerivativeOrderV;
182   LProp_Status myUTangentStatus;
183   LProp_Status myVTangentStatus;
184   LProp_Status myNormalStatus;
185   LProp_Status myCurvatureStatus;
186
187
188 };
189
190
191
192
193
194
195
196 #endif // _BRepLProp_SLProps_HeaderFile