Bayeux  3.4.1
Core Foundation library for SuperNEMO
multiple_placement.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2008-05-23
4  * Last modified: 2008-05-23
5  *
6  * License:
7  *
8  * Description:
9  * Multiple placement.
10  *
11  * History:
12  *
13  */
14 
15 #ifndef GEOMTOOLS_MULTIPLE_PLACEMENT_H
16 #define GEOMTOOLS_MULTIPLE_PLACEMENT_H 1
17 
18 // Standard library:
19 #include <iostream>
20 #include <string>
21 #include <vector>
22 
23 // This project:
24 #include <geomtools/placement.h>
25 
26 namespace geomtools {
27 
30  {
31  public:
32 
34  typedef std::vector<placement> placement_col_type;
35 
36  bool is_valid() const;
37 
38  void invalidate();
39 
40  void add(const placement & p_);
41 
42  const placement & get_placement(int index_) const;
43 
44  placement & get_placement(int index_);
45 
46  virtual size_t get_dimension() const;
47 
48  virtual bool is_replica() const;
49 
50  virtual size_t get_number_of_items() const;
51 
52  virtual void get_placement(int item_, placement & p_) const;
53 
54  virtual size_t compute_index_map(std::vector<uint32_t> & map_,
55  int item_) const;
56 
59 
61  virtual ~multiple_placement();
62 
64  virtual void reset();
65 
67  virtual void tree_dump(std::ostream & out_ = std::clog,
68  const std::string & title_ = "geomutils::multiple_placement",
69  const std::string & indent_ = "",
70  bool inherit_ = false) const;
71 
72  private:
73 
74  placement_col_type _placements_;
75 
76  };
77 
78 } // end of namespace geomtools
79 
80 #endif // GEOMTOOLS_MULTIPLE_PLACEMENT_H
81 /*
82 ** Local Variables: --
83 ** mode: c++ --
84 ** c-file-style: "gnu" --
85 ** tab-width: 2 --
86 ** End: --
87 */
Multiple placement with an arbitrary collection of single placements addressed by index.
Definition: multiple_placement.h:29
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.
virtual ~multiple_placement()
Destructor.
virtual bool is_replica() const
Check if the placement is a replica (GDML/Geant4 concept for multiple placement objects)
virtual size_t get_number_of_items() const
Return the number of placement items.
multiple_placement()
Default constructor.
const placement & get_placement(int index_) const
virtual size_t get_dimension() const
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="geomutils::multiple_placement", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual void reset()
Reset.
void add(const placement &p_)
Abstract interface for all placement objects.
Definition: i_placement.h:42
The placement for a geometry volume with its translation and rotation with respect to some mother ref...
Definition: placement.h:34
std::vector< placement > placement_col_type
Type alias for a collection of single placements.
Definition: multiple_placement.h:34
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39