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

An helix (1D shape) in a 3D space. More...

#include <bayeux/geomtools/helix_3d.h>

Inheritance diagram for geomtools::helix_3d:
geomtools::i_shape_1d geomtools::i_wires_3d_rendering geomtools::i_object_3d datatools::i_serializable datatools::i_tree_dumpable

Public Types

enum  print_flags_type { PRINT_XYZ_EXPAND1 = datatools::bit_mask::bit00, PRINT_XYZ_EXPAND2 = datatools::bit_mask::bit01, PRINT_XYZ_CENTER = datatools::bit_mask::bit02 }
 
enum  helix_wires_rendering_option_type { WR_HELIX_NO_ANGULAR_SAMPLE_BOOST = (WR_BASE_LAST << 1), WR_HELIX_LAST = (WR_HELIX_NO_ANGULAR_SAMPLE_BOOST), WR_HELIX_MASK = (WR_HELIX_NO_ANGULAR_SAMPLE_BOOST) }
 3D rendering options More...
 
- Public Types inherited from geomtools::i_object_3d
enum  dimensional_type { DIMENSIONAL_0 = 0, DIMENSIONAL_1 = 1, DIMENSIONAL_2 = 2, DIMENSIONAL_3 = 3 }
 Known dimensions. More...
 
typedef datatools::handle< i_object_3dhandle_type
 A handle to a 3D object. More...
 
typedef std::map< std::string, object_entryhandle_dict_type
 Dictionary of handle of 3D object entries. More...
 
- 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...
 
- Public Types inherited from geomtools::i_wires_3d_rendering
enum  wires_rendering_option_type {
  WR_NONE = 0, WR_BASE_GRID = datatools::bit_mask::bit00, WR_BASE_GRID_LOW_DENSITY = (WR_BASE_GRID << 1), WR_BASE_GRID_HIGH_DENSITY = (WR_BASE_GRID << 2),
  WR_BASE_GRID_VERY_HIGH_DENSITY = (WR_BASE_GRID << 3), WR_BASE_GRID_HUGE_DENSITY = (WR_BASE_GRID << 4), WR_BASE_LOW_ANGLE_SAMPLING = (WR_BASE_GRID << 5), WR_BASE_HIGH_ANGLE_SAMPLING = (WR_BASE_GRID << 6),
  WR_BASE_VERY_HIGH_ANGLE_SAMPLING = (WR_BASE_GRID << 7), WR_BASE_HUGE_ANGLE_SAMPLING = (WR_BASE_GRID << 8), WR_BASE_UNUSED_09 = (WR_BASE_GRID << 9), WR_BASE_UNUSED_10 = (WR_BASE_GRID << 10),
  WR_BASE_UNUSED_11 = (WR_BASE_GRID << 11), WR_BASE_UNUSED_12 = (WR_BASE_GRID << 12), WR_BASE_UNUSED_13 = (WR_BASE_GRID << 13), WR_BASE_BOUNDINGS = (WR_BASE_GRID << 14),
  WR_BASE_EXPLODE = (WR_BASE_GRID << 15), WR_BASE_LAST = (WR_BASE_EXPLODE), WR_BASE_MASK = datatools::bit_mask::nbits16
}
 Wires rendering optional flags. More...
 
enum  sampling_level_type {
  SL_NONE = 0, SL_LOW = 1, SL_NORMAL = 2, SL_HIGH = 3,
  SL_VERY_HIGH = 4, SL_HUGE = 5
}
 Sampling levels. More...
 

Public Member Functions

bool is_normal ()
 Check if the shape is normal. More...
 
virtual std::string get_shape_name () const
 Return the identifier/name of the shape. More...
 
bool is_valid () const
 Check if the helix is valid. More...
 
void invalidate ()
 Invalidate the helix. More...
 
const vector_3dget_center () const
 Return a reference to the non mutable center. More...
 
vector_3dgrab_center ()
 Return a reference to the mutable center. More...
 
void set_center (const vector_3d &)
 Set the center. More...
 
void set_center (double x_, double y_, double z_)
 Set the center. More...
 
double get_radius () const
 Return the radius. More...
 
void set_radius (double)
 Set the radius. More...
 
double get_step () const
 Return the step. More...
 
void set_step (double)
 Set the step. More...
 
double get_t1 () const
 Return the normalized start angle. More...
 
void set_t1 (double)
 Set the normalized start angle. More...
 
double get_t2 () const
 Return the normalized stop angle. More...
 
void set_t2 (double)
 Set the normalized stop angle. More...
 
void set_angle1 (double)
 Set the start angle. More...
 
void set_angle2 (double)
 Set the stop angle. More...
 
double get_angle1 () const
 Return the start angle. More...
 
double get_angle2 () const
 Return the stop angle. More...
 
virtual double get_length (uint32_t flags_=PATH_ALL_BITS) const
 Return the length. More...
 
double get_curvilinear_position (double t_) const
 Return the curvilinear position from the normalized angle. More...
 
bool t_is_valid (double t_) const
 Check if a given normalized angle is valid. More...
 
double get_theta_from_xy (double x_, double y_) const
 Return the angle associated to given (x,y) position in the reference frame of the helix. More...
 
double get_t (vector_3d point_) const
 Return the normalized angle associated to a position in the reference frame of the helix. More...
 
double get_t_from_xyz (double x_, double y_, double z_) const
 Return the normalized angle associated to a (x,y,z) position triplet in the reference frame of the helix. More...
 
double get_t_from_z (double z_) const
 Return the normalized angle associated to a z position in the reference frame of the helix. More...
 
double get_z_from_t (double t_) const
 Return the z position associated to a normalized angle. More...
 
vector_3d get_point (double t_) const
 Return the position on the helix for a given normalized angle. More...
 
vector_3d get_point_xy (double theta_) const
 Return the position on the helix for a given angle. More...
 
void invalidate_angles ()
 Invalidate helix's angles. More...
 
bool angles_are_valid () const
 Check if angles are valid. More...
 
vector_3d get_first () const
 Return the start position on the helix. More...
 
vector_3d get_last () const
 Return the stop position on the helix. More...
 
 helix_3d ()
 Default constructor. More...
 
virtual ~helix_3d ()
 Destructor. More...
 
void reset ()
 Reset. More...
 
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 () const
 Basic print. More...
 
void make_vertex_collection (basic_polyline_3d &, double angular_step_=0.0) const
 Compute a collection of vertexes representing the helix. More...
 
basic_polyline_3d make_vertex_collection () const
 Return a collection of vertexes representing the helix. More...
 
virtual bool is_on_curve (const vector_3d &position_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
 Check if a position in on the curve. More...
 
virtual vector_3d get_direction_on_curve (const vector_3d &position_) const
 Return the direction ar some position in on the curve. More...
 
virtual void generate_wires_self (wires_type &wires_, uint32_t options_=0) const
 Generate a sequence of polylines for wires 3D rendering. More...
 
- Public Member Functions inherited from geomtools::i_shape_1d
int get_dimensional () const
 Return the dimension of the object. More...
 
virtual bool has_number_of_paths () const
 Check if the 1D shape knows its number of associated paths. More...
 
virtual unsigned int get_number_of_paths () const
 Return the number of paths. More...
 
virtual bool has_length (uint32_t flags_=PATH_ALL_BITS) const
 Check if the 1D shape known its length. More...
 
 i_shape_1d ()
 Default constructor. More...
 
 i_shape_1d (double tolerance_)
 Constructor. More...
 
 i_shape_1d (double tolerance_, double angular_tolerance_)
 Constructor. More...
 
virtual ~i_shape_1d ()
 Destructor. More...
 
- Public Member Functions inherited from geomtools::i_object_3d
datatools::logger::priority get_logging_priority () const
 Return the logging priority threshold. More...
 
void set_logging_priority (datatools::logger::priority)
 Set the logging priority threshold. More...
 
bool has_wires_drawer () const
 Check is a wires drawer is available. More...
 
void set_wires_drawer (i_wires_3d_rendering &wires_drawer_)
 Set a wires drawer. More...
 
void reset_wires_drawer ()
 Reset the wires drawer. More...
 
i_wires_3d_renderinggrab_wires_drawer ()
 Return a wires drawer. More...
 
const i_wires_3d_renderingget_wires_drawer () const
 Return a wires drawer. More...
 
double compute_tolerance (double tolerance_) const
 Return the distance tolerance. More...
 
double compute_angular_tolerance (double angular_tolerance_) const
 Return the angular tolerance. More...
 
double get_tolerance () const
 Return the distance tolerance. More...
 
void set_tolerance (double tolerance_)
 Set the distance tolerance. More...
 
double get_angular_tolerance () const
 Return the angular tolerance. More...
 
void set_angular_tolerance (double tolerance_)
 Set the angular tolerance. More...
 
virtual bool is_composite () const
 Check if the object is composite. More...
 
 i_object_3d ()
 Default constructor. More...
 
 i_object_3d (double tolerance_)
 Constructor on length tolerance. More...
 
 i_object_3d (double tolerance_, double angular_tolerance_)
 Constructor on length tolerance. More...
 
 i_object_3d (const i_object_3d &)
 Copy constructor. More...
 
i_object_3doperator= (const i_object_3d &)
 Assignment operator. More...
 
virtual ~i_object_3d ()
 Destructor. More...
 
void initialize_simple ()
 Initialize the 3D object. More...
 
virtual void initialize (const datatools::properties &, const handle_dict_type *=0)
 Initialize from properties and a dictionary of 3D-objects. 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
 
- Public Member Functions inherited from geomtools::i_wires_3d_rendering
virtual ~i_wires_3d_rendering ()
 Destructor. More...
 
void generate_wires (wires_type &wires_, const placement &positioning_, uint32_t options_=0) const
 
void generate_wires (wires_type &wires_, const geomtools::vector_3d &position_, const geomtools::rotation_3d &rotation_, uint32_t options_=0) const
 

Static Public Member Functions

static const std::string & helix_3d_label ()
 Return the identifier label for the class. More...
 
static double t_to_angle (double t_)
 Convert parametric to angle in radian: More...
 
static double angle_to_t (double angle_)
 Convert angle in radian to parametric: More...
 
static void print_xyz (std::ostream &out_, const helix_3d &helix_, double step_angle_=0.0, unsigned int flags_=0)
 Print approximated data (x,y,z) triplets representing the helix. More...
 
- Static Public Member Functions inherited from geomtools::i_shape_1d
static void init_ocd (datatools::object_configuration_description &)
 OCD support. More...
 
- Static Public Member Functions inherited from geomtools::i_object_3d
static void init_ocd (datatools::object_configuration_description &)
 OCD support. 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_)
 
- Static Public Member Functions inherited from geomtools::i_wires_3d_rendering
static uint32_t linear_sampling (sampling_level_type)
 Return linear sampling from sampling level. More...
 
static uint32_t linear_sampling_from_options (uint32_t)
 Return linear sampling from rendering options. More...
 
static uint32_t angular_sampling (sampling_level_type)
 Return angular sampling from sampling level. More...
 
static uint32_t angular_sampling_from_options (uint32_t)
 Return angular sampling from rendering options. More...
 
static void boost_linear_sampling (uint32_t &)
 Boost the linear sampling. More...
 

Protected Member Functions

void _set_defaults ()
 Set the default attributes values. More...
 
- Protected Member Functions inherited from geomtools::i_object_3d
void _set_defaults ()
 Set default values for attributes. More...
 
void _initialize (const datatools::properties &, const handle_dict_type *=0)
 Initialize from properties. More...
 
void _reset ()
 Reset. More...
 

Detailed Description

An helix (1D shape) in a 3D space.

Member Enumeration Documentation

◆ helix_wires_rendering_option_type

3D rendering options

Enumerator
WR_HELIX_NO_ANGULAR_SAMPLE_BOOST 

Do not boost angular sampling.

WR_HELIX_LAST 

Last defined bit.

WR_HELIX_MASK 

Rendering options bit mask.

◆ print_flags_type

Enumerator
PRINT_XYZ_EXPAND1 
PRINT_XYZ_EXPAND2 
PRINT_XYZ_CENTER 

Constructor & Destructor Documentation

◆ helix_3d()

geomtools::helix_3d::helix_3d ( )

Default constructor.

◆ ~helix_3d()

virtual geomtools::helix_3d::~helix_3d ( )
virtual

Destructor.

Member Function Documentation

◆ _set_defaults()

void geomtools::helix_3d::_set_defaults ( )
protected

Set the default attributes values.

◆ angle_to_t()

static double geomtools::helix_3d::angle_to_t ( double  angle_)
static

Convert angle in radian to parametric:

◆ angles_are_valid()

bool geomtools::helix_3d::angles_are_valid ( ) const

Check if angles are valid.

◆ dump()

void geomtools::helix_3d::dump ( ) const

Basic print.

◆ generate_wires_self()

virtual void geomtools::helix_3d::generate_wires_self ( wires_type wires_,
uint32_t  options_ = 0 
) const
virtual

Generate a sequence of polylines for wires 3D rendering.

Implements geomtools::i_wires_3d_rendering.

◆ get_angle1()

double geomtools::helix_3d::get_angle1 ( ) const

Return the start angle.

◆ get_angle2()

double geomtools::helix_3d::get_angle2 ( ) const

Return the stop angle.

◆ get_center()

const vector_3d& geomtools::helix_3d::get_center ( ) const

Return a reference to the non mutable center.

◆ get_curvilinear_position()

double geomtools::helix_3d::get_curvilinear_position ( double  t_) const

Return the curvilinear position from the normalized angle.

◆ get_direction_on_curve()

virtual vector_3d geomtools::helix_3d::get_direction_on_curve ( const vector_3d position_) const
virtual

Return the direction ar some position in on the curve.

Implements geomtools::i_shape_1d.

◆ get_first()

vector_3d geomtools::helix_3d::get_first ( ) const

Return the start position on the helix.

◆ get_last()

vector_3d geomtools::helix_3d::get_last ( ) const

Return the stop position on the helix.

◆ get_length()

virtual double geomtools::helix_3d::get_length ( uint32_t  flags_ = PATH_ALL_BITS) const
virtual

Return the length.

Reimplemented from geomtools::i_shape_1d.

◆ get_point()

vector_3d geomtools::helix_3d::get_point ( double  t_) const

Return the position on the helix for a given normalized angle.

◆ get_point_xy()

vector_3d geomtools::helix_3d::get_point_xy ( double  theta_) const

Return the position on the helix for a given angle.

◆ get_radius()

double geomtools::helix_3d::get_radius ( ) const

Return the radius.

◆ get_shape_name()

virtual std::string geomtools::helix_3d::get_shape_name ( ) const
virtual

Return the identifier/name of the shape.

Implements geomtools::i_object_3d.

◆ get_step()

double geomtools::helix_3d::get_step ( ) const

Return the step.

◆ get_t()

double geomtools::helix_3d::get_t ( vector_3d  point_) const

Return the normalized angle associated to a position in the reference frame of the helix.

◆ get_t1()

double geomtools::helix_3d::get_t1 ( ) const

Return the normalized start angle.

◆ get_t2()

double geomtools::helix_3d::get_t2 ( ) const

Return the normalized stop angle.

◆ get_t_from_xyz()

double geomtools::helix_3d::get_t_from_xyz ( double  x_,
double  y_,
double  z_ 
) const

Return the normalized angle associated to a (x,y,z) position triplet in the reference frame of the helix.

◆ get_t_from_z()

double geomtools::helix_3d::get_t_from_z ( double  z_) const

Return the normalized angle associated to a z position in the reference frame of the helix.

◆ get_theta_from_xy()

double geomtools::helix_3d::get_theta_from_xy ( double  x_,
double  y_ 
) const

Return the angle associated to given (x,y) position in the reference frame of the helix.

◆ get_z_from_t()

double geomtools::helix_3d::get_z_from_t ( double  t_) const

Return the z position associated to a normalized angle.

◆ grab_center()

vector_3d& geomtools::helix_3d::grab_center ( )

Return a reference to the mutable center.

◆ helix_3d_label()

static const std::string& geomtools::helix_3d::helix_3d_label ( )
static

Return the identifier label for the class.

◆ invalidate()

void geomtools::helix_3d::invalidate ( )

Invalidate the helix.

◆ invalidate_angles()

void geomtools::helix_3d::invalidate_angles ( )

Invalidate helix's angles.

◆ is_normal()

bool geomtools::helix_3d::is_normal ( )

Check if the shape is normal.

◆ is_on_curve()

virtual bool geomtools::helix_3d::is_on_curve ( const vector_3d position_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
) const
virtual

Check if a position in on the curve.

Implements geomtools::i_shape_1d.

◆ is_valid()

bool geomtools::helix_3d::is_valid ( ) const
virtual

Check if the helix is valid.

Implements geomtools::i_object_3d.

◆ make_vertex_collection() [1/2]

void geomtools::helix_3d::make_vertex_collection ( basic_polyline_3d ,
double  angular_step_ = 0.0 
) const

Compute a collection of vertexes representing the helix.

◆ make_vertex_collection() [2/2]

basic_polyline_3d geomtools::helix_3d::make_vertex_collection ( ) const

Return a collection of vertexes representing the helix.

◆ print_xyz()

static void geomtools::helix_3d::print_xyz ( std::ostream &  out_,
const helix_3d helix_,
double  step_angle_ = 0.0,
unsigned int  flags_ = 0 
)
static

Print approximated data (x,y,z) triplets representing the helix.

◆ reset()

void geomtools::helix_3d::reset ( )
virtual

Reset.

Reimplemented from geomtools::i_object_3d.

◆ set_angle1()

void geomtools::helix_3d::set_angle1 ( double  )

Set the start angle.

◆ set_angle2()

void geomtools::helix_3d::set_angle2 ( double  )

Set the stop angle.

◆ set_center() [1/2]

void geomtools::helix_3d::set_center ( const vector_3d )

Set the center.

◆ set_center() [2/2]

void geomtools::helix_3d::set_center ( double  x_,
double  y_,
double  z_ 
)

Set the center.

◆ set_radius()

void geomtools::helix_3d::set_radius ( double  )

Set the radius.

◆ set_step()

void geomtools::helix_3d::set_step ( double  )

Set the step.

◆ set_t1()

void geomtools::helix_3d::set_t1 ( double  )

Set the normalized start angle.

◆ set_t2()

void geomtools::helix_3d::set_t2 ( double  )

Set the normalized stop angle.

◆ t_is_valid()

bool geomtools::helix_3d::t_is_valid ( double  t_) const

Check if a given normalized angle is valid.

◆ t_to_angle()

static double geomtools::helix_3d::t_to_angle ( double  t_)
static

Convert parametric to angle in radian:

◆ tree_dump()

virtual void geomtools::helix_3d::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_object_3d.


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