ViSP  2.9.0
vpHomogeneousMatrix.h
1 /****************************************************************************
2  *
3  * $Id: vpHomogeneousMatrix.h 4574 2014-01-09 08:48:51Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Homogeneous matrix.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 
43 
50 #ifndef VPHOMOGENEOUSMATRIX_HH
51 #define VPHOMOGENEOUSMATRIX_HH
52 
53 class vpPoseVector;
54 class vpMatrix;
55 class vpRotationMatrix;
56 class vpPoseVector;
57 class vpThetaUVector;
58 
59 #include <visp/vpMatrix.h>
60 
61 #include <visp/vpRotationMatrix.h>
62 #include <visp/vpThetaUVector.h>
63 #include <visp/vpTranslationVector.h>
64 #include <visp/vpPoseVector.h>
65 
66 #include <fstream>
67 
68 class vpMatrix;
69 class vpRotationMatrix;
70 class vpPoseVector;
71 class vpThetaUVector;
72 class vpQuaternionVector;
73 
102 class VISP_EXPORT vpHomogeneousMatrix : public vpMatrix
103 {
104  public:
119  vpHomogeneousMatrix(const vpPoseVector &p) ;
120 
122  vpHomogeneousMatrix(const double tx, const double ty, const double tz,
123  const double tux, const double tuy, const double tuz) ;
124 
126  void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R) ;
128  void buildFrom(const vpTranslationVector &t, const vpThetaUVector &tu) ;
130  void buildFrom(const vpTranslationVector &t, const vpQuaternionVector& q ) ;
131 
136  void buildFrom(const vpPoseVector &p) ;
137 
139  void buildFrom(const double tx,const double ty, const double tz,
140  const double tux,const double tuy, const double tuz ) ;
141 
144 
147 
150 
151  // Invert the homogeneous matrix.
152  vpHomogeneousMatrix inverse() const ;
153  // Invert the homogeneous matrix.
154  void inverse(vpHomogeneousMatrix &Mi) const;
155 
156  // Test if the rotational part of the matrix is a rotation matrix.
157  bool isAnHomogeneousMatrix() const ;
158 
159  void insert(const vpRotationMatrix &R) ;
160  void insert(const vpThetaUVector &tu) ;
161  void insert(const vpTranslationVector &t) ;
162  void insert(const vpQuaternionVector &t) ;
163 
164  void extract( vpRotationMatrix &R) const;
165  void extract(vpTranslationVector &t) const;
166  void extract(vpThetaUVector &tu) const;
167  void extract(vpQuaternionVector& q) const;
168 
169  // Load an homogeneous matrix from a file
170  void load(std::ifstream &f) ;
171  // Save an homogeneous matrix in a file
172  void save(std::ofstream &f) const ;
173 
174  // Set to identity
175  void eye();
177  void init() ;
178  // Basic initialisation (identity).
179  void setIdentity() ;
180 
182  void print() ;
183 
184 } ;
185 
186 #endif
187 
188 /*
189  * Local variables:
190  * c-basic-offset: 2
191  * End:
192  */
Definition of the vpMatrix class.
Definition: vpMatrix.h:98
void init()
Initialization of the object matrix.
Definition: vpMatrix.cpp:98
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
int print(std::ostream &s, unsigned int length, char const *intro=0)
Definition: vpMatrix.cpp:2668
The vpRotationMatrix considers the particular case of a rotation matrix.
void insert(const vpMatrix &A, const unsigned int r, const unsigned int c)
Definition: vpMatrix.cpp:3022
void setIdentity(const double &val=1.0)
Definition: vpMatrix.cpp:1159
vpMatrix & operator=(const vpMatrix &B)
Copy operator. Allow operation such as A = B.
Definition: vpMatrix.cpp:325
Defines a quaternion and its basic operations.
void eye(unsigned int n)
Definition: vpMatrix.cpp:1181
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
The pose is a complete representation of every rigid motion in the euclidian space.
Definition: vpPoseVector.h:92
vpMatrix operator*(const vpMatrix &B) const
Definition: vpMatrix.cpp:463
Class that consider the case of a translation vector.
Class that consider the case of the parameterization for the rotation.