changed attributes of header files
[platform/core/location/maps-plugin-here.git] / inc / engine / graphic / DoubleMatrix4.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 #ifndef HERE_DOUBLEMATRIX4_H
18 #define HERE_DOUBLEMATRIX4_H
19
20 #include "common/HereMaps_global.h"
21 #include "base/BaseObject.h"
22
23 TIZEN_MAPS_BEGIN_NAMESPACE
24
25 class DoubleMatrix4;
26
27 class DoubleMatrix4 : public Object
28 {
29 public:
30         /**
31          * This is the default constructor for this class. @n
32          * Constructs a 4 X 4 null matrix in which all the elements are zero.
33          *
34          * @since 2.0
35          */
36         DoubleMatrix4(void);
37
38         /**
39          * Copying of objects using this copy constructor is allowed.
40          *
41          * @since 2.0
42          *
43          * @param[in]   rhs     An instance of %DoubleMatrix4 to copy
44          */
45         DoubleMatrix4(const DoubleMatrix4& rhs);
46
47         /**
48          * Constructs a 4 by 4 matrix initialized to the value in the specified array.
49          *
50          * @since 2.0
51          *
52          * @param[in]   matrix  The matrix with 16 @c double values
53          */
54         DoubleMatrix4(const double matrix[4][4]);
55
56         /**
57          * This destructor overrides Object::~Object().
58          *
59          * @since 2.0
60          */
61         virtual ~DoubleMatrix4(void);
62
63         /**
64          * Checks whether the current instance and the specified instance of %DoubleMatrix4 are equal.
65          *
66          * @since 2.0
67          *
68          * @return              @c true if all the matrix members of the current instance are equal to the corresponding matrix members in the specified instance, @n
69          *                              else @c false
70          * @param[in]   rhs     An instance of %DoubleMatrix4
71          */
72         bool operator ==(const DoubleMatrix4& rhs) const;
73
74         /**
75          * Checks whether the current instance and the specified instance of %DoubleMatrix4 are not equal.
76          *
77          * @since 2.0
78          *
79          * @return              @c true if all the matrix members of the current instance are not equal to the corresponding matrix members in the specified instance, @n
80          *                              else @c false
81          * @param[in]   rhs     An instance of %DoubleMatrix4
82          */
83         bool operator !=(const DoubleMatrix4& rhs) const;
84
85         /**
86          * Copying of objects using this copy assignment operator is allowed.
87          *
88          * @since 2.0
89          *
90          * @return              A reference to this instance
91          * @param[in]   rhs     An instance of %DoubleMatrix4
92          */
93         DoubleMatrix4& operator =(const DoubleMatrix4& rhs);
94
95         /**
96          * Assigns the value of the specified instance to the current instance of %DoubleMatrix4.
97          *
98          * @since 2.0
99          *
100          * @return              A reference to this instance
101          * @param[in]   value   The @c double value to assign
102          */
103         DoubleMatrix4& operator =(double value);
104
105         /**
106          * Multiplies the value of the specified instance with the current instance of %DoubleMatrix4.
107          *
108          * @since 2.0
109          *
110          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
111          * @param[in]   rhs     An instance of %DoubleMatrix4
112          */
113         DoubleMatrix4 operator *(const DoubleMatrix4& rhs) const;
114
115         /**
116          * Multiplies the value to each matrix member of current instance of %DoubleMatrix4.
117          *
118          * @since 2.0
119          *
120          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
121          * @param[in]   value   The @c double value to multiply
122          */
123         DoubleMatrix4 operator *(double value) const;
124
125         /**
126          * Adds the value of the specified instance to the current instance of %DoubleMatrix4.
127          *
128          * @since 2.0
129          *
130          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
131          * @param[in]   rhs     An instance of %DoubleMatrix4
132          */
133         DoubleMatrix4 operator +(const DoubleMatrix4& rhs) const;
134
135         /**
136          * Adds the value to each matrix member of the current instance of %DoubleMatrix4.
137          *
138          * @since 2.0
139          *
140          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
141          * @param[in]   value   The @c double value to add
142          */
143         DoubleMatrix4 operator +(double value) const;
144
145         /**
146          * Subtracts the value of the specified instance from the current instance of %DoubleMatrix4.
147          *
148          * @since 2.0
149          *
150          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
151          * @param[in]   rhs     An instance of %DoubleMatrix4
152          */
153         DoubleMatrix4 operator -(const DoubleMatrix4& rhs) const;
154
155         /**
156          * Subtracts the value from each matrix member of the current instance of %DoubleMatrix4.
157          *
158          * @since 2.0
159          *
160          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
161          * @param[in]   value   The @c double value to subtract
162          */
163         DoubleMatrix4 operator -(double value) const;
164
165         /**
166          * Multiplies the value of the specified instance and the current instance of %DoubleMatrix4.
167          *
168          * @since 2.0
169          *
170          * @return              The reference to %DoubleMatrix4 that contains the resulting value of the operation
171          * @param[in]   rhs     An instance of %DoubleMatrix4
172          */
173         DoubleMatrix4& operator *=(const DoubleMatrix4& rhs);
174
175         /**
176          * Multiplies the value to each matrix member of the current instance of %DoubleMatrix4.
177          *
178          * @since 2.0
179          *
180          * @return              A reference to %DoubleMatrix4 that contains the resulting value of the operation
181          * @param[in]   value   The @c double value to multiply
182          */
183         DoubleMatrix4& operator *=(double value);
184
185         /**
186          * Adds the value of the specified instance to the current instance of %DoubleMatrix4.
187          *
188          * @since 2.0
189          *
190          * @return              A reference to %DoubleMatrix4 that contains the resulting value of the operation
191          * @param[in]   rhs     An instance of %DoubleMatrix4
192          */
193         DoubleMatrix4& operator +=(const DoubleMatrix4& rhs);
194
195         /**
196          * Adds the value to each matrix member of the current instance of %DoubleMatrix4.
197          *
198          * @since 2.0
199          *
200          * @return              A reference to %DoubleMatrix4 that contains the resulting value of the operation
201          * @param[in]   value   The @c double value to add
202          */
203         DoubleMatrix4& operator +=(double value);
204
205         /**
206          * Subtracts the value of the specified instance from the current instance of %DoubleMatrix4.
207          *
208          * @since 2.0
209          *
210          * @return              A reference to %DoubleMatrix4 cthat contains the resulting value of the operation
211          * @param[in]   rhs     An instance of %DoubleMatrix4
212          */
213         DoubleMatrix4& operator -=(const DoubleMatrix4& rhs);
214
215         /**
216          * Subtracts the value from each matrix member of the current instance of %DoubleMatrix4.
217          *
218          * @since 2.0
219          *
220          * @return              A reference to %DoubleMatrix4 that contains the resulting value of the operation
221          * @param[in]   value   The @c double value to subtract
222          */
223         DoubleMatrix4& operator -=(double value);
224
225         /**
226          * Gets an instance of %DoubleMatrix4 resulting from the sum of the value and the specified instance of %DoubleMatrix4.
227          *
228          * @since 2.0
229          *
230          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
231          * @param[in]   value   The @c double value to add
232          * @param[in]   rhs     An instance of %DoubleMatrix4
233          */
234         friend DoubleMatrix4 operator +(const double& value, const DoubleMatrix4& rhs);
235
236         /**
237          * Gets an instance of %DoubleMatrix4 resulting from the product of the value and the specified instance of %DoubleMatrix4.
238          *
239          * @since 2.0
240          *
241          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
242          * @param[in]   value   The @c double value to multiply
243          * @param[in]   rhs             An instance of %DoubleMatrix4
244          */
245         friend DoubleMatrix4 operator *(const double& value, const DoubleMatrix4& rhs);
246
247         /**
248          * Gets an instance of %DoubleMatrix4 resulting from the difference between the value and the specified instance of %DoubleMatrix4.
249          *
250          * @since 2.0
251          *
252          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
253          * @param[in]   value   The @c double value to subtract
254          * @param[in]   rhs             An instance of %DoubleMatrix4
255          */
256         friend DoubleMatrix4 operator -(const double& value, const DoubleMatrix4& rhs);
257
258         /**
259          * Checks whether the current instance of %DoubleMatrix4 equals the specified instance of %DoubleMatrix4.
260          *
261          * @since 2.0
262          *
263          * @return              @c true if the values of the current instance is equal to the value of the specified instance, @n
264          *                              else @c false
265          * @param[in]   obj     An instance of %DoubleMatrix4
266          * @remarks
267          *                              - This method overrides Object::Equals(). 
268          *                              - This method uses the values of the Matrix components to compare the two instances.
269          */
270         virtual bool Equals(const Object& obj) const;
271
272         /**
273          * Gets the determinant of the current instance of %DoubleMatrix4.
274          *
275          * @since 2.0
276          *
277          * @return              The determinant value of the current instance
278          */
279         double GetDeterminant(void) const;
280
281         /**
282          * Gets the inverse matrix of the current instance of %DoubleMatrix4.
283          *
284          * @since 2.0
285          *
286          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
287          * @remarks             This method must be called after checking whether the matrix is invertible or not.
288          */
289         DoubleMatrix4 GetInverse(void) const;
290
291         /**
292          * Gets the trace of the current instance of %DoubleMatrix4.
293          *
294          * @since 2.0
295          *
296          * @return              The trace of the current instance
297          */
298         double GetTrace(void) const;
299
300         /**
301          * Gets the transpose matrix of the current instance of %DoubleMatrix4.
302          *
303          * @since 2.0
304          *
305          * @return              A new instance of %DoubleMatrix4 that contains the resulting value of the operation
306          */
307         DoubleMatrix4 GetTranspose(void) const;
308
309         /**
310          * Checks whether the current instance is an identity matrix.
311          *
312          * @since 2.0
313          *
314          * @return              @c true if the matrix is an identity matrix, @n
315          *                              else @c false
316          */
317         bool IsIdentity(void) const;
318
319         /**
320          * Checks whether the current matrix is invertible.
321          *
322          * @since 2.0
323          *
324          * @return              @c true if the matrix is invertible, @n
325          *                              else @c false
326          */
327         bool IsInvertible(void) const;
328
329         /**
330          * Negates the matrix members of the current instance of %DoubleMatrix4.
331          *
332          * @since 2.0
333          */
334         void Negate(void);
335
336         /**
337          * Sets the identity matrix to the current instance of %DoubleMatrix4.
338          *
339          * @since 2.0
340          */
341         void SetAsIdentity(void);
342
343         /**
344          * Sets the inverse matrix to the current instance of %DoubleMatrix4.
345          *
346          * @since 2.0
347          *
348          * @return              An error code
349          * @exception   E_SUCCESS                       The method is successful.
350          * @exception   E_INVALID_OPERATION     The current instance is not invertible.
351          */
352         result Invert(void);
353
354         /**
355          * Sets the transposed matrix to the current instance of %DoubleMatrix4.
356          *
357          * @since 2.0
358          */
359         void Transpose(void);
360
361         /**
362          * Sets the matrix members of the current instance of %DoubleMatrix4 to zero.
363          *
364          * @since 2.0
365          */
366         void SetAsNull(void);
367
368         int Compare(const double d1, const double d2) const;
369
370         /**
371          * The matrix of the current instance of %DoubleMatrix4.
372          *
373          * @since 2.0
374          *
375          * @remarks             The column-major order matrix.
376          */
377         double matrix[4][4];
378
379 private:
380         friend class _DoubleMatrix4Impl;
381         class _DoubleMatrix4Impl* __pImpl;
382
383 }; // DoubleMatrix4
384
385
386 TIZEN_MAPS_END_NAMESPACE
387
388 #endif /* HERE_DOUBLEMATRIX4_H */