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