0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / BRepLProp / BRepLProp_SLProps.hxx
CommitLineData
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>
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>
32class LProp_BadContinuity;
33class Standard_DomainError;
34class Standard_OutOfRange;
35class LProp_NotDefined;
36class BRepAdaptor_Surface;
37class BRepLProp_SurfaceTool;
38class gp_Pnt;
39class gp_Vec;
40class gp_Dir;
41
42
43
44class BRepLProp_SLProps
45{
46public:
47
48 DEFINE_STANDARD_ALLOC
49
50
36b9ff75 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).
42cf5bc1 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
36b9ff75 63 //! idem as previous constructor but without setting the value
64 //! of parameters <U> and <V>.
42cf5bc1 65 Standard_EXPORT BRepLProp_SLProps(const BRepAdaptor_Surface& S, const Standard_Integer N, const Standard_Real Resolution);
66
36b9ff75 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.
42cf5bc1 70 Standard_EXPORT BRepLProp_SLProps(const Standard_Integer N, const Standard_Real Resolution);
71
36b9ff75 72 //! Initializes the local properties of the surface S
73 //! for the new surface.
42cf5bc1 74 Standard_EXPORT void SetSurface (const BRepAdaptor_Surface& S);
75
36b9ff75 76 //! Initializes the local properties of the surface S
77 //! for the new parameter values (<U>, <V>).
42cf5bc1 78 Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V);
79
36b9ff75 80 //! Returns the point.
42cf5bc1 81 Standard_EXPORT const gp_Pnt& Value() const;
82
36b9ff75 83 //! Returns the first U derivative.
84 //! The derivative is computed if it has not been yet.
42cf5bc1 85 Standard_EXPORT const gp_Vec& D1U();
86
36b9ff75 87 //! Returns the first V derivative.
88 //! The derivative is computed if it has not been yet.
42cf5bc1 89 Standard_EXPORT const gp_Vec& D1V();
90
36b9ff75 91 //! Returns the second U derivatives
92 //! The derivative is computed if it has not been yet.
42cf5bc1 93 Standard_EXPORT const gp_Vec& D2U();
94
36b9ff75 95 //! Returns the second V derivative.
96 //! The derivative is computed if it has not been yet.
42cf5bc1 97 Standard_EXPORT const gp_Vec& D2V();
98
36b9ff75 99 //! Returns the second UV cross-derivative.
100 //! The derivative is computed if it has not been yet.
42cf5bc1 101 Standard_EXPORT const gp_Vec& DUV();
102
36b9ff75 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.
42cf5bc1 106 Standard_EXPORT Standard_Boolean IsTangentUDefined();
107
36b9ff75 108 //! Returns the tangent direction <D> on the iso-V.
42cf5bc1 109 Standard_EXPORT void TangentU (gp_Dir& D);
110
36b9ff75 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.
42cf5bc1 114 Standard_EXPORT Standard_Boolean IsTangentVDefined();
115
36b9ff75 116 //! Returns the tangent direction <D> on the iso-V.
42cf5bc1 117 Standard_EXPORT void TangentV (gp_Dir& D);
118
36b9ff75 119 //! Tells if the normal is defined.
42cf5bc1 120 Standard_EXPORT Standard_Boolean IsNormalDefined();
121
36b9ff75 122 //! Returns the normal direction.
42cf5bc1 123 Standard_EXPORT const gp_Dir& Normal();
124
36b9ff75 125 //! returns True if the curvature is defined.
42cf5bc1 126 Standard_EXPORT Standard_Boolean IsCurvatureDefined();
127
36b9ff75 128 //! returns True if the point is umbilic (i.e. if the
129 //! curvature is constant).
42cf5bc1 130 Standard_EXPORT Standard_Boolean IsUmbilic();
131
36b9ff75 132 //! Returns the maximum curvature
42cf5bc1 133 Standard_EXPORT Standard_Real MaxCurvature();
134
36b9ff75 135 //! Returns the minimum curvature
42cf5bc1 136 Standard_EXPORT Standard_Real MinCurvature();
137
36b9ff75 138 //! Returns the direction of the maximum and minimum curvature
139 //! <MaxD> and <MinD>
42cf5bc1 140 Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD);
141
36b9ff75 142 //! Returns the mean curvature.
42cf5bc1 143 Standard_EXPORT Standard_Real MeanCurvature();
144
36b9ff75 145 //! Returns the Gaussian curvature
42cf5bc1 146 Standard_EXPORT Standard_Real GaussianCurvature();
147
148
149
150
151protected:
152
153
154
155
156
157private:
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