Open CASCADE Technology  6.9.1
Public Member Functions | Static Public Member Functions
NCollection_Mat4< Element_t > Class Template Reference

Generic matrix of 4 x 4 elements. To be used in conjunction with NCollection_Vec4 entities. Originally introduced for 3D space projection and orientation operations. More...

#include <NCollection_Mat4.hxx>

Public Member Functions

 NCollection_Mat4 ()
 Empty constructor. Construct the zero matrix. More...
 
 NCollection_Mat4 (const NCollection_Mat4 &theOther)
 Copy constructor. More...
 
const NCollection_Mat4operator= (const NCollection_Mat4 &theOther)
 Assignment operator. More...
 
Element_t GetValue (const size_t theRow, const size_t theCol) const
 Get element at the specified row and column. More...
 
Element_t & ChangeValue (const size_t theRow, const size_t theCol)
 Access element at the specified row and column. More...
 
void SetValue (const size_t theRow, const size_t theCol, const Element_t theValue)
 Set value for the element specified by row and columns. More...
 
NCollection_Vec4< Element_t > GetRow (const size_t theRow) const
 Get vector of elements for the specified row. More...
 
void SetRow (const size_t theRow, const NCollection_Vec3< Element_t > &theVec)
 Change first 3 row values by the passed vector. More...
 
void SetRow (const size_t theRow, const NCollection_Vec4< Element_t > &theVec)
 Set row values by the passed 4 element vector. More...
 
NCollection_Vec4< Element_t > GetColumn (const size_t theCol) const
 Get vector of elements for the specified column. More...
 
void SetColumn (const size_t theCol, const NCollection_Vec3< Element_t > &theVec)
 Change first 3 column values by the passed vector. More...
 
void SetColumn (const size_t theCol, const NCollection_Vec4< Element_t > &theVec)
 Set column values by the passed 4 element vector. More...
 
NCollection_Vec4< Element_t > GetDiagonal () const
 Get vector of diagonal elements. More...
 
void SetDiagonal (const NCollection_Vec3< Element_t > &theVec)
 Change first 3 elements of the diagonal matrix. More...
 
void SetDiagonal (const NCollection_Vec4< Element_t > &theVec)
 Set diagonal elements of the matrix by the passed vector. More...
 
void InitIdentity ()
 Initialize the identity matrix. More...
 
bool IsIdentity () const
 Checks the matrix for identity. More...
 
const Element_t * GetData () const
 Raw access to the data (for OpenGL exchange). More...
 
Element_t * ChangeData ()
 
 operator const Element_t * () const
 
 operator Element_t * ()
 
NCollection_Vec4< Element_t > operator* (const NCollection_Vec4< Element_t > &theVec) const
 Multiply by the vector (M * V). More...
 
NCollection_Mat4 Multiply (const NCollection_Mat4 &theMatA, const NCollection_Mat4 &theMatB)
 Compute matrix multiplication product: A * B. More...
 
void Multiply (const NCollection_Mat4 &theMat)
 Compute matrix multiplication. More...
 
NCollection_Mat4operator*= (const NCollection_Mat4 &theMat)
 Multiply by the another matrix. More...
 
NCollection_Mat4 operator* (const NCollection_Mat4 &theMat) const
 Compute matrix multiplication product. More...
 
NCollection_Mat4 Multiplied (const NCollection_Mat4 &theMat) const
 Compute matrix multiplication product. More...
 
void Multiply (const Element_t theFactor)
 Compute per-component multiplication. More...
 
NCollection_Mat4operator*= (const Element_t theFactor)
 Compute per-element multiplication. More...
 
NCollection_Mat4 operator* (const Element_t theFactor) const
 Compute per-element multiplication. More...
 
NCollection_Mat4 Multiplied (const Element_t theFactor) const
 Compute per-element multiplication. More...
 
void Translate (const NCollection_Vec3< Element_t > &theVec)
 Translate the matrix on the passed vector. More...
 
NCollection_Mat4 Transposed () const
 Transpose the matrix. More...
 
void Transpose ()
 Transpose the matrix. More...
 
bool Inverted (NCollection_Mat4< Element_t > &theOutMx) const
 Compute inverted matrix. More...
 
template<typename Other_t >
void Convert (const NCollection_Mat4< Other_t > &theOther)
 

Static Public Member Functions

static size_t Rows ()
 Get number of rows. More...
 
static size_t Cols ()
 Get number of columns. number of columns. More...
 
static NCollection_Mat4< Element_t > & Map (Element_t *theData)
 Maps plain C array to matrix type. More...
 
static const NCollection_Mat4< Element_t > & Map (const Element_t *theData)
 Maps plain C array to matrix type. More...
 

