1 -- Created on: 1991-03-26
2 -- Created by: Michel CHAUVAT
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
24 generic class SLProps from LProp (Surface as any;
25 Tool as any) -- as ToolSurface(Surface)
26 ---Purpose: Computation of Surface Local Properties:
32 -- - principal curvatures and their associated direction,
34 -- - Gaussian curvature.
41 raises BadContinuity, DomainError, OutOfRange, NotDefined
44 Create(S: Surface; U, V: Real; N: Integer; Resolution: Real)
45 ---Purpose: Initializes the local properties of the surface <S>
46 -- for the parameter values (<U>, <V>).
47 -- The current point and the derivatives are
48 -- computed at the same time, which allows an
49 -- optimization of the computation time.
50 -- <N> indicates the maximum number of derivations to
51 -- be done (0, 1, or 2). For example, to compute
52 -- only the tangent, N should be equal to 1.
53 -- <Resolution> is the linear tolerance (it is used to test
54 -- if a vector is null).
59 Create(S: Surface; N: Integer; Resolution: Real)
60 ---Purpose: idem as previous constructor but without setting the value
61 -- of parameters <U> and <V>.
66 Create( N: Integer; Resolution: Real)
67 ---Purpose: 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.
75 SetSurface(me : in out;S : Surface)
76 ---Purpose: Initializes the local properties of the surface S
77 -- for the new surface.
80 SetParameters(me: in out; U, V : Real)
81 ---Purpose: Initializes the local properties of the surface S
82 -- for the new parameter values (<U>, <V>).
86 ---Purpose: Returns the point.
87 ---C++: return const &
90 D1U(me: in out) returns Vec is static;
91 ---Purpose: Returns the first U derivative.
92 -- The derivative is computed if it has not been yet.
93 ---C++: return const &
95 D1V(me: in out) returns Vec is static;
96 ---Purpose: Returns the first V derivative.
97 -- The derivative is computed if it has not been yet.
98 ---C++: return const &
100 D2U(me: in out) returns Vec is static;
101 ---Purpose: Returns the second U derivatives
102 -- The derivative is computed if it has not been yet.
103 ---C++: return const &
105 D2V(me: in out) returns Vec is static;
106 ---Purpose: Returns the second V derivative.
107 -- The derivative is computed if it has not been yet.
108 ---C++: return const &
110 DUV(me: in out) returns Vec is static;
111 ---Purpose: Returns the second UV cross-derivative.
112 -- The derivative is computed if it has not been yet.
113 ---C++: return const &
115 IsTangentUDefined(me: in out) returns Boolean is static;
116 ---Purpose: returns True if the U tangent is defined.
117 -- For example, the tangent is not defined if the
118 -- two first U derivatives are null.
120 TangentU(me: in out; D : out Dir)
121 ---Purpose: Returns the tangent direction <D> on the iso-V.
123 -- if IsTangentUDefined() == False.
126 IsTangentVDefined(me: in out) returns Boolean is static;
127 ---Purpose: returns if the V tangent is defined.
128 -- For example, the tangent is not defined if the
129 -- two first V derivatives are null.
131 TangentV(me: in out; D : out Dir)
132 ---Purpose: Returns the tangent direction <D> on the iso-V.
134 -- if IsTangentVDefined() == False.
137 IsNormalDefined(me: in out) returns Boolean is static;
138 ---Purpose: Tells if the normal is defined.
140 Normal(me: in out) returns Dir
141 ---Purpose: Returns the normal direction.
142 ---C++: return const &
144 -- if IsNormalDefined() == False
147 IsCurvatureDefined(me: in out)
148 ---Purpose: returns True if the curvature is defined.
151 -- if the surface is not C2.
154 IsUmbilic(me: in out)
155 ---Purpose: returns True if the point is umbilic (i.e. if the
156 -- curvature is constant).
159 -- if IsCurvatureDefined() == False
162 MaxCurvature(me : in out)
163 ---Purpose: Returns the maximum curvature
166 -- if IsCurvatureDefined() == False.
169 MinCurvature(me : in out)
170 ---Purpose: Returns the minimum curvature
173 -- if IsCurvatureDefined() == False.
176 CurvatureDirections(me: in out; MaxD, MinD : out Dir)
177 ---Purpose: Returns the direction of the maximum and minimum curvature
180 -- if IsCurvatureDefined() == False
181 -- or IsUmbilic() == True.
184 MeanCurvature(me: in out)
185 ---Purpose: Returns the mean curvature.
188 -- if IsCurvatureDefined() == False.
191 GaussianCurvature(me: in out)
192 ---Purpose: Returns the Gaussian curvature
195 -- if IsCurvatureDefined() == False.
203 myDerOrder : Integer;
214 myNormal : Dir from gp;
217 myDirMinCurv : Dir from gp;
218 myDirMaxCurv : Dir from gp;
222 mySignificantFirstDerivativeOrderU : Integer;
223 mySignificantFirstDerivativeOrderV : Integer;
225 myUTangentStatus : Status from LProp;
226 myVTangentStatus : Status from LProp;
227 myNormalStatus : Status from LProp;
228 myCurvatureStatus : Status from LProp;