Bayeux  3.4.1
Core Foundation library for SuperNEMO
replicated_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: 2014-05-17
5  *
6  * License:
7  *
8  * Description:
9  * Replicated model
10  *
11  * History:
12  *
13  */
14 
15 #ifndef GEOMTOOLS_REPLICATED_MODEL_H
16 #define GEOMTOOLS_REPLICATED_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 
34  // \brief A geometry model implementing a single box with daughter volumes replicated along an axis
35  class replicated_model : public i_boxed_model
36  {
37 
38  public:
39 
41  void set_number_of_items (size_t);
42 
44  size_t get_number_of_items() const;
45 
47  void set_model (const i_model &);
48 
50  const i_model & get_model () const;
51 
53  double get_step () const;
54 
56  double get_x () const;
57 
59  double get_y () const;
60 
62  double get_z () const;
63 
65  virtual const geomtools::box & get_box () const;
66 
68  const geomtools::box & get_solid () const;
69 
72 
74  virtual ~replicated_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_linear_placement _replica_placement_;
103  physical_volume _phys_;
104  size_t _number_of_items_;
105  double _x_;
106  double _y_;
107  double _z_;
108  double _step_;
109  stackable_data _sd_;
110  geomtools::box _solid_;
111  MWIM _internals_;
112 
113  // registration interface :
115 
116  };
117 
118 } // end of namespace geomtools
119 
120 #include <datatools/ocd_macros.h>
122 
123 #endif // GEOMTOOLS_REPLICATED_MODEL_H
124 
125 /*
126 ** Local Variables: --
127 ** mode: c++ --
128 ** c-file-style: "gnu" --
129 ** tab-width: 2 --
130 ** End: --
131 */
Definition: replicated_model.h:35
virtual void _at_construct(const std::string &name_, const datatools::properties &config_, models_col_type *models_=0)
Construction.
virtual void _post_construct(datatools::properties &setup_, models_col_type *models_)
Post construction.
The base class for geometry models.
Definition: i_model.h:45
virtual std::string get_model_id() const
Return the model unique class Id.
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
const geomtools::box & get_solid() const
Return a reference to the mother box.
std::map< std::string, i_model * > models_col_type
Type alias for dictionary of geometry model plain handles.
Definition: model_tools.h:29
double get_y() const
Return the Y dimension of the mother box.
double get_x() const
Return the X dimension of the mother box.
double get_z() const
Return the Z dimension of the mother box.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
void set_number_of_items(size_t)
Set the number of replicated items.
virtual const geomtools::box & get_box() const
Return a reference to the mother box.
replicated_model()
Constructor.
void set_model(const i_model &)
Set the replicated model.
double get_step() const
Return the replication step along the axis.
virtual ~replicated_model()
Destructor.
Data for stacking along X, Y and/or Z axis.
Definition: i_stackable.h:161
const i_model & get_model() const
Return a reference to the replicated model.
#define GEOMTOOLS_MODEL_REGISTRATION_INTERFACE(ModelClassName)
Definition: model_macros.h:30
virtual void _pre_construct(datatools::properties &setup_, models_col_type *models_)
Pre-construction.
size_t get_number_of_items() const
Return the number of replicated items.
Regular linear placement.
Definition: regular_linear_placement.h:32
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