Bayeux  3.4.1
Core Foundation library for SuperNEMO
geom_info.h
Go to the documentation of this file.
1 /* Author (s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-04-30
4  * Last modified: 2010-04-30
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Geometry information about an object from a geometry setup.
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_GEOM_INFO_H
17 #define GEOMTOOLS_GEOM_INFO_H 1
18 
19 // Standard library:
20 #include <iostream>
21 
22 // Third party:
23 // - Bayeux/datatools:
24 #include <datatools/properties.h>
25 #include <datatools/i_predicate.h>
26 
27 // This project:
28 #include <geomtools/geom_id.h>
29 #include <geomtools/placement.h>
31 
32 namespace geomtools {
33 
34  // Forward declaration:
35  class logical_volume;
36 
38  class geom_info
39  {
40 
41  public:
42 
44  geom_info ();
45 
47  geom_info (const geom_id &);
48 
50  geom_info (const geom_id &,
51  const placement &,
52  const logical_volume &);
53 
55  bool has_logical () const;
56 
58  const placement & get_world_placement () const;
59 
61  const logical_volume & get_logical () const;
62 
64  const geom_id & get_id () const;
65 
67  const geom_id & get_gid () const;
68 
70  const geom_id & get_geom_id () const;
71 
73  const datatools::properties & get_properties () const;
74 
77 
79  friend std::ostream & operator<< (std::ostream &, const geom_info &);
80 
81  private:
82 
83  datatools::properties _properties_;
84  geom_id _gid_;
85  placement _world_placement_;
86  const logical_volume * _logical_;
87 
88  };
89 
92  {
93  has_geom_type_predicate (uint32_t geom_type_) : _geom_type_ (geom_type_)
94  {
95  return;
96  }
97  bool operator () (const geom_info & ginfo_) const
98  {
99  return (ginfo_.get_geom_id ().get_type () == _geom_type_);
100  }
101  uint32_t _geom_type_;
102  };
103 
105  typedef std::map<geom_id, geom_info> geom_info_dict_type;
106 
107 } // end of namespace geomtools
108 
109 #endif // GEOMTOOLS_GEOM_INFO_H
110 
111 /*
112 ** Local Variables: --
113 ** mode: c++ --
114 ** c-file-style: "gnu" --
115 ** tab-width: 2 --
116 ** End: --
117 */
geom_info()
Default constructor.
const geom_id & get_gid() const
Return the geometry Id.
const datatools::properties & get_properties() const
Return a reference to the non mutable container of auxiliary properties.
const placement & get_world_placement() const
Return the placement of the physical volume in the world coordinate system.
bool has_logical() const
Check if a logical volume is defined.
A record for geometry information about a physical volume in a virtual geometry.
Definition: geom_info.h:38
A logical geometry volume (ala GDML)
Definition: logical_volume.h:40
friend std::ostream & operator<<(std::ostream &, const geom_info &)
Basic print.
std::map< geom_id, geom_info > geom_info_dict_type
Dictionary of geometry information objects (key type is: geomtools::geom_id)
Definition: geom_info.h:105
uint32_t _geom_type_
Definition: geom_info.h:101
const geom_id & get_geom_id() const
Return the geometry Id.
A template predicate abstract class.
Definition: i_predicate.h:12
const logical_volume & get_logical() const
Return the logical volume.
has_geom_type_predicate(uint32_t geom_type_)
Definition: geom_info.h:93
bool operator()(const geom_info &ginfo_) const
Definition: geom_info.h:97
The placement for a geometry volume with its translation and rotation with respect to some mother ref...
Definition: placement.h:34
Definition: geom_id.h:41
Predicate that tests if a geom_info object has a given geometry Id.
Definition: geom_info.h:91
uint32_t get_type() const
Return the type.
const geom_id & get_id() const
Return the geometry Id.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125