Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Member Functions | Static Public Member Functions | List of all members
geomtools::placement Class Reference

The placement for a geometry volume with its translation and rotation with respect to some mother reference frame. More...

#include <bayeux/geomtools/placement.h>

Inheritance diagram for geomtools::placement:
geomtools::i_placement datatools::i_serializable datatools::i_tree_dumpable

Classes

class  builder
 Construct a placement. More...
 

Public Member Functions

bool is_valid () const
 Check validity. More...
 
void invalidate ()
 Invalidate. More...
 
const vector_3dget_translation () const
 Return the translation. More...
 
vector_3dgrab_translation ()
 Return the mutable translation. More...
 
void set_translation (double, double, double)
 Set the translation from a (x,y,z) coordinate triplet. More...
 
void set_translation_xyz (double, double, double)
 Set the translation from a (x,y,z) coordinate triplet. More...
 
void set_translation (const vector_3d &)
 Set the translation. More...
 
void set_translation_v (const vector_3d &)
 Set the translation. More...
 
void translate (const vector_3d &)
 Translate the current translation by some shift. More...
 
void translate (double dx_, double dy_, double dz_)
 Translate the current translation by some shift. More...
 
bool is_simple_rotation () const
 Check if the orientation is defined as a simple rotation (X, Y or Z axis) More...
 
bool is_rotation_x () const
 Check if the orientation is defined as a X axis rotation. More...
 
bool is_rotation_y () const
 Check if the orientation is defined as a Y axis rotation. More...
 
bool is_rotation_z () const
 Check if the orientation is defined as a Z axis rotation. More...
 
int get_rotation_axis () const
 Return rotation axis. More...
 
double get_rotation_angle () const
 Return rotation angle. More...
 
bool is_zyz_rotation () const
 Check if the orientation is defined through ZYZ Euler angles. More...
 
double get_phi () const
 Return phi Euler angle. More...
 
double get_theta () const
 Return theta Euler angle. More...
 
double get_delta () const
 Return delta Euler angle. More...
 
bool has_angles () const
 Chec if Euler angles are defined. More...
 
const rotation_3dget_rotation () const
 Return the rotation matrix. More...
 
const rotation_3dget_inverse_rotation () const
 Return the inverse rotation matrix. More...
 
virtual size_t get_dimension () const
 Return the dimension of the(multi-)placement object. More...
 
virtual size_t get_number_of_items () const
 Return the number of placement entries associated to this placement object. More...
 
virtual void get_placement (int item_, placement &p_) const
 Compute the placement at given index. More...
 
virtual bool is_replica () const
 Check if placement is a replica. More...
 
virtual bool has_only_one_rotation () const
 Check if the (multi-)placement has only one rotation for all its placement objects. More...
 
virtual size_t compute_index_map (std::vector< uint32_t > &map_, int item_) const
 Compute the list of multi-dimension multiplet for placement at given index. More...
 
bool is_identity () const
 Check if the placement is identity. More...
 
void set_identity ()
 Set identity. More...
 
void set_orientation (int axis_, double angle_)
 Set orientation by axis and angle. More...
 
void set_orientation_axis_angle (int axis_, double angle_)
 Set orientation by axis and angle. More...
 
void set_orientation (double phi_, double theta_, double delta_)
 Set orientation by ZYZ Euler angles. More...
 
void set_orientation_zyz (double phi_, double theta_, double delta_)
 Set orientation by ZYZ Euler angles. More...
 
void set_orientation (double angle0_, double angle1_, double angle2_, euler_angles_type euler_angle_)
 Set orientation by arbitrary Euler angles. More...
 
void set (double x_, double y_, double z_, double phi_, double theta_, double delta_)
 Set translation by (x,y,z) coordinate triplet and orientation by ZYZ Euler angles. More...
 
void set (double x_, double y_, double z_, double angle0_, double angle1_, double angle2_, euler_angles_type euler_angle_)
 Set translation by (x,y,z) coordinate triplet and orientation by Euler angles. More...
 
void set (double x_, double y_, double z_, int axis_, double angle_)
 Set translation by (x,y,z) coordinate triplet and orientation by axis and angle. More...
 
void set (const vector_3d &t_, double phi_, double theta_, double delta_)
 Set translation by position and orientation ZYZ Euler angles. More...
 
void set (const vector_3d &t_, double angle0_, double angle1_, double angle2_, euler_angles_type euler_angle_)
 Set translation by position and orientation by Euler angles. More...
 
void set (const vector_3d &t_, int axis_, double angle_)
 Set translation by position and orientation by axis and angle. More...
 
