cisst-saw
Loading...
Searching...
No Matches
vctMatrixRotation3.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4/*
5 Author(s): Anton Deguet
6 Created on: 2004-01-12
7
8 (C) Copyright 2004-2018 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19#pragma once
20#ifndef _vctMatrixRotation3_h
21#define _vctMatrixRotation3_h
22
27
31
32// Always include last
34
49template <class _elementType, bool _rowMajor>
50class vctMatrixRotation3: public vctMatrixRotation3Base<vctFixedSizeMatrix<_elementType, 3, 3, _rowMajor> >
51{
52 public:
53 /* no need to document, inherit doxygen documentation from base class */
55 enum {ROWS = 3, COLS = 3};
56 enum {DIMENSION = 3};
63
65 inline vctMatrixRotation3(void):
66 BaseType()
67 {
68 this->Assign(this->Identity());
69 }
70
71 inline vctMatrixRotation3(const ThisType & other):
72 BaseType()
73 {
74 this->Assign(other);
75 }
76
77 inline vctMatrixRotation3(const BaseType & other):
78 BaseType()
79 {
80 this->Assign(other);
81 }
82
83 inline vctMatrixRotation3(const ConstBaseType & other):
84 BaseType()
85 {
86 this->Assign(other);
87 }
88
90 BaseType()
91 {
92 this->Assign(other);
93 }
94
101 inline ThisType & operator = (const ContainerType & other) {
102 return reinterpret_cast<ThisType &>(this->Assign(other));
103 }
104
105 inline ThisType & operator = (const ThisType & other) {
106 return reinterpret_cast<ThisType &>(this->Assign(other));
108
109 inline ThisType & operator = (const BaseType & other) {
110 return reinterpret_cast<ThisType &>(this->Assign(other));
111 }
112
113
127
128
140 inline vctMatrixRotation3(const value_type & element00, const value_type & element01, const value_type & element02,
141 const value_type & element10, const value_type & element11, const value_type & element12,
142 const value_type & element20, const value_type & element21, const value_type & element22)
143 CISST_THROW(std::runtime_error)
144 {
145 this->From(element00, element01, element02,
146 element10, element11, element12,
147 element20, element21, element22);
148 }
149
156 template <stride_type __stride1, class __dataPtrType1,
157 stride_type __stride2, class __dataPtrType2,
158 stride_type __stride3, class __dataPtrType3>
167
174 template <class __vectorOwnerType1,
175 class __vectorOwnerType2,
176 class __vectorOwnerType3>
180 bool vectorsAreColumns = true)
181 CISST_THROW(std::runtime_error)
182 {
183 this->From(v1, v2, v3, vectorsAreColumns);
184 }
185
187 explicit inline vctMatrixRotation3(const vctAxisAngleRotation3<value_type> & axisAngleRotation)
188 CISST_THROW(std::runtime_error)
189 {
190 this->From(axisAngleRotation);
191 }
192
200 template <class __containerType>
201 explicit inline vctMatrixRotation3(const vctQuaternionRotation3Base<__containerType> & quaternionRotation)
202 CISST_THROW(std::runtime_error)
203 {
204 this->From(quaternionRotation);
205 }
206
208 template <class __containerType>
209 explicit inline vctMatrixRotation3(const vctRodriguezRotation3Base<__containerType> & rodriguezRotation)
210 CISST_THROW(std::runtime_error)
211 {
212 this->From(rodriguezRotation);
213 }
214
216 template <vctEulerRotation3Order::OrderType __order>
217 explicit inline vctMatrixRotation3(const vctEulerRotation3<__order> & eulerRotation)
218 CISST_THROW(std::runtime_error)
219 {
220 this->From(eulerRotation);
221 }
222
244
245
257 inline vctMatrixRotation3(const value_type & element00, const value_type & element01, const value_type & element02,
258 const value_type & element10, const value_type & element11, const value_type & element12,
259 const value_type & element20, const value_type & element21, const value_type & element22,
260 bool normalizeInput)
261 {
262 if (normalizeInput) {
263 this->FromNormalized(element00, element01, element02,
264 element10, element11, element12,
265 element20, element21, element22);
266 } else {
267 this->FromRaw(element00, element01, element02,
268 element10, element11, element12,
269 element20, element21, element22);
270 }
271 }
272
279 template <stride_type __stride1, class __dataPtrType1,
280 stride_type __stride2, class __dataPtrType2,
281 stride_type __stride3, class __dataPtrType3>
285 bool vectorsAreColumns, bool normalizeInput)
286 {
287 if (normalizeInput) {
288 this->FromNormalized(v1, v2, v3, vectorsAreColumns);
289 } else {
290 this->FromRaw(v1, v2, v3, vectorsAreColumns);
291 }
292 }
293
300 template <class __vectorOwnerType1,
301 class __vectorOwnerType2,
302 class __vectorOwnerType3>
306 bool vectorsAreColumns, bool normalizeInput)
307 {
308 if (normalizeInput) {
309 this->FromNormalized(v1, v2, v3, vectorsAreColumns);
310 } else {
311 this->FromRaw(v1, v2, v3, vectorsAreColumns);
312 }
313 }
314
317 bool normalizeInput)
318 {
319 if (normalizeInput) {
320 this->FromNormalized(axisAngleRotation);
321 } else {
322 this->FromRaw(axisAngleRotation);
323 }
324 }
325
334 template <class __containerType>
336 bool normalizeInput)
337 {
338 if (normalizeInput) {
339 this->FromNormalized(quaternionRotation);
340 } else {
341 this->FromRaw(quaternionRotation);
342 }
343 }
344
346 template <class __containerType>
348 bool normalizeInput)
349 {
350 if (normalizeInput) {
351 this->FromNormalized(rodriguezRotation);
352 } else {
353 this->FromRaw(rodriguezRotation);
354 }
355 }
356
358 template <vctEulerRotation3Order::OrderType __order>
359 inline vctMatrixRotation3(const vctEulerRotation3<__order> & eulerRotation,
360 bool normalizeInput)
361 {
362 if (normalizeInput) {
363 this->FromNormalized(eulerRotation);
364 } else {
365 this->FromRaw(eulerRotation);
366 }
367 }
368
370
381 template <stride_type __rowStride, stride_type __colStride, class __dataPtrType>
382 explicit inline
387
388};
389
390
391// declared in vctMatrixRotation3ConstBase.h
392template <class _containerType>
395 RotationValueType result(*this);
396 result.NormalizedSelf();
397 return result;
398}
399
400// declared in vctMatrixRotation3ConstBase.h
401template <class _containerType>
404 RotationValueType result(*this);
405 result.InverseSelf();
406 return result;
407}
408
409
410#endif // _vctMatrixRotation3_h
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition cmnTypeTraits.h:155
Define a rotation based on an axis and an angle for a space of dimension 3.
Definition vctAxisAngleRotation3.h:93
Definition vctForwardDeclarations.h:119
Dynamic matrix referencing existing memory.
Definition vctDynamicMatrixRef.h:75
Definition vctEulerRotation3.h:154
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeConstVectorBase.h:108
A template for a fixed size matrix with fixed spacings in memory.
Definition vctFixedSizeMatrixBase.h:60
ThisType & Assign(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
Definition vctFixedSizeMatrixBase.h:475
vctFixedSizeMatrix()
Definition vctFixedSizeMatrix.h:78
ThisType & FromNormalized(const vctMatrixRotation3Base< __containerType > &other) CISST_THROW(std
Definition vctMatrixRotation3Base.h:232
ThisType & From(const vctMatrixRotation3Base< __containerType > &other) CISST_THROW(std
Definition vctMatrixRotation3Base.h:106
ThisType & FromRaw(const vctMatrixRotation3Base< __containerType > &other) CISST_THROW(std
Definition vctMatrixRotation3Base.h:352
ThisType & NormalizedSelf(void)
Definition vctMatrixRotation3Base.h:491
ThisType & InverseSelf(void)
Definition vctMatrixRotation3Base.h:513
Define a rotation matrix for a space of dimension 3.
Definition vctMatrixRotation3ConstBase.h:56
RotationValueType Normalized(void) const
Definition vctMatrixRotation3.h:394
RotationValueType Inverse(void) const
Definition vctMatrixRotation3.h:403
static CISST_EXPORT const RotationValueType & Identity()
vctMatrixRotation3< value_type > RotationValueType
Definition vctMatrixRotation3ConstBase.h:68
vctMatrixRotation3(const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) CISST_THROW(std
Definition vctMatrixRotation3.h:209
cmnTypeTraits< value_type > TypeTraits
Definition vctMatrixRotation3.h:62
vctMatrixRotation3(const vctEulerRotation3< __order > &eulerRotation) CISST_THROW(std
Definition vctMatrixRotation3.h:217
vctFixedSizeMatrix< value_type, ROWS, COLS, _rowMajor > ContainerType
Definition vctMatrixRotation3.h:57
vctMatrixRotation3(const BaseType &other)
Definition vctMatrixRotation3.h:77
vctMatrixRotation3(const vctQuaternionRotation3Base< __containerType > &quaternionRotation) CISST_THROW(std
Definition vctMatrixRotation3.h:201
vctMatrixRotation3(const vctRodriguezRotation3Base< __containerType > &rodriguezRotation, bool normalizeInput)
Definition vctMatrixRotation3.h:347
vctMatrixRotation3(const value_type &element00, const value_type &element01, const value_type &element02, const value_type &element10, const value_type &element11, const value_type &element12, const value_type &element20, const value_type &element21, const value_type &element22, bool normalizeInput)
Definition vctMatrixRotation3.h:257
vctMatrixRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation) CISST_THROW(std
Definition vctMatrixRotation3.h:187
vctMatrixRotation3Base< ContainerType > BaseType
Definition vctMatrixRotation3.h:58
@ DIMENSION
Definition vctMatrixRotation3.h:56
vctMatrixRotation3(const vctQuaternionRotation3Base< __containerType > &quaternionRotation, bool normalizeInput)
Definition vctMatrixRotation3.h:335
vctMatrixRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation, bool normalizeInput)
Definition vctMatrixRotation3.h:316
ThisType & operator=(const ContainerType &other)
Definition vctMatrixRotation3.h:101
vctMatrixRotation3(const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &v1, const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &v2, const vctFixedSizeConstVectorBase< DIMENSION, __stride3, value_type, __dataPtrType3 > &v3, bool vectorsAreColumns, bool normalizeInput)
Definition vctMatrixRotation3.h:282
vctMatrixRotation3(const vctDynamicMatrixRef< value_type > &other)
Definition vctMatrixRotation3.h:89
vctMatrixRotation3(void)
Definition vctMatrixRotation3.h:65
vctMatrixRotation3(const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, const vctDynamicConstVectorBase< __vectorOwnerType3, value_type > &v3, bool vectorsAreColumns=true) CISST_THROW(std
Definition vctMatrixRotation3.h:177
vctMatrixRotation3(const value_type &element00, const value_type &element01, const value_type &element02, const value_type &element10, const value_type &element11, const value_type &element12, const value_type &element20, const value_type &element21, const value_type &element22) CISST_THROW(std
Definition vctMatrixRotation3.h:140
vctMatrixRotation3(const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, const vctDynamicConstVectorBase< __vectorOwnerType3, value_type > &v3, bool vectorsAreColumns, bool normalizeInput)
Definition vctMatrixRotation3.h:303
vctMatrixRotation3(const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &v1, const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &v2, const vctFixedSizeConstVectorBase< DIMENSION, __stride3, value_type, __dataPtrType3 > &v3, bool vectorsAreColumns=true) CISST_THROW(std
Definition vctMatrixRotation3.h:159
@ ROWS
Definition vctMatrixRotation3.h:55
@ COLS
Definition vctMatrixRotation3.h:55
vctMatrixRotation3ConstBase< ContainerType > ConstBaseType
Definition vctMatrixRotation3.h:59
vctMatrixRotation3< value_type, _rowMajor > ThisType
Definition vctMatrixRotation3.h:60
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
vctMatrixRotation3(const vctFixedSizeMatrixBase< ROWS, COLS, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
Definition vctMatrixRotation3.h:383
vctMatrixRotation3(const ThisType &other)
Definition vctMatrixRotation3.h:71
vctMatrixRotation3(const ConstBaseType &other)
Definition vctMatrixRotation3.h:83
vctMatrixRotation3(const vctEulerRotation3< __order > &eulerRotation, bool normalizeInput)
Definition vctMatrixRotation3.h:359
Define a rotation quaternion for a space of dimension 3.
Definition vctQuaternionRotation3Base.h:64
Define a rotation based on the rodriguez representation for a space of dimension 3.
Definition vctRodriguezRotation3Base.h:68
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
STL namespace.
Declaration of vctDynamicMatrixRef.
Macros to export the symbols of cisstVector (in a Dll).
Declaration of vctFixedSizeMatrix.
Declaration of vctMatrixRotation3Base.