Bayeux  3.4.1
Core Foundation library for SuperNEMO
elliptical_sector.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 elliptical_sector in x-y plane
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_ELLIPTICAL_SECTOR_H
17 #define GEOMTOOLS_ELLIPTICAL_SECTOR_H 1
18 
19 // This project:
20 #include <geomtools/i_shape_2d.h>
22 
23 namespace geomtools {
24 
25  // Forward class declaration:
26  class ellipse;
27 
30  {
31 
32  public:
33 
35  static const std::string & elliptical_sector_label();
36 
38  bool is_valid() const;
39 
41  double get_x_radius() const;
42 
44  double get_y_radius() const;
45 
47  void set_radii(double x_radius_, double y_radius_);
48 
50  void set_x_radius(double x_radius_);
51 
53  void set_y_radius(double y_radius_);
54 
56  const angular_range & get_angle_domain() const;
57 
59  bool has_partial_angle() const;
60 
62  bool has_start_angle() const;
63 
65  void set_start_angle(double);
66 
68  double get_start_angle() const;
69 
71  bool has_delta_angle() const;
72 
74  void set_delta_angle(double);
75 
77  double get_delta_angle() const;
78 
80  virtual double get_surface(uint32_t flags_ = ALL_PIECES) const;
81 
83  virtual double get_perimeter(uint32_t flags_ = ALL_PIECES) const;
84 
86  double get_circumference() const;
87 
89  void compute_edge(ellipse & edge_) const;
90 
91  // Set the parameters
92  void set(double x_radius_, double y_radius_);
93 
94  // Set the parameters
95  void set(double x_radius_, double y_radius_, double start_angle_, double delta_angle_);
96 
99 
101  elliptical_sector(double x_radius_, double y_radius_);
102 
104  elliptical_sector(double x_radius_, double y_radius_,
105  double start_angle_, double delta_angle_);
106 
108  virtual ~elliptical_sector();
109 
111  void initialize(const datatools::properties &, const handle_dict_type * = 0);
112 
114  void reset();
115 
117  virtual std::string get_shape_name() const;
118 
120  virtual bool is_on_surface(const vector_3d &,
121  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
122 
124  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
125  bool check_ = true,
126  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
127 
129  virtual bool find_intercept(const vector_3d & from_,
130  const vector_3d & direction_,
131  face_intercept_info & intercept_,
132  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
133 
135  virtual void tree_dump(std::ostream & out_ = std::clog,
136  const std::string & title_ = "",
137  const std::string & indent_ = "",
138  bool inherit_= false) const;
139 
149  };
150 
152  virtual void generate_wires_self(wires_type & wires_,
153  uint32_t options_ = 0) const;
154 
155  protected:
156 
158  void _set_defaults();
159 
160  private:
161 
162  double _x_radius_;
163  double _y_radius_;
164  angular_range _angle_domain_;
165 
166  // Registration interface :
168 
169  };
170 
171 } // end of namespace geomtools
172 
173 #endif // GEOMTOOLS_ELLIPTICAL_SECTOR_H
174 
175 /*
176 ** Local Variables: --
177 ** mode: c++ --
178 ** c-file-style: "gnu" --
179 ** tab-width: 2 --
180 ** End: --
181 */
double get_y_radius() const
Return the Y radius.
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
Do not render the start angle edge.
Definition: elliptical_sector.h:143
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
bool has_start_angle() const
Check the start angle.
Do not render the external edge.
Definition: elliptical_sector.h:142
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
void compute_edge(ellipse &edge_) const
Compute the external edge.
Do not render the stop angle edge.
Definition: elliptical_sector.h:144
void _set_defaults()
Set default attributes values.
elliptical_sector_wires_rendering_option_type
3D rendering options
Definition: elliptical_sector.h:141
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.
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.
Last defined bit.
Definition: elliptical_sector.h:145
bool has_partial_angle() const
Check for the partial arc.
static const std::string & elliptical_sector_label()
Return the identifier label for the class.
double get_start_angle() const
Return the start angle.
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
bool has_delta_angle() const
Check the dedislta angle.
double get_circumference() const
Return the circumference.
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
void set_radii(double x_radius_, double y_radius_)
Set the radii.
void set(double x_radius_, double y_radius_)
bool is_valid() const
Check if the elliptical_sector is valid.
double get_delta_angle() const
Return the delta angle.
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
void set_delta_angle(double)
Set the delta angle.
virtual ~elliptical_sector()
Destructor.
A elliptical_sector sector surface (2D shape)
Definition: elliptical_sector.h:29
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
A circular arc (1D shape)
Definition: ellipse.h:31
#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
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
void set_start_angle(double)
Set the start angle.
Last defined bit.
Definition: i_wires_3d_rendering.h:62
void set_y_radius(double y_radius_)
Set the Y radius.
double get_x_radius() const
Return the X radius.
void set_x_radius(double x_radius_)
Set the X radius.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
virtual bool is_on_surface(const vector_3d &, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is on the surface.
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
virtual double get_perimeter(uint32_t flags_=ALL_PIECES) const
Return the perimeter.
Elliptical sector rendering options bit mask.
Definition: elliptical_sector.h:146
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
elliptical_sector()
Default constructor.
A dictionary of arbitrary properties.
Definition: properties.h:125
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
const angular_range & get_angle_domain() const
Return the angle domain.