cisst-saw
Loading...
Searching...
No Matches
vctFrame4x4.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: 2007-09-13
8
9 (C) Copyright 2007-2012 Johns Hopkins University (JHU), All Rights
10 Reserved.
11
12--- begin cisst license - do not edit ---
13
14This software is provided "as is" under an open source license, with
15no warranty. The complete license can be found in license.txt and
16http://www.cisst.org/cisst/license.txt.
17
18--- end cisst license ---
19*/
20
21#pragma once
22#ifndef _vctFrame4x4_h
23#define _vctFrame4x4_h
24
29
33
48template <class _elementType, bool _rowMajor>
50 public vctFrame4x4Base<vctFixedSizeMatrix<_elementType, 4, 4, _rowMajor> >
51{
52public:
53 /* define most types from vctContainerTraits */
55
56 enum {ROWS = 4, COLS = 4};
57 enum {DIMENSION = 3};
58
62
65
66
67public:
68
69
72 BaseType()
73 {
74 this->Assign(this->Identity());
75 }
76
78 vctFrame4x4(const ThisType & other):
79 BaseType()
80 {
81 this->Assign(other);
82 }
83
84 inline ThisType & operator = (const ThisType & other) {
85 return reinterpret_cast<ThisType &>(this->Assign(other));
86 }
87
89 template <bool __rowMajor>
91 BaseType()
92 {
93 this->Assign(other);
94 }
95
96 template <bool __rowMajor>
98 return reinterpret_cast<ThisType &>(this->Assign(other));
99 }
100
101
104 template <class __containerType>
106 BaseType()
107 {
108 this->Assign(other);
109 }
110
111 template <class __containerType>
113 return reinterpret_cast<ThisType &>(this->Assign(other));
114 }
115
116
119 BaseType()
120 {
121 this->Assign(other);
122 }
123
124 inline ThisType & operator = (const ContainerType & other) {
125 return reinterpret_cast<ThisType &>(this->Assign(other));
126 }
127
128
130 template <class _rotationType, class _translationType>
131 vctFrame4x4(const _rotationType & rotation,
132 const _translationType & translation):
134 {
135 this->From(rotation, translation);
136 }
137
142 template <class __containerType>
143 explicit inline
145 BaseType()
146 {
147 this->From(other);
148 }
149
153 template <class __containerType>
154 inline
156 bool normalizeInput):
157 BaseType()
158 {
159 if (normalizeInput) {
160 this->FromNormalized(other);
161 } else {
162 this->FromRaw(other);
163 }
164 }
165};
166
167
168// declared in vctFrame4x4ConstBase.h
169template <class _containerType>
172 FrameValueType result;
173 result.InverseOf(*this);
174 return result;
175}
176
177
178// operators
179template <class _containerType,
180 vct::stride_type _stride, class _dataPtrType>
188
189template <class _containerType1, class _containerType2>
194 frame1.ApplyTo(frame2, result);
195 return result;
196}
197
198template <class _containerType,
199 vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _dataPtrType>
208
209
210#endif // _vctFrame4x4_h
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition cmnTypeTraits.h:155
A template for a fixed size matrix with fixed spacing in memory.
Definition vctFixedSizeConstMatrixBase.h:104
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeConstVectorBase.h:108
ThisType & Assign(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
Definition vctFixedSizeMatrixBase.h:475
Implementation of a fixed-size matrix using template metaprogramming.
Definition vctFixedSizeMatrix.h:54
vctFixedSizeMatrix()
Definition vctFixedSizeMatrix.h:78
Implementation of a fixed-size vector using template metaprogramming.
Definition vctFixedSizeVector.h:54
ThisType & FromNormalized(const __rotationType &rotation, const __translationType &translation)
Definition vctFrame4x4Base.h:131
ThisType & FromRaw(const __rotationType &rotation, const __translationType &translation)
Definition vctFrame4x4Base.h:142
ThisType & InverseOf(const vctFrame4x4ConstBase< __containerType > &otherFrame)
Definition vctFrame4x4Base.h:212
ThisType & From(const __rotationType &rotation, const __translationType &translation) CISST_THROW(std
Definition vctFrame4x4Base.h:119
Template base class for a 4x4 frame.
Definition vctFrame4x4ConstBase.h:51
vctFrame4x4< value_type, COLSTRIDE<=ROWSTRIDE > FrameValueType
Definition vctFrame4x4ConstBase.h:74
void ApplyTo(const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &input, vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &output) const
Definition vctFrame4x4ConstBase.h:161
vctFixedSizeMatrix< _elementType, 4, 4, _rowMajor > BaseType
Definition vctFrame4x4ConstBase.h:55
static CISST_EXPORT const FrameValueType & Identity(void)
FrameValueType Inverse(void) const
Definition vctFrame4x4.h:171
Template base class for a 4x4 frame.
Definition vctFrame4x4.h:51
ThisType & operator=(const ThisType &other)
Definition vctFrame4x4.h:84
@ DIMENSION
Definition vctFrame4x4.h:57
vctFixedSizeMatrix< value_type, ROWS, COLS, _rowMajor > ContainerType
Definition vctFrame4x4.h:59
vctFrame4x4(const vctFrameBase< __containerType > &other)
Definition vctFrame4x4.h:144
vctFrame4x4(const ContainerType &other)
Definition vctFrame4x4.h:118
vctFrame4x4(const vctFrame4x4ConstBase< __containerType > &other)
Definition vctFrame4x4.h:105
vctFrame4x4(void)
Definition vctFrame4x4.h:71
@ ROWS
Definition vctFrame4x4.h:56
@ COLS
Definition vctFrame4x4.h:56
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
vctFrame4x4(const _rotationType &rotation, const _translationType &translation)
Definition vctFrame4x4.h:131
vctFrame4x4(const ThisType &other)
Definition vctFrame4x4.h:78
vctFrame4x4< value_type, _rowMajor > ThisType
Definition vctFrame4x4.h:61
vctFrame4x4(const vctFrame4x4< value_type, __rowMajor > &other)
Definition vctFrame4x4.h:90
vctFrame4x4(const vctFrameBase< __containerType > &other, bool normalizeInput)
Definition vctFrame4x4.h:155
vctFrame4x4Base< ContainerType > BaseType
Definition vctFrame4x4.h:60
cmnTypeTraits< value_type > TypeTraits
Definition vctFrame4x4.h:64
Template base class for a frame.
Definition vctFrameBase.h:49
size_t size_type
Definition vctContainerTraits.h:35
ptrdiff_t stride_type
Definition vctContainerTraits.h:37
Macros to export the symbols of cisstVector (in a Dll).
Declaration of vctFixedSizeMatrix.
vctFixedSizeVector< typename _containerType::value_type, 3 > operator*(const vctFrame4x4ConstBase< _containerType > &frame, const vctFixedSizeConstVectorBase< 3, _stride, typename _containerType::value_type, _dataPtrType > &vector)
Definition vctFrame4x4.h:182
Declaration of vctFrame4x4Base.