void set_orientation (const rotation_3d &)
 Set the rotation (not recommended at all) More...
 
void set_orientation_xyz (double phi_, double theta_, double delta_)
 Set the rotation using XYZ Euler angles (experimental) More...
 
 placement ()
 Constructor. More...
 
 placement (const vector_3d &translation_)
 Constructor. More...
 
 placement (double x_, double y_, double z_)
 Constructor. More...
 
 placement (const vector_3d &translation_, double phi_, double theta_, double delta_)
 Constructor. More...
 
 placement (const vector_3d &translation_, int axis_, double angle_)
 Constructor. More...
 
 placement (double x_, double y_, double z_, double phi_, double theta_, double delta_)
 Constructor. More...
 
 placement (double x_, double y_, double z_, double angle0_, double angle1_, double angle2_, euler_angles_type euler_angles_)
 Constructor. More...
 
 placement (const vector_3d &translation_, double angle0_, double angle1_, double angle2_, euler_angles_type euler_angles_)
 Constructor. More...
 
 placement (double x_, double y_, double z_, int axis_, double angle_)
 Constructor. More...
 
 placement (const vector_3d &translation_, const rotation_3d &rotation_)
 Constructor. More...
 
virtual ~placement ()
 Destructor. More...
 
virtual void reset ()
 Reset. More...
 
void mother_to_child (const vector_3d &, vector_3d &) const
 
vector_3d mother_to_child (const vector_3d &) const
 
void child_to_mother (const vector_3d &, vector_3d &) const
 
vector_3d child_to_mother (const vector_3d &) const
 
void mother_to_child_direction (const vector_3d &, vector_3d &) const
 
vector_3d mother_to_child_direction (const vector_3d &) const
 
void child_to_mother_direction (const vector_3d &, vector_3d &) const
 
vector_3d child_to_mother_direction (const vector_3d &) const
 
void child_to_mother (const placement &, placement &) const
 
void relocate (const placement &, placement &) const
 
void initialize (const datatools::properties &config_, uint32_t flags_=0)
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
void dump (std::ostream &out_=std::clog, const std::string &title_="geomutils::placement", const std::string &indent_="") const
 Basic print. More...
 
void test () const
 Test method. More...
 
- Public Member Functions inherited from geomtools::i_placement
 i_placement ()
 Default constructor. More...
 
virtual ~i_placement ()
 Destructor. More...
 
bool is_multiple () const
 Check if the placement handles multiple positions. More...
 
placement get_placement (int item_) const
 Return the placement at given item rank/index. More...
 
placement get_placement_by_index (int item_) const
 Same as get_placement(int) but workaround method overloading for CAMP. More...
 
void compute_placement (int item_, placement &p_) const
 Compute the placement at given item rank/index. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Static Public Member Functions

static bool from_string (const std::string &, placement &)
 Parse from a description string. More...
 
static void to_string (std::string &, const placement &)
 Convert to a description string. More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Additional Inherited Members

- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Detailed Description

The placement for a geometry volume with its translation and rotation with respect to some mother reference frame.

Constructor & Destructor Documentation

◆ placement() [1/10]

geomtools::placement::placement ( )

Constructor.

◆ placement() [2/10]

geomtools::placement::placement ( const vector_3d translation_)

Constructor.

◆ placement() [3/10]

geomtools::placement::placement ( double  x_,
double  y_,
double  z_ 
)

Constructor.

◆ placement() [4/10]

geomtools::placement::placement ( const vector_3d translation_,
double  phi_,
double  theta_,
double  delta_ 
)

Constructor.

◆ placement() [5/10]

geomtools::placement::placement ( const vector_3d translation_,
int  axis_,
double  angle_ 
)

Constructor.

◆ placement() [6/10]

geomtools::placement::placement ( double  x_,
double  y_,
double  z_,
double  phi_,
double  theta_,
double  delta_ 
)

Constructor.

◆ placement() [7/10]

geomtools::placement::placement ( double  x_,
double  y_,
double  z_,
double  angle0_,
double  angle1_,
double  angle2_,
euler_angles_type  euler_angles_ 
)

Constructor.

◆ placement() [8/10]

geomtools::placement::placement ( const vector_3d translation_,
double  angle0_,
double  angle1_,
double  angle2_,
euler_angles_type  euler_angles_ 
)

Constructor.

◆ placement() [9/10]

geomtools::placement::placement ( double  x_,
double  y_,
double  z_,
int  axis_,
double  angle_ 
)

Constructor.

◆ placement() [10/10]

geomtools::placement::placement ( const vector_3d translation_,
const rotation_3d rotation_ 
)

Constructor.

