Bayeux  3.4.1
Core Foundation library for SuperNEMO
ellipsoid_sector.h
Go to the documentation of this file.
1 /* Author(s): F.Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2015-03-01
4  * Last modified: 2015-03-01
5  *
6  * License:
7  *
8  * Description:
9  * 3D ellipsoid description
10  *
11  * History:
12  *
13  */
14 
15 #ifndef GEOMTOOLS_ELLIPSOID_SECTOR_H
16 #define GEOMTOOLS_ELLIPSOID_SECTOR_H 1
17 
18 // Standard library:
19 #include <string>
20 #include <iostream>
21 
22 // Third party
23 // - Bayeux/datatools:
24 #include <datatools/bit_mask.h>
25 
26 // This project:
27 #include <geomtools/i_shape_2d.h>
29 
30 namespace datatools {
31  // Forward class declaration:
32  class properties;
33 }
34 
35 namespace geomtools {
36 
39  {
40  public:
41 
43  static const std::string & ellipsoid_sector_label();
44 
46  virtual std::string get_shape_name() const;
47 
48  double get_x_radius() const;
49 
50  void set_x_radius(double);
51 
52  double get_y_radius() const;
53 
54  void set_y_radius(double);
55 
56  double get_z_radius() const;
57 
58  void set_z_radius(double);
59 
60  double get_bottom_z_cut() const;
61 
62  void set_bottom_z_cut(double);
63 
64  double get_top_z_cut() const;
65 
66  void set_top_z_cut(double);
67 
68  void set(double rx_, double ry_, double rz_);
69 
70  void set(double rx_, double ry_, double rz_,
71  double zm_, double zp_);
72 
74  const angular_range & get_angle_domain() const;
75 
77  bool has_partial_angle() const;
78 
80  bool has_start_angle() const;
81 
83  void set_start_angle(double);
84 
86  double get_start_angle() const;
87 
89  bool has_delta_angle() const;
90 
92  void set_delta_angle(double);
93 
95  double get_delta_angle() const;
96 
99 
101  ellipsoid_sector(double rx_, double ry_, double rz_);
102 
104  ellipsoid_sector(double rx_, double ry_, double rz_,
105  double zm_, double zp_);
106 
108  ellipsoid_sector(double rx_, double ry_, double rz_,
109  double zm_, double zp_,
110  double start_angle_, double delta_angle_);
111 
113  virtual ~ellipsoid_sector();
114 
116  bool is_valid() const;
117 
119  void initialize(const datatools::properties &, const handle_dict_type * = 0);
120 
122  void reset();
123 
125  virtual double get_surface(uint32_t mask_ = ALL_PIECES) const;
126 
128  virtual bool is_on_surface(const vector_3d & ,
129  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
130 
132  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
133  bool check_ = true,
134  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
135 
137  virtual bool find_intercept(const vector_3d & from_,
138  const vector_3d & direction_,
139  face_intercept_info & intercept_,
140  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
141 
143  virtual void tree_dump(std::ostream & out_ = std::clog,
144  const std::string & title_ = "",
145  const std::string & indent_ = "",
146  bool inherit_ = false) const;
147 
158  )
159  };
160 
162  virtual void generate_wires_self(wires_type & wires_,
163  uint32_t options_ = 0) const;
164 
165  protected:
166 
168  void _set_defaults();
169 
170  private:
171 
172  double _x_radius_;
173  double _y_radius_;
174  double _z_radius_;
175  angular_range _angle_domain_;
176  double _bottom_z_cut_;
177  double _top_z_cut_;
178 
179  // Registration interface :
181 
182  };
183 
184 } // end of namespace geomtools
185 
186 #endif // GEOMTOOLS_ELLIPSOID_SECTOR_H
187 
188 /*
189 ** Local Variables: --
190 ** mode: c++ --
191 ** c-file-style: "gnu" --
192 ** tab-width: 2 --
193 ** End: --
194 */
virtual bool find_intercept(const vector_3d &from_, const vector_3d &direction_, face_intercept_info &intercept_, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
Find the intercept point of a segment with the surface.
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 double get_surface(uint32_t mask_=ALL_PIECES) const
Return the surface.
Last defined bit.
Definition: ellipsoid_sector.h:154
bool has_delta_angle() const
Check the delta angle.
virtual bool is_on_surface(const vector_3d &, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is on the surface.
ellipsoid_sector()
Constructor.
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
bool has_partial_angle() const
Check if the sector has partial angle.
double get_bottom_z_cut() const
Do not render the top edge.
Definition: ellipsoid_sector.h:151
Do not render the start angle edge.
Definition: ellipsoid_sector.h:152
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
double get_delta_angle() const
Return the delta angle.
bool has_start_angle() const
Check the start angle.
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
void set_delta_angle(double)
Set the delta angle.
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
virtual ~ellipsoid_sector()
Destructor.
void set(double rx_, double ry_, double rz_)
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
double get_top_z_cut() const
std::map< std::string, object_entry > handle_dict_type
Dictionary of handle of 3D object entries.
Definition: i_object_3d.h:124
void set_start_angle(double)
Set the start angle.
Angular range.
Definition: angular_range.h:33
ellsec_wires_rendering_option_type
3D rendering options
Definition: ellipsoid_sector.h:149
Do not render the bottom edge.
Definition: ellipsoid_sector.h:150
Rendering options bit mask.
Definition: ellipsoid_sector.h:155
#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
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
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: ellipsoid_sector.h:153
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
bool is_valid() const
Check the validity of the ellipsoid sector.
double get_start_angle() const
Return the start angle.
static const std::string & ellipsoid_sector_label()
Return the identifier label for the class.
const angular_range & get_angle_domain() const
Return the angle domain.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
The 2D shape/surface model for an ellipsoid sector.
Definition: ellipsoid_sector.h:38
void reset()
Reset the ellipsoid sector.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125
void _set_defaults()
Set default attributes.