Bayeux  3.4.1
Core Foundation library for SuperNEMO
spherical_extrusion_box_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 box extruded by a spherical volumes on top or bottom face.
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_SPHERICAL_EXTRUSION_BOX_MODEL_H
17 #define GEOMTOOLS_SPHERICAL_EXTRUSION_BOX_MODEL_H 1
18 
19 // Standard library:
20 #include <iostream>
21 #include <string>
22 
23 // Third party:
24 // - Boost:
25 #include <boost/scoped_ptr.hpp>
26 
27 // This project:
28 #include <geomtools/i_model.h>
29 #include <geomtools/box.h>
30 #include <geomtools/sphere.h>
32 #include <geomtools/placement.h>
36 
37 namespace geomtools {
38 
41  {
42  public:
43 
45  const std::string & get_material() const;
46 
48  const geomtools::subtraction_3d & get_solid() const;
49 
51  virtual std::string get_model_id() const;
52 
55 
58 
60  virtual void tree_dump(std::ostream & out_ = std::clog,
61  const std::string & title_ = "",
62  const std::string & indent_ = "",
63  bool inherit_ = false) const;
64 
66  struct wires_drawer : public i_wires_drawer<spherical_extrusion_box_model>
67  {
75  };
76 
79 
81  virtual ~wires_drawer();
82 
84  virtual void generate_wires_self(wires_type & wires_,
85  uint32_t options_ = 0) const;
86 
87  };
88 
89  protected:
90 
91  virtual void _at_construct(const std::string & name_,
92  const datatools::properties & setup_,
93  geomtools::models_col_type * models_ = 0);
94  private:
95 
96  std::string _material_;
97  geomtools::sphere _extrusion_;
98  geomtools::box _mother_;
100  double _x_;
101  double _y_;
102  double _z_;
103  double _r_extrusion_;
104  double _r_sphere_;
105  double _h_;
106  bool _bottom_;
107 
108  boost::scoped_ptr<wires_drawer> _drawer_;
109 
111 
112  };
113 
114 } // end of namespace geomtools
115 
116 #endif // GEOMTOOLS_SPHERICAL_EXTRUSION_BOX_MODEL_H
117 
118 /*
119 ** Local Variables: --
120 ** mode: c++ --
121 ** c-file-style: "gnu" --
122 ** tab-width: 2 --
123 ** End: --
124 */
The base class for geometry models.
Definition: i_model.h:45
A spherical volume (3D solid)
Definition: sphere.h:44
Last defined bit.
Definition: spherical_extrusion_box_model.h:72
The 3D shape model for a box.
Definition: box.h:44
Rendering options bit mask.
Definition: spherical_extrusion_box_model.h:73
wires_drawer(const spherical_extrusion_box_model &model_)
Constructor.
const std::string & get_material() const
Return the material label.
Special wires 3D rendering.
Definition: spherical_extrusion_box_model.h:66
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 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)
Subtraction of two 3D shapes.
Definition: subtraction_3d.h:24
virtual void _at_construct(const std::string &name_, const datatools::properties &setup_, geomtools::models_col_type *models_=0)
The main construction hook.
const geomtools::subtraction_3d & get_solid() const
Return the top level solid.
A box volume with a spherical extrusion.
Definition: spherical_extrusion_box_model.h:40
virtual std::string get_model_id() const
Return the model unique identifier.
wires_rendering_option_type
Wires rendering optional flags.
Definition: i_wires_3d_rendering.h:44
Do not render the mother box solid faces.
Definition: spherical_extrusion_box_model.h:70
virtual ~spherical_extrusion_box_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.
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
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125
Do not render the extrusion surface.
Definition: spherical_extrusion_box_model.h:71