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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepLProp_SLProps_HeaderFile
18 #define _BRepLProp_SLProps_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRepAdaptor_Surface.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Integer.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;
44 class BRepLProp_SLProps
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);
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);
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);
72 //! Initializes the local properties of the surface S
73 //! for the new surface.
74 Standard_EXPORT void SetSurface (const BRepAdaptor_Surface& S);
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);
80 //! Returns the point.
81 Standard_EXPORT const gp_Pnt& Value() const;
83 //! Returns the first U derivative.
84 //! The derivative is computed if it has not been yet.
85 Standard_EXPORT const gp_Vec& D1U();
87 //! Returns the first V derivative.
88 //! The derivative is computed if it has not been yet.
89 Standard_EXPORT const gp_Vec& D1V();
91 //! Returns the second U derivatives
92 //! The derivative is computed if it has not been yet.
93 Standard_EXPORT const gp_Vec& D2U();
95 //! Returns the second V derivative.
96 //! The derivative is computed if it has not been yet.
97 Standard_EXPORT const gp_Vec& D2V();
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();
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();
108 //! Returns the tangent direction <D> on the iso-V.
109 Standard_EXPORT void TangentU (gp_Dir& D);
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();
116 //! Returns the tangent direction <D> on the iso-V.
117 Standard_EXPORT void TangentV (gp_Dir& D);
119 //! Tells if the normal is defined.
120 Standard_EXPORT Standard_Boolean IsNormalDefined();
122 //! Returns the normal direction.
123 Standard_EXPORT const gp_Dir& Normal();
125 //! returns True if the curvature is defined.
126 Standard_EXPORT Standard_Boolean IsCurvatureDefined();
128 //! returns True if the point is umbilic (i.e. if the
129 //! curvature is constant).
130 Standard_EXPORT Standard_Boolean IsUmbilic();
132 //! Returns the maximum curvature
133 Standard_EXPORT Standard_Real MaxCurvature();
135 //! Returns the minimum curvature
136 Standard_EXPORT Standard_Real MinCurvature();
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);
142 //! Returns the mean curvature.
143 Standard_EXPORT Standard_Real MeanCurvature();
145 //! Returns the Gaussian curvature
146 Standard_EXPORT Standard_Real GaussianCurvature();
161 BRepAdaptor_Surface mySurf;
164 Standard_Integer myDerOrder;
165 Standard_Integer myCN;
166 Standard_Real myLinTol;
174 Standard_Real myMinCurv;
175 Standard_Real myMaxCurv;
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;
196 #endif // _BRepLProp_SLProps_HeaderFile