cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
6  Author(s): Anton Deguet
7  Created on: 2005-01-13
8 
9  (C) Copyright 2005-2012 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 */
20 
21 #pragma once
22 #ifndef _vctRodriguezRotation3_h
23 #define _vctRodriguezRotation3_h
24 
31 #include <cisstVector/vctExport.h>
32 
33 
47 template <class _elementType>
48 class vctRodriguezRotation3: public vctRodriguezRotation3Base<vctFixedSizeVector<_elementType, 3> >
49 {
50 public:
51  /* no need to document, inherit doxygen documentation from vctFixedSizeVectorBase */
52  VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType);
53  enum {DIMENSION = 3};
59 
60 public:
61 
65  {}
66 
67  inline vctRodriguezRotation3(const ThisType & other):
68  BaseType(other)
69  {}
70 
71  inline vctRodriguezRotation3(const BaseType & other):
72  BaseType(other)
73  {}
74 
75 
89 
90 
94  template <stride_type __stride, class __dataPtrType>
95  explicit inline
97  throw(std::runtime_error)
98  {
99  this->From(axis);
100  }
101 
105  inline vctRodriguezRotation3(value_type x, value_type y, value_type z)
106  throw(std::runtime_error)
107  {
108  this->From(x, y, z);
109  }
110 
112  template <class __containerType>
113  explicit inline
115  throw(std::runtime_error)
116  {
117  this->From(quaternionRotation);
118  }
119 
121  template <class __containerType>
122  explicit inline
124  throw(std::runtime_error)
125  {
126  this->From(matrixRotation);
127  }
128 
130  explicit inline
132  throw(std::runtime_error)
133  {
134  this->From(axisAngleRotation);
135  }
136 
138 
139 
140 
163 
168  template <stride_type __stride, class __dataPtrType>
170  bool normalizeInput)
171  {
172  if (normalizeInput) {
173  FromNormalized(axis);
174  } else {
175  FromRaw(axis);
176  }
177  }
178 
183  inline vctRodriguezRotation3(value_type x, value_type y, value_type z,
184  bool normalizeInput)
185  {
186  if (normalizeInput) {
187  this->FromNormalized(x, y, z);
188  } else {
189  this->FromRaw(x, y, z);
190  }
191  }
192 
194  template <class __containerType>
196  bool normalizeInput)
197  {
198  if (normalizeInput) {
199  this->FromNormalized(quaternionRotation);
200  } else {
201  this->FromRaw(quaternionRotation);
202  }
203  }
204 
206  template <class __containerType>
208  bool normalizeInput)
209  {
210  if (normalizeInput) {
211  this->FromNormalized(matrixRotation);
212  } else {
213  this->FromRaw(matrixRotation);
214  }
215  }
216 
219  bool normalizeInput)
220  {
221  if (normalizeInput) {
222  this->FromNormalized(axisAngleRotation);
223  } else {
224  this->FromRaw(axisAngleRotation);
225  }
226  }
227 
229 };
230 
231 
232 #endif // _vctRodriguezRotation3_h
vctRodriguezRotation3(const BaseType &other)
Definition: vctRodriguezRotation3.h:71
vctRodriguezRotation3< value_type > ThisType
Definition: vctRodriguezRotation3.h:56
vctRodriguezRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation, bool normalizeInput)
Definition: vctRodriguezRotation3.h:218
cmnTypeTraits< value_type > TypeTraits
Definition: vctRodriguezRotation3.h:58
ThisType & FromRaw(const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &vector)
Definition: vctRodriguezRotation3Base.h:223
vctRodriguezRotation3(const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &axis, bool normalizeInput)
Definition: vctRodriguezRotation3.h:169
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
vctRodriguezRotation3(const vctMatrixRotation3Base< __containerType > &matrixRotation)
Definition: vctRodriguezRotation3.h:123
vctFixedSizeVector< value_type, 3 > ContainerType
Definition: vctRodriguezRotation3.h:54
vctRodriguezRotation3(const vctQuaternionRotation3Base< __containerType > &quaternionRotation)
Definition: vctRodriguezRotation3.h:114
Implementation of a fixed-size vector using template metaprogramming.
Definition: vctFixedSizeVector.h:52
Define a rotation based on an axis and an angle for a space of dimension 3.
Definition: vctAxisAngleRotation3.h:94
ThisType & From(const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &vector)
Definition: vctRodriguezRotation3Base.h:126
vctRodriguezRotation3(const vctQuaternionRotation3Base< __containerType > &quaternionRotation, bool normalizeInput)
Definition: vctRodriguezRotation3.h:195
vctRodriguezRotation3(value_type x, value_type y, value_type z, bool normalizeInput)
Definition: vctRodriguezRotation3.h:183
vctRodriguezRotation3(value_type x, value_type y, value_type z)
Definition: vctRodriguezRotation3.h:105
vctRodriguezRotation3(const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &axis)
Definition: vctRodriguezRotation3.h:96
Define a rotation based on the rodriguez representation for a space of dimension 3. This representation is based on a vector. The direction of the vector determines the axis of rotation and its norm defines the amplitude of the rotation.
Definition: vctForwardDeclarations.h:216
Define a rotation matrix for a space of dimension 3.
Definition: vctForwardDeclarations.h:199
Declaration of vctRodriguezRotation3Base.
vctRodriguezRotation3()
Definition: vctRodriguezRotation3.h:63
vctRodriguezRotation3Base< ContainerType > BaseType
Definition: vctRodriguezRotation3.h:55
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeConstVectorBase.h:107
Define a rotation quaternion for a space of dimension 3.
Definition: vctForwardDeclarations.h:208
vctRodriguezRotation3(const ThisType &other)
Definition: vctRodriguezRotation3.h:67
Macros to export the symbols of cisstVector (in a Dll).
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition: cmnTypeTraits.h:155
ThisType & FromNormalized(const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &vector)
Definition: vctRodriguezRotation3Base.h:177
vctRodriguezRotation3(const vctMatrixRotation3Base< __containerType > &matrixRotation, bool normalizeInput)
Definition: vctRodriguezRotation3.h:207
vctRodriguezRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation)
Definition: vctRodriguezRotation3.h:131
Define a rotation based on the rodriguez representation for a space of dimension 3.
Definition: vctForwardDeclarations.h:214
Definition: vctRodriguezRotation3.h:53