Artec 3D Scanning SDK  2.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
artec::sdk::base::Matrix4x4< Type > Class Template Reference

Transformation matrix. More...

#include <artec/sdk/base/Matrix.h>

Public Types

typedef Type value_type
 

Public Member Functions

 Matrix4x4 ()
 
 Matrix4x4 (Type _00, Type _01, Type _02, Type _03, Type _10, Type _11, Type _12, Type _13, Type _20, Type _21, Type _22, Type _23, Type _30, Type _31, Type _32, Type _33)
 
template<typename Type2 , std::size_t sizeOfArray>
 Matrix4x4 (const Type2(&values)[sizeOfArray])
 
template<typename It >
 Matrix4x4 (It begin, It end)
 
template<typename Type2 >
 Matrix4x4 (const Type2 *values, int rows2, int cols2)
 
 Matrix4x4 (const Matrix4x4 &second)
 Copying constructor. More...
 
template<int rows2, int cols2, typename Type2 >
 Matrix4x4 (const GenericMatrix< rows2, cols2, Type2 > &second)
 Copying constructor with the size_ conversion. More...
 
template<typename Type2 >
 Matrix4x4 (const Matrix4x4< Type2 > &second)
 Copying constructor with the type conversion. More...
 
void fill (const Type value)
 Fill in the matrix with value. More...
 
template<typename Type2 >
Point4< Type2 > operator* (const Point4< Type2 > &point) const
 Matrix-point multiplication. More...
 
template<typename Type2 >
Point3< Type2 > operator* (const Point3< Type2 > &point) const
 Special case of the matrix-point multiplication: geometric transformation. More...
 
Matrix4x4 operator- () const
 Unary minus. More...
 
bool operator== (const Matrix4x4 &other) const
 Check whether the matrices are equal. More...
 
bool operator!= (const Matrix4x4 &other) const
 Check whether the matrices are not equal. More...
 
Type & operator() (int row, int col)
 
const Type & operator() (int row, int col) const
 
void setToIdentity ()
 Turn current matrix to identity. More...
 
bool isIdentity () const
 Check if the matrix is an identity one. More...
 
Matrix4x4 transposed () const
 Return copy of transposed matrix. More...
 
Matrix4x4< Type > inverted (bool *invertible=0) const
 Inversion. More...
 
Point3< Type > project (const Point3< Type > &point) const
 
int size () const
 Returns the number of elements in the matrix. More...
 
const Type & operator[] (int index) const
 Plain data element access operator Returns const reference to the element in the inner data array. More...
 
Type & operator[] (int index)
 
template<int rows2, int cols2, typename Type2 >
Matrix4x4 operator= (const GenericMatrix< rows2, cols2, Type2 > &second)
 
Matrix4x4operator= (const Matrix4x4 &second)
 
template<int rows, int cols>
GenericMatrix< rows, cols, Type > toGenericMatrix () const
 
template<int rows, int cols, typename Type2 >
GenericMatrix< rows, cols, Type2 > toGenericMatrix () const
 
Matrix4x4operator+= (const Matrix4x4 &mat)
 
Matrix4x4operator-= (const Matrix4x4 &mat)
 
Matrix4x4operator*= (const Matrix4x4 &other)
 
Matrix4x4 operator+ (const Matrix4x4 &mat) const
 
Matrix4x4 operator- (const Matrix4x4 &mat) const
 
Matrix4x4 operator* (const Matrix4x4 &mat) const
 
template<int cols2>
GenericMatrix< 4, cols2, Type > operator* (const GenericMatrix< 4, cols2, Type > &mat) const
 
Matrix4x4operator*= (const Type &val)
 
Matrix4x4operator/= (const Type &val)
 
Matrix4x4 operator* (const Type &val) const
 
Matrix4x4 operator/ (const Type &val) const
 
 operator const Type * () const
 
const Type * getData () const
 

Static Public Member Functions

static Matrix4x4 identity ()
 Identity matrix. More...
 
static Matrix4x4 rotation (Type angle, const Point3< Type > &direction)
 Important: Direction is a unit vector, don't forget to normalize it! More...
 
