Bayeux  3.4.1
Core Foundation library for SuperNEMO
spherical_sector.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2015-02-23
4  * Last modified: 2015-02-23
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Spherical sector
11  *
12  */
13 
14 #ifndef GEOMTOOLS_SPHERICAL_SECTOR_H
15 #define GEOMTOOLS_SPHERICAL_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 & spherical_sector_label();
30 
32  virtual std::string get_shape_name() const;
33 
35  bool is_valid() const;
36 
38  void set_radius(double new_value_);
39 
41  double get_radius() const;
42 
44  const angular_range & get_theta_domain() const;
45 
47  bool has_partial_theta() const;
48 
50  bool has_start_theta() const;
51 
53  void set_start_theta(double);
54 
56  double get_start_theta() const;
57 
59  bool has_delta_theta() const;
60 
62  void set_delta_theta(double);
63 
65  double get_delta_theta() const;
66 
68  const angular_range & get_phi_domain() const;
69 
71  bool has_partial_phi() const;
72 
74  bool has_start_phi() const;
75 
77  void set_start_phi(double);
78 
80  double get_start_phi() const;
81 
83  bool has_delta_phi() const;
84 
86  void set_delta_phi(double);
87 
89  double get_delta_phi() const;
90 
92  virtual double get_surface(uint32_t flags_ = ALL_PIECES) const;
93 
96 
98  spherical_sector(double radius_);
99 
101  spherical_sector(double radius_,
102  double start_theta_,
103  double delta_theta_,
104  double start_phi_,
105  double delta_phi_);
106 
108  virtual ~spherical_sector();
109 
111  void initialize(const datatools::properties &, const handle_dict_type * = 0);
112 
114  void reset();
115 
117  virtual bool is_on_surface(const vector_3d &,
118  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
119 
121  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
122  bool check_ = true,
123  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
124 
126  virtual bool find_intercept(const vector_3d & from_,
127  const vector_3d & direction_,
128  face_intercept_info & intercept_,
129  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
130 
132  virtual void tree_dump(std::ostream & out_ = std::clog,
133  const std::string & title_ = "",
134  const std::string & indent_ = "",
135  bool inherit_= false) const;
136 
150  };
151 
153  virtual void generate_wires_self(wires_type & wires_,
154  uint32_t options_ = 0) const;
155 
156  protected:
157 
159  void _set_defaults();
160 
161  private:
162 
163  double _radius_;
164  angular_range _theta_domain_;
165  angular_range _phi_domain_;
166 
167  // Registration interface :
169 
170  };
171 
172 } // end of namespace geomtools
173 
174 #endif // GEOMTOOLS_SPHERICAL_SECTOR_H
175 
176 /*
177 ** Local Variables: --
178 ** mode: c++ --
179 ** c-file-style: "gnu" --
180 ** tab-width: 2 --
181 ** End: --
182 */
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
A sperical sector (2D shape)
Definition: spherical_sector.h:24
void set_start_phi(double)
Set the start phi angle.
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
double get_radius() const
Return the radius.
virtual ~spherical_sector()
Destructor.
bool has_partial_theta() const
Check if the sector has partial theta angle.
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
void _set_defaults()
Set default attributes.
Last defined bit.
Definition: spherical_sector.h:144
bool has_delta_phi() const
Check the delta phi angle.
void set_radius(double new_value_)
Set the radius.
bool has_start_phi() const
Check the start phi angle.
double get_start_theta() const
Return the start theta angle.
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
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.
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
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.
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
static const std::string & spherical_sector_label()
Return the identifier label for the class.
double get_start_phi() const
Return the start phi angle.
Use Z sampling rather than theta sampling for parallel arcs.
Definition: spherical_sector.h:143
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
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
Do not render the start phi edge.
Definition: spherical_sector.h:141
#define GEOMTOOLS_OBJECT_3D_REGISTRATION_INTERFACE(ModelClassName)
Definition: i_object_3d.h:260
The abstract base class for all 2D shapes/surfaces.
Definition: i_shape_2d.h:37
Do not render the start theta edge.
Definition: spherical_sector.h:139
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
double get_delta_phi() const
Return the delta angle.
virtual bool is_on_surface(const vector_3d &, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is on the surface.
Last defined bit.
Definition: i_wires_3d_rendering.h:62
Rendering options bit mask.
Definition: spherical_sector.h:145
spherical_sector()
Default constructor.
Do not render the stop phi edge.
Definition: spherical_sector.h:142
void set_start_theta(double)
Set the start theta angle.
bool has_partial_phi() const
Check if the sector has partial phi angle.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
sphesec_wires_rendering_option_type
3D rendering options
Definition: spherical_sector.h:138
bool is_valid() const
Check if the rectangle is valid.
double get_delta_theta() const
Return the delta angle.
void set_delta_theta(double)
Set the delta theta angle.
Do not render the stop theta edge.
Definition: spherical_sector.h:140
const angular_range & get_phi_domain() const
Return the phi domain (azimuthal angle)
bool has_delta_theta() const
Check the delta theta angle.
void set_delta_phi(double)
Set the delta phi angle.
const angular_range & get_theta_domain() const
Return the theta domain (polar angle)
bool has_start_theta() const
Check the start theta angle.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125