Bayeux  3.4.1
Core Foundation library for SuperNEMO
elliptical_cylinder_sector.h
Go to the documentation of this file.
1 /* Author(s): F.Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2015-03-02
4  * Last modified: 2015-03-02
5  *
6  * License:
7  *
8  * Description:
9  *
10  * elliptical cylinder surface sector
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_ELLIPTICAL_CYLINDER_SECTOR_H
17 #define GEOMTOOLS_ELLIPTICAL_CYLINDER_SECTOR_H 1
18 
19 // Standard library:
20 #include <string>
21 #include <iostream>
22 
23 // Third party
24 // - Bayeux/datatools:
25 #include <datatools/bit_mask.h>
26 
27 // This project:
28 #include <geomtools/i_shape_2d.h>
30 
31 namespace datatools {
32  // Forward class declaration:
33  class properties;
34 }
35 
36 namespace geomtools {
37 
40  {
41  public:
42 
44  static const std::string & elliptical_cylinder_sector_label();
45 
47  virtual std::string get_shape_name() const;
48 
49  double get_x_radius() const;
50 
51  void set_x_radius(double);
52 
53  double get_y_radius() const;
54 
55  void set_y_radius(double);
56 
57  double get_z() const;
58 
59  void set_z(double);
60 
61  void set(double rx_, double ry_, double z_);
62 
63  void set(double rx_, double ry_, double z_,
64  double start_angle_, double delta_angle_);
65 
67  const angular_range & get_angle_domain() const;
68 
70  bool has_partial_angle() const;
71 
73  bool has_start_angle() const;
74 
76  void set_start_angle(double);
77 
79  double get_start_angle() const;
80 
82  bool has_delta_angle() const;
83 
85  void set_delta_angle(double);
86 
88  double get_delta_angle() const;
89 
92 
94  elliptical_cylinder_sector(double rx_, double ry_, double z_);
95 
97  elliptical_cylinder_sector(double rx_, double ry_, double z_,
98  double start_angle_, double delta_angle_);
99 
101  virtual ~elliptical_cylinder_sector();
102 
104  bool is_valid() const;
105 
107  void initialize(const datatools::properties &, const handle_dict_type * = 0);
108 
110  void reset();
111 
113  virtual double get_surface(uint32_t mask_ = i_shape_2d::FACE_ALL) const;
114 
116  virtual bool is_on_surface(const vector_3d & ,
117  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
118 
120  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
121  bool check_ = true,
122  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
123 
125  virtual bool find_intercept(const vector_3d & from_,
126  const vector_3d & direction_,
127  face_intercept_info & intercept_,
128  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
129 
131  virtual void tree_dump(std::ostream & out_ = std::clog,
132  const std::string & title_ = "",
133  const std::string & indent_ = "",
134  bool inherit_ = false) const;
135 
146  )
147  };
148 
150  virtual void generate_wires_self(wires_type & wires_,
151  uint32_t options_ = 0) const;
152 
153  protected:
154 
156  void _set_defaults();
157 
158  private:
159 
160  double _x_radius_;
161  double _y_radius_;
162  double _z_;
163  angular_range _angle_domain_;
164 
165  // Registration interface :
167 
168  };
169 
170 } // end of namespace geomtools
171 
172 #endif // GEOMTOOLS_ELLIPTICAL_CYLINDER_SECTOR_H
173 
174 /*
175 ** Local Variables: --
176 ** mode: c++ --
177 ** c-file-style: "gnu" --
178 ** tab-width: 2 --
179 ** End: --
180 */
static const std::string & elliptical_cylinder_sector_label()
Return the identifier label for the class.
void set(double rx_, double ry_, double z_)
bool has_partial_angle() const
Check if the sector has partial angle.
Last defined bit.
Definition: elliptical_cylinder_sector.h:142
Do not render the bottom edge.
Definition: elliptical_cylinder_sector.h:138
bool has_delta_angle() const
Check the delta angle.
Do not render the top edge.
Definition: elliptical_cylinder_sector.h:139
void set_delta_angle(double)
Set the delta angle.
The 2D shape/surface model for an elliptical cylinder sector.
Definition: elliptical_cylinder_sector.h:39
Do not render the start angle edge.
Definition: elliptical_cylinder_sector.h:140
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.
Definition: i_shape_2d.h:49
void set_start_angle(double)
Set the start angle.
virtual bool is_on_surface(const vector_3d &, double skin_=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
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
double get_delta_angle() const
Return the delta angle.
Rendering options bit mask.
Definition: elliptical_cylinder_sector.h:143
void _set_defaults()
Set default attributes.
virtual double get_surface(uint32_t mask_=i_shape_2d::FACE_ALL) const
Return 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.
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
#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 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.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
const angular_range & get_angle_domain() const
Return the angle domain.
Last defined bit.
Definition: i_wires_3d_rendering.h:62
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
virtual ~elliptical_cylinder_sector()
Destructor.
double get_start_angle() const
Return the start angle.
ellcylsec_wires_rendering_option_type
3D rendering options
Definition: elliptical_cylinder_sector.h:137
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
bool is_valid() const
Check the validity of the shape.
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
bool has_start_angle() const
Check the start angle.
Do not render the stop angle edge.
Definition: elliptical_cylinder_sector.h:141
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125