Bayeux  3.4.1
Core Foundation library for SuperNEMO
disk.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-02-14
4  * Last modified: 2015-02-15
5  *
6  * License:
7  *
8  * Description:
9  *
10  * A disk in x-y plane
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_DISK_H
17 #define GEOMTOOLS_DISK_H 1
18 
19 // This project:
20 #include <geomtools/i_shape_2d.h>
22 
23 namespace geomtools {
24 
26  class disk : public i_shape_2d
27  {
28 
29  public:
30 
32  static const std::string & disk_label();
33 
35  bool is_valid() const;
36 
38  void set_outer_r(double);
39 
41  double get_outer_r() const;
42 
44  void set_r(double);
45 
47  double get_r() const;
48 
50  double get_radius() const;
51 
53  void set_diameter(double);
54 
56  double get_diameter() const;
57 
59  bool has_inner_r() const;
60 
62  double get_inner_r() const;
63 
65  void set_inner_r(double);
66 
68  const angular_range & get_angle_domain() const;
69 
71  bool has_start_angle() const;
72 
74  void set_start_angle(double);
75 
77  double get_start_angle() const;
78 
80  bool has_delta_angle() const;
81 
83  void set_delta_angle(double);
84 
86  double get_delta_angle() const;
87 
89  bool has_partial_angle() const;
90 
92  virtual double get_surface(uint32_t flags_ = ALL_PIECES) const;
93 
95  virtual double get_perimeter(uint32_t flags_ = ALL_PIECES) const;
96 
98  double get_circumference() const;
99 
100  // Set the parameters
101  void set(double inner_r_, double outer_r_);
102 
103  // Set the parameters
104  void set(double inner_r_, double outer_r_, double start_angle_, double delta_angle_);
105 
107  disk();
108 
110  disk(double outer_r_);
111 
113  disk(double inner_r_, double outer_r_);
114 
116  disk(double inner_r_, double outer_r_, double start_angle_, double delta_angle_);
117 
119  virtual ~disk();
120 
122  void initialize(const datatools::properties &, const handle_dict_type * = 0);
123 
125  void reset();
126 
128  virtual std::string get_shape_name() const;
129 
131  virtual bool is_on_surface(const vector_3d &,
132  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
133 
135  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
136  bool check_ = true,
137  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
138 
140  virtual bool find_intercept(const vector_3d & from_,
141  const vector_3d & direction_,
142  face_intercept_info & intercept_,
143  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
144 
146  virtual void tree_dump(std::ostream & out_ = std::clog,
147  const std::string & title_ = "",
148  const std::string & indent_ = "",
149  bool inherit_= false) const;
150 
162  };
163 
165  virtual void generate_wires_self(wires_type & wires_,
166  uint32_t options_ = 0) const;
167 
168  protected:
169 
171  void _set_defaults();
172 
173  private:
174 
175  double _inner_radius_;
176  double _outer_radius_;
177  angular_range _angle_domain_;
178 
179  // Registration interface :
181 
182  };
183 
184 } // end of namespace geomtools
185 
186 #endif // GEOMTOOLS_DISK_H
187 
188 /*
189 ** Local Variables: --
190 ** mode: c++ --
191 ** c-file-style: "gnu" --
192 ** tab-width: 2 --
193 ** End: --
194 */
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
double get_radius() const
Return the outer radius.
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
double get_r() const
Return the outer radius.
disk()
Default constructor.
bool is_valid() const
Check if the disk is valid.
void set_inner_r(double)
Set the inner radius.
double get_start_angle() const
Return the start angle.
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
double get_diameter() const
Return the outer diameter.
void set_r(double)
Set the outer radius.
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
virtual bool is_on_surface(const vector_3d &, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is on the surface.
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
Do not render the internal edge.
Definition: disk.h:154
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
double get_inner_r() const
Return the inner radius.
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.
Disk rendering options bit mask.
Definition: disk.h:158
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
static const std::string & disk_label()
Return the identifier label for the class.
void reset()
Reset.
std::map< std::string, object_entry > handle_dict_type
Dictionary of handle of 3D object entries.
Definition: i_object_3d.h:124
virtual double get_perimeter(uint32_t flags_=ALL_PIECES) const
Return the perimeter.
Angular range.
Definition: angular_range.h:33
void set_delta_angle(double)
Set the delta angle.
#define GEOMTOOLS_OBJECT_3D_REGISTRATION_INTERFACE(ModelClassName)
Definition: i_object_3d.h:260
Do not render the external edge.
Definition: disk.h:153
The abstract base class for all 2D shapes/surfaces.
Definition: i_shape_2d.h:37
const angular_range & get_angle_domain() const
Return the angle domain.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
Last defined bit.
Definition: i_wires_3d_rendering.h:62
Do not render the stop angle edge.
Definition: disk.h:156
void _set_defaults()
Set default attributes values.
virtual bool find_intercept(const vector_3d &from_, const vector_3d &direction_, face_intercept_info &intercept_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Find some intercept point on the surface.
double get_delta_angle() const
Return the delta angle.
Do not render the start angle edge.
Definition: disk.h:155
void set_diameter(double)
Set the outer diameter.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
bool has_partial_angle() const
Check for the partial angle.
bool has_inner_r() const
Check the inner radius.
double get_circumference() const
Return the circumference.
bool has_start_angle() const
Check the start angle.
bool has_delta_angle() const
Check the dedislta angle.
disk_wires_rendering_option_type
3D rendering options
Definition: disk.h:152
virtual ~disk()
Destructor.
void set_outer_r(double)
Set the outer radius.
void set_start_angle(double)
Set the start angle.
Last defined bit.
Definition: disk.h:157
void set(double inner_r_, double outer_r_)
double get_outer_r() const
Return the outer radius.
A disk/ring sector surface (2D shape)
Definition: disk.h:26
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125