cisst-saw
Loading...
Searching...
No Matches
vctRodriguezRotation3.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: 2005-01-13
7
8 (C) Copyright 2005-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 _vctRodriguezRotation3_h
21#define _vctRodriguezRotation3_h
22
27
30
31
45template <class _elementType>
46class vctRodriguezRotation3: public vctRodriguezRotation3Base<vctFixedSizeVector<_elementType, 3> >
47{
48public:
49 /* no need to document, inherit doxygen documentation from vctFixedSizeVectorBase */
51 enum {DIMENSION = 3};
57
58public:
59
64
65 inline vctRodriguezRotation3(const ThisType & other):
66 BaseType(other)
67 {}
68
69 inline vctRodriguezRotation3(const BaseType & other):
70 BaseType(other)
71 {}
72
73
87
88
92 template <stride_type __stride, class __dataPtrType>
93 explicit inline
99
104 CISST_THROW(std::runtime_error)
105 {
106 this->From(x, y, z);
107 }
108
110 template <class __containerType>
111 explicit inline
113 CISST_THROW(std::runtime_error)
114 {
115 this->From(quaternionRotation);
116 }
117
119 template <class __containerType>
120 explicit inline
122 CISST_THROW(std::runtime_error)
123 {
124 this->From(matrixRotation);
125 }
126
128 explicit inline
130 CISST_THROW(std::runtime_error)
131 {
132 this->From(axisAngleRotation);
133 }
134
136
137
138
161
166 template <stride_type __stride, class __dataPtrType>
168 bool normalizeInput)
169 {
170 if (normalizeInput) {
171 FromNormalized(axis);
172 } else {
173 FromRaw(axis);
174 }
175 }
176
182 bool normalizeInput)
183 {
184 if (normalizeInput) {
185 this->FromNormalized(x, y, z);
186 } else {
187 this->FromRaw(x, y, z);
188 }
189 }
190
192 template <class __containerType>
194 bool normalizeInput)
195 {
196 if (normalizeInput) {
197 this->FromNormalized(quaternionRotation);
198 } else {
199 this->FromRaw(quaternionRotation);
200 }
201 }
202
204 template <class __containerType>
206 bool normalizeInput)
207 {
208 if (normalizeInput) {
209 this->FromNormalized(matrixRotation);
210 } else {
211 this->FromRaw(matrixRotation);
212 }
213 }
214
217 bool normalizeInput)
218 {
219 if (normalizeInput) {
220 this->FromNormalized(axisAngleRotation);
221 } else {
222 this->FromRaw(axisAngleRotation);
223 }
224 }
225
227};
228
229
230#endif // _vctRodriguezRotation3_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
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeConstVectorBase.h:108
vctFixedSizeVector()
Definition vctFixedSizeVector.h:76
Define a rotation matrix for a space of dimension 3.
Definition vctMatrixRotation3Base.h:71
Define a rotation quaternion for a space of dimension 3.
Definition vctQuaternionRotation3Base.h:64
ThisType & FromNormalized(const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &vector)
Definition vctRodriguezRotation3Base.h:175
ThisType & FromRaw(const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &vector)
Definition vctRodriguezRotation3Base.h:221
static CISST_EXPORT const ThisType & Identity()
ThisType & From(const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &vector) CISST_THROW(std
Definition vctRodriguezRotation3Base.h:124
vctRodriguezRotation3Base()
Definition vctRodriguezRotation3Base.h:102
vctFixedSizeVector< value_type, 3 > ContainerType
Definition vctRodriguezRotation3.h:52
vctRodriguezRotation3(const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &axis) CISST_THROW(std
Definition vctRodriguezRotation3.h:94
cmnTypeTraits< value_type > TypeTraits
Definition vctRodriguezRotation3.h:56
vctRodriguezRotation3(const ThisType &other)
Definition vctRodriguezRotation3.h:65
vctRodriguezRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation) CISST_THROW(std
Definition vctRodriguezRotation3.h:129
vctRodriguezRotation3(const vctMatrixRotation3Base< __containerType > &matrixRotation, bool normalizeInput)
Definition vctRodriguezRotation3.h:205
vctRodriguezRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation, bool normalizeInput)
Definition vctRodriguezRotation3.h:216
vctRodriguezRotation3(value_type x, value_type y, value_type z, bool normalizeInput)
Definition vctRodriguezRotation3.h:181
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
vctRodriguezRotation3Base< ContainerType > BaseType
Definition vctRodriguezRotation3.h:53
vctRodriguezRotation3(const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &axis, bool normalizeInput)
Definition vctRodriguezRotation3.h:167
vctRodriguezRotation3(const vctQuaternionRotation3Base< __containerType > &quaternionRotation) CISST_THROW(std
Definition vctRodriguezRotation3.h:112
vctRodriguezRotation3()
Definition vctRodriguezRotation3.h:61
vctRodriguezRotation3(const vctMatrixRotation3Base< __containerType > &matrixRotation) CISST_THROW(std
Definition vctRodriguezRotation3.h:121
vctRodriguezRotation3(const BaseType &other)
Definition vctRodriguezRotation3.h:69
@ DIMENSION
Definition vctRodriguezRotation3.h:51
vctRodriguezRotation3(value_type x, value_type y, value_type z) CISST_THROW(std
Definition vctRodriguezRotation3.h:103
vctRodriguezRotation3< value_type > ThisType
Definition vctRodriguezRotation3.h:54
vctRodriguezRotation3(const vctQuaternionRotation3Base< __containerType > &quaternionRotation, bool normalizeInput)
Definition vctRodriguezRotation3.h:193
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
Macros to export the symbols of cisstVector (in a Dll).
Declaration of vctRodriguezRotation3Base.