Helios++
Helios software for LiDAR simulations
DynMotion Class Reference

Class which wraps the RigidMotion class to implement extra features such as the self mode control mechanism and computation of normal counterparts. More...

#include <DynMotion.h>

Inheritance diagram for DynMotion:
Collaboration diagram for DynMotion:

Public Member Functions

 DynMotion (RigidMotion const &rm, bool selfMode=false)
 Dynamic motion construction from a rigid motion as basis. More...
 
 DynMotion (colvec const &C, arma::mat const &A)
 Dynamic motion construction from given translation column vector and fixed origin transformation matrix. More...
 
virtual bool checkModifiesNormal () const
 Check whether dynamic motion modifies normals when applied (true) or not (false). More...
 
virtual DynMotion makeNormalCounterpart () const
 Make the normal counterpart for the dynamic motion. More...
 
virtual shared_ptr< DynMotionmakeNormalCounterpartPtr () const
 Like makeNormalCounterpart method but returning a shared pointer instead of the raw object. More...
 
bool isSelfMode () const
 Check if self mode is enabled for the dynamic motion (true) or not (false) More...
 
void setSelfMode (bool const selfMode)
 Enable or disable self mode. More...
 
bool isNormalMode () const
 Check if normal mode is enabled for the dynamic motion (true) or not (false) More...
 
void setNormalMode (bool const normalMode)
 Enable or disable normal mode. More...
 
- Public Member Functions inherited from rigidmotion::RigidMotion
 RigidMotion ()=default
 RigidMotion default constructor. Notice rigid motions should be instantiated through corresponding factories. More...
 
 RigidMotion (colvec const &C, arma::mat const &A)
 Build a rigid motion with given translation vector and fixed origin transformation matrix. More...
 
virtual RigidMotion compose (RigidMotion const rm) const
 Compose this rigid motion \(f\) with given rigid motion \(g\) so \(f \circ g = f(g(x))\) is obtained. More...
 
virtual void composeInPlace (RigidMotion const rm)
 Like compose method but updating this rigid motion instead of returning a new one. More...
 
virtual SuperType findSuperType () const
 Obtain the supertype of the rigid motion. More...
 
virtual bool hasFixedPoints () const
 Check if rigid motion has fixed points. More...
 
virtual Type findType () const
 Obtain the type of the rigid motion. More...
 
virtual size_t findInvariantDimensionality () const
 Obtain the dimensionality of the associated invariant which can be either the set of fixed points or the associated invariant variety if there are no fixed points. More...
 
colvec getC () const
 Get the translation column vector. More...
 
void setC (colvec const C)
 Set the translation column vector. More...
 
arma::mat getA () const
 Get the fixed origin transformation matrix. More...
 
void setA (arma::mat const A)
 Set the fixed origin transformation matrix. More...
 
size_t getDimensionality () const
 Get the dimensionality of the rigid motion. More...
 

Protected Attributes

bool selfMode = false
 Specify if the self mode is enabled for this dynamic motion (true) or not (false). More...
 
bool normalMode = false
 Specify if the normal mode is enabled for thid dynamic motion (true) or not (false). More...
 
- Protected Attributes inherited from rigidmotion::RigidMotion
colvec C
 The column vector representing the translation.
 
arma::mat A
 The matrix representing the fixed origin transformation.
 

Private Member Functions

template<typename Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize a dynamic motion to a stream of bytes. More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Types inherited from rigidmotion::RigidMotion
enum  SuperType {
  R2_BASE , R2_REFLECTION , R2_ROTATION , R3_BASE ,
  R3_REFLECTION , R3_ROTATION , R3_ROTATIONAL_SYMMETRY
}
 Rigid motions supertypes. It is, the classification of a rigid motion attending to its fixed origin transformation matrix \(A\) only. More...
 
enum  Type {
  IDENTITY_R2 , TRANSLATION_R2 , REFLECTION_R2 , GLIDE_REFLECTION_R2 ,
  ROTATION_R2 , IDENTITY_R3 , TRANSLATION_R3 , REFLECTION_R3 ,
  GLIDE_REFLECTION_R3 , ROTATION_R3 , HELICAL_R3 , ROTATIONAL_SYMMETRY_R3
}
 Rigid motions types. It is, the classification of a rigid motion attending to its associated isometry and fixed points. More...
 

Detailed Description

Class which wraps the RigidMotion class to implement extra features such as the self mode control mechanism and computation of normal counterparts.

Author
Alberto M. Esmoris Pena
Version
1.0
See also
rigidmotion::RigidMotion
DynMotion::selfMode
DynMotion::makeNormalCounterpart

Constructor & Destructor Documentation

