cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vctQuaternionRotation3.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: 2004-01-15
8 
9  (C) Copyright 2004-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 _vctQuaternionRotation3_h
23 #define _vctQuaternionRotation3_h
24 
32 
33 #include <cisstVector/vctExport.h>
34 
35 
50 template <class _elementType>
51 class vctQuaternionRotation3: public vctQuaternionRotation3Base<vctFixedSizeVector<_elementType, 4> >
52 {
53  public:
54  /* no need to document, inherit doxygen documentation from vctFixedSizeVectorBase */
55  VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType);
56  enum {SIZE = 4};
57  enum {DIMENSION = 3};
63 
64 
65  /* documented in base class */
67  BaseType()
68  {}
69 
70  inline vctQuaternionRotation3(const ThisType & quaternionRotation):
71  BaseType(quaternionRotation)
72  {}
73 
74  template <class __containerType>
75  inline
77  throw(std::runtime_error):
78  BaseType(other)
79  {}
80 
81  inline
82  vctQuaternionRotation3(const value_type & x, const value_type & y, const value_type & z,
83  const value_type & r)
84  throw(std::runtime_error):
85  BaseType(x, y, z, r)
86  {}
87 
88  template <class __containerType>
89  explicit inline
91  throw(std::runtime_error):
92  BaseType(matrixRotation)
93  {}
94 
95  explicit inline
97  throw(std::runtime_error):
98  BaseType(axisAngleRotation)
99  {}
100 
101  template <class __containerType>
102  explicit inline
104  throw(std::runtime_error):
105  BaseType(rodriguezRotation)
106  {}
107 
108  inline
109  vctQuaternionRotation3(const ThisType & quaternionRotation,
110  bool normalizeInput):
111  BaseType(quaternionRotation, normalizeInput)
112  {}
113 
114  template <class _containerType>
115  inline
116  vctQuaternionRotation3(const _containerType & vector4,
117  bool normalizeInput):
118  BaseType(vector4, normalizeInput)
119  {}
120 
121  inline
122  vctQuaternionRotation3(const value_type & x, const value_type & y, const value_type & z,
123  const value_type & r,
124  bool normalizeInput):
125  BaseType(x, y, z, r, normalizeInput)
126  {}
127 
128  template <class __containerType>
129  inline explicit
131  bool normalizeInput):
132  BaseType(matrixRotation, normalizeInput)
133  {}
134 
135  inline
137  bool normalizeInput):
138  BaseType(axisAngleRotation, normalizeInput)
139  {}
140 
141  template <class __containerType>
142  inline
144  bool normalizeInput):
145  BaseType(rodriguezRotation, normalizeInput)
146  {}
147 
148 
155  template <class __containerType>
157  return reinterpret_cast<ThisType &>(this->Assign(other));
158  }
159 
160 };
161 
162 
163 #endif // _vctQuaternionRotation3_h
vctQuaternionRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation, bool normalizeInput)
Definition: vctQuaternionRotation3.h:136
vctQuaternionRotation3(const value_type &x, const value_type &y, const value_type &z, const value_type &r)
Definition: vctQuaternionRotation3.h:82
vctQuaternionRotation3(const vctMatrixRotation3Base< __containerType > &matrixRotation, bool normalizeInput)
Definition: vctQuaternionRotation3.h:130
vctQuaternionRotation3(const vctMatrixRotation3Base< __containerType > &matrixRotation)
Definition: vctQuaternionRotation3.h:90
vctQuaternionRotation3(const vctAxisAngleRotation3< value_type > &axisAngleRotation)
Definition: vctQuaternionRotation3.h:96
vctQuaternionRotation3< value_type > ThisType
Definition: vctQuaternionRotation3.h:60
vctQuaternionRotation3(const vctQuaternionRotation3Base< __containerType > &other)
Definition: vctQuaternionRotation3.h:76
ThisType & Assign(const vctFixedSizeConstVectorBase< _size, __stride, __elementType, __dataPtrType > &other)
Definition: vctFixedSizeVectorBase.h:274
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
Define a rotation matrix for a space of dimension 3.
Definition: vctForwardDeclarations.h:199
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
Define a rotation quaternion for a space of dimension 3.
Definition: vctQuaternionRotation3.h:51
Declaration of vctFixedSizeVector.
ThisType & operator=(const vctQuaternionRotation3Base< __containerType > &other)
Definition: vctQuaternionRotation3.h:156
Definition: vctQuaternionRotation3.h:56
vctQuaternionRotation3()
Definition: vctQuaternionRotation3.h:66
cmnTypeTraits< value_type > TypeTraits
Definition: vctQuaternionRotation3.h:62
vctQuaternionRotation3(const vctRodriguezRotation3Base< __containerType > &rodriguezRotation, bool normalizeInput)
Definition: vctQuaternionRotation3.h:143
Definition: vctQuaternionRotation3.h:57
vctFixedSizeVector< value_type, SIZE > ContainerType
Definition: vctQuaternionRotation3.h:58
vctQuaternionRotation3(const ThisType &quaternionRotation)
Definition: vctQuaternionRotation3.h:70
vctQuaternionRotation3(const value_type &x, const value_type &y, const value_type &z, const value_type &r, bool normalizeInput)
Definition: vctQuaternionRotation3.h:122
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeConstVectorBase.h:107
Declaration of vctQuaternionRotation3Base.
Define a rotation quaternion for a space of dimension 3.
Definition: vctForwardDeclarations.h:208
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
vctQuaternionRotation3(const _containerType &vector4, bool normalizeInput)
Definition: vctQuaternionRotation3.h:116
vctQuaternionRotation3(const vctRodriguezRotation3Base< __containerType > &rodriguezRotation)
Definition: vctQuaternionRotation3.h:103
vctQuaternionRotation3(const ThisType &quaternionRotation, bool normalizeInput)
Definition: vctQuaternionRotation3.h:109
Define a rotation based on the rodriguez representation for a space of dimension 3.
Definition: vctForwardDeclarations.h:214
vctQuaternionRotation3Base< ContainerType > BaseType
Definition: vctQuaternionRotation3.h:59