1 // Created on: 2002-08-02
2 // Created by: Alexander KARTOMIN (akm)
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _LProp3d_SLProps_HeaderFile
17 #define _LProp3d_SLProps_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Real.hxx>
24 #include <Standard_Integer.hxx>
28 #include <LProp_Status.hxx>
29 #include <Standard_Boolean.hxx>
30 class Adaptor3d_HSurface;
31 class LProp_BadContinuity;
32 class Standard_DomainError;
33 class Standard_OutOfRange;
34 class LProp_NotDefined;
35 class LProp3d_SurfaceTool;
49 //! Initializes the local properties of the surface <S>
50 //! for the parameter values (<U>, <V>).
51 //! The current point and the derivatives are
52 //! computed at the same time, which allows an
53 //! optimization of the computation time.
54 //! <N> indicates the maximum number of derivations to
55 //! be done (0, 1, or 2). For example, to compute
56 //! only the tangent, N should be equal to 1.
57 //! <Resolution> is the linear tolerance (it is used to test
58 //! if a vector is null).
59 Standard_EXPORT LProp3d_SLProps(const Handle(Adaptor3d_HSurface)& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution);
61 //! idem as previous constructor but without setting the value
62 //! of parameters <U> and <V>.
63 Standard_EXPORT LProp3d_SLProps(const Handle(Adaptor3d_HSurface)& S, const Standard_Integer N, const Standard_Real Resolution);
65 //! idem as previous constructor but without setting the value
66 //! of parameters <U> and <V> and the surface.
67 //! the surface can have an empty constructor.
68 Standard_EXPORT LProp3d_SLProps(const Standard_Integer N, const Standard_Real Resolution);
70 //! Initializes the local properties of the surface S
71 //! for the new surface.
72 Standard_EXPORT void SetSurface (const Handle(Adaptor3d_HSurface)& S);
74 //! Initializes the local properties of the surface S
75 //! for the new parameter values (<U>, <V>).
76 Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V);
78 //! Returns the point.
79 Standard_EXPORT const gp_Pnt& Value() const;
81 //! Returns the first U derivative.
82 //! The derivative is computed if it has not been yet.
83 Standard_EXPORT const gp_Vec& D1U();
85 //! Returns the first V derivative.
86 //! The derivative is computed if it has not been yet.
87 Standard_EXPORT const gp_Vec& D1V();
89 //! Returns the second U derivatives
90 //! The derivative is computed if it has not been yet.
91 Standard_EXPORT const gp_Vec& D2U();
93 //! Returns the second V derivative.
94 //! The derivative is computed if it has not been yet.
95 Standard_EXPORT const gp_Vec& D2V();
97 //! Returns the second UV cross-derivative.
98 //! The derivative is computed if it has not been yet.
99 Standard_EXPORT const gp_Vec& DUV();
101 //! returns True if the U tangent is defined.
102 //! For example, the tangent is not defined if the
103 //! two first U derivatives are null.
104 Standard_EXPORT Standard_Boolean IsTangentUDefined();
106 //! Returns the tangent direction <D> on the iso-V.
107 Standard_EXPORT void TangentU (gp_Dir& D);
109 //! returns if the V tangent is defined.
110 //! For example, the tangent is not defined if the
111 //! two first V derivatives are null.
112 Standard_EXPORT Standard_Boolean IsTangentVDefined();
114 //! Returns the tangent direction <D> on the iso-V.
115 Standard_EXPORT void TangentV (gp_Dir& D);
117 //! Tells if the normal is defined.
118 Standard_EXPORT Standard_Boolean IsNormalDefined();
120 //! Returns the normal direction.
121 Standard_EXPORT const gp_Dir& Normal();
123 //! returns True if the curvature is defined.
124 Standard_EXPORT Standard_Boolean IsCurvatureDefined();
126 //! returns True if the point is umbilic (i.e. if the
127 //! curvature is constant).
128 Standard_EXPORT Standard_Boolean IsUmbilic();
130 //! Returns the maximum curvature
131 Standard_EXPORT Standard_Real MaxCurvature();
133 //! Returns the minimum curvature
134 Standard_EXPORT Standard_Real MinCurvature();
136 //! Returns the direction of the maximum and minimum curvature
137 //! <MaxD> and <MinD>
138 Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD);
140 //! Returns the mean curvature.
141 Standard_EXPORT Standard_Real MeanCurvature();
143 //! Returns the Gaussian curvature
144 Standard_EXPORT Standard_Real GaussianCurvature();
159 Handle(Adaptor3d_HSurface) mySurf;
162 Standard_Integer myDerOrder;
163 Standard_Integer myCN;
164 Standard_Real myLinTol;
172 Standard_Real myMinCurv;
173 Standard_Real myMaxCurv;
176 Standard_Real myMeanCurv;
177 Standard_Real myGausCurv;
178 Standard_Integer mySignificantFirstDerivativeOrderU;
179 Standard_Integer mySignificantFirstDerivativeOrderV;
180 LProp_Status myUTangentStatus;
181 LProp_Status myVTangentStatus;
182 LProp_Status myNormalStatus;
183 LProp_Status myCurvatureStatus;
194 #endif // _LProp3d_SLProps_HeaderFile