Bayeux  3.4.1
Core Foundation library for SuperNEMO
circle.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 circular arc in x-y plane
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_CIRCLE_H
17 #define GEOMTOOLS_CIRCLE_H 1
18 
19 // Standard library:
20 #include <iostream>
21 #include <string>
22 
23 // This project:
24 #include <geomtools/i_shape_1d.h>
27 
28 namespace geomtools {
29 
31  class circle : public i_shape_1d,
33  {
34 
35  public:
36 
38  static const std::string & circle_label();
39 
41  bool is_valid() const;
42 
44  double get_r() const;
45 
47  double get_radius() const;
48 
50  void set_r(double a_radius);
51 
53  void set_radius(double a_radius);
54 
56  void set_diameter(double a_diameter);
57 
59  double get_diameter() const;
60 
62  const angular_range & get_angle_domain() const;
63 
65  bool has_partial_angle() const;
66 
68  bool has_start_angle() const;
69 
71  void set_start_angle(double);
72 
74  double get_start_angle() const;
75 
77  bool has_delta_angle() const;
78 
80  void set_delta_angle(double);
81 
83  double get_delta_angle() const;
84 
86  double get_circumference() const;
87 
89  double get_surface() const;
90 
92  virtual unsigned int get_number_of_path() const;
93 
95  virtual double get_length(uint32_t flags_ = PATH_ALL_BITS) const;
96 
98  circle();
99 
101  circle(double radius_);
102 
104  circle(double radius_, double start_angle_, double delta_angle_);
105 
107  virtual ~circle();
108 
110  virtual std::string get_shape_name() const;
111 
113  virtual void tree_dump(std::ostream & a_out = std::clog,
114  const std::string & a_title = "",
115  const std::string & a_indent = "",
116  bool a_inherit= false) const;
117 
119  virtual bool is_on_curve(const vector_3d &,
120  double a_tolerance = GEOMTOOLS_PROPER_TOLERANCE) const;
121 
123  virtual vector_3d get_direction_on_curve(const vector_3d & a_tposition) const;
124 
126  virtual void generate_wires_self(wires_type & wires_, uint32_t options_ = 0) const;
127 
129  void initialize(const datatools::properties &, const handle_dict_type * = 0);
130 
132  void reset();
133 
134  protected:
135 
137  void _set_defaults();
138 
139  private:
140 
141  double _radius_;
142  angular_range _angle_domain_;
143 
144  // Registration interface :
146 
147  };
148 
149 } // end of namespace geomtools
150 
151 #endif // GEOMTOOLS_CIRCLE_H
152 
153 /*
154 ** Local Variables: --
155 ** mode: c++ --
156 ** c-file-style: "gnu" --
157 ** tab-width: 2 --
158 ** End: --
159 */
virtual std::string get_shape_name() const
Return the name of this solid shape class.
The abstract base class for all 1D curves/shapes.
Definition: i_shape_1d.h:32
Definition: utils.h:184
A circular arc (1D shape)
Definition: circle.h:31
void set_radius(double a_radius)
Set the radius.
double get_surface() const
Return the surface.
virtual ~circle()
Destructor.
static const std::string & circle_label()
Return the label of 1D shape.
virtual bool is_on_curve(const vector_3d &, double a_tolerance=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is on the curve.
void reset()
Reset.
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
void set_start_angle(double)
Set the start angle.
void set_diameter(double a_diameter)
Set the diameter.
virtual vector_3d get_direction_on_curve(const vector_3d &a_tposition) const
Returns the direction of a point on the curve.
double get_start_angle() const
Return the start angle.
bool has_start_angle() const
Check the start angle.
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
virtual double get_length(uint32_t flags_=PATH_ALL_BITS) const
Return the length of the target paths.
brief Abstract interface for objects that can describe themselves as a collection of polylines for 3D...
Definition: i_wires_3d_rendering.h:39
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
double get_delta_angle() const
Return the delta angle.
bool is_valid() const
Check the validity of the circle.
double get_circumference() const
Return the circumference.
const angular_range & get_angle_domain() const
Return the angle domain.
bool has_delta_angle() const
Check the dedislta angle.
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
double get_r() const
Return the radius.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
circle()
Default constructor.
void _set_defaults()
Set default attributes values.
double get_diameter() const
Return the diameter.
void set_delta_angle(double)
Set the delta angle.
double get_radius() const
Return the radius.
void set_r(double a_radius)
Set the radius.
virtual void tree_dump(std::ostream &a_out=std::clog, const std::string &a_title="", const std::string &a_indent="", bool a_inherit=false) const
Smart print.
bool has_partial_angle() const
Check for the partial arc.
virtual unsigned int get_number_of_path() const
Return the number of path.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125