Bayeux  3.4.1
Core Foundation library for SuperNEMO
regular_circular_placement.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-02-26
4  * Last modified: 2010-03-31
5  *
6  * License:
7  *
8  * Description:
9  * Utilities.
10  *
11  * History:
12  *
13  */
14 
15 #ifndef GEOMTOOLS_REGULAR_CIRCULAR_PLACEMENT_H
16 #define GEOMTOOLS_REGULAR_CIRCULAR_PLACEMENT_H 1
17 
18 // Standard library:
19 #include <iostream>
20 #include <iomanip>
21 #include <string>
22 #include <vector>
23 
24 // This project:
25 #include <geomtools/i_placement.h>
26 #include <geomtools/placement.h>
27 #include <geomtools/utils.h>
28 
29 namespace geomtools {
30 
33  {
34  public:
35 
36  bool is_valid() const;
37 
38  void invalidate();
39 
40  virtual size_t get_dimension() const;
41 
42  virtual bool is_replica() const;
43 
44  virtual bool has_only_one_rotation() const;
45 
47 
49 
50  bool is_rotation_x_axis() const;
51 
52  bool is_rotation_y_axis() const;
53 
54  bool is_rotation_z_axis() const;
55 
56  void set_follow_rotation(bool);
57 
58  bool is_follow_rotation() const;
59 
60  void set_radius(double radius_);
61 
62  double get_radius() const;
63 
64  void set_start_angle(double angle_);
65 
66  double get_start_angle() const;
67 
68  void set_step_angle(double angle_);
69 
70  double get_step_angle() const;
71 
72  void set_center(const vector_3d &);
73 
74  const vector_3d & get_center() const;
75 
76  void set_number_of_items(size_t n_);
77 
78  virtual size_t get_number_of_items() const;
79 
80  virtual void get_placement(int item_, placement & p_) const;
81 
82  virtual size_t compute_index_map(std::vector<uint32_t> & map_,
83  int item_) const;
84 
87 
89  regular_circular_placement(const vector_3d & center_,
90  double radius_,
91  double step_angle_,
92  double start_angle_,
93  size_t number_of_items_,
94  rotation_axis_type rotation_axis_ = ROTATION_AXIS_Z);
95 
98 
100  void initialize(const vector_3d & center_,
101  double radius_,
102  double step_angle_,
103  double start_angle_,
104  size_t number_of_items_,
105  rotation_axis_type rotation_axis_ = ROTATION_AXIS_Z);
106 
108  virtual void reset();
109 
111  virtual void tree_dump(std::ostream & out_ = std::clog,
112  const std::string & title_ = "geomutils::regular_circular_placement",
113  const std::string & indent_ = "",
114  bool inherit_ = false) const;
115 
116  protected:
117 
119  void _set_default();
120 
121  private:
122 
123  vector_3d _center_;
124  double _radius_;
125  double _step_angle_;
126  double _start_angle_;
127  size_t _number_of_items_;
128  bool _follow_rotation_;
129  rotation_axis_type _rotation_axis_;
130 
131  };
132 
133 } // end of namespace geomtools
134 
135 #endif // GEOMTOOLS_REGULAR_CIRCULAR_PLACEMENT_H
136 
137 
138 // Local Variables: --
139 // mode: c++ --
140 // c-file-style: "gnu" --
141 // tab-width: 2 --
142 // End: --
void initialize(const vector_3d &center_, double radius_, double step_angle_, double start_angle_, size_t number_of_items_, rotation_axis_type rotation_axis_=ROTATION_AXIS_Z)
Initialization.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="geomutils::regular_circular_placement", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual size_t get_dimension() const
rotation_axis_type
Rotation axis type.
Definition: utils.h:395
virtual bool is_replica() const
Check if the placement is a replica (GDML/Geant4 concept for multiple placement objects)
virtual bool has_only_one_rotation() const
Check if the placement is based on one unique rotation.
rotation_axis_type get_rotation_axis() const
Z rotation axis.
Definition: utils.h:399
void set_center(const vector_3d &)
virtual size_t compute_index_map(std::vector< uint32_t > &map_, int item_) const
Compute an array of indexes in a multidimensional frame from the item rank/index.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
Abstract interface for all placement objects.
Definition: i_placement.h:42
virtual void get_placement(int item_, placement &p_) const
Compute the placement at given item rank/index.
The placement for a geometry volume with its translation and rotation with respect to some mother ref...
Definition: placement.h:34
const vector_3d & get_center() const
Regular circular placement.
Definition: regular_circular_placement.h:32
virtual size_t get_number_of_items() const
Return the number of placement items.
void set_rotation_axis(rotation_axis_type)
virtual ~regular_circular_placement()
Destructor.
regular_circular_placement()
Default constructor.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39