0023706: Cannot project point on curve
[occt.git] / src / LProp / LProp_CLProps.cdl
1 -- Created on: 1991-03-25
2 -- Created by: Michel CHAUVAT
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
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.
10 --
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.
13 --
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.
20
21
22
23 generic class CLProps from LProp
24                          (Curve as any;
25                           Vec   as any; -- as Vec or Vec2d
26                           Pnt   as any; -- as Pnt or Pnt2d
27                           Dir   as any; -- as Dir or Dir2d
28                           Tool  as any) -- as ToolCurve(Curve, Pnt, Vec)  
29
30     ---Purpose: Computation of Curve Local Properties:
31     --          - point,
32     --          - derivatives,
33     --          - tangent,
34     --          - normal plane,
35     --          - curvature,
36     --          - normal,
37     --          - centre of curvature,
38
39 uses    Status from LProp
40
41 raises  BadContinuity from LProp, 
42         DomainError   from Standard, 
43         OutOfRange    from Standard, 
44         NotDefined    from LProp
45 is
46
47
48     Create(C: Curve; N: Integer; Resolution: Real)
49         ---Purpose: Initializes the local properties of the curve <C> 
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, 2 or 3). 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).
58         returns CLProps
59         raises OutOfRange;
60                 -- if N < 0 or N > 3.
61
62     Create(C: Curve; U : Real; N: Integer; Resolution: Real)
63         --- Purpose : Same as previous constructor but here the parameter is
64         --            set to the value <U>.
65         --            All the computations done will be related to <C> and <U>.
66         returns CLProps
67         raises OutOfRange;
68                 -- if N < 0 or N > 3.
69                 
70     Create(N : Integer;Resolution:Real)
71         --- Purpose : Same as previous constructor but here the parameter is
72         --            set to the value <U> and the curve is set 
73         --            with SetCurve.
74         --            the curve can have a empty constructor
75         --            All the computations done will be related to <C> and <U>
76         --            when the functions "set" will be done.
77
78     returns CLProps
79     raises OutOfRange;
80     
81     SetParameter(me: in out; U : Real)
82         ---Purpose: Initializes the local properties of the curve 
83         --          for the parameter value <U>.
84         is static;
85                 
86     SetCurve(me: in out; C : Curve)
87         ---Purpose: Initializes the local properties of the curve 
88         --          for the new curve.
89         is static;
90
91     Value(me) returns Pnt is static;
92         ---Purpose: Returns the Point.
93         ---C++: return const &
94
95     D1(me: in out) returns Vec is static;
96         ---Purpose: Returns the first derivative. 
97         --          The derivative is computed if it has not been yet.
98         ---C++: return const &
99
100     D2(me: in out) returns Vec is static;
101         ---Purpose: Returns the second derivative.
102         --          The derivative is computed if it has not been yet.
103         ---C++: return const &
104
105     D3(me: in out) returns Vec is static;
106         ---Purpose: Returns the third derivative.
107         --          The derivative is computed if it has not been yet.
108         ---C++: return const &
109
110     IsTangentDefined(me: in out) returns Boolean is static;
111         ---Purpose: Returns True if the tangent is defined.
112         --          For example, the tangent is not defined if the 
113         --          three first derivatives are all null.
114
115     Tangent(me: in out; D : out Dir)
116         ---Purpose: output  the tangent direction <D>
117         raises  NotDefined
118                 -- if IsTangentDefined(me)=False.
119         is static;
120
121     Curvature(me: in out)
122         ---Purpose: Returns the curvature.
123         returns Real
124         raises  NotDefined
125                 -- if IsTangentDefined(me) == False.
126         is static;
127
128     Normal(me: in out; N : out Dir)
129         ---Purpose: Returns the normal direction <N>.
130         raises  NotDefined
131                 -- if Curvature(me) < Resolution
132         is static;
133
134     CentreOfCurvature(me: in out; P : out Pnt)
135         ---Purpose: Returns the centre of curvature <P>.
136         raises  NotDefined
137                 -- if Curvature(me) < Resolution
138         is static;
139
140 fields
141
142     myCurve      : Curve;    -- the Curve on which thw calculus are done
143     myU          : Real;     -- the current value of the parameter
144     myDerOrder   : Integer;  -- the order of derivation
145     myCN         : Real;     -- the order of continuity of the Curve
146     myLinTol     : Real;     -- the tolerance for null Vector
147     
148     myPnt        : Pnt;      -- the current point value
149     myDerivArr   : Vec[3];   -- the current first, second and third derivative
150                              -- value
151     myTangent    : Dir;      -- the tangent value
152     myCurvature  : Real;     -- the curvature value
153
154     myTangentStatus   : Status from LProp; 
155                           -- the status of the tangent direction
156     mySignificantFirstDerivativeOrder : Integer;
157                           -- the order of the first non null derivative
158                           -- 
159 end CLProps;
160
161
162
163