Bayeux  3.4.1
Core Foundation library for SuperNEMO
gdml_export.h
Go to the documentation of this file.
1 /* Author (s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-02-14
4  * Last modified: 2010-02-14
5  *
6  * License:
7  *
8  * Description:
9  * GDML export utility
10  *
11  * History:
12  *
13  */
14 
15 #ifndef GEOMTOOLS_GDML_EXPORT_H
16 #define GEOMTOOLS_GDML_EXPORT_H 1
17 
18 // Standard library:
19 #include <cstdlib>
20 #include <iostream>
21 #include <sstream>
22 #include <string>
23 #include <set>
24 
25 // Third party:
26 // - Bayeux/datatools :
27 #include <datatools/utils.h>
28 #include <datatools/properties.h>
29 
30 // This project:
32 #include <geomtools/gdml_writer.h>
33 
34 namespace geomtools {
35 
38  {
39  public:
40  static const std::string & default_length_unit();
41  static const std::string & default_angle_unit();
42  static const std::string & default_density_unit();
43 
44  public:
45 
48 
51 
53  bool is_auxiliary_supported () const;
54 
56  void add_auxiliary_support (bool s_ = true);
57 
59  bool is_replica_supported () const;
60 
62  void add_replica_support (bool s_ = true);
63 
65  bool has_fake_materials () const;
66 
68  void add_fake_materials(bool);
69 
71  const datatools::properties & parameters () const;
72 
75 
77  gdml_export ();
78 
80  virtual ~gdml_export ();
81 
83  virtual void export_gdml (const std::string & filename_,
84  const model_factory & factory_,
85  const std::string & model_name_ = "");
86 
88  void attach_external_materials (const std::ostringstream & oss_);
89 
90  protected:
91 
93  virtual void _export_gdml_solid (const i_shape_3d & shape_,
94  const std::string & log_name_);
95 
97  virtual void _export_gdml_logical (const logical_volume & log_vol__);
98 
99 
101  virtual void _export_gdml_model (const i_model & model_);
102 
104  virtual void _export_gdml (std::ostream & out_,
105  const model_factory & factory_,
106  const std::string & model_name_);
107 
108  private:
109 
110  datatools::logger::priority _logging_priority_;
111  datatools::properties _parameters_;
112  gdml_writer _writer_;
113  const model_factory * _factory_;
114  bool _fake_materials_;
115  std::string _length_unit_;
116  std::string _angle_unit_;
117  std::string _density_unit_;
118  std::set<std::string> _solid_refs_;
119  std::set<std::string> _volume_refs_;
120  const std::ostringstream * _external_materials_stream_;
121 
122  bool _support_replica_;
123  bool _support_auxiliary_;
124 
125  };
126 
127 } // end of namespace geomtools
128 
129 #endif // GEOMTOOLS_GDML_EXPORT_H
130 
131 /*
132 ** Local Variables: --
133 ** mode: c++ --
134 ** c-file-style: "gnu" --
135 ** tab-width: 2 --
136 ** End: --
137 */
The base class for geometry models.
Definition: i_model.h:45
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
void add_replica_support(bool s_=true)
Set the flag to support replica.
Mother abstract class for all 3D solid shapes.
Definition: i_shape_3d.h:46
bool is_auxiliary_supported() const
Check the flag to support auxiliary.
datatools::logger::priority get_logging_priority() const
Return the logging priority threshold.
bool has_fake_materials() const
Check the flag to use mock materials.
virtual void _export_gdml(std::ostream &out_, const model_factory &factory_, const std::string &model_name_)
GDML export of the model factory, given the name of the top level model.
gdml_export()
Default constructor.
A logical geometry volume (ala GDML)
Definition: logical_volume.h:40
static const std::string & default_density_unit()
GDML export class.
Definition: gdml_export.h:37
void add_fake_materials(bool)
Set the flag to use mock materials.
virtual void _export_gdml_solid(const i_shape_3d &shape_, const std::string &log_name_)
GDML export of a solid.
virtual void export_gdml(const std::string &filename_, const model_factory &factory_, const std::string &model_name_="")
GDML export.
virtual void _export_gdml_logical(const logical_volume &log_vol__)
GDML export of a logical volume.
static const std::string & default_angle_unit()
virtual void _export_gdml_model(const i_model &model_)
GDML export of a geometry model.
void set_logging_priority(datatools::logger::priority)
Set the logging priority threshold.
void add_auxiliary_support(bool s_=true)
Set the flag to support auxiliary.
const datatools::properties & parameters() const
Return a reference to the non mutable container of parameters.
The factory of geometry models.
Definition: model_factory.h:40
static const std::string & default_length_unit()
void attach_external_materials(const std::ostringstream &oss_)
Attach an external GDML stream fro materials.
GDML writer class used by the geomtools GDML export functionalities.
Definition: gdml_writer.h:55
virtual ~gdml_export()
Destructor.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
bool is_replica_supported() const
Check the flag to support replica.
A dictionary of arbitrary properties.
Definition: properties.h:125