Detailed Description

template<typename Element_t>
class NCollection_Mat4< Element_t >

Generic matrix of 4 x 4 elements. To be used in conjunction with NCollection_Vec4 entities. Originally introduced for 3D space projection and orientation operations.

Constructor & Destructor Documentation

template<typename Element_t>
NCollection_Mat4< Element_t >::NCollection_Mat4 ( )
inline

Empty constructor. Construct the zero matrix.

template<typename Element_t>
NCollection_Mat4< Element_t >::NCollection_Mat4 ( const NCollection_Mat4< Element_t > &  theOther)
inline

Copy constructor.

Parameters
theOther[in] the matrix to copy values from.

Member Function Documentation

template<typename Element_t>
Element_t* NCollection_Mat4< Element_t >::ChangeData ( )
inline
template<typename Element_t>
Element_t& NCollection_Mat4< Element_t >::ChangeValue ( const size_t  theRow,
const size_t  theCol 
)
inline

Access element at the specified row and column.

Parameters
theRow[in] the row.to access.
theCol[in] the column to access.
Returns
reference on the matrix element.
template<typename Element_t>
static size_t NCollection_Mat4< Element_t >::Cols ( )
inlinestatic

Get number of columns. number of columns.

template<typename Element_t>
template<typename Other_t >
void NCollection_Mat4< Element_t >::Convert ( const NCollection_Mat4< Other_t > &  theOther)
inline
template<typename Element_t>
NCollection_Vec4<Element_t> NCollection_Mat4< Element_t >::GetColumn ( const size_t  theCol) const
inline

Get vector of elements for the specified column.

Parameters
theCol[in] the column to access.
Returns
vector of elements.
template<typename Element_t>
const Element_t* NCollection_Mat4< Element_t >::GetData ( ) const
inline

Raw access to the data (for OpenGL exchange).

template<typename Element_t>
NCollection_Vec4<Element_t> NCollection_Mat4< Element_t >::GetDiagonal ( ) const
inline

Get vector of diagonal elements.

Returns
vector of diagonal elements.
template<typename Element_t>
NCollection_Vec4<Element_t> NCollection_Mat4< Element_t >::GetRow ( const size_t  theRow) const
inline

Get vector of elements for the specified row.

Parameters
theRow[in] the row to access.
Returns
vector of elements.
template<typename Element_t>
Element_t NCollection_Mat4< Element_t >::GetValue ( const size_t  theRow,
const size_t  theCol 
) const
inline

Get element at the specified row and column.

Parameters
theRow[in] the row.to address.
theCol[in] the column to address.
Returns
the value of the addressed element.
template<typename Element_t>
void NCollection_Mat4< Element_t >::InitIdentity ( )
inline

Initialize the identity matrix.

template<typename Element_t>
bool NCollection_Mat4< Element_t >::Inverted ( NCollection_Mat4< Element_t > &  theOutMx) const
inline

Compute inverted matrix.

Parameters
theOutMx[out] the inverted matrix.
Returns
true if reversion success.
template<typename Element_t>
bool NCollection_Mat4< Element_t >::IsIdentity ( ) const
inline

Checks the matrix for identity.

template<typename Element_t>
static NCollection_Mat4<Element_t>& NCollection_Mat4< Element_t >::Map ( Element_t *  theData)
inlinestatic

Maps plain C array to matrix type.

template<typename Element_t>
static const NCollection_Mat4<Element_t>& NCollection_Mat4< Element_t >::Map ( const Element_t *  theData)
inlinestatic

Maps plain C array to matrix type.

template<typename Element_t>
NCollection_Mat4 NCollection_Mat4< Element_t >::Multiplied ( const NCollection_Mat4< Element_t > &  theMat) const
inline

Compute matrix multiplication product.

Parameters
theMat[in] the other matrix.
Returns
result of multiplication.
template<typename Element_t>
NCollection_Mat4 NCollection_Mat4< Element_t >::Multiplied ( const Element_t  theFactor) const
inline

Compute per-element multiplication.

Parameters
theFactor[in] the scale factor.
Returns
the result of multiplicaton.
template<typename Element_t>
NCollection_Mat4 NCollection_Mat4< Element_t >::Multiply ( const NCollection_Mat4< Element_t > &  theMatA,
const NCollection_Mat4< Element_t > &  theMatB 
)
inline

Compute matrix multiplication product: A * B.

Parameters
theMatA[in] the matrix "A".
theMatB[in] the matrix "B".
template<typename Element_t>
void NCollection_Mat4< Element_t >::Multiply ( const NCollection_Mat4< Element_t > &  theMat)
inline

Compute matrix multiplication.