◆ ~placement()

virtual geomtools::placement::~placement ( )
virtual

Destructor.

Member Function Documentation

◆ child_to_mother() [1/3]

void geomtools::placement::child_to_mother ( const vector_3d ,
vector_3d  
) const

◆ child_to_mother() [2/3]

vector_3d geomtools::placement::child_to_mother ( const vector_3d ) const

◆ child_to_mother() [3/3]

void geomtools::placement::child_to_mother ( const placement ,
placement  
) const

◆ child_to_mother_direction() [1/2]

void geomtools::placement::child_to_mother_direction ( const vector_3d ,
vector_3d  
) const

◆ child_to_mother_direction() [2/2]

vector_3d geomtools::placement::child_to_mother_direction ( const vector_3d ) const

◆ compute_index_map()

virtual size_t geomtools::placement::compute_index_map ( std::vector< uint32_t > &  map_,
int  item_ 
) const
virtual

Compute the list of multi-dimension multiplet for placement at given index.

Implements geomtools::i_placement.

◆ dump()

void geomtools::placement::dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "geomutils::placement",
const std::string &  indent_ = "" 
) const

Basic print.

◆ from_string()

static bool geomtools::placement::from_string ( const std::string &  ,
placement  
)
static

Parse from a description string.

◆ get_delta()

double geomtools::placement::get_delta ( ) const

Return delta Euler angle.

◆ get_dimension()

virtual size_t geomtools::placement::get_dimension ( ) const
virtual

Return the dimension of the(multi-)placement object.

Implements geomtools::i_placement.

◆ get_inverse_rotation()

const rotation_3d& geomtools::placement::get_inverse_rotation ( ) const

Return the inverse rotation matrix.

◆ get_number_of_items()

virtual size_t geomtools::placement::get_number_of_items ( ) const
virtual

Return the number of placement entries associated to this placement object.

Implements geomtools::i_placement.

◆ get_phi()

double geomtools::placement::get_phi ( ) const

Return phi Euler angle.

◆ get_placement()

virtual void geomtools::placement::get_placement ( int  item_,
placement p_ 
) const
virtual

Compute the placement at given index.

Implements geomtools::i_placement.

◆ get_rotation()

const rotation_3d& geomtools::placement::get_rotation ( ) const

Return the rotation matrix.

◆ get_rotation_angle()

double geomtools::placement::get_rotation_angle ( ) const

Return rotation angle.

◆ get_rotation_axis()

int geomtools::placement::get_rotation_axis ( ) const

Return rotation axis.

◆ get_theta()

double geomtools::placement::get_theta ( ) const

Return theta Euler angle.

◆ get_translation()

const vector_3d& geomtools::placement::get_translation ( ) const

Return the translation.

◆ grab_translation()

vector_3d& geomtools::placement::grab_translation ( )

Return the mutable translation.

◆ has_angles()

bool geomtools::placement::has_angles ( ) const

Chec if Euler angles are defined.

◆ has_only_one_rotation()

virtual bool geomtools::placement::has_only_one_rotation ( ) const
virtual

Check if the (multi-)placement has only one rotation for all its placement objects.

Reimplemented from geomtools::i_placement.

◆ initialize()

void geomtools::placement::initialize ( const datatools::properties config_,
uint32_t  flags_ = 0 
)

◆ invalidate()

void geomtools::placement::invalidate ( )

Invalidate.

◆ is_identity()

bool geomtools::placement::is_identity ( ) const

Check if the placement is identity.

◆ is_replica()

virtual bool geomtools::placement::is_replica ( ) const
virtual

Check if placement is a replica.

Implements geomtools::i_placement.

◆ is_rotation_x()

bool geomtools::placement::is_rotation_x ( ) const

Check if the orientation is defined as a X axis rotation.

◆ is_rotation_y()

bool geomtools::placement::is_rotation_y ( ) const

Check if the orientation is defined as a Y axis rotation.

◆ is_rotation_z()

bool geomtools::placement::is_rotation_z ( ) const

Check if the orientation is defined as a Z axis rotation.

◆ is_simple_rotation()

bool geomtools::placement::is_simple_rotation ( ) const

Check if the orientation is defined as a simple rotation (X, Y or Z axis)

◆ is_valid()

bool geomtools::placement::is_valid ( ) const

Check validity.

◆ is_zyz_rotation()

bool geomtools::placement::is_zyz_rotation ( ) const

Check if the orientation is defined through ZYZ Euler angles.

◆ mother_to_child() [1/2]

void geomtools::placement::mother_to_child ( const vector_3d ,
vector_3d  
) const

