Bayeux  3.4.1
Core Foundation library for SuperNEMO
surrounded_boxed_model.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-04-02
4  * Last modified: 2010-04-02
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Geometry model with multiple surrounded boxes.
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_SURROUNDED_BOXED_MODEL_H
17 #define GEOMTOOLS_SURROUNDED_BOXED_MODEL_H 1
18 
19 // Standard library:
20 #include <string>
21 #include <iostream>
22 #include <vector>
23 #include <map>
24 
25 // This project:
27 #include <geomtools/box.h>
29 #include <geomtools/placement.h>
30 #include <geomtools/model_macros.h>
32 
33 namespace geomtools {
34 
36  class surrounded_boxed_model : public i_boxed_model
37  {
38  public:
39 
40  static const std::string LABEL_PROPERTY_PREFIX;
41  static const std::string MODEL_PROPERTY_PREFIX;
42  static const std::string SURROUNDED_LABEL;
43  static const std::string SURROUNDING_LABEL;
44 
45  static const std::vector<std::string> & position_labels();
46 
48  public:
49  const std::string & get_label () const
50  {
51  return label;
52  }
53  const i_model & get_model () const
54  {
55  return *model;
56  }
57  const placement & get_placement () const
58  {
59  return placmt;
60  }
62  {
63  return phys;
64  }
65  public:
66  std::string label;
67  const i_model * model;
70  };
71 
72  typedef std::map<int, surrounding_item> surrounding_dict_type;
73  typedef std::map<std::string, int> labels_dict_type;
74 
75  const std::string & get_material_name () const;
76 
77  void set_material_name (const std::string &);
78 
79  virtual const geomtools::box & get_box () const;
80 
81  const geomtools::box & get_solid () const;
82 
83  void set_surrounded_label (const std::string & label_);
84 
85  const std::string & get_surrounded_label () const;
86 
87  void set_surrounded_model (const i_model & model_);
88 
89  const i_model & get_surrounded_model () const;
90 
91  size_t get_number_of_surrounding_items () const;
92 
93  bool has_surrounding_model (const std::string & label_) const;
94 
95  void add_surrounding_model (int pos_, const i_model &, const std::string & label_ = "");
96 
97  const i_model & get_surrounding_model (int i_) const;
98 
99  const surrounding_item & get_surrounding_item (int i_) const;
100 
101  const i_model & get_surrounding_model (const std::string & label_) const;
102 
103  const surrounding_item & get_surrounding_item (const std::string & label_) const;
104 
105  const labels_dict_type & get_surrounding_labels () const;
106 
108 
111 
113  virtual ~surrounded_boxed_model ();
114 
115  virtual std::string get_model_id () const;
116 
118  virtual void tree_dump (std::ostream & out_ = std::clog,
119  const std::string & title_ = "",
120  const std::string & indent_ = "",
121  bool inherit_ = false) const;
122 
123  protected:
124 
126  virtual void _at_construct (const std::string & name_,
127  const datatools::properties & config_,
128  models_col_type * models_ = 0);
129 
130  private:
131 
132  std::string _material_name_;
133 
134  const i_model * _surrounded_model_;
135  std::string _surrounded_label_;
136  placement _surrounded_placmt_;
137  physical_volume _surrounded_phys_;
138 
139  surrounding_dict_type _surrounding_items_;
140  labels_dict_type _surrounding_labels_;
141  bool _centered_x_;
142  bool _centered_y_;
143  bool _centered_z_;
144  geomtools::box _solid_;
145  MWIM _internals_;
146 
147  // Registration interface :
149 
150  };
151 
152 } // end of namespace geomtools
153 
154 #include <datatools/ocd_macros.h>
156 
157 #endif // GEOMTOOLS_SURROUNDED_BOXED_MODEL_H
158 
159 /*
160 ** Local Variables: --
161 ** mode: c++ --
162 ** c-file-style: "gnu" --
163 ** tab-width: 2 --
164 ** End: --
165 */
const i_model & get_model() const
Definition: surrounded_boxed_model.h:53
The base class for geometry models.
Definition: i_model.h:45
size_t get_number_of_surrounding_items() const
const i_model * model
Definition: surrounded_boxed_model.h:67
surrounded_boxed_model()
Default constructor.
static const std::string SURROUNDING_LABEL
Definition: surrounded_boxed_model.h:43
const std::string & get_label() const
Definition: surrounded_boxed_model.h:49
bool has_surrounding_model(const std::string &label_) const
std::map< int, surrounding_item > surrounding_dict_type
Definition: surrounded_boxed_model.h:72
The 3D shape model for a box.
Definition: box.h:44
A physical geometry volume (ala GDML)
Definition: physical_volume.h:36
const surrounding_dict_type & get_surrounding_items() const
const placement & get_placement() const
Definition: surrounded_boxed_model.h:57
Handler for internal items.
Definition: model_with_internal_items_tools.h:37
const labels_dict_type & get_surrounding_labels() const
std::map< std::string, i_model * > models_col_type
Type alias for dictionary of geometry model plain handles.
Definition: model_tools.h:29
virtual const geomtools::box & get_box() const
std::map< std::string, int > labels_dict_type
Definition: surrounded_boxed_model.h:73
const i_model & get_surrounding_model(int i_) const
const i_model & get_surrounded_model() const
const std::string & get_surrounded_label() const
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
virtual ~surrounded_boxed_model()
Destructor.
virtual std::string get_model_id() const
void set_surrounded_model(const i_model &model_)
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
physical_volume phys
Definition: surrounded_boxed_model.h:69
const geomtools::box & get_solid() const
static const std::vector< std::string > & position_labels()
void set_surrounded_label(const std::string &label_)
void set_material_name(const std::string &)
A geometry model with a boxed model surrounded by up to 6 other models.
Definition: surrounded_boxed_model.h:36
The placement for a geometry volume with its translation and rotation with respect to some mother ref...
Definition: placement.h:34
static const std::string LABEL_PROPERTY_PREFIX
Definition: surrounded_boxed_model.h:40
std::string label
Definition: surrounded_boxed_model.h:66
const physical_volume & get_physical_volume() const
Definition: surrounded_boxed_model.h:61
static const std::string SURROUNDED_LABEL
Definition: surrounded_boxed_model.h:42
Definition: surrounded_boxed_model.h:47
void add_surrounding_model(int pos_, const i_model &, const std::string &label_="")
const std::string & get_material_name() const
const surrounding_item & get_surrounding_item(int i_) const
#define GEOMTOOLS_MODEL_REGISTRATION_INTERFACE(ModelClassName)
Definition: model_macros.h:30
static const std::string MODEL_PROPERTY_PREFIX
Definition: surrounded_boxed_model.h:41
placement placmt
Definition: surrounded_boxed_model.h:68
virtual void _at_construct(const std::string &name_, const datatools::properties &config_, models_col_type *models_=0)
Construction.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125