Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Namespaces | Typedefs | Enumerations | Functions
utils.h File Reference
#include <string>
#include <iostream>
#include <list>
#include <vector>
#include <datatools/bit_mask.h>
#include <datatools/reflection_interface.h>
#include <geomtools/geomtools_config.h>
#include <geomtools/clhep.h>

Go to the source code of this file.

Classes

struct  geomtools::constants
 Some constants. More...
 
class  geomtools::filled_utils
 
class  geomtools::rotation_wrapper_type
 Wrapper for rotation object. More...
 
struct  geomtools::io
 I/O constants for the serialization of vector(2D/3D) and rotation objects. More...
 

Namespaces

 geomtools
 Top-level namespace of the Bayeux/geomtools module library.
 
 boost
 Serialization stuff for CLHEP 'vector_3d'.
 
 boost::serialization
 

Typedefs

typedef std::list< vector_2d > geomtools::basic_polyline_2d
 Alias for a list of 2D vertice as a 2D-polyline. More...
 
typedef std::pair< vector_3d, vector_3d > geomtools::basic_segment_3d
 Aliases for a segment made of two 3D vertice. More...
 
typedef basic_segment_3d geomtools::segment_type
 
typedef std::list< vector_3d > geomtools::basic_polyline_3d
 Aliases for a list of 3D vertice as a 3D-polyline. More...
 
typedef std::list< vector_3d > geomtools::polyline_type
 
typedef std::vector< vector_3d > geomtools::vertex_col_type
 Aliases for an ordered collection of 3D vertice. More...
 
typedef std::list< polyline_type > geomtools::wires_type
 Alias for a list of 3D-polylines. More...
 
typedef side_2d_type geomtools::edge_2d_type
 
typedef rotation_wrapper_type geomtools::rotation_wrapper_t
 Type alias. More...
 

Enumerations

enum  geomtools::orientation_type {
  geomtools::ORIENTATION_INVALID = -1, geomtools::ORIENTATION_VERTICAL = 0, geomtools::VERTICAL = 0, geomtools::ORIENTATION_HORIZONTAL = 1,
  geomtools::HORIZONTAL = 1
}
 Orientation constants. More...
 
enum  geomtools::direction_flags_type {
  geomtools::DIRECTION_FLAGS_NONE = 0x0, geomtools::DIRECTION_FLAGS_BACK = datatools::bit_mask::bit00, geomtools::DIRECTION_FLAGS_FRONT = datatools::bit_mask::bit01, geomtools::DIRECTION_FLAGS_LEFT = datatools::bit_mask::bit02,
  geomtools::DIRECTION_FLAGS_RIGHT = datatools::bit_mask::bit03, geomtools::DIRECTION_FLAGS_BOTTOM = datatools::bit_mask::bit04, geomtools::DIRECTION_FLAGS_TOP = datatools::bit_mask::bit05
}
 Direction flags. More...
 
enum  geomtools::direction_type {
  geomtools::DIRECTION_INVALID = -1, geomtools::DIRECTION_BACK = 0, geomtools::DIRECTION_XMINUS = DIRECTION_BACK, geomtools::DIRECTION_FRONT = 1,
  geomtools::DIRECTION_XPLUS = DIRECTION_FRONT, geomtools::DIRECTION_LEFT = 2, geomtools::DIRECTION_YMINUS = DIRECTION_LEFT, geomtools::DIRECTION_RIGHT = 3,
  geomtools::DIRECTION_YPLUS = DIRECTION_RIGHT, geomtools::DIRECTION_BOTTOM = 4, geomtools::DIRECTION_ZMINUS = DIRECTION_BOTTOM, geomtools::DIRECTION_TOP = 5,
  geomtools::DIRECTION_ZPLUS = DIRECTION_TOP
}
 Direction type. More...
 
enum  geomtools::vertex_1d_type { geomtools::VERTEX_NONE = 0x0, geomtools::VERTEX_ALL_BITS = datatools::bit_mask::nbits31, geomtools::VERTEX_ALL = VERTEX_ALL_BITS }
 
enum  geomtools::path_1d_type { geomtools::PATH_NONE = 0x0, geomtools::PATH_ALL_BITS = datatools::bit_mask::nbits31, geomtools::PATH_ALL = PATH_ALL_BITS }
 
enum  geomtools::side_2d_type {
  geomtools::SIDE_NONE = 0x0, geomtools::EDGE_NONE = SIDE_NONE, geomtools::SIDE_ALL_BITS = datatools::bit_mask::nbits31, geomtools::EDGE_ALL_BITS = SIDE_ALL_BITS,
  geomtools::SIDE_ALL = SIDE_ALL_BITS, geomtools::EDGE_ALL = SIDE_ALL
}
 
enum  geomtools::shape_domain_flags_type {
  geomtools::SHAPE_DOMAIN_NONE = 0x0, geomtools::SHAPE_DOMAIN_INSIDE = datatools::bit_mask::bit00, geomtools::SHAPE_DOMAIN_OUTSIDE = datatools::bit_mask::bit01, geomtools::SHAPE_DOMAIN_ON_SURFACE = datatools::bit_mask::bit02,
  geomtools::SHAPE_DOMAIN_INSIDE_DAUGHTER = datatools::bit_mask::bit03, geomtools::SHAPE_DOMAIN_ON_DAUGHTER_SURFACE = datatools::bit_mask::bit04
}
 Flags determining the position of a point with respect to a 3D shape. More...
 
enum  geomtools::euler_angles_type {
  geomtools::EULER_ANGLES_INVALID = -1, geomtools::EULER_ANGLES_ZXZ = 0, geomtools::EULER_ANGLES_XYX = 1, geomtools::EULER_ANGLES_YZY = 2,
  geomtools::EULER_ANGLES_ZYZ = 3, geomtools::EULER_ANGLES_XZX = 4, geomtools::EULER_ANGLES_YXY = 5, geomtools::EULER_ANGLES_XYZ = 6,
  geomtools::EULER_ANGLES_YZX = 7, geomtools::EULER_ANGLES_ZXY = 8, geomtools::EULER_ANGLES_XZY = 9, geomtools::EULER_ANGLES_ZYX = 10,
  geomtools::EULER_ANGLES_YXZ = 11
}
 Type of Euler angles. More...
 
enum  geomtools::special_rotation_angle_type {
  geomtools::ROTATION_ANGLE_INVALID = -1, geomtools::ROTATION_ANGLE_0 = 0, geomtools::ROTATION_ANGLE_90 = 1, geomtools::ROTATION_ANGLE_180 = 2,
  geomtools::ROTATION_ANGLE_270 = 3
}
 Special rotation angle values. More...
 
enum  geomtools::axis_type { geomtools::AXIS_INVALID = -1, geomtools::AXIS_X = 0, geomtools::AXIS_Y = 1, geomtools::AXIS_Z = 2 }
 Axis type. More...
 
enum  geomtools::rotation_axis_type { geomtools::ROTATION_AXIS_INVALID = -1, geomtools::ROTATION_AXIS_X = AXIS_X, geomtools::ROTATION_AXIS_Y = AXIS_Y, geomtools::ROTATION_AXIS_Z = AXIS_Z }
 Rotation axis type. More...
 

Functions

bool geomtools::position_is_in (double position_, double start_position_, double delta_position_, double tolerance_=0.0, bool bounds_excluded_=false)
 Check if a position is inside a position interval. More...
 
bool geomtools::angle_is_in (double angle_, double start_angle_, double delta_angle_, double angular_tolerance_=0.0, bool bounds_excluded_=false)
 Check if an angle is inside an angular interval. More...
 
void geomtools::print_xy (std::ostream &out_, const vector_2d &p_, bool endl_=true)
 
std::string geomtools::to_xy (const vector_2d &p_)
 
std::string geomtools::vector_2d_to_xy (const vector_2d &p_)
 
void geomtools::print_xy_stdout (const vector_2d &p_)
 
void geomtools::print_xy_stderr (const vector_2d &p_)
 
void geomtools::print_xyz (std::ostream &out_, const vector_3d &p_, bool endl_=true)
 
void geomtools::print (std::ostream &out_, const vector_3d &p_)
 
std::string geomtools::to_xyz (const vector_3d &p_)
 
std::string geomtools::vector_3d_to_xyz (const vector_3d &p_)
 
void geomtools::print_xyz_stdout (const vector_3d &p_)
 
void geomtools::print_xyz_stderr (const vector_3d &p_)
 
void geomtools::set_vector_2d (const std::vector< double > &source_, vector_2d &target_)
 
void geomtools::set_vector_3d (const std::vector< double > &source_, vector_3d &target_)
 
bool geomtools::parse (std::istream &in_, vector_3d &position_, bool nothing_more_=false)
 Parse a vector 3D object from an input stream. More...
 
bool geomtools::parse (const std::string &token_, vector_3d &position_)
 Parse a vector 3D object from an input string. More...
 
void geomtools::print_xy (std::ostream &out_, const basic_polyline_2d &p_, bool endl_=true)
 
std::string geomtools::to_xy (const basic_polyline_2d &p_)
 
std::string geomtools::basic_polyline_2d_to_xy (const basic_polyline_2d &p_)
 
void geomtools::print_xy_stdout (const basic_polyline_2d &p_)
 
void geomtools::print_xy_stderr (const basic_polyline_2d &p_)
 
void geomtools::print_xyz (std::ostream &out_, const basic_polyline_3d &p_, bool endl_=true)
 
std::string geomtools::to_xyz (const basic_polyline_3d &p_)
 
std::string geomtools::basic_polyline_3d_to_xyz (const basic_polyline_3d &p_)
 
void geomtools::print_xyz_stdout (const basic_polyline_3d &p_)
 
void geomtools::print_xyz_stderr (const basic_polyline_3d &p_)
 
direction_type geomtools::get_direction_from_label (const std::string &)
 
std::string geomtools::get_direction_label (direction_type)
 
std::string geomtools::shape_domain_flag_label (shape_domain_flags_type flag_)
 
void geomtools::create (rotation_3d &rot_, double angle0_, double angle1_, double angle2_, euler_angles_type et_)
 
void geomtools::create_zyz (rotation_3d &rot_, double phi_, double theta_, double delta_)
 
void geomtools::create (rotation_3d &rot_, double phi_, double theta_, double delta_)
 
void geomtools::create_zxz (rotation_3d &rot_, double phi_, double theta_, double psi_)
 Create a rotation using ZXZ Euler angles. More...
 
void geomtools::create_xyz (rotation_3d &rot_, double phi_, double theta_, double psi_)
 Create a rotation using XYZ Euler angles. More...
 
void geomtools::create_rotation_3d (rotation_3d &rot_, double phi_, double theta_, double delta_)
 
void geomtools::create_rotation_from_zyz_euler_angles (rotation_3d &rot_, double phi_, double theta_, double delta_)
 
void geomtools::create_rotation (rotation_3d &rot_, double phi_, double theta_, double delta_)
 
bool geomtools::is_identity (const rotation_3d &rot_)
 Check if a rotation is the identity. More...
 
void geomtools::extract_xyz_euler_angle_from_rotation (const rotation_3d &rot_, double &a_, double &b_, double &c_)
 Extract the XYZ Euler angles from a rotation. More...
 
void geomtools::extract_zyz_euler_angle_from_rotation (const rotation_3d &rot_, double &a_, double &b_, double &c_)
 Extract the ZYZ Euler angles from a rotation. More...
 
bool geomtools::check_special_rotation_angle (int)
 
double geomtools::get_special_rotation_angle (int)
 
int geomtools::get_special_rotation_angle_from_label (const std::string &)
 
std::string geomtools::get_special_rotation_angle_label (int)
 
bool geomtools::check_rotation_axis (int)
 
int geomtools::get_rotation_axis_from_label (const std::string &)
 