static Matrix4x4 rotation (Type angle, const Point3< Type > &direction, const Point3< Type > &center)
 Important: Direction is a unit vector, don't forget to normalize it! More...
 
static Matrix4x4 translation (const Point3< Type > &direction)
 Translations. More...
 
static Matrix4x4 inverseMotion (const Matrix4x4 &matrix)
 Inverse transformation matrix. More...
 
static Matrix4x4 perspective (Type left, Type right, Type bottom, Type top, Type nearVal, Type farVal)
 Get perspective projection matrix. More...
 
static Matrix4x4 perspectiveFov (float fovy, float aspect, float zNear, float zFar)
 Get perspective projection matrix. More...
 
static Matrix4x4 ortho (Type left, Type right, Type bottom, Type top, Type nearVal, Type farVal)
 Get orthogonal matrix. More...
 
static Matrix4x4 rotationX (Type angle)
 
static Matrix4x4 rotationY (Type angle)
 
static Matrix4x4 rotationZ (Type angle)
 
static Matrix4x4 rotationX (Type angle, const Point3< Type > &center)
 
static Matrix4x4 rotationY (Type angle, const Point3< Type > &center)
 
static Matrix4x4 rotationZ (Type angle, const Point3< Type > &center)
 
static Matrix4x4 scale (Type factor)
 
static Matrix4x4 scale (Type factor, const Point3< Type > &center)
 

Protected Attributes

union {
   struct {
      Type   m [4][4]
 
   } 
 
   Type   data [4 *4]
 
}; 
 Matrix data. More...
 

Static Protected Attributes

static int const rows_ = 4
 
static int const cols_ = 4
 
static int const size_ = 4 * 4
 

Detailed Description

template<typename Type = double>
class artec::sdk::base::Matrix4x4< Type >

Transformation matrix.

Examples:
project-sample.cpp.

Definition at line 26 of file Matrix.h.

Member Typedef Documentation

template<typename Type = double>
typedef Type artec::sdk::base::Matrix4x4< Type >::value_type

Definition at line 29 of file Matrix.h.

Constructor & Destructor Documentation

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( )
inline

Definition at line 31 of file Matrix.h.

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( Type  _00,
Type  _01,
Type  _02,
Type  _03,
Type  _10,
Type  _11,
Type  _12,
Type  _13,
Type  _20,
Type  _21,
Type  _22,
Type  _23,
Type  _30,
Type  _31,
Type  _32,
Type  _33 
)
inline

Definition at line 33 of file Matrix.h.

template<typename Type = double>
template<typename Type2 , std::size_t sizeOfArray>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Type2(&)  values[sizeOfArray])
inlineexplicit

Definition at line 45 of file Matrix.h.

template<typename Type = double>
template<typename It >
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( It  begin,
It  end 
)
inline

Definition at line 54 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Type2 *  values,
int  rows2,
int  cols2 
)
inline

Definition at line 71 of file Matrix.h.

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Matrix4x4< Type > &  second)
inline

Copying constructor.

Definition at line 86 of file Matrix.h.

template<typename Type = double>
template<int rows2, int cols2, typename Type2 >
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const GenericMatrix< rows2, cols2, Type2 > &  second)
inlineexplicit

Copying constructor with the size_ conversion.

Definition at line 90 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Matrix4x4< Type2 > &  second)
inlineexplicit

Copying constructor with the type conversion.

Definition at line 94 of file Matrix.h.

Member Function Documentation

template<typename Type = double>
void artec::sdk::base::Matrix4x4< Type >::fill ( const Type  value)
inline

Fill in the matrix with value.

Definition at line 151 of file Matrix.h.

template<typename Type = double>
const Type* artec::sdk::base::Matrix4x4< Type >::getData ( ) const
inline

Conversion to plain data pointer operator

Definition at line 614 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::identity ( )
inlinestatic

Identity matrix.

Definition at line 325 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::inverseMotion ( const Matrix4x4< Type > &  matrix)
inlinestatic

Inverse transformation matrix.

Get rotation and translation components of motion

Inverse rotation

Assemble inverse motion matrix

Definition at line 535 of file Matrix.h.

