8e40c31a4571f01fc9dcf4e401c350c5ea1f6ac0
[occt.git] / src / gp / gp_XYZ.cdl
1 -- Copyright (c) 1991-1999 Matra Datavision
2 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
3 --
4 -- This file is part of Open CASCADE Technology software library.
5 --
6 -- This library is free software; you can redistribute it and/or modify it under
7 -- the terms of the GNU Lesser General Public License version 2.1 as published
8 -- by the Free Software Foundation, with special exception defined in the file
9 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 -- distribution for complete text of the license and disclaimer of any warranty.
11 --
12 -- Alternatively, this file may be used under the terms of Open CASCADE
13 -- commercial license or contractual agreement.
14
15 class XYZ   from gp   inherits Storable 
16
17         --- Purpose :
18         --  This class describes a cartesian coordinate entity in 
19         --  3D space {X,Y,Z}. This entity is used for algebraic
20         --  calculation. This entity can be transformed
21         --  with a "Trsf" or a  "GTrsf" from package "gp".
22         -- It is used in vectorial computations or for holding this type
23         -- of information in data structures.
24 uses  Mat from gp
25
26 raises ConstructionError from Standard,
27        OutOfRange        from Standard
28
29 is
30
31
32   Create   returns XYZ;
33         ---C++: inline
34         --- Purpose : Creates an XYZ object with zero co-ordinates (0,0,0)
35
36   Create (X, Y, Z : Real)  returns XYZ;
37         ---C++:inline
38         --- Purpose : creates an XYZ with given coordinates
39
40   SetCoord (me : in out; X, Y, Z : Real)
41         ---C++: inline
42         ---Purpose: For this XYZ object, assigns
43         --   the values X, Y and Z to its three coordinates
44      is static;
45
46   SetCoord (me : in out; Index : Integer; Xi : Real)
47         ---C++:inline
48         --- Purpose :
49         --  modifies the coordinate of range Index 
50         --  Index = 1 => X is modified
51         --  Index = 2 => Y is modified
52         --  Index = 3 => Z is modified 
53         --  Raises OutOfRange if Index != {1, 2, 3}.
54      raises OutOfRange
55      is static;
56
57   SetX (me: in out; X : Real)    is static;
58         ---C++: inline
59         ---Purpose: Assigns the given value to the X coordinate
60
61   SetY (me: in out; Y : Real)    is static;
62         ---C++: inline
63         ---Purpose: Assigns the given value to the Y coordinate
64
65   SetZ (me: in out; Z : Real)    is static;
66         ---C++: inline
67         ---Purpose: Assigns the given value to the Z coordinate
68
69    Coord (me; Index : Integer)  returns Real
70         ---C++: inline
71         --- Purpose :
72         --  returns the coordinate of range Index :
73         --  Index = 1 => X is returned
74         --  Index = 2 => Y is returned
75         --  Index = 3 => Z is returned
76         --  
77         -- Raises OutOfRange if Index != {1, 2, 3}.
78       raises OutOfRange
79       is static;
80
81   Coord (me; X, Y, Z : out Real)  is static;
82         ---C++: inline
83         --Purpose: For this XYZ object, returns:
84         -- -   its coordinates X, Y, and Z 
85     
86   X (me)  returns Real            is static;
87         ---C++: inline
88         ---Purpose: Returns the X coordinate
89
90   Y (me)  returns Real            is static;
91         ---C++: inline
92         ---Purpose: Returns the Y coordinate
93
94   Z (me)  returns Real            is static;
95         ---C++: inline
96         ---Purpose: Returns the Z coordinate
97
98   Modulus (me)         returns Real    is static;
99         --- Purpose : computes Sqrt (X*X + Y*Y + Z*Z) where X, Y and Z are the three coordinates of this XYZ object.
100         ---C++: inline
101
102   SquareModulus (me)  returns Real     is static;
103         --- Purpose : Computes X*X + Y*Y + Z*Z where X, Y and Z are the three coordinates of this XYZ object.
104         ---C++: inline
105
106   IsEqual (me; Other : XYZ; Tolerance : Real)   returns Boolean
107         --- Purpose :
108         --  Returns True if he coordinates of this XYZ object are
109         -- equal to the respective coordinates Other,
110         -- within the specified tolerance Tolerance. I.e.:
111         --  abs(<me>.X() - Other.X()) <= Tolerance and
112         --  abs(<me>.Y() - Other.Y()) <= Tolerance and 
113         --  abs(<me>.Z() - Other.Z()) <= Tolerance.
114      is static;
115
116
117   Add (me : in out; Other : XYZ)         is static;
118         --- Purposes :
119         -- <me>.X() = <me>.X() + Other.X()
120         -- <me>.Y() = <me>.Y() + Other.Y()
121         -- <me>.Z() = <me>.Z() + Other.Z()
122         ---C++: inline
123         ---C++: alias operator +=
124
125   Added (me; Other : XYZ)  returns XYZ   is static;
126         ---C++:inline
127         --- Purposes :
128         -- new.X() = <me>.X() + Other.X()
129         -- new.Y() = <me>.Y() + Other.Y()
130         -- new.Z() = <me>.Z() + Other.Z()
131         ---C++: alias operator +
132
133   Cross (me : in out; Right : XYZ)       is static;
134         ---C++:inline
135         ---C++: alias operator ^=
136         --- Purposes :
137         -- <me>.X() = <me>.Y() * Other.Z() - <me>.Z() * Other.Y()
138         -- <me>.Y() = <me>.Z() * Other.X() - <me>.X() * Other.Z()
139         -- <me>.Z() = <me>.X() * Other.Y() - <me>.Y() * Other.X()
140
141   Crossed (me; Right : XYZ)   returns XYZ   is static;
142         ---C++:inline
143         ---C++: alias operator ^
144         --- Purposes :
145         -- new.X() = <me>.Y() * Other.Z() - <me>.Z() * Other.Y()
146         -- new.Y() = <me>.Z() * Other.X() - <me>.X() * Other.Z()
147         -- new.Z() = <me>.X() * Other.Y() - <me>.Y() * Other.X()
148
149   CrossMagnitude (me; Right : XYZ)  returns Real   is static;
150         ---C++:inline
151         --- Purpose :
152         --  Computes the magnitude of the cross product between <me> and
153         --  Right. Returns || <me> ^ Right ||
154
155   CrossSquareMagnitude (me; Right : XYZ)  returns Real   is static;
156         ---C++:inline
157         --- Purpose :
158         --  Computes the square magnitude of the cross product between <me> and
159         --  Right. Returns || <me> ^ Right ||**2
160
161   CrossCross (me : in out; Coord1, Coord2 : XYZ)   is static;
162         ---C++:inline
163         --- Purposes : Triple vector product
164         --  Computes <me> = <me>.Cross(Coord1.Cross(Coord2))
165
166   CrossCrossed (me; Coord1, Coord2 : XYZ)   returns XYZ   is static;
167         ---C++:inline
168         --- Purposes : Triple vector product
169         --  computes New = <me>.Cross(Coord1.Cross(Coord2))
170
171   Divide (me : in out; Scalar : Real)    is static;
172         --- Purpose : divides <me> by a real.
173         ---C++: inline
174         ---C++: alias operator /=
175
176   Divided (me; Scalar : Real)   returns XYZ   is static;
177         ---C++:inline
178         --- Purpose : divides <me> by a real.
179         ---C++: alias operator /
180
181   Dot (me; Other : XYZ)  returns Real
182         --- Purpose : computes the scalar product between <me> and Other
183         ---C++: inline
184         ---C++: alias operator *
185      is static;
186
187   DotCross (me; Coord1, Coord2 : XYZ)   returns Real   is static;
188         ---C++: inline
189         --- Purpose : computes the triple scalar product
190
191   Multiply (me : in out; Scalar : Real)    is static;
192         ---C++: inline
193         ---C++: alias operator *=
194         --- Purpose :
195         --  <me>.X() = <me>.X() * Scalar;
196         --  <me>.Y() = <me>.Y() * Scalar;
197         --  <me>.Z() = <me>.Z() * Scalar;
198
199   Multiply (me : in out; Other : XYZ)    is static;
200         ---C++: inline
201         ---C++: alias operator *=
202         --- Purpose :
203         --  <me>.X() = <me>.X() * Other.X();
204         --  <me>.Y() = <me>.Y() * Other.Y();
205         --  <me>.Z() = <me>.Z() * Other.Z();
206
207   Multiply (me : in out; Matrix : Mat)    is static;
208         ---C++:inline
209         ---C++: alias operator *=
210         --- Purpose : <me> = Matrix * <me>
211
212   Multiplied (me; Scalar : Real)  returns XYZ    is static;
213         ---C++:inline
214         --- Purpose :
215         --  New.X() = <me>.X() * Scalar;
216         --  New.Y() = <me>.Y() * Scalar;
217         --  New.Z() = <me>.Z() * Scalar;
218         ---C++: alias operator *
219
220   Multiplied (me; Other : XYZ)   returns XYZ    is static;
221         ---C++:inline
222         --- Purpose :
223         --  new.X() = <me>.X() * Other.X();
224         --  new.Y() = <me>.Y() * Other.Y();
225         --  new.Z() = <me>.Z() * Other.Z();
226
227   Multiplied (me; Matrix : Mat)   returns XYZ    is static;
228         ---C++:inline
229         --- Purpose :  New = Matrix * <me>
230         ---C++: alias operator *
231
232   Normalize (me : in out) 
233         ---C++:inline
234         --- Purpose :
235         --  <me>.X() = <me>.X()/ <me>.Modulus()
236         --  <me>.Y() = <me>.Y()/ <me>.Modulus()
237         --  <me>.Z() = <me>.Z()/ <me>.Modulus()
238      raises ConstructionError
239         --- Purpose : Raised if <me>.Modulus() <= Resolution from gp
240      is static;
241
242   Normalized (me)  returns XYZ
243         ---C++:inline
244         --- Purpose :
245         --  New.X() = <me>.X()/ <me>.Modulus()
246         --  New.Y() = <me>.Y()/ <me>.Modulus()
247         --  New.Z() = <me>.Z()/ <me>.Modulus()
248      raises ConstructionError
249         --- Purpose : Raised if <me>.Modulus() <= Resolution from gp
250      is static;
251
252   Reverse (me : in out)    is static;
253         ---C++:inline
254         --- Purpose :
255         --  <me>.X() = -<me>.X()
256         --  <me>.Y() = -<me>.Y()
257         --  <me>.Z() = -<me>.Z()
258
259   Reversed (me)   returns XYZ     is static;
260         ---C++:inline
261         --- Purpose :
262         --  New.X() = -<me>.X()
263         --  New.Y() = -<me>.Y()
264         --  New.Z() = -<me>.Z()
265
266   Subtract (me : in out; Right : XYZ)       is static;
267         ---C++: inline
268         ---C++: alias operator -=
269         --- Purpose :
270         --  <me>.X() = <me>.X() - Other.X()
271         --  <me>.Y() = <me>.Y() - Other.Y()
272         --  <me>.Z() = <me>.Z() - Other.Z()
273
274   Subtracted (me; Right : XYZ)   returns XYZ    is static;
275         ---C++: inline
276         ---C++: alias operator -
277         --- Purpose :
278         --  new.X() = <me>.X() - Other.X()
279         --  new.Y() = <me>.Y() - Other.Y()
280         --  new.Z() = <me>.Z() - Other.Z()
281
282   SetLinearForm (me : in out; 
283                  A1 : Real; XYZ1 : XYZ; A2 : Real; XYZ2 : XYZ;
284                  A3 : Real; XYZ3 : XYZ; XYZ4 : XYZ)
285      is static;
286         --- Purpose :
287         --  <me> is set to the following linear form :
288         --  A1 * XYZ1 + A2 * XYZ2 + A3 * XYZ3 + XYZ4
289         ---C++: inline
290
291   SetLinearForm (me : in out; 
292                  A1 : Real; XYZ1 : XYZ; A2 : Real; XYZ2 : XYZ;
293                  A3 : Real; XYZ3 : XYZ)
294      is static;
295         --- Purpose :
296         --  <me> is set to the following linear form :
297         --  A1 * XYZ1 + A2 * XYZ2 + A3 * XYZ3
298         ---C++: inline
299
300   SetLinearForm (me : in out;
301                  A1 : Real; XYZ1 : XYZ; A2 : Real; XYZ2 : XYZ;  XYZ3 : XYZ)
302      is static;
303         --- Purpose :
304         --  <me> is set to the following linear form :
305         --  A1 * XYZ1 + A2 * XYZ2 + XYZ3
306         ---C++: inline
307
308   SetLinearForm (me : in out; A1 : Real; XYZ1 : XYZ; A2 : Real; XYZ2 : XYZ)
309      is static;
310         --- Purpose :
311         --  <me> is set to the following linear form :
312         --  A1 * XYZ1 + A2 * XYZ2
313         ---C++: inline
314
315   SetLinearForm (me : in out; A1 : Real; XYZ1 : XYZ; XYZ2 : XYZ)
316      is static;
317         --- Purpose :
318         --  <me> is set to the following linear form :
319         --  A1 * XYZ1 + XYZ2
320         ---C++: inline
321
322   SetLinearForm (me : in out; XYZ1, XYZ2 : XYZ)   is static;
323         --- Purpose :
324         --  <me> is set to the following linear form :
325         --  XYZ1 + XYZ2
326         ---C++: inline
327
328 fields
329   x : Real;
330   y : Real;
331   z : Real;
332
333 end;