0024624: Lost word in license statement in source files
[occt.git] / src / gp / gp_Mat2d.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 Mat2d   from gp   inherits Storable
16         ---Purpose:
17         -- Describes a two column, two row matrix. This sort of
18         -- object is used in various vectorial or matrix computations.
19     
20 uses XY  from gp, 
21      XYZ from gp
22
23 raises ConstructionError from Standard,
24        OutOfRange        from Standard
25
26 is
27
28
29
30
31
32   Create  returns Mat2d;
33         ---C++: inline
34         --- Purpose : Creates  a matrix with null coefficients.
35
36
37   Create (Col1, Col2 : XY)   returns Mat2d;
38         --- Purpose : 
39         --  Col1, Col2 are the 2 columns of the matrix.
40
41
42
43  
44
45   SetCol (me : in out; Col : Integer; Value : XY)
46         --- Purpose :  Assigns the two coordinates of Value to the column of range
47         --   Col of this matrix 
48         -- Raises OutOfRange if Col < 1 or Col > 2.
49      raises OutOfRange
50      is static;
51
52
53   SetCols (me : in out; Col1, Col2 : XY)
54         --- Purpose : Assigns the number pairs Col1, Col2 to the two columns of   this matrix
55      is static;
56
57
58   SetDiagonal (me : in out; X1, X2 : Real)     is static;
59        ---C++: inline
60        --- Purpose : 
61        --  Modifies the main diagonal of the matrix.
62        --  <me>.Value (1, 1) = X1
63        --  <me>.Value (2, 2) = X2
64        --  The other coefficients of the matrix are not modified.
65
66
67   SetIdentity (me : in out)      is static;
68         ---C++: inline
69         --- Purpose : Modifies this matrix, so that it represents the Identity matrix.
70
71
72   SetRotation (me : in out; Ang : Real)   is static;
73         --- Purpose :
74         --  Modifies this matrix, so that it representso a rotation. Ang is the angular
75         --  value in radian of the rotation.
76         ---C++: inline
77
78   SetRow (me : in out; Row : Integer; Value : XY)
79         --- Purpose : Assigns the two coordinates of Value to the row of index Row of this matrix. 
80         -- Raises OutOfRange if Row < 1 or Row > 2.
81      raises OutOfRange
82      is static;
83
84
85   SetRows (me : in out; Row1, Row2 : XY)    is static;
86         --- Purpose : Assigns the number pairs Row1, Row2 to the two rows of this matrix.
87
88
89   SetScale (me : in out; S : Real)    is static;
90        ---C++: inline
91        --- Purpose :
92        --  Modifies the matrix such that it
93        -- represents a scaling transformation, where S is the scale   factor :
94        --           | S    0.0 |
95        --   <me> =  | 0.0   S  |
96
97
98   SetValue (me : in out; Row, Col : Integer; Value : Real)
99         --- Purpose : Assigns <Value> to the coefficient of row Row, column Col of this matrix.
100         -- Raises OutOfRange if Row < 1 or Row > 2 or Col < 1 or Col > 2
101         ---C++: inline
102      raises OutOfRange
103      is static;
104
105   Column (me; Col : Integer)   returns XY
106         --- Purpose : Returns the column of Col index.
107         -- Raises OutOfRange if Col < 1 or Col > 2
108      raises OutOfRange
109      is static;
110
111
112   Determinant (me)   returns Real    is static;
113         ---C++: inline
114         --- Purpose : Computes the determinant of the matrix.
115
116
117   Diagonal (me)  returns XY    is static;
118         --- Purpose : Returns the main diagonal of the matrix.
119
120
121   Row (me; Row : Integer)  returns XY
122         --- Purpose : Returns the row of index Row.
123      raises OutOfRange
124         --- Purpose : Raised if Row < 1 or Row > 2
125      is static;
126
127
128   Value (me; Row, Col : Integer)  returns Real
129         --- Purpose : Returns the coefficient of range (Row, Col)
130         -- Raises OutOfRange
131         -- if Row < 1 or Row > 2 or Col < 1 or Col > 2
132         ---C++: inline
133         ---C++: return const &
134         ---C++: alias operator()
135      raises OutOfRange
136        
137      is static;
138
139
140   ChangeValue (me : in out; Row, Col : Integer)  returns Real
141         --- Purpose : Returns the coefficient of range (Row, Col)
142         -- Raises OutOfRange
143         -- if Row < 1 or Row > 2 or Col < 1 or Col > 2
144         ---C++: inline
145         ---C++: return  &
146         ---C++: alias operator()
147      raises OutOfRange
148       
149      is static;
150
151
152   IsSingular (me)  returns Boolean   is static;
153         --- Purpose :
154         -- Returns true if this matrix is singular (and therefore, cannot be inverted).
155         --  The Gauss LU decomposition is used to invert the matrix 
156         --  so the matrix is considered as singular if the largest 
157         --  pivot found is lower or equal to Resolution from gp.
158         ---C++: inline
159
160
161   Add (me : in out; Other : Mat2d)    is static;
162         ---C++: inline
163         ---C++: alias operator +=
164
165   Added (me; Other : Mat2d)  returns Mat2d   is static;
166         ---C++: inline
167         ---C++: alias operator +
168
169         --- Purpose :
170         --  Computes the sum of this matrix and the matrix
171         -- Other.for each coefficient of the matrix :
172         --  <me>.Coef(i,j) + <Other>.Coef(i,j)
173         -- Note:
174         -- -   operator += assigns the result to this matrix, while
175         -- -   operator + creates a new one.
176         
177     
178
179   Divide (me : in out; Scalar : Real)    is static;
180         ---C++: inline
181         ---C++: alias operator /=
182
183   Divided (me; Scalar : Real)  returns Mat2d   is static;
184         ---C++: inline
185         ---C++: alias operator /
186             --- Purpose : 
187             --  Divides all the coefficients of the matrix by a scalar.
188
189
190
191   Invert (me : in out)  raises ConstructionError   is static;
192
193   Inverted (me)  returns Mat2d   raises ConstructionError   is static;
194         --- Purpose :
195         --  Inverses the matrix and raises exception if the matrix
196         --  is singular.
197         ---C++: inline
198
199      
200
201   Multiplied (me; Other : Mat2d)   returns Mat2d   is static;
202           ---C++: inline
203           ---C++: alias operator *
204
205   Multiply (me : in out; Other : Mat2d)            is static;
206        --- Purpose :
207        --  Computes the product of two matrices <me> * <Other>
208        ---C++: inline
209        -- C++: alias operator *=
210
211   PreMultiply(me : in out; Other : Mat2d)          is static;
212        --- Purpose : Modifies this matrix by premultiplying it by the matrix Other
213        -- <me> = Other * <me>.
214        ---C++: inline
215
216           
217     
218   Multiplied (me; Scalar : Real)   returns Mat2d   is static;
219         ---C++: inline
220         ---C++: alias operator *
221
222   Multiply (me : in out; Scalar : Real)    is static;
223         --- Purpose :
224         --  Multiplies all the coefficients of the matrix by a scalar.
225         ---C++: inline
226         ---C++: alias operator *=
227
228
229   Power (me : in out; N : Integer)  raises ConstructionError is static;
230
231   Powered (me; N : Integer)  returns Mat2d  raises ConstructionError is static;
232         --- Purpose :
233         --  computes <me> = <me> * <me> * .......* <me>, N time.
234         --  if N = 0 <me> = Identity
235         --  if N < 0 <me> = <me>.Invert() *...........* <me>.Invert().
236         --  If N < 0 an exception can be raised if the matrix is not
237         --  inversible
238         ---C++: inline
239
240   
241   Subtract (me : in out; Other : Mat2d)           is static;
242         ---C++: inline
243         ---C++: alias operator -=
244
245   Subtracted (me; Other : Mat2d)  returns Mat2d   is static;
246         ---C++: inline
247         ---C++: alias operator -
248         --- Purpose :
249         --  Computes for each coefficient of the matrix :
250         --  <me>.Coef(i,j) - <Other>.Coef(i,j)
251
252
253   Transpose (me : in out)        is static;
254         ---C++: inline  
255
256   Transposed (me)  returns Mat2d is static;
257         --- Purpose : 
258         --  Transposes the matrix. A(j, i) -> A (i, j)
259         ---C++: inline
260 fields
261
262   matrix : Real[2, 2];
263
264 friends
265
266   class Trsf2d   from gp,
267   class GTrsf2d  from gp,
268   class XY       from gp
269
270 end;