qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ccIndexedTransformation Class Reference

A 4x4 'transformation' matrix (column major order) associated to an index (typically a timestamp) More...

#include <ccIndexedTransformation.h>

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

Public Member Functions

 ccIndexedTransformation ()
 Default constructor. More...
 
 ccIndexedTransformation (const ccGLMatrix &matrix)
 Constructor from a transformation matrix. More...
 
 ccIndexedTransformation (const ccGLMatrix &matrix, double index)
 Constructor from a transformation matrix and an index. More...
 
 ccIndexedTransformation (const ccIndexedTransformation &trans)
 Copy constructor.
 
double getIndex () const
 Returns associated index (e.g. timestamp)
 
void setIndex (double index)
 Sets associated index (e.g. timestamp)
 
ccIndexedTransformation operator* (const ccGLMatrix &mat) const
 Multiplication by a ccGLMatrix operator.
 
ccIndexedTransformationoperator*= (const ccGLMatrix &mat)
 (in place) Multiplication by a ccGLMatrix operator More...
 
ccIndexedTransformationoperator+= (const CCVector3 &T)
 Multiplication operator. More...
 
ccIndexedTransformationoperator-= (const CCVector3 &T)
 (in place) Translation operator More...
 
ccIndexedTransformation transposed () const
 Returns transposed transformation. More...
 
ccIndexedTransformation inverse () const
 Returns inverse transformation. More...
 
virtual bool toAsciiFile (const char *filename) const
 Saves transformation to an ASCII file.
 
virtual bool fomAsciiFile (const char *filename)
 Loads transformation from an ASCII file.
 
virtual bool isSerializable () const
 Returns whether object is serializable of not.
 
virtual bool toFile (QFile &out) const
 Saves data to binay stream. More...
 
virtual bool fromFile (QFile &in, short dataVersion, int flags)
 Loads data from binay stream. More...
 
- Public Member Functions inherited from ccGLMatrix
 ccGLMatrix ()
 Default constructor. More...
 
 ccGLMatrix (const float *mat16f)
 Constructor from a float GL matrix array. More...
 
 ccGLMatrix (const double *mat16d)
 Constructor from a double GL matrix array. More...
 
 ccGLMatrix (const CCVector3 &X, const CCVector3 &Y, const CCVector3 &Z, const CCVector3 &T)
 Constructor from 4 columns (X,Y,Z,T) More...
 
 ccGLMatrix (const CCLib::SquareMatrix &R, const CCVector3 &T)
 Constructor from a 3x3 rotation matrix R and a vector T.
 
 ccGLMatrix (const CCLib::SquareMatrix &R, const CCVector3 &T, PointCoordinateType S)
 Constructor from a 3x3 rotation matrix R, a vector T, a scale S.
 
 ccGLMatrix (const CCLib::SquareMatrix &R, const CCVector3 &T, const CCVector3 &rotCenter)
 Constructor from a rotation center G, a 3x3 rotation matrix R and a vector T.
 
 ccGLMatrix (const ccGLMatrix &mat)
 Copy constructor.
 
QString toString (int precision=12, QChar separator= ' ') const
 Returns matrix as a string. More...
 
ccGLMatrix xRotation () const
 Returns the rotation component around X only.
 
ccGLMatrix yRotation () const
 Returns the rotation component around Y only.
 
ccGLMatrix zRotation () const
 Returns the rotation component around Z only.
 
virtual void toZero ()
 Clears matrix. More...
 
virtual void toIdentity ()
 Sets matrix to identity.
 
void clearTranslation ()
 Clears translation. More...
 
void initFromParameters (PointCoordinateType alpha_rad, const CCVector3 &axis3D, const CCVector3 &t3D)
 Inits transformation from a rotation axis, an angle and a translation. More...
 
void initFromParameters (PointCoordinateType phi_rad, PointCoordinateType theta_rad, PointCoordinateType psi_rad, const CCVector3 &t3D)
 Inits transformation from 3 rotation angles and a translation. More...
 
void getParameters (PointCoordinateType &alpha_rad, CCVector3 &axis3D, CCVector3 &t3D) const
 Returns equivalent parameters: a rotation axis, an angle and a translation. More...
 
void getParameters (PointCoordinateType &phi_rad, PointCoordinateType &theta_rad, PointCoordinateType &psi_rad, CCVector3 &t3D) const
 Returns equivalent parameters: 3 rotation angles and a translation. More...
 
float * data ()
 Returns a pointer to internal data.
 
const float * data () const
 Returns a const pointer to internal data.
 
float * getTranslation ()
 Retruns a pointer to internal translation. More...
 
const float * getTranslation () const
 Retruns a const pointer to internal translation. More...
 
CCVector3 getTranslationAsVec3D () const
 Returns a copy of the translation as a CCVector3. More...
 
void setTranslation (const CCVector3 &T)
 Sets translation. More...
 
void setTranslation (const float T[3])
 Sets translation. More...
 
float * getColumn (unsigned index)
 Returns a pointer to a given column. More...
 
const float * getColumn (unsigned index) const
 Returns a const pointer to a given column. More...
 
CCVector3 getColumnAsVec3D (unsigned index) const
 Returns a copy of a given column as a CCVector3. More...
 
ccGLMatrix operator* (const ccGLMatrix &mat) const
 Multiplication by a matrix operator.
 
CCVector3 operator* (const CCVector3 &vec) const
 Multiplication by a vector operator.
 
ccGLMatrixoperator*= (const ccGLMatrix &mat)
 (in place) Multiplication operator
 
ccGLMatrixoperator+= (const CCVector3 &T)
 (in place) Translation operator
 
ccGLMatrixoperator-= (const CCVector3 &T)
 (in place) Translation operator
 
