Bayeux  3.4.1
Core Foundation library for SuperNEMO
extruded_box_model.h
Go to the documentation of this file.
1 /* Author(s) : Arnaud Chapon <chapon@lpccaen.in2p3.fr>
3  * Creation date: 2015-10-27
4  * Last modified: 2015-10-27
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Geometry model for an extruded box
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_EXTRUDED_BOX_MODEL_H
17 #define GEOMTOOLS_EXTRUDED_BOX_MODEL_H 1
18 
19 // Standard libraries:
20 #include <iostream>
21 #include <string>
22 #include <exception>
23 #include <limits>
24 
25 // This project:
26 #include <geomtools/i_model.h>
27 #include <geomtools/model_macros.h>
28 #include <geomtools/box.h>
29 #include <geomtools/extruded_box.h>
32 #include <geomtools/placement.h>
35 
36 namespace geomtools {
37 
39  class extruded_box_model : public i_model
40  {
41  public:
42 
44  void set_material_name(const std::string &);
45 
47  const std::string & get_material_name() const;
48 
50  const geomtools::i_shape_3d & get_solid() const;
51 
54 
56  virtual ~extruded_box_model();
57 
59  virtual std::string get_model_id() const;
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 
69 
71  struct wires_drawer : public i_wires_drawer<extruded_box>
72  {
73 
75  wires_drawer(const extruded_box & eb_);
76 
78  virtual ~wires_drawer();
79 
81  virtual void generate_wires_self(wires_type & wires_,
82  uint32_t options_ = 0) const;
83  };
84 
85  protected:
86 
88  virtual void _at_construct(const std::string & name_,
89  const datatools::properties & config_,
90  models_col_type * models_ = 0);
91 
92  private:
93 
94  std::string _material_name_;
95  geomtools::extruded_box _extruded_box_;
96  geomtools::box _mother_box_;
97  geomtools::box _daughter_box_;
98  geomtools::subtraction_3d _subtraction_box_;
99 
100  boost::scoped_ptr<wires_drawer> _drawer_;
101 
102  // Registration interface :
104 
105  };
106 
107 } // end of namespace geomtools
108 
109 #include <datatools/ocd_macros.h>
111 
112 #endif // GEOMTOOLS_EXTRUDED_BOX_MODEL_H
113 
114 /*
115 ** Local Variables: --
116 ** mode: c++ --
117 ** c-file-style: "gnu" --
118 ** tab-width: 2 --
119 ** End: --
120 */
The base class for geometry models.
Definition: i_model.h:45
Special 3D rendering.
Definition: extruded_box_model.h:71
Mother abstract class for all 3D solid shapes.
Definition: i_shape_3d.h:46
const geomtools::extruded_box & get_extruded_box() const
Return the embedded extruded box.
The 3D shape model for a box.
Definition: box.h:44
Subtraction of two 3D shapes.
Definition: subtraction_3d.h:24
The 3D shape model for an extruded box.
Definition: extruded_box.h:43
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
extruded_box_model()
Default constructor.
virtual ~extruded_box_model()
Destructor.
const geomtools::i_shape_3d & get_solid() const
Return the shape of the extruded box.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
geomtools::models_col_type models_col_type
The collection of geometry models:
Definition: i_model.h:58
virtual void _at_construct(const std::string &name_, const datatools::properties &config_, models_col_type *models_=0)
Executed at construct.
A geometry model implementing a box with a cylindrical extrusion.
Definition: extruded_box_model.h:39
void set_material_name(const std::string &)
Set the name of the material.
wires_drawer(const extruded_box &eb_)
Constructor.
const std::string & get_material_name() const
Return the name of the material.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
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
virtual std::string get_model_id() const
Return the string Id of the model.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125