template<typename Type >
Matrix4x4< Type > artec::sdk::base::Matrix4x4< Type >::inverted ( bool *  invertible = 0) const

Inversion.

Returns
false if the matrix is singular and can't be inverted, otherwise the value is true

Definition at line 672 of file Matrix.h.

template<typename Type = double>
bool artec::sdk::base::Matrix4x4< Type >::isIdentity ( ) const
inline

Check if the matrix is an identity one.

Definition at line 342 of file Matrix.h.

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::operator const Type * ( ) const
inline

Conversion to plain data pointer operator

Definition at line 613 of file Matrix.h.

template<typename Type = double>
bool artec::sdk::base::Matrix4x4< Type >::operator!= ( const Matrix4x4< Type > &  other) const
inline

Check whether the matrices are not equal.

Definition at line 309 of file Matrix.h.

template<typename Type = double>
Type& artec::sdk::base::Matrix4x4< Type >::operator() ( int  row,
int  col 
)
inline

Definition at line 314 of file Matrix.h.

template<typename Type = double>
const Type& artec::sdk::base::Matrix4x4< Type >::operator() ( int  row,
int  col 
) const
inline

Definition at line 319 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator* ( const Matrix4x4< Type > &  mat) const
inline

Matrix-matrix multiplication

Definition at line 193 of file Matrix.h.

template<typename Type = double>
template<int cols2>
GenericMatrix< 4, cols2, Type > artec::sdk::base::Matrix4x4< Type >::operator* ( const GenericMatrix< 4, cols2, Type > &  mat) const
inline

Matrix-matrix multiplication

Definition at line 209 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
Point4< Type2 > artec::sdk::base::Matrix4x4< Type >::operator* ( const Point4< Type2 > &  point) const
inline

Matrix-point multiplication.

Definition at line 227 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
Point3< Type2 > artec::sdk::base::Matrix4x4< Type >::operator* ( const Point3< Type2 > &  point) const
inline

Special case of the matrix-point multiplication: geometric transformation.

Definition at line 244 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator* ( const Type &  val) const
inline

Matrix-Scalar

Definition at line 273 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator*= ( const Matrix4x4< Type > &  other)
inline

Arithmetical operations Matrix-Matrix (element-wise)

Definition at line 170 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator*= ( const Type &  val)
inline

Matrix-Scalar

Definition at line 262 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator+ ( const Matrix4x4< Type > &  mat) const
inline

Arithmetical operations Matrix-Matrix (element-wise)

Definition at line 176 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator+= ( const Matrix4x4< Type > &  mat)
inline

Arithmetical operations Matrix-Matrix (element-wise)

Definition at line 160 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator- ( const Matrix4x4< Type > &  mat) const
inline

Arithmetical operations Matrix-Matrix (element-wise)

Definition at line 183 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator- ( ) const
inline

Unary minus.

Definition at line 288 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator-= ( const Matrix4x4< Type > &  mat)
inline

Arithmetical operations Matrix-Matrix (element-wise)

Definition at line 165 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator/ ( const Type &  val) const
inline

Matrix-Scalar

Definition at line 279 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator/= ( const Type &  val)
inline

Matrix-Scalar

Definition at line 267 of file Matrix.h.

template<typename Type = double>
template<int rows2, int cols2, typename Type2 >
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator= ( const GenericMatrix< rows2, cols2, Type2 > &  second)
inline

Assignment operators

Definition at line 102 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator= ( const Matrix4x4< Type > &  second)
inline

Assignment operators

Definition at line 117 of file Matrix.h.

template<typename Type = double>
bool artec::sdk::base::Matrix4x4< Type >::operator== ( const Matrix4x4< Type > &  other) const
inline

Check whether the matrices are equal.

Definition at line 296 of file Matrix.h.

template<typename Type = double>
const Type& artec::sdk::base::Matrix4x4< Type >::operator[] ( int  index) const
inline

Plain data element access operator Returns const reference to the element in the inner data array.

Definition at line 622 of file Matrix.h.

template<typename Type = double>
Type& artec::sdk::base::Matrix4x4< Type >::operator[] ( int  index)
inline

