Bayeux  3.4.1
Core Foundation library for SuperNEMO
cylindrical_sector.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2015-02-26
4  * Last modified: 2016-03-10
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Cylindrical sector
11  *
12  */
13 
14 #ifndef GEOMTOOLS_CYLINDRICAL_SECTOR_H
15 #define GEOMTOOLS_CYLINDRICAL_SECTOR_H 1
16 
17 // This project:
18 #include <geomtools/i_shape_2d.h>
20 
21 namespace geomtools {
22 
25  {
26  public:
27 
29  static const std::string & cylindrical_sector_label();
30 
32  virtual std::string get_shape_name() const;
33 
35  void set_radius(double new_value_);
36 
38  double get_radius() const;
39 
41  void set_z(double new_value_);
42 
44  double get_z() const;
45 
47  const angular_range & get_angle_domain() const;
48 
50  bool has_partial_angle() const;
51 
53  bool has_start_angle() const;
54 
56  void set_start_angle(double);
57 
59  double get_start_angle() const;
60 
62  bool has_delta_angle() const;
63 
65  void set_delta_angle(double);
66 
68  double get_delta_angle() const;
69 
71  void set(double radius_,
72  double z_,
73  double start_angle_,
74  double delta_angle_);
75 
78 
80  cylindrical_sector(double radius_,
81  double z_);
82 
84  cylindrical_sector(double radius_,
85  double z_,
86  double start_angle_,
87  double delta_angle_);
88 
90  virtual ~cylindrical_sector();
91 
93  void initialize(const datatools::properties &, const handle_dict_type * = 0);
94 
96  void reset();
97 
99  bool is_valid() const;
100 
102  virtual double get_surface(uint32_t flags_ = ALL_PIECES) const;
103 
105  virtual bool is_on_surface(const vector_3d &,
106  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
107 
109  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
110  bool check_ = true,
111  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
112 
114  virtual bool find_intercept(const vector_3d & from_,
115  const vector_3d & direction_,
116  face_intercept_info & intercept_,
117  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
118 
120  virtual void tree_dump(std::ostream & out_ = std::clog,
121  const std::string & title_ = "",
122  const std::string & indent_ = "",
123  bool inherit_= false) const;
124 
136  };
137 
139  virtual void generate_wires_self(wires_type & wires_,
140  uint32_t options_ = 0) const;
141 
142  protected:
143 
145  void _set_defaults();
146 
147  private:
148 
149  double _radius_;
150  double _z_;
151  angular_range _angle_domain_;
152 
153  };
154 
155 } // end of namespace geomtools
156 
157 #endif // GEOMTOOLS_CYLINDRICAL_SECTOR_H
158 
159 /*
160 ** Local Variables: --
161 ** mode: c++ --
162 ** c-file-style: "gnu" --
163 ** tab-width: 2 --
164 ** End: --
165 */
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
static const std::string & cylindrical_sector_label()
Return the identifier label for the class.
Do not render the bottom edge.
Definition: cylindrical_sector.h:127
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
double get_delta_angle() const
Return the delta angle.
Last defined bit.
Definition: cylindrical_sector.h:131
const angular_range & get_angle_domain() const
Return the angle domain.
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.
void set_delta_angle(double)
Set the delta angle.
double get_z() const
Return the height.
virtual bool is_on_surface(const vector_3d &, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is on the surface.
Do not render the top edge.
Definition: cylindrical_sector.h:128
Do not render the stop angle edge.
Definition: cylindrical_sector.h:130
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.
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
Rendering options bit mask.
Definition: cylindrical_sector.h:132
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
void set_start_angle(double)
Set the start angle.
A spherical sector (2D shape)
Definition: cylindrical_sector.h:24
bool has_start_angle() const
Check the start angle.
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
double get_start_angle() const
Return the start angle.
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
void set(double radius_, double z_, double start_angle_, double delta_angle_)
Set the radius and angular bounds.
std::map< std::string, object_entry > handle_dict_type
Dictionary of handle of 3D object entries.
Definition: i_object_3d.h:124
Angular range.
Definition: angular_range.h:33
bool has_partial_angle() const
Check if the sector has partial angle.
cylindrical_sector()
Default constructor.
The abstract base class for all 2D shapes/surfaces.
Definition: i_shape_2d.h:37
void set_radius(double new_value_)
Set the radius.
void set_z(double new_value_)
Set the height.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
virtual ~cylindrical_sector()
Destructor.
Last defined bit.
Definition: i_wires_3d_rendering.h:62
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
bool has_delta_angle() const
Check the delta angle.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
bool is_valid() const
Check if the rectangle is valid.
Do not render the start angle edge.
Definition: cylindrical_sector.h:129
void _set_defaults()
Set default attributes.
cylsec_wires_rendering_option_type
3D rendering options
Definition: cylindrical_sector.h:126
double get_radius() const
Return the radius.
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125