Parameters
theMat[in] the matrix to multiply.
template<typename Element_t>
void NCollection_Mat4< Element_t >::Multiply ( const Element_t  theFactor)
inline

Compute per-component multiplication.

Parameters
theFactor[in] the scale factor.
template<typename Element_t>
NCollection_Mat4< Element_t >::operator const Element_t * ( ) const
inline
template<typename Element_t>
NCollection_Mat4< Element_t >::operator Element_t * ( )
inline
template<typename Element_t>
NCollection_Vec4<Element_t> NCollection_Mat4< Element_t >::operator* ( const NCollection_Vec4< Element_t > &  theVec) const
inline

Multiply by the vector (M * V).

Parameters
theVec[in] the vector to multiply.
template<typename Element_t>
NCollection_Mat4 NCollection_Mat4< Element_t >::operator* ( const NCollection_Mat4< Element_t > &  theMat) const
inline

Compute matrix multiplication product.

Parameters
theMat[in] the other matrix.
Returns
result of multiplication.
template<typename Element_t>
NCollection_Mat4 NCollection_Mat4< Element_t >::operator* ( const Element_t  theFactor) const
inline

Compute per-element multiplication.

Parameters
theFactor[in] the scale factor.
Returns
the result of multiplicaton.
template<typename Element_t>
NCollection_Mat4& NCollection_Mat4< Element_t >::operator*= ( const NCollection_Mat4< Element_t > &  theMat)
inline

Multiply by the another matrix.

Parameters
theMat[in] the other matrix.
template<typename Element_t>
NCollection_Mat4& NCollection_Mat4< Element_t >::operator*= ( const Element_t  theFactor)
inline

Compute per-element multiplication.

Parameters
theFactor[in] the scale factor.
template<typename Element_t>
const NCollection_Mat4& NCollection_Mat4< Element_t >::operator= ( const NCollection_Mat4< Element_t > &  theOther)
inline

Assignment operator.

Parameters
theOther[in] the matrix to copy values from.
template<typename Element_t>
static size_t NCollection_Mat4< Element_t >::Rows ( )
inlinestatic

Get number of rows.

Returns
number of rows.
template<typename Element_t>
void NCollection_Mat4< Element_t >::SetColumn ( const size_t  theCol,
const NCollection_Vec3< Element_t > &  theVec 
)
inline

Change first 3 column values by the passed vector.

Parameters
theCol[in] the column to change.
theVec[in] the vector of values.
template<typename Element_t>
void NCollection_Mat4< Element_t >::SetColumn ( const size_t  theCol,
const NCollection_Vec4< Element_t > &  theVec 
)
inline

Set column values by the passed 4 element vector.

Parameters
theCol[in] the column to change.
theVec[in] the vector of values.
template<typename Element_t>
void NCollection_Mat4< Element_t >::SetDiagonal ( const NCollection_Vec3< Element_t > &  theVec)
inline

Change first 3 elements of the diagonal matrix.

Parameters
theVecthe vector of values.
template<typename Element_t>
void NCollection_Mat4< Element_t >::SetDiagonal ( const NCollection_Vec4< Element_t > &  theVec)
inline

Set diagonal elements of the matrix by the passed vector.

Parameters
theVec[in] the vector of values.
template<typename Element_t>
void NCollection_Mat4< Element_t >::SetRow ( const size_t  theRow,
const NCollection_Vec3< Element_t > &  theVec 
)
inline

Change first 3 row values by the passed vector.

Parameters
theRow[in] the row to change.
theVec[in] the vector of values.
template<typename Element_t>
void NCollection_Mat4< Element_t >::SetRow ( const size_t  theRow,
const NCollection_Vec4< Element_t > &  theVec 
)
inline

Set row values by the passed 4 element vector.

Parameters
theRow[in] the row to change.
theVec[in] the vector of values.
template<typename Element_t>
void NCollection_Mat4< Element_t >::SetValue ( const size_t  theRow,
const size_t  theCol,
const Element_t  theValue 
)
inline

Set value for the element specified by row and columns.

Parameters
theRow[in] the row to change.
theCol[in] the column to change.
theValue[in] the value to set.s
template<typename Element_t>
void NCollection_Mat4< Element_t >::Translate ( const NCollection_Vec3< Element_t > &  theVec)
inline

Translate the matrix on the passed vector.

Parameters
theVec[in] the translation vector.
template<typename Element_t>
void NCollection_Mat4< Element_t >::Transpose ( )
inline

Transpose the matrix.

template<typename Element_t>
NCollection_Mat4 NCollection_Mat4< Element_t >::Transposed ( ) const
inline

Transpose the matrix.

Returns
transposed copy of the matrix.

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