◆ DynMotion() [1/2]

DynMotion::DynMotion ( RigidMotion const &  rm,
bool  selfMode = false 
)
inline

Dynamic motion construction from a rigid motion as basis.

Parameters
rmRigid motion as basis for the dynamic motion
selfModeSpecify the initial value for self mode
See also
rigidmotion::RigidMotion
DynMotion::selfMode

◆ DynMotion() [2/2]

DynMotion::DynMotion ( colvec const &  C,
arma::mat const &  A 
)
inline

Dynamic motion construction from given translation column vector and fixed origin transformation matrix.

Parameters
CColumn vector representing the translation
AMatrix representing the fixed origin transformation
See also
rigidmotion::RigidMotion::RigidMotion(colvec const, mat const)

Member Function Documentation

◆ checkModifiesNormal()

bool DynMotion::checkModifiesNormal ( ) const
virtual

Check whether dynamic motion modifies normals when applied (true) or not (false).

Returns
True if applying the dynamic motion modifies normals, false otherwise

◆ isNormalMode()

bool DynMotion::isNormalMode ( ) const
inline

Check if normal mode is enabled for the dynamic motion (true) or not (false)

Returns
True if normal mode is enabled, false otherwise
See also
DynMotion::normalMode
DynMotion::setNormalMode

◆ isSelfMode()

bool DynMotion::isSelfMode ( ) const
inline

Check if self mode is enabled for the dynamic motion (true) or not (false)

Returns
True if self mode is enabled, false otherwise
See also
DynMotion::selfMode
DynMotion::setSelfMode

◆ makeNormalCounterpart()

DynMotion DynMotion::makeNormalCounterpart ( ) const
virtual

Make the normal counterpart for the dynamic motion.

It is, a version which preserves the fixed origin transformation but that does not change the position. It is mean to be used mainly to transform normals which must not change its position since they are normal unitary vectors defining direction only. Thus, when applying for instance a helical motion, the position of the dynamic object should be fully transformed but its normals must only be rotated with no transposition. Applying the normal counterpart of the helical motion with object normals guarantees this.

More formally, let \(f(X)\) be the affine application defining the base rigid motion at the core of the dynamic motion:

\[ f(X) = C + AX \]

Its normal counterpart namely \(g(X)\) would be:

\[ g(X) = \vec{0} + AX \]

Also, dynamic motions which are normal counterparts have normal mode enabled by default and self mode inherited from source dynamic motion.

Returns
Normal counterpart for the dynamic motion
See also
rigidmotion::RigidMotion
DynMotion::makeNormalCounterpartPtr
DynMotion::normalMode

◆ makeNormalCounterpartPtr()

virtual shared_ptr<DynMotion> DynMotion::makeNormalCounterpartPtr ( ) const
inlinevirtual

Like makeNormalCounterpart method but returning a shared pointer instead of the raw object.

See also
DynMotion::makeNormalCounterpart

◆ serialize()

template<typename Archive >
void DynMotion::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Serialize a dynamic motion to a stream of bytes.

Template Parameters
ArchiveType of rendering
Parameters
arSpecific rendering for the stream of bytes
versionVersion number for the dynamic motion

◆ setNormalMode()

void DynMotion::setNormalMode ( bool const  normalMode)
inline

Enable or disable normal mode.

Parameters
normalModeTrue to enable normal mode, false to disable it
See also
DynMotion::normalMode
DynMotion::isNormalMode

◆ setSelfMode()

void DynMotion::setSelfMode ( bool const  selfMode)
inline

Enable or disable self mode.

Parameters
selfModeTrue to enable self mode, false to disable it
See also
DynMotion::selfMode
DynMotion::isSelfMode

Member Data Documentation

◆ normalMode

bool DynMotion::normalMode = false
protected

Specify if the normal mode is enabled for thid dynamic motion (true) or not (false).

The normal mode specifies that a dynamic motion is mean to be applied to normals and not points. Generally speaking, enabling normal mode implies ignoring self mode for most cases, even if it is enabled.

See also
DynMotion::isNormalMode
DynMotion::setNormalMode
DynMotion::selfMode
DynMotionEngine::apply(DynMotion const &, mat const &, DynObject &)

◆ selfMode

bool DynMotion::selfMode = false
protected

Specify if the self mode is enabled for this dynamic motion (true) or not (false).

The self mode flag specifies that a dynamic motion should be applied to an object centered in the origin

See also
DynMotion::isSelfMode
DynMotion::setSelfMode
DynMotion::normalMode
DynMotionEngine::apply(DynMotion const &, mat const &, DynObject &)

The documentation for this class was generated from the following files: