Bayeux  3.4.1
Core Foundation library for SuperNEMO
toroid_nappe.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2016-02-18
4  * Last modified: 2016-02-18
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Toroid nappe
11  *
12  */
13 
14 #ifndef GEOMTOOLS_TOROID_NAPPE_H
15 #define GEOMTOOLS_TOROID_NAPPE_H 1
16 
17 // This project:
18 #include <geomtools/i_shape_2d.h>
20 
21 namespace geomtools {
22 
24  class toroid_nappe : public i_shape_2d
25  {
26  public:
27 
29  static const std::string & toroid_nappe_label();
30 
32  virtual std::string get_shape_name() const;
33 
35  bool is_valid() const;
36 
38  void set_sweep_radius(double new_value_);
39 
41  double get_sweep_radius() const;
42 
44  void set_radius(double new_value_);
45 
47  double get_radius() const;
48 
50  bool has_partial_phi() const;
51 
53  bool has_start_phi() const;
54 
56  void set_start_phi(double);
57 
59  double get_start_phi() const;
60 
62  bool has_delta_phi() const;
63 
65  void set_delta_phi(double);
66 
68  double get_delta_phi() const;
69 
71  virtual double get_surface(uint32_t flags_ = ALL_PIECES) const;
72 
74  toroid_nappe();
75 
77  toroid_nappe(double sweep_radius_, double radius_);
78 
80  toroid_nappe(double sweep_radius_,
81  double radius_,
82  double start_phi_,
83  double delta_phi_);
84 
86  virtual ~toroid_nappe();
87 
89  void initialize(const datatools::properties &, const handle_dict_type * = 0);
90 
92  void reset();
93 
95  virtual bool is_on_surface(const vector_3d &,
96  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
97 
99  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
100  bool check_ = true,
101  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
102 
104  virtual bool find_intercept(const vector_3d & from_,
105  const vector_3d & direction_,
106  face_intercept_info & intercept_,
107  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
108 
110  virtual void tree_dump(std::ostream & out_ = std::clog,
111  const std::string & title_ = "",
112  const std::string & indent_ = "",
113  bool inherit_= false) const;
114 
122  };
123 
125  virtual void generate_wires_self(wires_type & wires_,
126  uint32_t options_ = 0) const;
127 
128  protected:
129 
131  void _set_defaults();
132 
134  void _at_init();
135 
136  private:
137 
138  double _sweep_radius_;
139  double _radius_;
140  angular_range _phi_domain_;
141 
142  // Registration interface :
144 
145  };
146 
147 } // end of namespace geomtools
148 
149 #endif // GEOMTOOLS_TOROID_NAPPE_H
150 
151 /*
152 ** Local Variables: --
153 ** mode: c++ --
154 ** c-file-style: "gnu" --
155 ** tab-width: 2 --
156 ** End: --
157 */
virtual bool is_on_surface(const vector_3d &, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is on the surface.
void set_delta_phi(double)
Set the delta phi angle.
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
void set_sweep_radius(double new_value_)
Set the sweep radius.
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
Rendering options bit mask.
Definition: toroid_nappe.h:120
bool is_valid() const
Check if the rectangle is valid.
virtual vector_3d get_normal_on_surface(const vector_3d &position_, bool check_=true, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
Return the normal at a given position of the surface.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
bool has_start_phi() const
Check the start phi angle.
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
toroid_nappe_wires_rendering_option_type
3D rendering options
Definition: toroid_nappe.h:116
toroid_nappe()
Default constructor.
void set_start_phi(double)
Set the start phi angle.
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
Do not render the start theta edge.
Definition: toroid_nappe.h:117
virtual ~toroid_nappe()
Destructor.
void _at_init()
Action at initialization.
std::map< std::string, object_entry > handle_dict_type
Dictionary of handle of 3D object entries.
Definition: i_object_3d.h:124
void set_radius(double new_value_)
Set the radius.
virtual bool find_intercept(const vector_3d &from_, const vector_3d &direction_, face_intercept_info &intercept_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Find the intercept point of a segment with the surface.
Angular range.
Definition: angular_range.h:33
double get_delta_phi() const
Return the delta angle.
#define GEOMTOOLS_OBJECT_3D_REGISTRATION_INTERFACE(ModelClassName)
Definition: i_object_3d.h:260
double get_sweep_radius() const
Return the sweep radius.
The abstract base class for all 2D shapes/surfaces.
Definition: i_shape_2d.h:37
bool has_partial_phi() const
Check if the sector has partial phi angle.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
A toroid nappe (2D shape)
Definition: toroid_nappe.h:24
Do not render the stop theta edge.
Definition: toroid_nappe.h:118
bool has_delta_phi() const
Check the delta phi angle.
double get_radius() const
Return the radius.
Last defined bit.
Definition: i_wires_3d_rendering.h:62
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
Last defined bit.
Definition: toroid_nappe.h:119
double get_start_phi() const
Return the start phi angle.
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
void _set_defaults()
Set default attributes.
static const std::string & toroid_nappe_label()
Return the identifier label for the class.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125