Bayeux  3.4.1
Core Foundation library for SuperNEMO
spherical_extrusion_cylinder_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: 2015-02-15
5  *
6  * License:
7  *
8  * Description:
9  *
10  * A cylinder extruded by a spherical volumes on top or bottom face.
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_SPHERICAL_EXTRUSION_CYLINDER_MODEL_H
17 #define GEOMTOOLS_SPHERICAL_EXTRUSION_CYLINDER_MODEL_H 1
18 
19 // Standard library:
20 #include <iostream>
21 #include <iomanip>
22 #include <string>
23 
24 // Third party:
25 // - Boost:
26 #include <boost/scoped_ptr.hpp>
27 
28 // This project:
29 #include <geomtools/i_model.h>
30 #include <geomtools/cylinder.h>
31 #include <geomtools/sphere.h>
33 #include <geomtools/placement.h>
37 
38 namespace geomtools {
39 
42  {
43 
44  public:
45 
47  const std::string & get_material() const;
48 
50  const geomtools::subtraction_3d & get_solid() const;
51 
53  virtual std::string get_model_id() const;
54 
57 
60 
62  virtual void tree_dump(std::ostream & out_ = std::clog,
63  const std::string & title_ = "",
64  const std::string & indent_ = "",
65  bool inherit_ = false) const;
66 
68  struct wires_drawer : public i_wires_drawer<spherical_extrusion_cylinder_model>
69  {
77  };
78 
81 
83  virtual ~wires_drawer();
84 
86  virtual void generate_wires_self(wires_type & wires_,
87  uint32_t options_ = 0) const;
88 
89  };
90 
91  protected:
92 
93  virtual void _at_construct(const std::string & name_,
94  const datatools::properties & setup_,
95  geomtools::models_col_type * models_ = 0);
96  private:
97 
98  std::string _material_;
99  geomtools::sphere _extrusion_;
100  geomtools::cylinder _mother_;
102  double _r_;
103  double _z_;
104  double _r_extrusion_;
105  double _r_sphere_;
106  double _h_;
107  bool _bottom_;
108 
109  boost::scoped_ptr<wires_drawer> _drawer_;
110 
112 
113  };
114 
115 } // end of namespace geomtools
116 
117 #endif // GEOMTOOLS_SPHERICAL_EXTRUSION_CYLINDER_MODEL_H
118 
119 /*
120 ** Local Variables: --
121 ** mode: c++ --
122 ** c-file-style: "gnu" --
123 ** tab-width: 2 --
124 ** End: --
125 */
Rendering options bit mask.
Definition: spherical_extrusion_cylinder_model.h:75
virtual std::string get_model_id() const
Return the model unique identifier.
The base class for geometry models.
Definition: i_model.h:45
A spherical volume (3D solid)
Definition: sphere.h:44
A cylinder volume with a spherical extrusion.
Definition: spherical_extrusion_cylinder_model.h:41
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 geomtools::subtraction_3d & get_solid() const
Return the top level solid.
wires_rendering_option_type
Wires rendering optional flags.
Definition: i_wires_3d_rendering.h:44
Do not render the mother cylinder solid faces.
Definition: spherical_extrusion_cylinder_model.h:72
virtual void _at_construct(const std::string &name_, const datatools::properties &setup_, geomtools::models_col_type *models_=0)
The main construction hook.
Special wires 3D rendering.
Definition: spherical_extrusion_cylinder_model.h:68
wires_drawer(const spherical_extrusion_cylinder_model &model_)
Constructor.
virtual ~spherical_extrusion_cylinder_model()
Destructor.
Last defined bit.
Definition: i_wires_3d_rendering.h:62
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
The 3D shape model for a cylinder.
Definition: cylinder.h:41
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
Do not render the extrusion surface.
Definition: spherical_extrusion_cylinder_model.h:73
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)
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
const std::string & get_material() const
Return the material label.
Last defined bit.
Definition: spherical_extrusion_cylinder_model.h:74
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125