Bayeux  3.4.1
Core Foundation library for SuperNEMO
plate_with_hole_model.h
Go to the documentation of this file.
1 /* Author (s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2012-04-04
4  * Last modified: 2014-05-19
5  *
6  * License:
7  *
8  * Description:
9  *
10  * A box extruded by a spherical volumes on top or bottom face.
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_PLATE_WITH_HOLE_MODEL_H
17 #define GEOMTOOLS_PLATE_WITH_HOLE_MODEL_H 1
18 
19 // Standard library:
20 #include <cstdlib>
21 #include <cmath>
22 #include <stdexcept>
23 #include <iostream>
24 #include <iomanip>
25 #include <sstream>
26 #include <string>
27 
28 // Third party:
29 // - Boost:
30 #include <boost/scoped_ptr.hpp>
31 
32 // This project:
33 #include <geomtools/i_model.h>
34 #include <geomtools/box.h>
35 #include <geomtools/cylinder.h>
37 #include <geomtools/placement.h>
41 
42 namespace geomtools {
43 
48  {
49  public:
50 
52  const std::string & get_material () const;
53 
55  const geomtools::subtraction_3d & get_solid () const;
56 
58  virtual std::string get_model_id () const;
59 
62 
64  virtual ~plate_with_hole_model ();
65 
67  virtual void tree_dump (std::ostream & out_ = std::clog,
68  const std::string & title_ = "",
69  const std::string & indent_ = "",
70  bool inherit_ = false) const;
71 
73  struct wires_drawer : public i_wires_drawer<plate_with_hole_model>
74  {
82  };
83 
85  wires_drawer(const plate_with_hole_model & model_);
86 
88  virtual ~wires_drawer();
89 
91  virtual void generate_wires_self(wires_type & wires_,
92  uint32_t options_ = 0) const;
93 
94  };
95 
96  protected:
97 
99  virtual void _at_construct(const std::string & name_,
100  const datatools::properties & setup_,
101  geomtools::models_col_type * models_ = 0);
102 
103  private:
104 
105  std::string _material_;
106  geomtools::box _mother_;
107  geomtools::box _box_hole_;
108  geomtools::cylinder _cyl_hole_;
109  geomtools::subtraction_3d _solid_;
110  double _x_;
111  double _y_;
112  double _z_;
113 
114  double _r_hole_;
115  double _x_hole_;
116  double _y_hole_;
117  double _z_hole_;
118  double _x_pos_hole_;
119  double _y_pos_hole_;
120 
121  boost::scoped_ptr<wires_drawer> _drawer_;
122 
123  private:
124 
125  // Registration interface :
127 
128  };
129 
130 } // end of namespace geomtools
131 
132 #endif // GEOMTOOLS_PLATE_WITH_HOLE_MODEL_H
133 
134 /*
135 ** Local Variables: --
136 ** mode: c++ --
137 ** c-file-style: "gnu" --
138 ** tab-width: 2 --
139 ** End: --
140 */
const geomtools::subtraction_3d & get_solid() const
Return the top level solid.
virtual ~plate_with_hole_model()
Destructor.
The base class for geometry models.
Definition: i_model.h:45
plate_with_hole_model()
Default constructor.
wires_drawer(const plate_with_hole_model &model_)
Constructor.
The 3D shape model for a box.
Definition: box.h:44
virtual void _at_construct(const std::string &name_, const datatools::properties &setup_, geomtools::models_col_type *models_=0)
Construction.
std::map< std::string, i_model * > models_col_type
Type alias for dictionary of geometry model plain handles.
Definition: model_tools.h:29
Subtraction of two 3D shapes.
Definition: subtraction_3d.h:24
const std::string & get_material() const
Return the name of the material.
wires_rendering_option_type
Wires rendering optional flags.
Definition: i_wires_3d_rendering.h:44
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
A geometry model implementing a box/plate with cylindrical hole This class is similar to the geomtool...
Definition: plate_with_hole_model.h:47
Special wires 3D rendering.
Definition: plate_with_hole_model.h:73
Do not render the hole solid faces.
Definition: plate_with_hole_model.h:78
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a list of polylines representing the contour of the shape (for display clients)
Last defined bit.
Definition: plate_with_hole_model.h:79
virtual std::string get_model_id() const
Return the geometry model class Id.
Last defined bit.
Definition: i_wires_3d_rendering.h:62
The 3D shape model for a cylinder.
Definition: cylinder.h:41
Do not render the mother plate solid faces.
Definition: plate_with_hole_model.h:77
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
Base class for all shape drawer objects in wires mode.
Definition: i_wires_drawer.h:72
#define GEOMTOOLS_MODEL_REGISTRATION_INTERFACE(ModelClassName)
Definition: model_macros.h:30
Rendering options bit mask.
Definition: plate_with_hole_model.h:80
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125