![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
A 4x4 'transformation' matrix (column major order) More...
#include <ecvGLMatrixTpl.h>
Public Member Functions | |
| ccGLMatrixTpl (const Eigen::Matrix< float, 4, 4 > &mat) | |
| Copy Function. More... | |
| ccGLMatrixTpl (const Eigen::Matrix< double, 4, 4 > &mat) | |
| ccGLMatrixTpl (const Eigen::Matrix< float, 3, 3 > &mat) | |
| ccGLMatrixTpl (const Eigen::Matrix< double, 3, 3 > &mat) | |
| ccGLMatrixTpl< T > & | operator= (const Eigen::Matrix< float, 4, 4 > &mat) |
| Assignment Function. More... | |
| ccGLMatrixTpl< T > & | operator= (const Eigen::Matrix< double, 4, 4 > &mat) |
| ccGLMatrixTpl< T > & | operator= (const Eigen::Matrix< float, 3, 3 > &mat) |
| ccGLMatrixTpl< T > & | operator= (const Eigen::Matrix< double, 3, 3 > &mat) |
| ccGLMatrixTpl () | |
| Default constructor. More... | |
| ccGLMatrixTpl (const ccGLMatrixTpl< T > &mat) | |
| Copy constructor. More... | |
| ccGLMatrixTpl< T > & | operator= (const ccGLMatrixTpl< T > &mat) |
| Copy assignment operator. More... | |
| ccGLMatrixTpl (const float *mat16f) | |
| Constructor from a float GL matrix array. More... | |
| ccGLMatrixTpl (const double *mat16d) | |
| Constructor from a double GL matrix array. More... | |
| ccGLMatrixTpl (const Vector3Tpl< T > &X, const Vector3Tpl< T > &Y, const Vector3Tpl< T > &Z, const Vector3Tpl< T > &Tr) | |
| Constructor from 4 columns (X,Y,Z,T) More... | |
| void | toQuaternion (T q[]) const |
| Converts to a quaternion from a rotation matrix. More... | |
| void | toAngleAxis (T &alpha_rad, Vector3Tpl< T > &axis3D) const |
| Returns equivalent parameters: a rotation axis and an angle. More... | |
| void | toEulerAngle (T &rz, T &ry, T &rx) const |
| Returns equivalent parameters: 3 rotation angles. More... | |
| QString | toString (int precision=12, QChar separator=' ') const |
| Returns matrix as a string. More... | |
| virtual bool | toAsciiFile (QString filename, int precision=12) const |
| Saves matrix to an ASCII file. More... | |
| virtual bool | fromAsciiFile (QString filename) |
| Loads matrix from an ASCII file. More... | |
| ccGLMatrixTpl< T > | xRotation () const |
| Returns the rotation component around X only. More... | |
| ccGLMatrixTpl< T > | yRotation () const |
| Returns the rotation component around Y only. More... | |
| ccGLMatrixTpl< T > | zRotation () const |
| Returns the rotation component around Z only. More... | |
| virtual void | toZero () |
| Clears matrix. More... | |
| virtual void | toIdentity () |
| Sets matrix to identity. More... | |
| virtual bool | isIdentity () const |
| Returns whether this matrix is equal to identity. More... | |
| void | clearTranslation () |
| Clears translation. More... | |
| void | initFromParameters (T alpha_rad, const Vector3Tpl< T > &axis3D, const Vector3Tpl< T > &t3D) |
| Inits transformation from a rotation axis, an angle and a translation. More... | |
| void | initFromParameters (T phi_rad, T theta_rad, T psi_rad, const Vector3Tpl< T > &t3D) |
| Inits transformation from 3 rotation angles and a translation. More... | |
| void | getParameters (T &alpha_rad, Vector3Tpl< T > &axis3D, Vector3Tpl< T > &t3D) const |
| void | getParameters (T &phi_rad, T &theta_rad, T &psi_rad, Vector3Tpl< T > &t3D) const |
| Returns equivalent parameters: 3 rotation angles and a translation. More... | |
| T * | data () |
| Returns a pointer to internal data. More... | |
| const T * | data () const |
| Returns a const pointer to internal data. More... | |
| T * | getTranslation () |
| Retruns a pointer to internal translation. More... | |
| const T * | getTranslation () const |
| Retruns a const pointer to internal translation. More... | |
| Vector3Tpl< T > | getTranslationAsVec3D () const |
| Returns a copy of the translation as a CCVector3. More... | |
| void | setTranslation (const Vector3Tpl< float > &Tr) |
| Sets translation (float version) More... | |
| void | setTranslation (const Vector3Tpl< double > &Tr) |
| Sets translation (double version) More... | |
| void | setTranslation (const float Tr[3]) |
| Sets translation from a float array. More... | |
| void | setTranslation (const double Tr[3]) |
| Sets translation from a double array. More... | |
| void | setRotation (const float Rt[9]) |
| Sets Rotation from a float array. More... | |
| void | setRotation (const double Rt[9]) |
| Sets Rotation from a double array. More... | |
| T * | getColumn (unsigned index) |
| Returns a pointer to a given column. More... | |
| const T * | getColumn (unsigned index) const |
| Returns a const pointer to a given column. More... | |
| Vector3Tpl< T > | getColumnAsVec3D (unsigned index) const |
| Returns a copy of a given column as a CCVector3. More... | |
| void | setColumn (unsigned index, const Vector3Tpl< T > &v) |
| Sets the content of a given column. More... | |
| void | setColumn (unsigned index, const Tuple4Tpl< T > &v) |
| Sets the content of a given column. More... | |
| ccGLMatrixTpl< T > | operator* (const ccGLMatrixTpl< T > &mat) const |
| Multiplication by a matrix operator. More... | |
| Vector3Tpl< float > | operator* (const Vector3Tpl< float > &vec) const |
| Multiplication by a vector operator (float version) More... | |
| Vector3Tpl< double > | operator* (const Vector3Tpl< double > &vec) const |
| Multiplication by a vector operator (double version) More... | |
| Tuple4Tpl< float > | operator* (const Tuple4Tpl< float > &vec) const |
| Multiplication by a 4D vector operator (float version) More... | |
| Tuple4Tpl< double > | operator* (const Tuple4Tpl< double > &vec) const |
| Multiplication by a 4D vector operator (double version) More... | |
| ccGLMatrixTpl< T > & | operator+= (const ccGLMatrixTpl< T > &mat) |
| (in place) Addition operator More... | |
| ccGLMatrixTpl< T > & | operator-= (const ccGLMatrixTpl< T > &mat) |
| (in place) Difference operator More... | |
| ccGLMatrixTpl< T > & | operator*= (const ccGLMatrixTpl< T > &mat) |
| (in place) Multiplication operator More... | |
| ccGLMatrixTpl< T > & | operator+= (const Vector3Tpl< float > &Tr) |
| (in place) Forward translation operator (float version) More... | |
| ccGLMatrixTpl< T > & | operator+= (const Vector3Tpl< double > &Tr) |
| (in place) Forward translation operator (double version) More... | |
| ccGLMatrixTpl< T > & | operator-= (const Vector3Tpl< float > &Tr) |
| (in place) Backward translation operator (float version) More... | |
| ccGLMatrixTpl< T > & | operator-= (const Vector3Tpl< double > &Tr) |
| (in place) Backward translation operator (double version) More... | |
| T | operator() (unsigned row, unsigned col) const |
| Returns the value at a given position. More... | |
| void | apply (float vec[3]) const |
| Applies transformation to a 3D vector (in place) - float version. More... | |
| void | apply (double vec[3]) const |
| Applies transformation to a 3D vector (in place) - double version. More... | |
| void | apply (Vector3Tpl< float > &vec) const |
| Applies transformation to a 3D vector (in place) - float version. More... | |
| void | apply (Vector3Tpl< double > &vec) const |
| Applies transformation to a 3D vector (in place) - double version. More... | |
| void | apply (Tuple4Tpl< float > &vec) const |
| Applies transformation to a 4D vector (in place) - float version. More... | |
| void | apply (Tuple4Tpl< double > &vec) const |
| Applies transformation to a 3D vector (in place) - double version. More... | |
| float | applyX (const Vector3Tpl< float > &vec) const |
| Get the resulting transformation along X dimension (float version) More... | |
| double | applyX (const Vector3Tpl< double > &vec) const |
| Get the resulting transformation along X dimension (double version) More... | |
| float | applyY (const Vector3Tpl< float > &vec) const |
| Get the resulting transformation along Y dimension (float version) More... | |
| double | applyY (const Vector3Tpl< double > &vec) const |
| Get the resulting transformation along Y dimension (double version) More... | |
| float | applyZ (const Vector3Tpl< float > &vec) const |
| Get the resulting transformation along Z dimension (float version) More... | |
| double | applyZ (const Vector3Tpl< double > &vec) const |
| Get the resulting transformation along Z dimension (double version) More... | |
| float | applyX (const Tuple4Tpl< float > &vec) const |
| Get the resulting transformation along X dimension (float version) More... | |
| double | applyX (const Tuple4Tpl< double > &vec) const |
| Get the resulting transformation along X dimension (double version) More... | |
| float | applyY (const Tuple4Tpl< float > &vec) const |
| Get the resulting transformation along Y dimension (float version) More... | |
| double | applyY (const Tuple4Tpl< double > &vec) const |
| Get the resulting transformation along Y dimension (double version) More... | |
| float | applyZ (const Tuple4Tpl< float > &vec) const |
| Get the resulting transformation along Z dimension (float version) More... | |
| double | applyZ (const Tuple4Tpl< double > &vec) const |
| Get the resulting transformation along Z dimension (double version) More... | |
| float | applyW (const Tuple4Tpl< float > &vec) const |
| Get the resulting transformation along the 4th dimension (float version) More... | |
| double | applyW (const Tuple4Tpl< double > &vec) const |
| void | applyRotation (Vector3Tpl< float > &vec) const |
| Applies rotation only to a 3D vector (in place) - float version. More... | |
| void | applyRotation (Vector3Tpl< double > &vec) const |
| Applies rotation only to a 3D vector (in place) - double version. More... | |
| void | applyRotation (float vec[3]) const |
| Applies rotation only to a 3D vector (in place) - float version. More... | |
| void | applyRotation (double vec[3]) const |
| Applies rotation only to a 3D vector (in place) - float version. More... | |
| void | shiftRotationCenter (const Vector3Tpl< T > &vec) |
| Shifts rotation center. More... | |
| void | transpose () |
| Transposes matrix (in place) More... | |
| ccGLMatrixTpl< T > | transposed () const |
| Returns transposed matrix. More... | |
| void | invert () |
| Inverts transformation. More... | |
| ccGLMatrixTpl< T > | inverse () const |
| Returns inverse transformation. More... | |
| void | scale (T coef) |
| Scales the whole matrix. More... | |
| void | scaleLine (unsigned lineIndex, T coef) |
| Scales one line of the matrix. More... | |
| void | scaleRotation (T coef) |
| Scales the rotation part of the matrix. More... | |
| void | scaleRow (unsigned rowIndex, T coef) |
| Scales one row of the matrix. More... | |
| void | scaleColumn (unsigned colIndex, T coef) |
| Scales one column of the matrix. More... | |
| bool | isSerializable () const override |
| Returns whether object is serializable of not. More... | |
| bool | toFile (QFile &out, short dataVersion) const override |
| Saves data to binary stream. More... | |
| short | minimumFileVersion () const override |
| Returns the minimum file version required to save this instance. More... | |
| bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Loads data from binary stream. More... | |
Public Member Functions inherited from ccSerializableObject | |
| virtual | ~ccSerializableObject ()=default |
| Destructor. More... | |
Static Public Member Functions | |
| static ccGLMatrixTpl< T > | FromEigenMatrix (const Eigen::Matrix< double, 4, 4 > &mat) |
| static ccGLMatrixTpl< T > | FromEigenMatrix3 (const Eigen::Matrix< T, 3, 3 > &mat) |
| static Eigen::Matrix< T, 4, 4 > | ToEigenMatrix4 (const ccGLMatrixTpl< float > &mat) |
| static Eigen::Matrix< T, 4, 4 > | ToEigenMatrix4 (const ccGLMatrixTpl< double > &mat) |
| static Eigen::Matrix< T, 3, 3 > | ToEigenMatrix3 (const ccGLMatrixTpl< float > &mat) |
| static Eigen::Matrix< T, 3, 3 > | ToEigenMatrix3 (const ccGLMatrixTpl< double > &mat) |
| static ccGLMatrixTpl | Interpolate (T coef, const ccGLMatrixTpl< T > &glMat1, const ccGLMatrixTpl< T > &glMat2) |
| Interpolates two matrices at relative position 'coef'. More... | |
| static ccGLMatrixTpl< T > | FromToRotation (const Vector3Tpl< T > &from, const Vector3Tpl< T > &to) |
| Creates a transformation matrix that rotates a vector to another. More... | |
| template<class Tq > | |
| static ccGLMatrixTpl< T > | FromQuaternion (const Tq q[]) |
| Converts a quaternion to a rotation matrix. More... | |
| static Eigen::Matrix< T, 3, 3 > | QuaternionToRotationMatrix (const Eigen::Matrix< T, 4, 1 > &qvec) |
| Converts a quaternion to a rotation matrix. More... | |
| static ccGLMatrixTpl< T > | QuaternionToRotationMatrix (const Tuple4Tpl< T > &qvec) |
| Converts a quaternion to a rotation matrix. More... | |
| static Eigen::Matrix< T, 4, 1 > | NormalizeQuaternion (const Eigen::Matrix< T, 4, 1 > &qvec) |
| Converts a quaternion to a rotation matrix. More... | |
| static ccGLMatrixTpl< T > | FromViewDirAndUpDir (const Vector3Tpl< T > &forward, const Vector3Tpl< T > &up) |
| Generates a 'viewing' matrix from a looking vector and a 'up' direction. More... | |
| static ccGLMatrixTpl< T > | FromString (const 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 | |
| T | m_mat [OPENGL_MATRIX_SIZE] |
| Internal 4x4 GL-style matrix data. More... | |
Additional Inherited Members | |
Public Types inherited from ccSerializableObject | |
| enum | DeserializationFlags { DF_POINT_COORDS_64_BITS, DF_SCALAR_VAL_32_BITS = 2 } |
| Deserialization flags (bit-field) More... | |
| typedef QMultiMap< unsigned, unsigned > | LoadedIDMap |
| Map of loaded unique IDs (old ID --> new ID) More... | |
A 4x4 'transformation' matrix (column major order)
Transformation (M) is composed by a rotation (R) and a translation (T): M*X = R*X + T
|
inline |
Copy Function.
|
inline |
|
inline |
|
inline |
|
inline |
Default constructor.
Matrix is set to identity (see toIdentity) by default.
|
inline |
Copy constructor.
|
inlineexplicit |
Constructor from a float GL matrix array.
| mat16f | a 16 elements array (column major order) |
|
inlineexplicit |
Constructor from a double GL matrix array.
| mat16d | a 16 elements array (column major order) |
|
inline |
Constructor from 4 columns (X,Y,Z,T)
| X | 3 first elements of the 1st column (last one is 0) |
| Y | 3 first elements of the 2nd column (last one is 0) |
| Z | 3 first elements of the 3rd column (last one is 0) |
| Tr | 3 first elements of the last column (last one is 1) |
|
inline |
Applies transformation to a 3D vector (in place) - double version.
Input array is directly modified after calling this method
|
inline |
Applies transformation to a 3D vector (in place) - float version.
Input array is directly modified after calling this method
Referenced by ccGLMatrixTpl< float >::apply(), ccFacet::applyGLTransformation(), ccPointCloud::applyRigidTransformation(), DistanceMapGenerationTool::ConvertProfileToMesh(), ccGriddedTools::DetectParameters(), cc2DViewportLabel::drawMeOnly(), ccSphere::drawNameIn3D(), ccClipBox::flagPointsInside(), ccCameraSensor::fromGlobalCoordToLocalCoord(), ccCameraSensor::fromLocalCoordToGlobalCoord(), ccCone::getBottomCenter(), ccCone::getTopCenter(), MainWindow::onItemPicked(), ccOctree::pointPicking(), cc2DLabel::pointPicking(), ccGenericPointCloud::pointPicking(), ccQuadric::projectOnQuadric(), ccGBLSensor::projectPoint(), and PclTools::TransformVtkPoints().
|
inline |
Applies transformation to a 3D vector (in place) - double version.
Input vector is directly modified after calling this method
|
inline |
Applies transformation to a 4D vector (in place) - float version.
Input vector is directly modified after calling this method
|
inline |
Applies transformation to a 3D vector (in place) - double version.
Input vector is directly modified after calling this method
|
inline |
Applies transformation to a 3D vector (in place) - float version.
Input vector is directly modified after calling this method
|
inline |
Applies rotation only to a 3D vector (in place) - float version.
Input array is directly modified after calling this method
|
inline |
Applies rotation only to a 3D vector (in place) - float version.
Input array is directly modified after calling this method
|
inline |
Applies rotation only to a 3D vector (in place) - double version.
Input vector is directly modified after calling this method
|
inline |
Applies rotation only to a 3D vector (in place) - float version.
Input vector is directly modified after calling this method
Referenced by ccFacet::applyGLTransformation(), ccWaveform::applyRigidTransformation(), ccPointCloud::applyRigidTransformation(), ccGBLSensor::applyViewport(), ccCameraSensor::fromImageCoordToGlobalCoord(), ccPlane::getEquation(), ccPlanarEntityInterface::glDrawNormal(), ccGLMatrixTpl< float >::invert(), QVTKWidgetCustom::mouseMoveEvent(), ccClipBox::move3D(), ccOctree::pointPicking(), CommandMatchBestFitPlane::process(), ecvDisplayTools::SetupProjectiveViewport(), ccGLMatrixTpl< float >::shiftRotationCenter(), ccMesh::transformTriNormals(), and QVTKWidgetCustom::updateActivateditems().
|
inline |
Get the resulting transformation along the 4th dimension (double version)
|
inline |
Get the resulting transformation along the 4th dimension (float version)
Referenced by ccGLMatrixTpl< float >::operator*().
|
inline |
Get the resulting transformation along X dimension (double version)
|
inline |
Get the resulting transformation along X dimension (float version)
|
inline |
Get the resulting transformation along X dimension (double version)
|
inline |
Get the resulting transformation along X dimension (float version)
Referenced by ccGLMatrixTpl< float >::operator*().
|
inline |
Get the resulting transformation along Y dimension (double version)
|
inline |
Get the resulting transformation along Y dimension (float version)
|
inline |
Get the resulting transformation along Y dimension (double version)
|
inline |
Get the resulting transformation along Y dimension (float version)
Referenced by ccGLMatrixTpl< float >::operator*().
|
inline |
Get the resulting transformation along Z dimension (double version)
|
inline |
Get the resulting transformation along Z dimension (float version)
|
inline |
Get the resulting transformation along Z dimension (double version)
|
inline |
Get the resulting transformation along Z dimension (float version)
Referenced by ccGLMatrixTpl< float >::operator*().
|
inline |
Clears translation.
Translation is set to (0,0,0).
Referenced by ccGLMatrixTpl< float >::FromEigenMatrix3(), and ecvDisplayTools::SetupProjectiveViewport().
|
inline |
Returns a pointer to internal data.
Referenced by MainWindow::addToDB(), ccGraphicalTransformationTool::apply(), ccPointCloud::applyRigidTransformation(), CorrespondenceMatching::applyTransformation(), TemplateAlignment::applyTransformation(), ccGBLSensor::applyViewport(), NurbsCurveFitting::compute(), FastGlobalRegistrationFilter::compute(), ccEntityAction::computeNormals(), ccCameraSensor::computeProjectionMatrix(), ecvViewportParameters::computeScaleMatrix(), DecodeRotation(), DecodeTransformation(), ccPointPair::drawMeOnly(), cc2DViewportLabel::drawMeOnly(), ccTrace::drawMeOnly(), MatrixDisplayDlg::fillDialogWith(), FromCCLibMatrix(), ccGLMatrixTpl< float >::FromQuaternion(), ccGLMatrixTpl< float >::FromString(), ccGLMatrixTpl< float >::FromViewDirAndUpDir(), ecvGenericDisplayTools::Frustum(), PclFiltersTool::get(), ecvDisplayTools::GetGLCameraParameters(), cvStreamlineFilter::getInteractorTransformation(), cvProbeFilter::getInteractorTransformation(), cvCutFilter::getInteractorTransformation(), BundlerImportDlg::getOptionalTransfoMatrix(), GetPoseInformation(), ecvViewportParameters::getUpDir(), ecvViewportParameters::getViewDir(), Frustum::initfromMPMatrix(), ccCamSensorProjectionDlg::initWithCamSensor(), ccGBLSensorProjectionDlg::initWithGBLSensor(), PTXFilter::loadFile(), PovFilter::loadFile(), FBXFilter::loadFile(), LoadImage(), qSRA::loadProfile(), LoadScan(), cloudViewer::ModelViewerWidget::ModelViewMatrix(), MainWindow::onItemPicked(), ccGLMatrixTpl< float >::operator=(), ecvGenericDisplayTools::Ortho(), ecvGenericDisplayTools::Perspective(), ccCloudLayersHelper::projectCloud(), ecvDisplayTools::RenderText(), SaveImage(), SavePoseInformation(), SaveScan(), PovFilter::saveToFile(), ccPointCloud::scale(), PclUtils::PCLVis::setModelViewMatrix(), TransformInfo::setTransformation(), ccGLMatrixTpl< float >::ToEigenMatrix3(), ccGLMatrixTpl< float >::ToEigenMatrix4(), PCLDisplayTools::transformCameraProjection(), PCLDisplayTools::transformCameraView(), ecvGenericDisplayTools::Unproject(), ccCamSensorProjectionDlg::updateCamSensor(), ecvDisplayTools::UpdateDisplayParameters(), and ccGBLSensorProjectionDlg::updateGBLSensor().
|
inline |
Returns a const pointer to internal data.
|
inlinevirtual |
Loads matrix from an ASCII file.
| filename | input file name |
Reimplemented in ccIndexedTransformation.
Referenced by ccApplyTransformationDlg::loadFromASCIIFile(), and CommandApplyTransformation::process().
|
inlinestatic |
|
inlinestatic |
Referenced by ccGLMatrixTpl< float >::QuaternionToRotationMatrix().
|
inlineoverridevirtual |
Loads data from binary stream.
| in | input file (already opened) |
| dataVersion | file version (for version-specific deserialization) |
| flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
| oldToNewIDMap | map to link old IDs with new IDs |
Note: When implementing, use dataVersion checks to handle differentversions:
Reimplemented from ccSerializableObject.
|
inlinestatic |
Converts a quaternion to a rotation matrix.
| q | quaternion (4 values: w,x,y,z) |
|
inlinestatic |
Converts a 'text' matrix to a ccGLMatrix.
| [in] | matText | matrix text |
| [out] | success | whether input matrix text is valid or not |
|
inlinestatic |
Creates a transformation matrix that rotates a vector to another.
Adapted from "Efficiently Building a Matrix to Rotate One Vector to Another" By Tomas Möller, John Hughes, Journal of Graphics Tools, 4(4):1-4, 1999
| from | normalized non-zero source vector |
| to | normalized non-zero destination vector |
|
inlinestatic |
Generates a 'viewing' matrix from a looking vector and a 'up' direction.
| forward | forward 'view' vector |
| up | up vector |
|
inline |
Returns a pointer to a given column.
| index | column index (between 0 and 3) |
Referenced by CleanMatrix(), qFacets::exportFacets(), ccGLMatrixTpl< float >::getColumnAsVec3D(), Mouse3DInput::GetMatrix(), PTXFilter::loadFile(), PDMSFilter::loadFile(), PcdFilter::loadFile(), PcdFilter::saveToFile(), and ccGLMatrixTpl< float >::scaleColumn().
|
inline |
Returns a const pointer to a given column.
| index | column index (between 0 and 3) |
|
inline |
Returns a copy of a given column as a CCVector3.
4th value is ignored.
| index | column index (between 0 and 3) |
Referenced by ccDBRoot::alignCameraWithEntity(), Mouse3DInput::Apply(), ccCameraSensor::applyViewport(), ccBoundingBoxEditorDlg::fromClipboardClicked(), GetConeProfile(), ccGLMatrixTpl< float >::getTranslationAsVec3D(), ccGLMatrixTpl< float >::invert(), QVTKWidgetCustom::mouseMoveEvent(), ccClipBox::move3D(), ecvDisplayTools::RotateBaseViewMat(), ecvDisplayTools::SetupProjectiveViewport(), and ccClipBox::update().
|
inline |
Returns equivalent parameters: a rotation axis, an angle and a translation
| [out] | alpha_rad | rotation angle in radians (in [0;pi]) |
| [out] | axis3D | unit rotation axis |
| [out] | t3D | translation |
Referenced by ccGraphicalTransformationTool::apply(), MatrixDisplayDlg::fillDialogWith(), ccGLMatrixTpl< float >::Interpolate(), TransformInfo::setTransformation(), ccApplyTransformationDlg::updateAll(), and ccGLMatrixTpl< float >::zRotation().
|
inline |
Returns equivalent parameters: 3 rotation angles and a translation.
See http://en.wikipedia.org/wiki/Euler_angles (Tait-Bryan Z1Y2X3)
| [out] | phi_rad | Phi angle (in radians) |
| [out] | theta_rad | Theta angle (in radians) |
| [out] | psi_rad | Psi angle (in radians) |
| [out] | t3D | translation |
|
inline |
Retruns a pointer to internal translation.
Translation corresponds to the beginning of the third column of the matrix.
Referenced by ccGBLSensor::applyViewport(), ccBox::buildUp(), DistanceMapGenerationTool::ProfileMetaData::computeCloudToProfileOriginTrans(), GetPoseInformation(), ccCamSensorProjectionDlg::initWithCamSensor(), ccGBLSensorProjectionDlg::initWithGBLSensor(), PTXFilter::loadFile(), SavePoseInformation(), PovFilter::saveToFile(), ccGLMatrixTpl< float >::xRotation(), and ccGLMatrixTpl< float >::yRotation().
|
inline |
Retruns a const pointer to internal translation.
Translation corresponds to the beginning of the third column of the matrix.
|
inline |
Returns a copy of the translation as a CCVector3.
Referenced by ccCameraSensor::applyViewport(), CleanMatrix(), ccPlane::drawMeOnly(), qFacets::exportFacets(), ccPropertiesTreeDelegate::fillWithHObject(), ccBoundingBoxEditorDlg::fromClipboardClicked(), ccCameraSensor::fromImageCoordToGlobalCoord(), ccSensor::getActiveAbsoluteCenter(), GetConeProfile(), ccPlane::getEquation(), ccCompassImport::importFoliations(), ccCompass::importFoliations(), qAnimationDlg::init(), PTXFilter::loadFile(), LoadScan(), ecvOrientedBBox::operator*(), ccGBLSensor::projectNormals(), ecvDisplayTools::RotateBaseViewMat(), SaveScan(), PcdFilter::saveToFile(), TransformInfo::setTransformation(), ecvDisplayTools::SetupProjectiveViewport(), and ccPlaneEditDlg::updatePlane().
|
inline |
Inits transformation from a rotation axis, an angle and a translation.
| [in] | alpha_rad | rotation angle (in radians) |
| [in] | axis3D | rotation axis |
| [in] | t3D | translation |
Referenced by ccGraphicalTransformationTool::apply(), Mouse3DInput::Apply(), ccGBLSensor::applyViewport(), ccBox::buildUp(), ccCoordinateSystem::createYZplane(), ccCoordinateSystem::createZXplane(), ccPlane::flip(), ccCompassImport::importFoliations(), ccCompass::importFoliations(), ccGLMatrixTpl< float >::Interpolate(), IcmFilter::LoadCalibratedImages(), QVTKWidgetCustom::mouseMoveEvent(), ccClipBox::move3D(), ccApplyTransformationDlg::onEulerValueChanged(), ccApplyTransformationDlg::onRotAngleValueChanged(), ccPlaneEditDlg::updatePlane(), and ccGLMatrixTpl< float >::zRotation().
|
inline |
Inits transformation from 3 rotation angles and a translation.
See http://en.wikipedia.org/wiki/Euler_angles (Tait-Bryan Z1Y2X3)
| [in] | phi_rad | Phi angle (in radians) |
| [in] | theta_rad | Theta angle (in radians) |
| [in] | psi_rad | Psi angle (in radians) |
| [in] | t3D | translation |
|
inlinestatic |
Interpolates two matrices at relative position 'coef'.
| coef | interpolation position (should be between 0 and 1). |
| glMat1 | 'left' matrix |
| glMat2 | 'right' matrix |
|
inline |
Returns inverse transformation.
Referenced by ccPointPairRegistrationDlg::apply(), Mouse3DInput::Apply(), ccPointPairRegistrationDlg::cancel(), NurbsCurveFitting::compute(), ccEntityAction::computeNormals(), DistanceMapGenerationTool::ConvertProfileToMesh(), ccCropTool::Crop(), ccPolyline::drawMeOnly(), ccClipBox::flagPointsInside(), qAnimationDlg::init(), ccGLMatrixTpl< float >::Interpolate(), PTXFilter::loadFile(), PovFilter::loadFile(), ccClipBox::move3D(), ccOctree::pointPicking(), ccQuadric::projectOnQuadric(), ccPointPairRegistrationDlg::reset(), and SaveScan().
|
inline |
Inverts transformation.
Referenced by ccGBLSensor::applyViewport(), qFacets::exportFacets(), ccApplyTransformationDlg::getTransformation(), ccIndexedTransformation::inverse(), ccGLMatrixTpl< float >::inverse(), and ecvDisplayTools::SetupProjectiveViewport().
|
inlinevirtual |
Returns whether this matrix is equal to identity.
Referenced by ccHObject::minimumFileVersion().
|
inlineoverridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccSerializableObject.
|
inlineoverridevirtual |
Returns the minimum file version required to save this instance.
To be overridden by subclasses to indicate their minimum required version. This enables the system to determine:
Implements ccSerializableObject.
Referenced by ecvViewportParameters::minimumFileVersion(), ccGenericPrimitive::minimumFileVersion_MeOnly(), and ccSensor::minimumFileVersion_MeOnly().
|
inlinestatic |
Converts a quaternion to a rotation matrix.
| q | quaternion (4 values: w,x,y,z) |
Referenced by ccGLMatrixTpl< float >::QuaternionToRotationMatrix().
|
inline |
Returns the value at a given position.
|
inline |
Multiplication by a matrix operator.
|
inline |
Multiplication by a 4D vector operator (double version)
|
inline |
Multiplication by a 4D vector operator (float version)
|
inline |
Multiplication by a vector operator (double version)
|
inline |
Multiplication by a vector operator (float version)
|
inline |
(in place) Multiplication operator
|
inline |
(in place) Addition operator
|
inline |
(in place) Forward translation operator (double version)
|
inline |
(in place) Forward translation operator (float version)
|
inline |
(in place) Difference operator
|
inline |
(in place) Backward translation operator (double version)
|
inline |
(in place) Backward translation operator (float version)
|
inline |
Copy assignment operator.
|
inline |
|
inline |
|
inline |
|
inline |
Assignment Function.
|
inlinestatic |
Converts a quaternion to a rotation matrix.
| q | quaternion (4 values: w,x,y,z) |
|
inlinestatic |
Converts a quaternion to a rotation matrix.
| q | quaternion (4 values: w,x,y,z) |
|
inline |
Scales the whole matrix.
| coef | scaling coef. |
|
inline |
Scales one column of the matrix.
| colIndex | (0-3) |
| coef | scaling coef. |
|
inline |
Scales one line of the matrix.
| lineIndex | (0-3) |
| coef | scaling coef. |
|
inline |
Scales the rotation part of the matrix.
| coef | scaling coef. |
|
inline |
Scales one row of the matrix.
| rowIndex | tow index (0-3) |
| coef | scaling coef. |
|
inline |
Sets the content of a given column.
| index | column index (between 0 and 3) |
| v | new column values |
|
inline |
Sets the content of a given column.
| index | column index (between 0 and 3) |
| v | new column values |
Referenced by ccBoundingBoxEditorDlg::toClipboardClicked().
|
inline |
Sets Rotation from a double array.
| Rt | Rotation matrix as a double array |
|
inline |
Sets Rotation from a float array.
| Rt | Rotation matrix as a float array |
Referenced by ccGLMatrixTpl< float >::FromEigenMatrix3(), ecvDisplayTools::GetGLCameraParameters(), ccGLMatrixTpl< float >::operator=(), ccMesh::Rotate(), ccPointCloud::Rotate(), and ecvDisplayTools::UpdateDisplayParameters().
|
inline |
Sets translation from a double array.
| Tr | 3D vector as a double array |
|
inline |
Sets translation from a float array.
| Tr | 3D vector as a float array |
|
inline |
Sets translation (double version)
| Tr | 3D vector |
|
inline |
Sets translation (float version)
| Tr | 3D vector |
Referenced by ccPointPairRegistrationDlg::addAlignedPoint(), ccPointPairRegistrationDlg::addReferencePoint(), MainWindow::addToDB(), ccDBRoot::alignCameraWithEntity(), ccGraphicalTransformationTool::apply(), ccGBLSensor::applyViewport(), DistanceMapGenerationTool::ProfileMetaData::computeCloudToSurfaceOriginTrans(), ecvViewportParameters::computeViewMatrix(), ecvPrimitiveFactoryDlg::createPrimitive(), ccCoordinateSystem::createXYplane(), ccCompass::estimateStrain(), qFacets::exportFacets(), FromCCLibMatrix(), ccSensor::getActiveAbsoluteRotation(), ccCompassImport::importFoliations(), ccCompass::importFoliations(), ccApplyTransformationDlg::initFromDipAndDipDir(), PTXFilter::loadFile(), PovFilter::loadFile(), PDMSFilter::loadFile(), PcdFilter::loadFile(), CSVMatrixFilter::loadFile(), qSRA::loadProfile(), LoadScan(), ccClipBox::move2D(), ccClipBox::move3D(), MainWindow::onItemPicked(), ccInnerRect2DFinder::process(), CommandMatchBestFitPlane::process(), SaveScan(), ccPointCloud::scale(), ccBoundingBoxEditorDlg::toClipboardClicked(), qCanupo2DViewDialog::trainClassifier(), ccPointCloud::Translate(), DistanceMapGenerationDlg::update(), ccCamSensorProjectionDlg::updateCamSensor(), ccGBLSensorProjectionDlg::updateGBLSensor(), ccPlaneEditDlg::updatePlane(), ccGLMatrixTpl< float >::xRotation(), and ccGLMatrixTpl< float >::yRotation().
|
inline |
Shifts rotation center.
Warning, this method only applies a shift (i.e. relatively to the current rotation center). This is not a way to set an absolute rotation center 'directly'.
Referenced by FromCCLibMatrix(), ccMesh::Rotate(), and ccPointCloud::Rotate().
|
inline |
Returns equivalent parameters: a rotation axis and an angle.
| [out] | alpha_rad | rotation angle in radians (in [0;pi]) |
| [out] | axis3D | unit rotation axis |
|
inlinevirtual |
Saves matrix to an ASCII file.
| filename | output file name |
| precision | output digits precision |
Reimplemented in ccIndexedTransformation.
Referenced by MatrixDisplayDlg::exportToASCII().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Returns equivalent parameters: 3 rotation angles.
yaw(rz) pitch(ry) roll(rx)
| [out] | rz | angle (in radians) |
| [out] | ry | angle (in radians) |
| [out] | rx | angle (in radians) |
Referenced by TransformInfo::setTransformation().
|
inlineoverridevirtual |
Saves data to binary stream.
| out | output file (already opened) |
| dataVersion | target file version (for forward/backward compatibility) |
Reimplemented from ccSerializableObject.
|
inlinevirtual |
Sets matrix to identity.
Referenced by MainWindow::addToDB(), ccGenericPrimitive::applyTransformationToVertices(), ccGLMatrixTpl< float >::ccGLMatrixTpl(), ccHObject::ccHObject(), ccSensor::ccSensor(), ecvViewportParameters::computeScaleMatrix(), ecvViewportParameters::computeViewMatrix(), ecvPrimitiveFactoryDlg::createPrimitive(), ccCoordinateSystem::createXYplane(), ecvViewportParameters::ecvViewportParameters(), qFacets::exportFacets(), ccClipBox::get(), ccHObject::getAbsoluteGLTransformation(), ccSensor::getAbsoluteTransformation(), ccHObject::getOwnFitBB(), ccPointCloud::Grid::Grid(), PovFilter::loadFile(), BundlerFilter::loadFileExtended(), ecvGenericDisplayTools::Ortho(), ccPointPairRegistrationDlg::reset(), ccDrawableObject::resetGLTransformation(), ccGLMatrixTpl< float >::xRotation(), and ccGLMatrixTpl< float >::yRotation().
|
inline |
Converts to a quaternion from a rotation matrix.
| q | quaternion (4 values: w,x,y,z) |
|
inline |
Returns matrix as a string.
| precision | numerical precision |
| separator | separator |
Referenced by ccGraphicalTransformationTool::apply(), ccPointPairRegistrationDlg::apply(), TemplateAlignment::applyTransformation(), FastGlobalRegistrationFilter::compute(), JsonRPCPlugin::execute(), MatrixDisplayDlg::exportToClipboard(), MatrixDisplayDlg::fillDialogWith(), ccApplyTransformationDlg::loadFromASCIIFile(), LoadScan(), CommandApplyTransformation::process(), CommandMatchBestFitPlane::process(), CommandICP::process(), ccBoundingBoxEditorDlg::toClipboardClicked(), ccApplyTransformationDlg::updateAll(), and ccPlaneEditDlg::updatePlane().
|
inlinevirtual |
Clears matrix.
Matrix is set to 0.
Referenced by MatrixDisplayDlg::clear(), ccCameraSensor::computeProjectionMatrix(), BundlerImportDlg::getOptionalTransfoMatrix(), and ccGLMatrixTpl< float >::toIdentity().
|
inline |
Transposes matrix (in place)
Referenced by DecodeRotation(), DecodeTransformation(), ccIndexedTransformation::transposed(), and ccGLMatrixTpl< float >::transposed().
|
inline |
Returns transposed matrix.
Referenced by ccGraphicalTransformationTool::apply(), QVTKWidgetCustom::mouseMoveEvent(), and QVTKWidgetCustom::updateActivateditems().
|
inline |
Returns the rotation component around X only.
|
inline |
Returns the rotation component around Y only.
|
inline |
Returns the rotation component around Z only.
|
protected |
Internal 4x4 GL-style matrix data.
Referenced by ccGLMatrixTpl< float >::ccGLMatrixTpl(), ccGLMatrixTpl< float >::data(), ccGLMatrixTpl< float >::fromAsciiFile(), ccGLMatrixTpl< float >::getColumn(), ccGLMatrixTpl< float >::getTranslation(), ccGLMatrixTpl< float >::invert(), ccGLMatrixTpl< float >::isIdentity(), ccGLMatrixTpl< float >::operator()(), ccGLMatrixTpl< float >::operator*(), ccGLMatrixTpl< float >::operator+=(), ccGLMatrixTpl< float >::operator-=(), ccGLMatrixTpl< float >::operator=(), ccGLMatrixTpl< float >::scaleLine(), ccGLMatrixTpl< float >::scaleRow(), ccGLMatrixTpl< float >::setColumn(), ccGLMatrixTpl< float >::toAsciiFile(), ccGLMatrixTpl< float >::toString(), and ccGLMatrixTpl< float >::toZero().