Bayeux  3.4.1
Core Foundation library for SuperNEMO
box_model_vg.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-04-13
4  * Last modified: 2014-04-09
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Vertex generator from a box model addressed through some
11  * collection of geometry IDs extracted from a mapping object.
12  *
13  * History:
14  *
15  */
16 
17 #ifndef GENVTX_BOX_MODEL_VG_H
18 #define GENVTX_BOX_MODEL_VG_H
19 
20 // Standard library:
21 #include <string>
22 
23 // Third party:
24 // - Boost:
25 #include <boost/scoped_ptr.hpp>
26 
27 // This project:
28 #include <genvtx/vg_macros.h>
29 #include <genvtx/utils.h>
30 #include <genvtx/i_from_model_vg.h>
31 
32 namespace genvtx {
33 
36  {
37  public:
38 
40  box_model_vg();
41 
43  virtual ~box_model_vg();
44 
46  bool is_mode_valid() const;
47 
49  bool is_mode_bulk() const;
50 
52  bool is_mode_surface() const;
53 
55  bool is_surface_back() const;
56 
58  bool is_surface_front() const;
59 
61  bool is_surface_bottom() const;
62 
64  bool is_surface_top() const;
65 
67  bool is_surface_left() const;
68 
70  bool is_surface_right() const;
71 
73  void set_surface_left(bool);
74 
76  void set_surface_right(bool);
77 
79  void set_surface_bottom(bool);
80 
82  void set_surface_top(bool);
83 
85  void set_surface_back(bool);
86 
88  void set_surface_front(bool);
89 
91  void set_skin_skip(double skin_skip_);
92 
94  void set_skin_thickness(double skin_thickness_);
95 
97  int get_mode() const;
98 
100  void set_mode(int);
101 
103  void set_use_bounding_box(bool);
104 
106  bool is_using_bounding_box();
107 
109  virtual void tree_dump(std::ostream & out_ = std::clog,
110  const std::string & title_ = "",
111  const std::string & indent_ = "",
112  bool inherit_ = false) const;
113 
115  virtual void initialize(const ::datatools::properties &,
118 
120  virtual void reset();
121 
123  virtual bool is_initialized() const;
124 
125  protected :
126 
128  virtual void _shoot_vertex(::mygsl::rng & random_, ::geomtools::vector_3d & vertex_);
129 
131  void _shoot_vertex_boxes(mygsl::rng & random_, geomtools::vector_3d & vertex_);
132 
133  private:
134 
136  void _init_();
137 
139  void _reset_();
140 
142  void _set_defaults_();
143 
144  private:
145 
146  bool _initialized_;
147  bool _use_bb_;
148  int _mode_;
149  bool _surface_back_;
150  bool _surface_front_;
151  bool _surface_bottom_;
152  bool _surface_top_;
153  bool _surface_left_;
154  bool _surface_right_;
155  double _skin_skip_;
156  double _skin_thickness_;
157 
158  // Pimplized:
159  struct _work_type;
160  boost::scoped_ptr<_work_type> _work_;
161 
165 
166  };
167 
168 } // end of namespace genvtx
169 
170 /***************
171  * OCD support *
172  ***************/
173 #include <datatools/ocd_macros.h>
175 
176 #endif // GENVTX_BOX_MODEL_VG_H
177 
178 /*
179 ** Local Variables: --
180 ** mode: c++ --
181 ** c-file-style: "gnu" --
182 ** tab-width: 2 --
183 ** End: --
184 */
box_model_vg()
Constructor.
void set_surface_bottom(bool)
Set 'bottom' surface activation.
bool is_mode_surface() const
Check if 'surface' mode is activated.
void set_surface_back(bool)
Set 'back' surface activation.
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::genvtx::vg_dict_type &)
Initialization.
void set_skin_skip(double skin_skip_)
Set the skin skip distance.
bool is_surface_left() const
Check if 'left' surface is activated.
void set_use_bounding_box(bool)
Set the flag using bounding box.
bool is_surface_front() const
Check if 'front' surface is activated.
virtual ~box_model_vg()
Destructor.
void _shoot_vertex_boxes(mygsl::rng &random_, geomtools::vector_3d &vertex_)
Main vertex randomization algorithm.
An abstract vertex generator based on a geometry model.
Definition: i_from_model_vg.h:39
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
void set_mode(int)
Set the mode.
virtual void _shoot_vertex(::mygsl::rng &random_, ::geomtools::vector_3d &vertex_)
Randomize vertex.
void set_surface_left(bool)
Set 'left' surface activation.
void set_skin_thickness(double skin_thickness_)
Set the skin thickness.
int get_mode() const
Return the mode.
A vertex generator based on a boxed geometry model.
Definition: box_model_vg.h:35
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
void set_surface_front(bool)
Set 'front' surface activation.
bool is_surface_bottom() const
Check if 'bottom' surface is activated.
#define GENVTX_VG_REGISTRATION_INTERFACE(GENVTX_CLASS_NAME)
Definition: vg_macros.h:46
bool is_mode_valid() const
Check the validity of the mode.
Macros to automatically register vertex generator class.
bool is_surface_back() const
Check if 'back' surface is activated.
bool is_using_bounding_box()
Check the flag using bounding box.
void set_surface_right(bool)
Set 'right' surface activation.
std::map< std::string, vg_entry_type > vg_dict_type
Definition: vg_tools.h:125
virtual void reset()
Reset.
virtual bool is_initialized() const
Check initialization status.
Service management class.
Definition: service_manager.h:57
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Pseudo random number generator.
Definition: rng.h:53
bool is_surface_right() const
Check if 'right' surface is activated.
bool is_surface_top() const
Check if 'top' surface is activated.
void set_surface_top(bool)
Set 'top' surface activation.
bool is_mode_bulk() const
Check if 'bulk' mode is activated.