void apply (CCVector3 &vec) const
 Applies transformation to a 3D vector (in place) More...
 
PointCoordinateType applyX (const CCVector3 &vec) const
 Get the resulting transformation along X dimension.
 
PointCoordinateType applyY (const CCVector3 &vec) const
 Get the resulting transformation along Y dimension.
 
PointCoordinateType applyZ (const CCVector3 &vec) const
 Get the resulting transformation along Z dimension.
 
void applyRotation (CCVector3 &vec) const
 Applies rotation only to a 3D vector (in place) More...
 
void applyRotation (float vec[3]) const
 Applies rotation only to a 3D vector (in place) More...
 
void shiftRotationCenter (const CCVector3 &vec)
 Shifts rotation center. More...
 
void transpose ()
 Transposes matrix (in place)
 
ccGLMatrix transposed () const
 Returns transposed matrix.
 
void invert ()
 Inverts transformation.
 
ccGLMatrix inverse () const
 Returns inverse transformation.
 
void scale (float coef)
 Scales the whole matrix. More...
 
void scaleLine (unsigned lineIndex, float coef)
 Scales one line of the matrix. More...
 
void scaleColumn (unsigned colIndex, float coef)
 Scales one column of the matrix. More...
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()
 Desctructor.
 

Static Public Member Functions

static ccIndexedTransformation Interpolate (double interpIndex, const ccIndexedTransformation &trans1, const ccIndexedTransformation &trans2)
 Interpolates two transformations at an absolute position (index) More...
 
- Static Public Member Functions inherited from ccGLMatrix
static ccGLMatrix Interpolate (PointCoordinateType coef, const ccGLMatrix &glMat1, const ccGLMatrix &glMat2)
 Interpolates two matrices at relative position 'coef'. More...
 
static ccGLMatrix FromToRotation (const CCVector3 &from, const CCVector3 &to)
 Creates a transformation matrix that rotates a vector to another. More...
 
static ccGLMatrix FromQuaternion (const float q[])
 Converts a quaternion to a rotation matrix. More...
 
static ccGLMatrix FromString (QString matText, bool &success)
 Converts a 'text' matrix to a ccGLMatrix. More...
 
- Static Public Member Functions inherited from ccSerializableObject
static bool WriteError ()
 Sends a custom error message (write error) and returns 'false'. More...
 
static bool ReadError ()
 Sends a custom error message (read error) and returns 'false'. More...
 
static bool MemoryError ()
 Sends a custom error message (not enough memory) and returns 'false'. More...
 
static bool CorruptError ()
 Sends a custom error message (corrupted file) and returns 'false'. More...
 

Protected Attributes

double m_index
 Associated index (e.g. timestamp)
 
- Protected Attributes inherited from ccGLMatrix
float m_mat [OPENGL_MATRIX_SIZE]
 Internal 4x4 GL-style matrix data.
 

Additional Inherited Members

- Public Types inherited from ccSerializableObject
enum  DeserializationFlags { DF_POINT_COORDS_64_BITS = 1, DF_SCALAR_VAL_32_BITS = 2 }
 Deserialization flags (bit-field) More...
 

Detailed Description

A 4x4 'transformation' matrix (column major order) associated to an index (typically a timestamp)

Constructor & Destructor Documentation

ccIndexedTransformation::ccIndexedTransformation ( )

Default constructor.

Matrix is set to identity (see ccGLMatrix::toIdentity) by default. Index is set to zero by default.

ccIndexedTransformation::ccIndexedTransformation ( const ccGLMatrix matrix)

Constructor from a transformation matrix.

Index is set to zero by default.

Parameters
matrixtransformation matrix
ccIndexedTransformation::ccIndexedTransformation ( const ccGLMatrix matrix,
double  index 
)

Constructor from a transformation matrix and an index.

Parameters
matrixtransformation matrix
indexassociated index (e.g. timestamp)

Member Function Documentation

bool ccIndexedTransformation::fromFile ( QFile &  in,
short  dataVersion,
int  flags 
)
virtual

Loads data from binay stream.

Parameters
ininput file (already opened)
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
Returns
success

Reimplemented from ccGLMatrix.

ccIndexedTransformation ccIndexedTransformation::Interpolate ( double  interpIndex,
const ccIndexedTransformation trans1,
const ccIndexedTransformation trans2 
)
static

Interpolates two transformations at an absolute position (index)

Warning: interpolation index must lie between the two input matrices indexes!

Parameters
interpIndexinterpolation position (should be between trans1 and trans2 indexes).
trans1first transformation
trans2second transformation
ccIndexedTransformation ccIndexedTransformation::inverse ( ) const

Returns inverse transformation.

Warning: index is not modified by this operation.

ccIndexedTransformation & ccIndexedTransformation::operator*= ( const ccGLMatrix mat)

(in place) Multiplication by a ccGLMatrix operator

Warning: index is not modified by this operation.

ccIndexedTransformation & ccIndexedTransformation::operator+= ( const CCVector3 &  T)

Multiplication operator.

(in place) Multiplication operator Warning: index is not modified by this operation.(in place) Translation operator Warning: index is not modified by this operation.

ccIndexedTransformation & ccIndexedTransformation::operator-= ( const CCVector3 &  T)

(in place) Translation operator

Warning: index is not modified by this operation.

bool ccIndexedTransformation::toFile ( QFile &  out) const
virtual

Saves data to binay stream.

Parameters
outoutput file (already opened)
Returns
success

Reimplemented from ccGLMatrix.

ccIndexedTransformation ccIndexedTransformation::transposed ( ) const

Returns transposed transformation.

Warning: index is not modified by this operation.


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