std::string geomtools::get_rotation_label (int)
 
void geomtools::create_rotation_from_axis (rotation_3d &rot_, int axis_, double angle_)
 
void geomtools::create_rotation (rotation_3d &rot_, int axis_, double angle_)
 
void geomtools::create_rotation (rotation_3d &rot_, int axis_, int special_angle_)
 
void geomtools::create_rotation_from (rotation_3d &rot_, const std::string &)
 
void geomtools::reset (rotation_3d &rot_)
 Invalidate a rotation 3D object. More...
 
void geomtools::reset_rotation_3d (rotation_3d &rot_)
 Invalidate a rotation 3D object. More...
 
void geomtools::tree_dump (const rotation_3d &rot_, std::ostream &out_, const std::string &title_="", const std::string &indent_="")
 Smart print for rotation 3D object. More...
 
void geomtools::invalidate (rotation_3d &rot_)
 Invalidate a rotation 3D object. More...
 
void geomtools::rectify (rotation_3d &rot_)
 Rectify a rotation 3D object. More...
 
void geomtools::invalidate_rotation_3d (rotation_3d &rot_)
 Invalidate a rotation 3D object. More...
 
bool geomtools::is_valid (const rotation_3d &rot_)
 Check if a rotation 3D object is valid. More...
 
bool geomtools::is_valid_rotation_3d (const rotation_3d &rot_)
 Check if a rotation 3D object is valid. More...
 
void geomtools::create (vector_3d &, double x_, double y_, double z_)
 Create/set coordinates of a vector 3D object (cartesian) More...
 
void geomtools::create_xyz (vector_3d &, double x_, double y_, double z_)
 Create/set coordinates of a vector 3D object (cartesian) More...
 
void geomtools::create_polar (vector_3d &, double r_, double theta_, double z_)
 Create/set coordinates of a vector 3D object (polar) More...
 
void geomtools::create_spherical (vector_3d &, double r_, double phi_, double theta_)
 Create/set coordinates of a vector 3D object (spherical) More...
 
void geomtools::set (vector_3d &vec_, double x_, double y_, double z_)
 Set coordinates of a vector 3D object (cartesian) More...
 
void geomtools::set_r_theta_phi (vector_3d &vec_, double r_, double theta_, double phi_)
 Set coordinates of a vector 3D object (spherical) More...
 
void geomtools::set_rho_phi_z (vector_3d &vec_, double rho_, double phi_, double z_)
 Set coordinates of a vector 3D object (polar) More...
 
void geomtools::zero (vector_3d &vec_)
 Zero a vector 3D object. More...
 
const vector_3d & geomtools::invalid_vector_3d ()
 Return an invalid vector 3D object (static singleton) More...
 
void geomtools::invalidate (vector_3d &vec_)
 Invalidate a vector 3D object. More...
 
void geomtools::invalidate_vector_3d (vector_3d &vec_)
 Invalidate a vector 3D object. More...
 
bool geomtools::is_valid (const vector_3d &vec_)
 Check if a vector 3D object is valid. More...
 
bool geomtools::is_valid_vector_3d (const vector_3d &vec_)
 Check if a vector 3D object is valid. More...
 
bool geomtools::are_near (const vector_3d &vec1_, const vector_3d &vec2_, double tolerance_=constants::DEFAULT_TOLERANCE)
 Check if two vector 3D objects are close to each other given a tolerance. More...
 
bool geomtools::are_near_vector_3d (const vector_3d &vec1_, const vector_3d &vec2_, double tolerance_)
 Check if two vector 3D objects are close to each other given a tolerance. More...
 
void geomtools::set (vector_2d &vec_, double x_, double y_)
 Set coordinates of a vector 2D object (cartesian) More...
 
void geomtools::set_r_phi (vector_2d &vec_, double r_, double phi_)
 Set coordinates of a vector 2D object (polar) More...
 
void geomtools::zero (vector_2d &vec_)
 Zero a vector 2D object. More...
 