Definition at line 627 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::ortho ( Type  left,
Type  right,
Type  bottom,
Type  top,
Type  nearVal,
Type  farVal 
)
inlinestatic

Get orthogonal matrix.

Definition at line 589 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::perspective ( Type  left,
Type  right,
Type  bottom,
Type  top,
Type  nearVal,
Type  farVal 
)
inlinestatic

Get perspective projection matrix.

Definition at line 555 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::perspectiveFov ( float  fovy,
float  aspect,
float  zNear,
float  zFar 
)
inlinestatic

Get perspective projection matrix.

Definition at line 578 of file Matrix.h.

template<typename Type = double>
Point3<Type> artec::sdk::base::Matrix4x4< Type >::project ( const Point3< Type > &  point) const
inline

Definition at line 374 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotation ( Type  angle,
const Point3< Type > &  direction 
)
inlinestatic

Important: Direction is a unit vector, don't forget to normalize it!

Definition at line 464 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotation ( Type  angle,
const Point3< Type > &  direction,
const Point3< Type > &  center 
)
inlinestatic

Important: Direction is a unit vector, don't forget to normalize it!

Definition at line 490 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationX ( Type  angle)
inlinestatic

Rotations (* - all angles are in radians)

Definition at line 391 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationX ( Type  angle,
const Point3< Type > &  center 
)
inlinestatic

Rotations (* - all angles are in radians)

Definition at line 434 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationY ( Type  angle)
inlinestatic

Rotations (* - all angles are in radians)

Definition at line 405 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationY ( Type  angle,
const Point3< Type > &  center 
)
inlinestatic

Rotations (* - all angles are in radians)

Definition at line 443 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationZ ( Type  angle)
inlinestatic

Rotations (* - all angles are in radians)

Definition at line 419 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationZ ( Type  angle,
const Point3< Type > &  center 
)
inlinestatic

Rotations (* - all angles are in radians)

Definition at line 452 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::scale ( Type  factor)
inlinestatic

Scale

Definition at line 513 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::scale ( Type  factor,
const Point3< Type > &  center 
)
inlinestatic

Scale

Definition at line 523 of file Matrix.h.

template<typename Type = double>
void artec::sdk::base::Matrix4x4< Type >::setToIdentity ( )
inline

Turn current matrix to identity.

Definition at line 332 of file Matrix.h.

template<typename Type = double>
int artec::sdk::base::Matrix4x4< Type >::size ( ) const
inline

Returns the number of elements in the matrix.

Definition at line 617 of file Matrix.h.

template<typename Type = double>
template<int rows, int cols>
GenericMatrix<rows, cols, Type> artec::sdk::base::Matrix4x4< Type >::toGenericMatrix ( ) const
inline

Convert matrix4x4 to generic matrix

Definition at line 127 of file Matrix.h.

template<typename Type = double>
template<int rows, int cols, typename Type2 >
GenericMatrix<rows, cols, Type2> artec::sdk::base::Matrix4x4< Type >::toGenericMatrix ( ) const
inline

Convert matrix4x4 to generic matrix

Definition at line 133 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::translation ( const Point3< Type > &  direction)
inlinestatic

Translations.

Definition at line 501 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::transposed ( ) const
inline

Return copy of transposed matrix.

Definition at line 360 of file Matrix.h.

Member Data Documentation

union { ... }

Matrix data.

template<typename Type = double>
int const artec::sdk::base::Matrix4x4< Type >::cols_ = 4
staticprotected

Definition at line 646 of file Matrix.h.

template<typename Type = double>
Type artec::sdk::base::Matrix4x4< Type >::data[4 *4]

Definition at line 642 of file Matrix.h.

template<typename Type = double>
Type artec::sdk::base::Matrix4x4< Type >::m[4][4]

Definition at line 639 of file Matrix.h.

template<typename Type = double>
int const artec::sdk::base::Matrix4x4< Type >::rows_ = 4
staticprotected

Definition at line 645 of file Matrix.h.

template<typename Type = double>
int const artec::sdk::base::Matrix4x4< Type >::size_ = 4 * 4
staticprotected

Definition at line 647 of file Matrix.h.


The documentation for this class was generated from the following file: