ALBA
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
albaMatrix Class Reference

#include <albaMatrix.h>

Inheritance diagram for albaMatrix:
Inheritance graph
[legend]
Collaboration diagram for albaMatrix:
Collaboration graph
[legend]

Public Member Functions

 albaTypeMacro (albaMatrix, albaReferenceCounted)
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaMatrix ()
 
virtual ~albaMatrix ()
 
 albaMatrix (const albaMatrix &mat)
 
albaMatrixoperator= (const albaMatrix &mat)
 
bool operator== (const albaMatrix &mat) const
 
bool Equals (const albaMatrix *mat) const
 
void DeepCopy (const albaMatrix *mat)
 
albaMatrixElements GetElements () const
 
void SetElement (const int i, const int j, double value)
 
double GetElement (const int i, const int j) const
 
unsigned long GetMTime () const
 
void Modified ()
 
void SetTimeStamp (albaTimeStamp t)
 
albaTimeStamp GetTimeStamp () const
 
void GetVersor (const int axis, double versor[3]) const
 
void CopyRotation (const albaMatrix &source)
 
void Zero ()
 
void Identity ()
 
bool IsIdentity ()
 
albaMatrixInvert ()
 
double Determinant () const
 
void Adjoint (const albaMatrix &inMat, albaMatrix &outMat)
 
void Adjoint ()
 
void Transpose ()
 
void MultiplyPoint (const double in[4], double out[4]) const
 
albaVect3d MultiplyPoint (albaVect3d point)
 
double * operator[] (const unsigned int i)
 
const double * operator[] (unsigned int i) const
 
 operator vtkMatrix4x4 * () const
 
void SetFromDirectionCosines (const double orientation[6])
 
- Public Member Functions inherited from albaReferenceCounted
 albaReferenceCounted ()
 
virtual ~albaReferenceCounted ()
 
 albaAbstractTypeMacro (albaReferenceCounted, albaObject)
 
virtual void Delete ()
 
void Register (void *obj)
 
virtual void UnRegister (void *obj)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
- Public Member Functions inherited from albaObject
 albaObject ()
 
virtual ~albaObject ()
 
virtual void Delete ()
 
virtual const char * GetTypeName () const
 
virtual bool IsA (const char *type_name) const
 
virtual bool IsA (const albaTypeID &type_id) const
 
virtual albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () const
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaObject (const albaObject &c)
 

Static Public Member Functions

static void GetVersor (const int axis, const albaMatrix &matrix, double versor[3])
 
static void CopyRotation (const albaMatrix &source, albaMatrix &target)
 
static void Zero (double elements[16])
 
static void Identity (double elements[16])
 
static void Invert (const albaMatrix &in, albaMatrix &out)
 
static void Invert (const double inElements[16], double outElements[16])
 
static double Determinant (const double Elements[16])
 
static void Adjoint (const double inElements[16], double outElements[16])
 
static void Transpose (const albaMatrix &in, albaMatrix &out)
 
static void Transpose (const double inElements[16], double outElements[16])
 
static void MultiplyPoint (const double Elements[16], const double in[4], double out[4])
 
static void Multiply4x4 (const albaMatrix &a, const albaMatrix &b, albaMatrix &c)
 
static void Multiply4x4 (const double a[16], const double b[16], double c[16])
 
static void PointMultiply (const double Elements[16], const float in[4], float out[4])
 
static void PointMultiply (const double Elements[16], const double in[4], double out[4])
 
- Static Public Member Functions inherited from albaObject
static const char * GetStaticTypeName ()
 
static bool IsStaticType (const char *type_name)
 
static bool IsStaticType (const albaTypeID &type_id)
 
static const albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 

Protected Attributes

albaTimeStamp m_TimeStamp
 
double m_Elements [4][4]
 
albaMTime m_MTime
 
- Protected Attributes inherited from albaReferenceCounted
int m_ReferenceCount
 
- Protected Attributes inherited from albaObject
bool m_HeapFlag
 

Detailed Description

albaMatrix - Time stamped 4x4 Matrix.

This class defines a TimeStamped 4x4 Matrix class. If ALBA has been compiled with VTK support, this class can be used wherever a vtkMatrix4x4 is requested, and indeed the internal representation is a vtkMatrix4x4. Also GetVTKMatrix() explicitly return a vtkMatrix4x4 pointer. Also albaMatrix can reference a vtkMatrix4x4, i.e. register it and share the same Elements vector, with SetVTKMatrix.

See also
albaReferenceCounted vtkMatrix4x4

Definition at line 43 of file albaMatrix.h.

Constructor & Destructor Documentation

◆ albaMatrix() [1/2]

albaMatrix::albaMatrix ( )

◆ ~albaMatrix()

virtual albaMatrix::~albaMatrix ( )
virtual

◆ albaMatrix() [2/2]

albaMatrix::albaMatrix ( const albaMatrix mat)

Member Function Documentation

◆ albaTypeMacro()

albaMatrix::albaTypeMacro ( albaMatrix  ,
albaReferenceCounted   
)

◆ Print()

virtual void albaMatrix::Print ( std::ostream &  os,
const int  indent = 0 
) const
virtual

print debug information for this object

Reimplemented from albaObject.

◆ operator=()

albaMatrix & albaMatrix::operator= ( const albaMatrix mat)

◆ operator==()

bool albaMatrix::operator== ( const albaMatrix mat) const

◆ Equals()

bool albaMatrix::Equals ( const albaMatrix mat) const

◆ DeepCopy()

void albaMatrix::DeepCopy ( const albaMatrix mat)
inline

Definition at line 60 of file albaMatrix.h.

◆ GetElements()

albaMatrixElements albaMatrix::GetElements ( ) const

return pointer to elements matrix: returned type is a double [4][4] object

Referenced by Adjoint(), Invert(), Multiply4x4(), and Transpose().

◆ SetElement()

void albaMatrix::SetElement ( const int  i,
const int  j,
double  value 
)
inline

Sets the element i,j in the matrix.

Remember to call explicitly Modified when using this function.

Definition at line 88 of file albaMatrix.h.

◆ GetElement()

double albaMatrix::GetElement ( const int  i,
const int  j 
) const
inline

Returns the element i,j from the matrix.

Definition at line 91 of file albaMatrix.h.

◆ GetMTime()

unsigned long albaMatrix::GetMTime ( ) const

return modification time for this object

◆ Modified()

void albaMatrix::Modified ( )

update modification time stamp for this object

Referenced by Adjoint(), Invert(), Multiply4x4(), and Transpose().

◆ SetTimeStamp()

void albaMatrix::SetTimeStamp ( albaTimeStamp  t)
inline

Set the TimeStamp for this matrix.

Definition at line 100 of file albaMatrix.h.

References albaEquals().

Here is the call graph for this function:

◆ GetTimeStamp()

albaTimeStamp albaMatrix::GetTimeStamp ( ) const
inline

Definition at line 101 of file albaMatrix.h.

Referenced by albaTransform::SetMatrix().

◆ GetVersor() [1/2]

static void albaMatrix::GetVersor ( const int  axis,
const albaMatrix matrix,
double  versor[3] 
)
static

Get the given matrix versor.

Static version.

Referenced by albaTransform::GetVersor().

◆ GetVersor() [2/2]

void albaMatrix::GetVersor ( const int  axis,
double  versor[3] 
) const
inline

Get the given matrix versor.

Definition at line 106 of file albaMatrix.h.

References GetVersor().

Referenced by GetVersor().

Here is the call graph for this function:

◆ CopyRotation() [1/2]

void albaMatrix::CopyRotation ( const albaMatrix source)
inline

Copy the 3x3 rotation matrix from another 4x4 matrix.

Definition at line 109 of file albaMatrix.h.

References CopyRotation().

Referenced by CopyRotation().

Here is the call graph for this function:

◆ CopyRotation() [2/2]

static void albaMatrix::CopyRotation ( const albaMatrix source,
albaMatrix target 
)
static

Copy the 3x3 rotation matrix from a 4x4 matrix to another.

Static version.

◆ Zero() [1/2]

void albaMatrix::Zero ( )
inline

Set all of the elements to zero.

Static version.

Definition at line 114 of file albaMatrix.h.

References Zero().

Referenced by Zero().

Here is the call graph for this function:

◆ Zero() [2/2]

static void albaMatrix::Zero ( double  elements[16])
static

Set all of the elements to zero.

◆ Identity() [1/2]

void albaMatrix::Identity ( )
inline

Set equal to Identity matrix.

Definition at line 119 of file albaMatrix.h.

References Identity().

Referenced by Identity().

Here is the call graph for this function:

◆ Identity() [2/2]

static void albaMatrix::Identity ( double  elements[16])
static

◆ IsIdentity()

bool albaMatrix::IsIdentity ( )

Return true if is an Identity Matrix.

◆ Invert() [1/3]

static void albaMatrix::Invert ( const albaMatrix in,
albaMatrix out 
)
inlinestatic

Matrix Inversion (adapted from Richard Carling in "Graphics Gems," Academic Press, 1990).

static version.

Definition at line 128 of file albaMatrix.h.

References GetElements(), Invert(), and Modified().

Here is the call graph for this function:

◆ Invert() [2/3]

albaMatrix * albaMatrix::Invert ( )
inline

Matrix Inversion (adapted from Richard Carling in "Graphics Gems," Academic Press, 1990).

Definition at line 132 of file albaMatrix.h.

References Invert().

Referenced by Invert().

Here is the call graph for this function:

◆ Invert() [3/3]

static void albaMatrix::Invert ( const double  inElements[16],
double  outElements[16] 
)
static

Matrix Inversion, (adapted from Richard Carling in "Graphics Gems," Academic Press, 1990).

static version.

◆ Determinant() [1/2]

static double albaMatrix::Determinant ( const double  Elements[16])
static

Matrix determinant.

◆ Determinant() [2/2]

double albaMatrix::Determinant ( ) const
inline

Definition at line 140 of file albaMatrix.h.

References Determinant().

Referenced by Determinant().

Here is the call graph for this function:

◆ Adjoint() [1/3]

static void albaMatrix::Adjoint ( const double  inElements[16],
double  outElements[16] 
)
static

Matrix adjoint.

◆ Adjoint() [2/3]

void albaMatrix::Adjoint ( const albaMatrix inMat,
albaMatrix outMat 
)
inline

Definition at line 144 of file albaMatrix.h.

References Adjoint(), GetElements(), and Modified().

Referenced by Adjoint().

Here is the call graph for this function:

◆ Adjoint() [3/3]

void albaMatrix::Adjoint ( )
inline

Definition at line 145 of file albaMatrix.h.

References Adjoint().

Referenced by Adjoint().

Here is the call graph for this function:

◆ Transpose() [1/3]

static void albaMatrix::Transpose ( const albaMatrix in,
albaMatrix out 
)
inlinestatic

Transpose the matrix and put it into out.

static version.

Definition at line 148 of file albaMatrix.h.

References GetElements(), Modified(), and Transpose().

Here is the call graph for this function:

◆ Transpose() [2/3]

void albaMatrix::Transpose ( )
inline

Transpose the matrix and put it into out.

Definition at line 151 of file albaMatrix.h.

References Transpose().

Referenced by Transpose().

Here is the call graph for this function:

◆ Transpose() [3/3]

static void albaMatrix::Transpose ( const double  inElements[16],
double  outElements[16] 
)
static

Transpose the matrix and put it into out.

static version.

◆ MultiplyPoint() [1/3]

void albaMatrix::MultiplyPoint ( const double  in[4],
double  out[4] 
) const
inline

Multiply a homogeneous coordinate by this matrix, i.e.

out = A*in. The in[4] and out[4] can be the same array.

Definition at line 158 of file albaMatrix.h.

References MultiplyPoint().

Referenced by MultiplyPoint().

Here is the call graph for this function:

◆ MultiplyPoint() [2/3]

albaVect3d albaMatrix::MultiplyPoint ( albaVect3d  point)

Multiply an albaVect3d to this matrix, i.e.

out = A*in.

◆ MultiplyPoint() [3/3]

static void albaMatrix::MultiplyPoint ( const double  Elements[16],
const double  in[4],
double  out[4] 
)
static

Multiply a homogeneous coordinate by this matrix, i.e.

out = A*in. The in[4] and out[4] can be the same array.

◆ Multiply4x4() [1/2]

static void albaMatrix::Multiply4x4 ( const albaMatrix a,
const albaMatrix b,
albaMatrix c 
)
inlinestatic

Multiplies matrices a and b and stores the result in c.

Definition at line 173 of file albaMatrix.h.

References GetElements(), Modified(), and Multiply4x4().

Referenced by Multiply4x4().

Here is the call graph for this function:

◆ Multiply4x4() [2/2]

static void albaMatrix::Multiply4x4 ( const double  a[16],
const double  b[16],
double  c[16] 
)
static

Multiplies matrices a and b and stores the result in c.

this works with arrays.

◆ operator[]() [1/2]

double * albaMatrix::operator[] ( const unsigned int  i)
inline

bracket operator to access & write single elements

Definition at line 180 of file albaMatrix.h.

◆ operator[]() [2/2]

const double * albaMatrix::operator[] ( unsigned int  i) const
inline

bracket operator to access single elements

Definition at line 183 of file albaMatrix.h.

◆ operator vtkMatrix4x4 *()

albaMatrix::operator vtkMatrix4x4 * ( ) const
inline

Definition at line 186 of file albaMatrix.h.

◆ PointMultiply() [1/2]

static void albaMatrix::PointMultiply ( const double  Elements[16],
const float  in[4],
float  out[4] 
)
static

Multiply a homogeneous coordinate by this matrix, i.e.

out = in*A. The in[4] and out[4] can be the same array.

◆ PointMultiply() [2/2]

static void albaMatrix::PointMultiply ( const double  Elements[16],
const double  in[4],
double  out[4] 
)
static

Multiply a homogeneous coordinate by this matrix, i.e.

out = in*A. The in[4] and out[4] can be the same array.

◆ SetFromDirectionCosines()

void albaMatrix::SetFromDirectionCosines ( const double  orientation[6])

Member Data Documentation

◆ m_TimeStamp

albaTimeStamp albaMatrix::m_TimeStamp
protected

Definition at line 205 of file albaMatrix.h.

◆ m_Elements

double albaMatrix::m_Elements[4][4]
protected

has its own internal representation

Definition at line 210 of file albaMatrix.h.

◆ m_MTime

albaMTime albaMatrix::m_MTime
protected

Definition at line 211 of file albaMatrix.h.


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