My Project
Pose.h
Go to the documentation of this file.
1 /*
2  * This file is part of ALVAR, A Library for Virtual and Augmented Reality.
3  *
4  * Copyright 2007-2012 VTT Technical Research Centre of Finland
5  *
6  * Contact: VTT Augmented Reality Team <alvar.info@vtt.fi>
7  * <http://www.vtt.fi/multimedia/alvar.html>
8  *
9  * ALVAR is free software; you can redistribute it and/or modify it under the
10  * terms of the GNU Lesser General Public License as published by the Free
11  * Software Foundation; either version 2.1 of the License, or (at your option)
12  * any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
17  * for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with ALVAR; if not, see
21  * <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>.
22  */
23 
24 #ifndef POSE_H
25 #define POSE_H
26 
27 #include "Alvar.h"
28 #include "Rotation.h"
29 
30 #include <opencv2/opencv.hpp>
31 
38 namespace alvar {
39 
52 class ALVAR_EXPORT Pose : public Rotation
53 {
54 protected:
55  // Note, although we are using homogeneous coordinates x, y, z, w -- w is now mostly ignored
56 public:
57  double translation[4];
58  cv::Mat translation_mat;
59 
61  void Output() const;
63  Pose();
69  Pose(const cv::Mat &tra, const cv::Mat &rot, RotationType t);
73  Pose(const cv::Mat &mat);
75  Pose(const Pose &p);
77  void Reset();
81  void SetMatrix(const cv::Mat &mat);
86  void SetMatrixGL(double gl[16], bool mirror = true);
90  void GetMatrix(cv::Mat &mat) const;
95  void GetMatrixGL(double gl[16], bool mirror = true);
97  void Transpose();
99  void Invert();
105  void Mirror(bool x, bool y, bool z);
109  void SetTranslation(const cv::Mat &tra);
113  void SetTranslation(const double *tra);
115  void SetTranslation(const double x, const double y, const double z);
119  void GetTranslation(cv::Mat &tra) const;
121  Pose &operator=(const Pose &p);
122 };
123 
124 } // namespace alvar
125 
126 #endif
This file defines library export definitions, version numbers and build information.
This file implements a parametrized rotation.
Pose representation derived from the Rotation class
Definition: Pose.h:53
void Transpose()
Pose & operator=(const Pose &p)
Pose(const cv::Mat &tra, const cv::Mat &rot, RotationType t)
void SetTranslation(const cv::Mat &tra)
void Reset()
void GetMatrixGL(double gl[16], bool mirror=true)
Get the transformation matrix representation of the Pose using OpenGL's transposed format....
Pose(const cv::Mat &mat)
void SetMatrixGL(double gl[16], bool mirror=true)
Set the Pose using OpenGL's transposed format. Note, that by default this also mirrors both the y- an...
void SetTranslation(const double *tra)
void Output() const
void SetMatrix(const cv::Mat &mat)
void GetTranslation(cv::Mat &tra) const
void GetMatrix(cv::Mat &mat) const
void Mirror(bool x, bool y, bool z)
void SetTranslation(const double x, const double y, const double z)
void Invert()
Pose(const Pose &p)
Rotation structure and transformations between different parameterizations.
Definition: Rotation.h:45
RotationType
Rotation can be represented in four ways: quaternion (QUAT), matrix (MAT), euler angles (EUL) and exp...
Definition: Rotation.h:54
Main ALVAR namespace.
Definition: Alvar.h:174