Helios++
Helios software for LiDAR simulations
RigidMotion.h
1 #pragma once
2 
3 #include <armadillo>
4 #include <boost/serialization/serialization.hpp>
5 
6 using namespace arma;
7 
8 namespace rigidmotion{
9 
50 private:
51  // *** SERIALIZATION *** //
52  // *********************** //
53  friend class boost::serialization::access;
60  template <typename Archive>
61  void serialize(Archive &ar, const unsigned int version){
62  ar &C;
63  ar &A;
64  }
65 protected:
66  // *** ATTRIBUTES *** //
67  // ******************** //
71  colvec C;
75  arma::mat A;
76 
77 public:
78  // *** TYPE ENUMS *** //
79  // ******************** //
97  enum SuperType{
98  R2_BASE, R2_REFLECTION, R2_ROTATION,
99  R3_BASE, R3_REFLECTION, R3_ROTATION, R3_ROTATIONAL_SYMMETRY
100  };
115  enum Type{
116  IDENTITY_R2, TRANSLATION_R2, REFLECTION_R2, GLIDE_REFLECTION_R2,
117  ROTATION_R2,
118  IDENTITY_R3, TRANSLATION_R3, REFLECTION_R3, GLIDE_REFLECTION_R3,
119  ROTATION_R3, HELICAL_R3, ROTATIONAL_SYMMETRY_R3
120  };
121  // *** CONSTRUCTION / DESTRUCTION *** //
122  // ************************************ //
129  RigidMotion() = default;
138  RigidMotion(colvec const &C, arma::mat const &A) : C(C), A(A) {};
139  virtual ~RigidMotion() = default;
140 
141  // *** RIGID MOTION METHODS *** //
142  // ****************************** //
150  virtual RigidMotion compose(RigidMotion const rm) const;
156  virtual void composeInPlace(RigidMotion const rm);
162  virtual SuperType findSuperType() const;
174  virtual bool hasFixedPoints() const;
180  virtual Type findType() const;
200  virtual size_t findInvariantDimensionality() const;
201 
202  // *** GETTERS and SETTERS *** //
203  // ***************************** //
208  inline colvec getC() const {return C;}
213  inline void setC(colvec const C) {this->C = C;}
218  inline arma::mat getA() const {return A;}
223  inline void setA(arma::mat const A) {this->A = A;}
228  inline size_t getDimensionality() const {return this->A.n_rows;}
229 
230 };
231 
232 }
Interface that must be implemented by any class which represents a specific rigid motions.
Definition: RigidMotion.h:49
colvec getC() const
Get the translation column vector.
Definition: RigidMotion.h:208
SuperType
Rigid motions supertypes. It is, the classification of a rigid motion attending to its fixed origin t...
Definition: RigidMotion.h:97
size_t getDimensionality() const
Get the dimensionality of the rigid motion.
Definition: RigidMotion.h:228
void serialize(Archive &ar, const unsigned int version)
Serialize a rigid motion to a stream of bytes.
Definition: RigidMotion.h:61
Type
Rigid motions types. It is, the classification of a rigid motion attending to its associated isometry...
Definition: RigidMotion.h:115
colvec C
The column vector representing the translation.
Definition: RigidMotion.h:71
RigidMotion(colvec const &C, arma::mat const &A)
Build a rigid motion with given translation vector and fixed origin transformation matrix.
Definition: RigidMotion.h:138
RigidMotion()=default
RigidMotion default constructor. Notice rigid motions should be instantiated through corresponding fa...
arma::mat getA() const
Get the fixed origin transformation matrix.
Definition: RigidMotion.h:218
arma::mat A
The matrix representing the fixed origin transformation.
Definition: RigidMotion.h:75
void setA(arma::mat const A)
Set the fixed origin transformation matrix.
Definition: RigidMotion.h:223
void setC(colvec const C)
Set the translation column vector.
Definition: RigidMotion.h:213