Quaternion.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <boost/shared_ptr.hpp>
21 #include <Eigen/Geometry>
22 #include "Serializable.hpp"
23 
24 namespace ISM {
25 class Quaternion : public Serializable {
26 public:
27  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
28 
29  //Using a public eigen datastructure to avoid the need to convert it to other structure to do any math.
30  Eigen::Quaternion<double> eigen;
31 
32  Quaternion() : eigen(1.0, 0.0, 0.0, 0.0) { }
33  Quaternion(double w, double x, double y, double z) : eigen(w, x, y, z) { }
34  Quaternion(Eigen::Quaternion<double> q) : eigen(q) { }
35 
36  virtual void serialize(std::ostream& strm) const;
37  Eigen::Quaternion<double> getEigen();
38 };
39 typedef boost::shared_ptr<Quaternion> QuaternionPtr;
40 
41 bool operator==(const QuaternionPtr& q1, const QuaternionPtr& q2);
42 bool operator==(const Quaternion& q1, const Quaternion& q2);
43 
44 std::ostream& operator<<(std::ostream &strm, const ISM::Quaternion &q);
45 std::ostream& operator<<(std::ostream &strm, const ISM::QuaternionPtr &q);
46 }
boost::shared_ptr< Quaternion > QuaternionPtr
Definition: Quaternion.hpp:39
virtual void serialize(std::ostream &strm) const
Definition: Quaternion.cpp:31
Quaternion(double w, double x, double y, double z)
Definition: Quaternion.hpp:33
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Quaternion< double > eigen
Definition: Quaternion.hpp:30
Quaternion(Eigen::Quaternion< double > q)
Definition: Quaternion.hpp:34
std::ostream & operator<<(std::ostream &strm, const ISM::ObjectRelation &r)
bool operator==(const PointPtr &p1, const PointPtr &p2)
Definition: Point.cpp:39
this namespace contains all generally usable classes.
Eigen::Quaternion< double > getEigen()
Definition: Quaternion.cpp:62


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40