◆ mother_to_child() [2/2]

vector_3d geomtools::placement::mother_to_child ( const vector_3d ) const

◆ mother_to_child_direction() [1/2]

void geomtools::placement::mother_to_child_direction ( const vector_3d ,
vector_3d  
) const

◆ mother_to_child_direction() [2/2]

vector_3d geomtools::placement::mother_to_child_direction ( const vector_3d ) const

◆ relocate()

void geomtools::placement::relocate ( const placement ,
placement  
) const

Given two placements P1 and P2 expressed in some mother coordinate system, recompute the relative placement P2 in the coordinate system of placement P1 and store the result in P2_1.

Usage:

P1.relocate (P2, P2_1);

◆ reset()

virtual void geomtools::placement::reset ( )
virtual

Reset.

◆ set() [1/6]

void geomtools::placement::set ( double  x_,
double  y_,
double  z_,
double  phi_,
double  theta_,
double  delta_ 
)

Set translation by (x,y,z) coordinate triplet and orientation by ZYZ Euler angles.

◆ set() [2/6]

void geomtools::placement::set ( double  x_,
double  y_,
double  z_,
double  angle0_,
double  angle1_,
double  angle2_,
euler_angles_type  euler_angle_ 
)

Set translation by (x,y,z) coordinate triplet and orientation by Euler angles.

◆ set() [3/6]

void geomtools::placement::set ( double  x_,
double  y_,
double  z_,
int  axis_,
double  angle_ 
)

Set translation by (x,y,z) coordinate triplet and orientation by axis and angle.

◆ set() [4/6]

void geomtools::placement::set ( const vector_3d t_,
double  phi_,
double  theta_,
double  delta_ 
)

Set translation by position and orientation ZYZ Euler angles.

◆ set() [5/6]

void geomtools::placement::set ( const vector_3d t_,
double  angle0_,
double  angle1_,
double  angle2_,
euler_angles_type  euler_angle_ 
)

Set translation by position and orientation by Euler angles.

◆ set() [6/6]

void geomtools::placement::set ( const vector_3d t_,
int  axis_,
double  angle_ 
)

Set translation by position and orientation by axis and angle.

◆ set_identity()

void geomtools::placement::set_identity ( )

Set identity.

◆ set_orientation() [1/4]

void geomtools::placement::set_orientation ( int  axis_,
double  angle_ 
)

Set orientation by axis and angle.

◆ set_orientation() [2/4]

void geomtools::placement::set_orientation ( double  phi_,
double  theta_,
double  delta_ 
)

Set orientation by ZYZ Euler angles.

◆ set_orientation() [3/4]

void geomtools::placement::set_orientation ( double  angle0_,
double  angle1_,
double  angle2_,
euler_angles_type  euler_angle_ 
)

Set orientation by arbitrary Euler angles.

◆ set_orientation() [4/4]

void geomtools::placement::set_orientation ( const rotation_3d )

Set the rotation (not recommended at all)

◆ set_orientation_axis_angle()

void geomtools::placement::set_orientation_axis_angle ( int  axis_,
double  angle_ 
)

Set orientation by axis and angle.

◆ set_orientation_xyz()

void geomtools::placement::set_orientation_xyz ( double  phi_,
double  theta_,
double  delta_ 
)

Set the rotation using XYZ Euler angles (experimental)

◆ set_orientation_zyz()

void geomtools::placement::set_orientation_zyz ( double  phi_,
double  theta_,
double  delta_ 
)

Set orientation by ZYZ Euler angles.

◆ set_translation() [1/2]

void geomtools::placement::set_translation ( double  ,
double  ,
double   
)

Set the translation from a (x,y,z) coordinate triplet.

◆ set_translation() [2/2]

void geomtools::placement::set_translation ( const vector_3d )

Set the translation.

◆ set_translation_v()

void geomtools::placement::set_translation_v ( const vector_3d )

Set the translation.

◆ set_translation_xyz()

void geomtools::placement::set_translation_xyz ( double  ,
double  ,
double   
)

Set the translation from a (x,y,z) coordinate triplet.

◆ test()

void geomtools::placement::test ( ) const

Test method.

◆ to_string()

static void geomtools::placement::to_string ( std::string &  ,
const placement  
)
static

Convert to a description string.

◆ translate() [1/2]

void geomtools::placement::translate ( const vector_3d )

Translate the current translation by some shift.

◆ translate() [2/2]

void geomtools::placement::translate ( double  dx_,
double  dy_,
double  dz_ 
)

Translate the current translation by some shift.

◆ tree_dump()

virtual void geomtools::placement::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from geomtools::i_placement.


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