Bayeux  3.4.1
Core Foundation library for SuperNEMO
i_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  * Utilities.
10  *
11  * History:
12  *
13  */
14 
15 #ifndef GEOMTOOLS_I_PLACEMENT_H
16 #define GEOMTOOLS_I_PLACEMENT_H 1
17 
18 // Standard library:
19 #include <iostream>
20 #include <string>
21 #include <vector>
22 
23 // Third party:
24 // - Boost:
25 #include <boost/cstdint.hpp>
26 #include <boost/serialization/access.hpp>
27 // - Bayeux/datatools:
29 #include <datatools/i_tree_dump.h>
31 
32 // This project:
34 #include <geomtools/utils.h>
35 
36 namespace geomtools {
37 
38  // Forward class declaration
39  class placement;
40 
45  {
46  public:
47 
49  i_placement();
50 
52  virtual ~i_placement();
53 
55  bool is_multiple() const;
56 
58  placement get_placement(int item_) const;
59 
61  placement get_placement_by_index(int item_) const;
62 
64  virtual bool has_only_one_rotation() const;
65 
72  virtual size_t get_dimension() const = 0;
73 
75  virtual size_t get_number_of_items() const = 0;
76 
78  virtual size_t compute_index_map(std::vector<uint32_t> & map_, int item_) const = 0;
79 
81  virtual bool is_replica() const = 0;
82 
84  virtual void get_placement(int item_, placement & p_) const = 0;
85 
87  void compute_placement(int item_, placement & p_) const;
88 
90  virtual void tree_dump(std::ostream & out_ = std::clog,
91  const std::string & title_ = "",
92  const std::string & indent_ = "",
93  bool inherit_ = false) const;
94 
97 
98 
100 
101  };
102 
103 } // end of namespace geomtools
104 
105 // Activate reflection layer for the geomtools::i_placement class :
107 
108 /*
109 // Class version:
110 #include <boost/serialization/version.hpp>
111 BOOST_CLASS_VERSION(geomtools::i_placement, 0)
112 */
113 
114 #endif // GEOMTOOLS_I_PLACEMENT_H
115 
116 /*
117 ** Local Variables: --
118 ** mode: c++ --
119 ** c-file-style: "gnu" --
120 ** tab-width: 2 --
121 ** End: --
122 */
#define DR_CLASS_INIT(Introspectable)
Inform Camp that class Introspectable exists and trigger the automatic registration of dedicated refl...
Definition: reflection_interface.h:149
Base abstract class of all serializable (and possibly introspectable) classes.
Definition: i_serializable.h:51
placement get_placement(int item_) const
Return the placement at given item rank/index.
i_placement()
Default constructor.
An interface with utilities for printable objects.
Definition: i_tree_dump.h:36
virtual size_t get_dimension() const =0
bool is_multiple() const
Check if the placement handles multiple positions.
placement get_placement_by_index(int item_) const
Same as get_placement(int) but workaround method overloading for CAMP.
#define DATATOOLS_SERIALIZATION_DECLARATION()
Definition: i_serializable.h:266
void compute_placement(int item_, placement &p_) const
Compute the placement at given item rank/index.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual size_t compute_index_map(std::vector< uint32_t > &map_, int item_) const =0
Compute an array of indexes in a multidimensional frame from the item rank/index.
virtual bool has_only_one_rotation() const
Check if the placement is based on one unique rotation.
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
virtual bool is_replica() const =0
Check if the placement is a replica (GDML/Geant4 concept for multiple placement objects)
virtual size_t get_number_of_items() const =0
Return the number of placement items.
#define DR_CLASS_RTTI()
Declare Camp RTTI within class declaration.
Definition: reflection_interface.h:46
virtual ~i_placement()
Destructor.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39