void geomtools::invalidate (vector_2d &vec_)
 Invalidate a vector 2D object. More...
 
void geomtools::invalidate_vector_2d (vector_2d &vec_)
 Invalidate a vector 2D object. More...
 
const vector_2d & geomtools::invalid_vector_2d ()
 Return an invalid vector 2D object (static singleton) More...
 
bool geomtools::is_valid (const vector_2d &vec_)
 Check if a vector 2D object is valid. More...
 
bool geomtools::is_valid_vector_2d (const vector_2d &vec_)
 Check if a vector 2D object is valid. More...
 
void geomtools::vector_2d_to_vector_3d (const vector_2d &v2d_, vector_3d &v3d_)
 Convert a vector 2D object to a vector 3D object (export x and y coordinates, setting z to zero) More...
 
void geomtools::vector_3d_to_vector_2d (const vector_3d &v3d_, vector_2d &v2d_)
 Convert a vector 3D object to a vector 2D object (export only x and y coordinates) More...
 
void geomtools::make_phi_theta (vector_3d &vec_, double phi_, double theta_)
 Create a vector 3D object from spherical angular coordinates (magnitude is set to 1) More...
 
template<class ran_func >
void geomtools::randomize_direction (ran_func &ran_, vector_3d &ran_dir_)
 Isotropically randomize the direction of an unit vector. More...
 
template<class ran_func >
vector_3d geomtools::randomize_direction (ran_func &ran_)
 Isotropically randomize the direction of an unit vector. More...
 
template<class ran_func >
void geomtools::randomize_orthogonal_direction (ran_func &ran_, const vector_3d &dir_, vector_3d &ran_dir_)
 Isotropically randomize the direction of an unit vector orthogonal to a given direction. More...
 
template<class ran_func >
vector_3d geomtools::randomize_orthogonal_direction (ran_func &ran_, const vector_3d &ref_dir_)
 Isotropically randomize the direction of an unit vector orthogonal to a given direction. More...
 
void geomtools::compute_barycenter (const std::vector< vector_3d > &points_, vector_3d &barycenter_)
 
vector_3d geomtools::compute_barycenter (const std::vector< vector_3d > &points_)
 
void geomtools::compute_weighted_barycenter (const std::vector< vector_3d > &points_, const std::vector< double > &weights_, vector_3d &weighted_barycenter_)
 
vector_3d geomtools::compute_weighted_barycenter (const std::vector< vector_3d > &points_, const std::vector< double > &weights_)
 
template<class Archive >
void boost::serialization::save (Archive &a_ar, const geomtools::vector_3d &v_, const unsigned int a_version)
 
template<class Archive >
void boost::serialization::load (Archive &a_ar, geomtools::vector_3d &v_, const unsigned int a_version)
 
template<class Archive >
void boost::serialization::serialize (Archive &a_ar, geomtools::vector_3d &v_, const unsigned int a_version)
 
template<class Archive >
void boost::serialization::save (Archive &a_ar, const geomtools::vector_2d &v_, const unsigned int a_version)
 Boost serialization save method for vector 2D objects. More...
 
template<class Archive >
void boost::serialization::load (Archive &a_ar, geomtools::vector_2d &v_, const unsigned int a_version)
 Boost serialization load method for vector 2D objects. More...
 
template<class Archive >
void boost::serialization::serialize (Archive &a_ar, geomtools::vector_2d &v_, const unsigned int a_version)
 Boost serialization general method for vector 2D objects. More...
 
template<class Archive >
void boost::serialization::save (Archive &a_ar, const geomtools::rotation_3d &r_, const unsigned int a_version)
 Boost serialization save method for vector 3D objects. More...
 
template<class Archive >
void boost::serialization::load (Archive &a_ar, geomtools::rotation_3d &a_rotation, const unsigned int a_version)
 Boost serialization load method for vector 3D objects. More...
 
template<class Archive >
void boost::serialization::serialize (Archive &a_ar, geomtools::rotation_3d &a_rotation, const unsigned int a_version)
 Boost serialization general method for vector 3D objects. More...