22 #ifndef _vctFrame4x4ConstBase_h
23 #define _vctFrame4x4ConstBase_h
49 template <
class _containerType>
89 RotationRefType RotationRef;
90 TranslationRefType TranslationRef;
91 PerspectiveRefType PerspectiveRef;
99 RotationRef.SetRef(this->Pointer(0, 0));
101 TranslationRef.SetRef(this->Pointer(0,
DIMENSION));
103 PerspectiveRef.SetRef(this->Pointer(
DIMENSION, 0));
121 return this->TranslationRef;
125 return this->RotationRef;
129 return this->PerspectiveRef;
133 FrameValueType
Inverse(
void)
const;
143 inline bool IsNormalized(value_type tolerance = TypeTraits::Tolerance())
const {
145 static_cast<value_type>(0.0),
146 static_cast<value_type>(0.0),
147 static_cast<value_type>(1.0)),
149 && this->RotationRef.IsNormalized(tolerance));
159 template <str
ide_type __str
ide1,
class __dataPtrType1, str
ide_type __str
ide2,
class __dataPtrType2>
163 this->RotationRef.ApplyTo(input, output);
164 output.
X() += this->TranslationRef.X();
165 output.
Y() += this->TranslationRef.Y();
166 output.
Z() += this->TranslationRef.Z();
178 template <str
ide_type __str
ide,
class __dataPtrType>
196 template <
class __containerType1,
class __containerType2>
199 typename TranslationRefType::CopyType temp;
214 template <
class __containerType>
216 FrameValueType result;
226 template <
class __vectorOwnerType1,
class __vectorOwnerType2>
231 this->RotationRef.ApplyTo(input, output);
232 output[0] += this->TranslationRef[0];
233 output[1] += this->TranslationRef[1];
234 output[2] += this->TranslationRef[2];
246 typedef typename inputType::ConstColumnRefType inputColumnType;
248 typedef typename outputType::ColumnRefType outputColumnType;
250 for (columnIndex = 0; columnIndex < __cols; ++columnIndex) {
251 const inputColumnType inputColumn(input.Column(columnIndex));
252 outputColumnType outputColumn(output.
Column(columnIndex));
253 this->
ApplyTo(inputColumn, outputColumn);
269 for (index = 0; index < inputSize; ++index) {
270 this->
ApplyTo(input[index], output[index]);
275 template <str
ide_type __str
ide1,
class __dataPtrType1, str
ide_type __str
ide2,
class __dataPtrType2>
291 template <
class __vectorOwnerType1,
class __vectorOwnerType2>
296 input[1] - this->TranslationRef[1],
297 input[2] - this->TranslationRef[2]);
298 typename TranslationRefType::CopyType result;
299 this->RotationRef.ApplyInverseTo(temp, result);
300 output[0] = result[0];
301 output[1] = result[1];
302 output[2] = result[2];
314 template <str
ide_type __str
ide,
class __dataPtrType>
323 template <
class __containerType1,
class __containerType2>
326 FrameValueType inverse;
327 inverse.InverseOf(*
this);
328 inverse.ApplyTo(input, output);
331 template <
class __containerType>
333 FrameValueType result;
348 return (this->RotationRef.Equal(other.Rotation())
349 && this->TranslationRef.Equal(other.Translation()));
353 return this->
Equal(other);
370 value_type tolerance = TypeTraits::Tolerance())
const {
371 return (this->RotationRef.AlmostEqual(other.Rotation(), tolerance)
372 && this->TranslationRef.AlmostEqual(other.Translation(), tolerance));
383 value_type tolerance = TypeTraits::Tolerance())
const {
390 #endif // _vctFrame4x4Base_h
size_t index_type
Definition: vctContainerTraits.h:36
Template base class for a 4x4 frame.
Definition: vctForwardDeclarations.h:234
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
value_type & Y(void)
Definition: vctFixedSizeVectorBase.h:572
A template for a fixed size matrix with fixed spacing in memory.
Definition: vctFixedSizeConstMatrixBase.h:103
void ApplyInverseTo(const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &input, vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &output) const
Definition: vctFrame4x4ConstBase.h:277
bool AlmostEquivalent(const ThisType &other, value_type tolerance=TypeTraits::Tolerance()) const
Definition: vctFrame4x4ConstBase.h:382
BaseType::ConstRowRefType ConstRowRefType
Definition: vctFrame4x4ConstBase.h:68
vctFixedSizeVector< value_type, DIMENSION > ApplyTo(const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
Definition: vctFrame4x4ConstBase.h:180
An implementation of the ``abstract'' vctFixedSizeVectorBase.
Definition: vctFixedSizeVectorRef.h:46
Declaration of vctMatrixRotation3Ref.
Definition: vctFrame4x4ConstBase.h:53
BaseType::ConstRefTransposeType ConstRefTransposeType
Definition: vctFrame4x4ConstBase.h:73
Define a rotation matrix for a space of dimension 3.
Definition: vctForwardDeclarations.h:202
BaseType::RowRefType RowRefType
Definition: vctFrame4x4ConstBase.h:66
An implementation of the ``abstract'' vctFixedSizeConstVectorBase.
Definition: vctFixedSizeConstVectorRef.h:50
size_t size_type
Definition: vctContainerTraits.h:35
bool operator==(const ThisType &other) const
Definition: vctFrame4x4ConstBase.h:352
_containerType BaseType
Definition: vctFrame4x4ConstBase.h:55
_containerType ContainerType
Definition: vctFrame4x4ConstBase.h:56
FrameValueType ApplyInverseTo(const vctFrame4x4ConstBase< __containerType > &input) const
Definition: vctFrame4x4ConstBase.h:332
Template base class for a 4x4 frame.
Definition: vctForwardDeclarations.h:236
Template base class for a 4x4 frame.
Definition: vctForwardDeclarations.h:235
void ApplyTo(const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &input, vctDynamicVectorBase< __vectorOwnerType2, value_type > &output) const
Definition: vctFrame4x4ConstBase.h:228
BaseType::ConstDiagonalRefType ConstDiagonalRefType
Definition: vctFrame4x4ConstBase.h:71
Implementation of a fixed-size vector using template metaprogramming.
Definition: vctFixedSizeVector.h:52
bool AlmostEqual(const ThisType &other, value_type tolerance=TypeTraits::Tolerance()) const
Definition: vctFrame4x4ConstBase.h:369
VCT_CONTAINER_TRAITS_TYPEDEFS(typename ContainerType::value_type)
BaseType::RefTransposeType RefTransposeType
Definition: vctFrame4x4ConstBase.h:72
vctFrame4x4ConstBase< ContainerType > ThisType
Definition: vctFrame4x4ConstBase.h:57
void ApplyTo(const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &input, vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &output) const
Definition: vctFrame4x4ConstBase.h:242
Definition: vctFrame4x4ConstBase.h:54
value_type & X(void)
Definition: vctFixedSizeVectorBase.h:559
A template for a fixed size matrix with fixed spacings in memory.
Definition: vctFixedSizeMatrixBase.h:58
BaseType::RowValueType RowValueType
Definition: vctFrame4x4ConstBase.h:64
class cmnTypeTraits< value_type > TypeTraits
Definition: vctFixedSizeMatrix.h:75
BaseType::DiagonalRefType DiagonalRefType
Definition: vctFrame4x4ConstBase.h:70
ConstPerspectiveRefType Perspective(void) const
Definition: vctFrame4x4ConstBase.h:128
BaseType::ColumnRefType ColumnRefType
Definition: vctFrame4x4ConstBase.h:67
Define a rotation matrix for a space of dimension 3.
Definition: vctForwardDeclarations.h:201
Definition: vctFrame4x4ConstBase.h:53
void ApplyTo(size_type inputSize, const vctFixedSizeVector< value_type, DIMENSION > *input, vctFixedSizeVector< value_type, DIMENSION > *output) const
Definition: vctFrame4x4ConstBase.h:265
An implementation of the ``abstract'' vctFixedSizeMatrixBase.
Definition: vctFixedSizeMatrixRef.h:46
ConstTranslationRefType Translation(void) const
Definition: vctFrame4x4Base.h:89
void ApplyInverseTo(const vctFrame4x4ConstBase< __containerType1 > &input, vctFrame4x4Base< __containerType2 > &output) const
Definition: vctFrame4x4ConstBase.h:324
ConstRotationRefType Rotation(void) const
Definition: vctFrame4x4Base.h:93
void ApplyTo(const vctFrame4x4ConstBase< __containerType1 > &input, vctFrame4x4Base< __containerType2 > &output) const
Definition: vctFrame4x4ConstBase.h:197
ConstRotationRefType Rotation(void) const
Definition: vctFrame4x4ConstBase.h:124
Declaration of vctFixedSizeVectorRef.
FrameValueType ApplyTo(const vctFrame4x4ConstBase< __containerType > &input) const
Definition: vctFrame4x4ConstBase.h:215
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeVectorBase.h:76
vctFixedSizeVector< value_type, DIMENSION > ApplyInverseTo(const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
Definition: vctFrame4x4ConstBase.h:316
ptrdiff_t stride_type
Definition: vctContainerTraits.h:37
void ApplyTo(const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &input, vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &output) const
Definition: vctFrame4x4ConstBase.h:161
BaseType::ColumnValueType ColumnValueType
Definition: vctFrame4x4ConstBase.h:65
BaseType::ConstColumnRefType ConstColumnRefType
Definition: vctFrame4x4ConstBase.h:69
Definition: vctDynamicConstVectorBase.h:77
vctFrame4x4< value_type, COLSTRIDE<=ROWSTRIDE > FrameValueType;typedef cmnTypeTraits< value_type > TypeTraits;typedef vctFixedSizeVectorRef< value_type, DIMENSION, ROWSTRIDE > TranslationRefType;typedef vctFixedSizeConstVectorRef< value_type, DIMENSION, ROWSTRIDE > ConstTranslationRefType;typedef vctFixedSizeVectorRef< value_type, DIMENSION, COLSTRIDE > PerspectiveRefType;typedef vctFixedSizeConstVectorRef< value_type, DIMENSION, COLSTRIDE > ConstPerspectiveRefType;typedef vctMatrixRotation3Ref< value_type, ROWSTRIDE, COLSTRIDE > RotationRefType;typedef vctMatrixRotation3ConstRef< value_type, ROWSTRIDE, COLSTRIDE > ConstRotationRefType;protected:RotationRefType RotationRef;TranslationRefType TranslationRef;PerspectiveRefType PerspectiveRef;inline void UpdateReferences(void){RotationRef.SetRef(this->Pointer(0, 0));TranslationRef.SetRef(this->Pointer(0, DIMENSION));PerspectiveRef.SetRef(this->Pointer(DIMENSION, 0));}public:vctFrame4x4ConstBase(void){this-> UpdateReferences()
Definition: vctFrame4x4ConstBase.h:111
An implementation of the ``abstract'' vctFixedSizeConstMatrixBase.
Definition: vctFixedSizeConstMatrixRef.h:50
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeConstVectorBase.h:107
void SumOf(const PlainObjectBase< OtherDerived1 > &other1, const PlainObjectBase< OtherDerived2 > &other2)
Definition: cisstVectorEigenAddons.h:24
ConstTranslationRefType Translation(void) const
Definition: vctFrame4x4ConstBase.h:120
value_type & Z(void)
Definition: vctFixedSizeVectorBase.h:585
void ApplyInverseTo(const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &input, vctDynamicVectorBase< __vectorOwnerType2, value_type > &output) const
Definition: vctFrame4x4ConstBase.h:293
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
ColumnRefType Column(size_type index)
Definition: vctFixedSizeMatrixBase.h:249
ThisType & DifferenceOf(const vctFixedSizeConstVectorBase< _size, __stride1, value_type, __dataPtrType1 > &vector1, const vctFixedSizeConstVectorBase< _size, __stride2, value_type, __dataPtrType2 > &vector2)
Definition: vctFixedSizeVectorBase.h:820
FrameValueType Inverse(void) const
Definition: vctFrame4x4.h:171
Definition: vctFrame4x4ConstBase.h:62
static CISST_EXPORT const FrameValueType & Identity(void)
Declaration of vctMatrixRotation3Ref.
bool IsNormalized(value_type tolerance=TypeTraits::Tolerance()) const
Definition: vctFrame4x4ConstBase.h:143
Definition: vctDynamicVectorBase.h:61
Definition: vctFrame4x4ConstBase.h:62
bool Equal(const ThisType &other) const
Definition: vctFrame4x4ConstBase.h:347