Bayeux  3.4.1
Core Foundation library for SuperNEMO
grid_model.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2013-02-21
4  * Last modified: 2013-02-21
5  *
6  * License:
7  *
8  * Description:
9  * Grid model
10  *
11  * History:
12  *
13  */
14 
15 #ifndef GEOMTOOLS_GRID_MODEL_H
16 #define GEOMTOOLS_GRID_MODEL_H 1
17 
18 // Standard library:
19 #include <string>
20 #include <iostream>
21 
22 // This project:
26 #include <geomtools/box.h>
27 #include <geomtools/i_stackable.h>
29 
30 namespace geomtools {
31 
32  class box;
33 
35  class grid_model : public i_boxed_model
36  {
37 
38  public:
39 
41  size_t get_number_of_items (int) const;
42 
44  void set_model (const i_model &);
45 
47  const i_model & get_model () const;
48 
50  double get_step (int) const;
51 
53  double get_x () const;
54 
56  double get_y () const;
57 
59  double get_z () const;
60 
62  virtual const geomtools::box & get_box () const;
63 
65  const geomtools::box & get_solid () const;
66 
68  const std::string & get_grid_daughter_label () const;
69 
71  grid_model ();
72 
74  virtual ~grid_model ();
75 
77  virtual std::string get_model_id () const;
78 
80  virtual void tree_dump (std::ostream & out_ = std::clog,
81  const std::string & title_ = "",
82  const std::string & indent_ = "",
83  bool inherit_ = false) const;
84 
85  protected:
86 
88  virtual void _pre_construct (datatools::properties & setup_,
89  models_col_type * models_);
90 
92  virtual void _post_construct (datatools::properties & setup_,
93  models_col_type * models_);
94 
96  virtual void _at_construct (const std::string & name_,
97  const datatools::properties & config_,
98  models_col_type * models_ = 0);
99  private:
100 
101  const i_model * _model_;
102  regular_grid_placement _grid_placement_;
103  physical_volume _phys_;
104  std::string _grid_daughter_label_;
105  std::string _grid_plane_label_;
106  size_t _number_of_items_[2];
107  double _x_;
108  double _y_;
109  double _z_;
110  double _step_[2];
111  stackable_data _sd_;
112  geomtools::box _solid_;
113  MWIM _internals_;
114 
115  // registration interface :
117 
118  };
119 
120 } // end of namespace geomtools
121 
122 #include <datatools/ocd_macros.h>
124 
125 #endif // GEOMTOOLS_GRID_MODEL_H
126 
127 /*
128 ** Local Variables: --
129 ** mode: c++ --
130 ** c-file-style: "gnu" --
131 ** tab-width: 2 --
132 ** End: --
133 */
const i_model & get_model() const
Return a reference to the replicated model.
double get_z() const
Return the Z dimension of the mother box.
The base class for geometry models.
Definition: i_model.h:45
Definition: regular_grid_placement.h:44
const std::string & get_grid_daughter_label() const
Return the label used for daughter volumes set on the grid.
grid_model()
Constructor.
virtual ~grid_model()
Destructor.
double get_step(int) const
Return the replication step along one of the grid axis.
The 3D shape model for a box.
Definition: box.h:44
A physical geometry volume (ala GDML)
Definition: physical_volume.h:36
Handler for internal items.
Definition: model_with_internal_items_tools.h:37
virtual void _pre_construct(datatools::properties &setup_, models_col_type *models_)
Pre-construction.
std::map< std::string, i_model * > models_col_type
Type alias for dictionary of geometry model plain handles.
Definition: model_tools.h:29
virtual void _post_construct(datatools::properties &setup_, models_col_type *models_)
Post construction.
size_t get_number_of_items(int) const
Return the number of replicated items along one of the grid axis.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
A geometry model implementing a mother box volume with some daughter volumes positioned on a 2D grid.
Definition: grid_model.h:35
const geomtools::box & get_solid() const
Return a reference to the mother box.
virtual void _at_construct(const std::string &name_, const datatools::properties &config_, models_col_type *models_=0)
Construction.
virtual const geomtools::box & get_box() const
Return a reference to the mother box.
Data for stacking along X, Y and/or Z axis.
Definition: i_stackable.h:161
double get_y() const
Return the Y dimension of the mother box.
void set_model(const i_model &)
Set the replicated model.
#define GEOMTOOLS_MODEL_REGISTRATION_INTERFACE(ModelClassName)
Definition: model_macros.h:30
double get_x() const
Return the X dimension of the mother box.
virtual std::string get_model_id() const
Return the model unique class Id.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125