Bayeux  3.4.1
Core Foundation library for SuperNEMO
model_with_internal_items_tools.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-10-16
4  * Last modified: 2014-05-17
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Some tools to make a model owning internal items
11  * within its mother shape
12  *
13  * History:
14  *
15  */
16 
17 #ifndef GEOMTOOLS_MODEL_WITH_INTERNAL_ITEMS_TOOLS_H
18 #define GEOMTOOLS_MODEL_WITH_INTERNAL_ITEMS_TOOLS_H 1
19 
20 // Standard library:
21 #include <string>
22 #include <map>
23 
24 // Third party:
25 // - Bayeux/datatools:
27 
28 // This project:
29 #include <geomtools/i_model.h>
30 #include <geomtools/placement.h>
32 #include <datatools/properties.h>
33 
34 namespace geomtools {
35 
38  {
39  public:
40 
41  static const std::string INTERNAL_ITEM_PREFIX;
42  static const std::string INTERNAL_ITEM_LABELS_KEY;
43  static const std::string INTERNAL_ITEM_MODEL_PREFIX;
44  static const std::string INTERNAL_ITEM_PLACEMENT_PREFIX;
45 
47  struct item_type
48  {
49 
50  public:
51  item_type ();
52  void set_label (const std::string &);
53  const std::string & get_label () const;
54  void set_model (const i_model &);
55  const i_model & get_model () const;
56  void set_placement (const placement &);
57  const placement & get_placement () const;
58  const physical_volume & get_physical_volume () const;
60 
61  public:
62  std::string _label_;
63  const i_model * _model_;
66 
67  };
68 
69  typedef std::map<std::string, item_type> item_dict_type;
70 
71  public:
72 
74 
76 
77  const item_type & get_item (const std::string &) const;
78 
79  item_type & grab_item (const std::string &);
80 
81  void add_item (const std::string & label_,
82  const i_model & model_,
83  const placement & placement_);
84 
85  bool has_item (const std::string &) const;
86 
87  size_t get_number_of_items () const;
88 
89  const item_dict_type & get_items () const;
90 
92 
93  void plug_internal_models (const datatools::properties & setup_,
94  logical_volume & log_,
95  models_col_type * models_);
96 
97 
99  const std::string & prefix_ = "");
100 
101  private:
102 
103  item_dict_type _items_;
104 
105  };
106 
107  // Type alias:
109 
110 } // end of namespace geomtools
111 
112 #endif // GEOMTOOLS_MODEL_WITH_INTERNAL_ITEMS_TOOLS_H
113 
114 /*
115 ** Local Variables: --
116 ** mode: c++ --
117 ** c-file-style: "gnu" --
118 ** tab-width: 2 --
119 ** End: --
120 */
The base class for geometry models.
Definition: i_model.h:45
std::string _label_
Daughter label.
Definition: model_with_internal_items_tools.h:62
A physical geometry volume (ala GDML)
Definition: physical_volume.h:36
Handler for internal items.
Definition: model_with_internal_items_tools.h:37
A logical geometry volume (ala GDML)
Definition: logical_volume.h:40
std::map< std::string, i_model * > models_col_type
Type alias for dictionary of geometry model plain handles.
Definition: model_tools.h:29
An object that describes the way an object of a given class can be configured through properties.
Definition: object_configuration_description.h:234
Internal item record.
Definition: model_with_internal_items_tools.h:47
model_with_internal_items_tools MWIM
Definition: model_with_internal_items_tools.h:108
static const std::string INTERNAL_ITEM_MODEL_PREFIX
value = "internal_item.model."
Definition: model_with_internal_items_tools.h:43
placement _placement_
Daughter placement.
Definition: model_with_internal_items_tools.h:64
const item_type & get_item(const std::string &) const
static const std::string INTERNAL_ITEM_LABELS_KEY
value = "internal_item.labels"
Definition: model_with_internal_items_tools.h:42
const item_dict_type & get_items() const
const physical_volume & get_physical_volume() const
std::map< std::string, item_type > item_dict_type
Definition: model_with_internal_items_tools.h:69
static const std::string INTERNAL_ITEM_PREFIX
value = "internal_item."
Definition: model_with_internal_items_tools.h:41
void plug_internal_models(const datatools::properties &setup_, logical_volume &log_, models_col_type *models_)
physical_volume _phys_
Physical volume handler.
Definition: model_with_internal_items_tools.h:65
The placement for a geometry volume with its translation and rotation with respect to some mother ref...
Definition: placement.h:34
static void init_ocd(datatools::object_configuration_description &ocd_, const std::string &prefix_="")
const i_model * _model_
Model handler.
Definition: model_with_internal_items_tools.h:63
void add_item(const std::string &label_, const i_model &model_, const placement &placement_)
item_type & grab_item(const std::string &)
bool has_item(const std::string &) const
static const std::string INTERNAL_ITEM_PLACEMENT_PREFIX
value = "internal_item.placement."
Definition: model_with_internal_items_tools.h:44
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125