Bayeux  3.4.1
Core Foundation library for SuperNEMO
cylindric_extrusion_boxed_model.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-04-02
4  * Last modified: 2014-03-27
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Geometry model for a box with a central cylindrical extrusion.
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_CYLINDRIC_EXTRUSION_BOXED_MODEL_H
17 #define GEOMTOOLS_CYLINDRIC_EXTRUSION_BOXED_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/cylinder.h>
32 #include <geomtools/placement.h>
35 
36 namespace geomtools {
37 
41  {
42  public:
43 
45  void set_material_name (const std::string &);
46 
48  const std::string & get_material_name () const;
49 
51  void set_mother_x (double);
52 
54  void set_mother_y (double);
55 
57  void set_mother_z (double);
58 
60  void set_extrusion_radius (double);
61 
63  void set_extrusion_x_position (double);
64 
66  void set_extrusion_y_position (double);
67 
69  void set_extrusion (double x_, double y_, double r_);
70 
72  double get_mother_x () const;
73 
75  double get_mother_y () const;
76 
78  double get_mother_z () const;
79 
81  double get_extrusion_radius () const;
82 
84  double get_extrusion_x_position () const;
85 
87  double get_extrusion_y_position () const;
88 
90  const geomtools::i_shape_3d & get_solid () const;
91 
94 
97 
99  virtual std::string get_model_id () const;
100 
102  virtual void tree_dump (std::ostream & out_ = std::clog,
103  const std::string & title_ = "",
104  const std::string & indent_ = "",
105  bool inherit_ = false) const;
106 
107 
109  struct wires_drawer : public i_wires_drawer<cylindric_extrusion_boxed_model>
110  {
118  };
119 
122 
124  virtual ~wires_drawer();
125 
127  virtual void generate_wires_self(wires_type & wires_,
128  uint32_t options_ = 0) const;
129 
130  };
131 
132  protected:
133 
135  virtual void _at_construct (const std::string & name_,
136  const datatools::properties & config_,
137  models_col_type * models_ = 0);
138 
139  private:
140 
141  std::string _material_name_;
142  double _mother_x_, _mother_y_, _mother_z_;
143  double _extrusion_radius_;
144  double _extrusion_x_;
145  double _extrusion_y_;
146 
147  geomtools::box _mother_box_;
148  geomtools::cylinder _extrusion_cylinder_;
149  geomtools::subtraction_3d _extruded_solid_;
150 
151  boost::scoped_ptr<wires_drawer> _drawer_;
152 
153  // Registration interface :
155 
156  };
157 
158 } // end of namespace geomtools
159 
160 #include <datatools/ocd_macros.h>
162 
163 #endif // GEOMTOOLS_CYLINDRIC_EXTRUSION_BOXED_MODEL_H
164 
165 /*
166 ** Local Variables: --
167 ** mode: c++ --
168 ** c-file-style: "gnu" --
169 ** tab-width: 2 --
170 ** End: --
171 */
The base class for geometry models.
Definition: i_model.h:45
void set_extrusion_radius(double)
Set the radius of the cylindric extrusion.
double get_extrusion_y_position() const
Return the Y position of the cylindric extrusion's axis.
const geomtools::i_shape_3d & get_solid() const
Return the shape of the mother box.
Mother abstract class for all 3D solid shapes.
Definition: i_shape_3d.h:46
double get_mother_x() const
Return the X dimension of the mother box.
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 box.
Definition: box.h:44
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)
A geometry model implementing a box with a cylindrical extrusion, open on both bottom and top faces o...
Definition: cylindric_extrusion_boxed_model.h:40
virtual ~cylindric_extrusion_boxed_model()
Destructor.
void set_material_name(const std::string &)
Set the name of the material.
std::map< std::string, i_model * > models_col_type
Type alias for dictionary of geometry model plain handles.
Definition: model_tools.h:29
void set_extrusion_y_position(double)
Set the Y position of the cylindric extrusion's axis.
Subtraction of two 3D shapes.
Definition: subtraction_3d.h:24
Do not render the mother box solid faces.
Definition: cylindric_extrusion_boxed_model.h:113
const std::string & get_material_name() const
Return the name of the material.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
Do not render the extrusion surface.
Definition: cylindric_extrusion_boxed_model.h:114
void set_extrusion(double x_, double y_, double r_)
Set the X and Y positions and radius of the cylindric extrusion.
double get_extrusion_radius() const
Return the extrusion radius.
virtual void _at_construct(const std::string &name_, const datatools::properties &config_, models_col_type *models_=0)
Executed at construct.
Rendering options bit mask.
Definition: cylindric_extrusion_boxed_model.h:116
void set_mother_y(double)
Set the Y dimension of the mother box.
double get_mother_y() const
Return the Y dimension of the mother box.
double get_mother_z() const
Return the Z dimension of the mother box.
void set_mother_z(double)
Set the Z dimension of the mother box.
double get_extrusion_x_position() const
Return the X position of the cylindric extrusion's axis.
Last defined bit.
Definition: cylindric_extrusion_boxed_model.h:115
Last defined bit.
Definition: i_wires_3d_rendering.h:62
void set_mother_x(double)
Set the X dimension of the mother box.
The 3D shape model for a cylinder.
Definition: cylinder.h:41
wires_rendering_option_type
Rendering options.
Definition: cylindric_extrusion_boxed_model.h:112
void set_extrusion_x_position(double)
Set the X position of the cylindric extrusion's axis.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
wires_drawer(const cylindric_extrusion_boxed_model &model_)
Constructor.
cylindric_extrusion_boxed_model()
Default constructor.
Base class for all shape drawer objects in wires mode.
Definition: i_wires_drawer.h:72
virtual std::string get_model_id() const
Return the string Id of the model.
#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
Special wires 3D rendering.
Definition: cylindric_extrusion_boxed_model.h:109
A dictionary of arbitrary properties.
Definition: properties.h:125