Bayeux  3.4.1
Core Foundation library for SuperNEMO
gdml_writer.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: 2015-02-04
5  *
6  * License:
7  *
8  * Description:
9  * GDML writer
10  *
11  * History:
12  *
13  *
14  * To do:
15  * Add auxiliary properties for volumes...
16  *
17  */
18 
19 #ifndef GEOMTOOLS_GDML_WRITER_H
20 #define GEOMTOOLS_GDML_WRITER_H 1
21 
22 // Standard library:
23 #include <iostream>
24 #include <sstream>
25 #include <string>
26 #include <map>
27 
28 // Third party:
29 // - Bayeux/datatools:
30 #include <datatools/logger.h>
31 // - Bayeux/materials:
32 #include <materials/material.h>
33 
34 // This project:
35 #include <geomtools/utils.h>
36 
37 namespace geomtools {
38 
39  // Forward class declarations:
40  class box;
41  class right_circular_conical_frustrum;
42  class ellipsoid;
43  class elliptical_cylinder;
44  class sphere;
45  class polycone;
46  class polyhedra;
47  class right_polygonal_frustrum;
48  class tube;
49  class torus;
50  class cylinder;
51  class tessellated_solid;
52  class wall_solid;
53 
56  {
57  public:
58 
60  typedef std::map<std::string, std::ostringstream *> streams_col_type;
61 
63  static const std::string & default_xml_version();
64 
66  static const std::string & default_xml_encoding();
67 
69  static const std::string & default_xsi();
70 
72  static const std::string & default_gdml_schema();
73 
75  static const std::string & default_remote_gdml_schema();
76 
78  static const std::string & define_section();
79 
81  static const std::string & materials_section();
82 
84  static const std::string & solids_section();
85 
87  static const std::string & structure_section();
88 
90  static const std::string & setup_section();
91 
93  static const std::string & state_convert(::materials::material::state_type);
94 
96  static std::string to_html(const std::string &,
97  bool using_html_symbols_ = false);
98 
100  static std::string to_ascii(const std::string &,
101  bool using_html_symbols_ = true);
102 
104  bool is_initialized() const;
105 
107  bool is_verbose() const;
108 
110  void set_verbose(bool);
111 
113  void set_using_html_symbols(bool u_);
114 
116  bool is_using_html_symbols() const;
117 
119  const std::ostringstream & get_stream(const std::string & section_) const;
120 
122  void attach_external_materials(const std::ostringstream & oss_);
123 
125  bool has_external_materials_stream() const;
126 
129 
131  gdml_writer();
132 
134  virtual ~gdml_writer();
135 
137  void init();
138 
140  void initialize();
141 
143  void reset();
144 
145  /* ************** Defines section ****************** */
146 
147  void add_constant(const std::string & name_,
148  double value_);
149 
150  void add_quantity(const std::string & name_,
151  const std::string & quantity_type_,
152  const std::string & unit_str_,
153  double value_);
154 
155  void add_variable(const std::string & name_,
156  double value_);
157 
158  void add_variable(const std::string & name_,
159  const std::string & expr_value_);
160 
161  void add_position(const std::string & name_,
162  double x_, double y_, double z_,
163  const std::string & unit_str_);
164 
165  void add_position(const std::string & name_,
166  const std::string & x_str_,
167  const std::string & y_str_,
168  const std::string & z_str_,
169  const std::string & unit_str_);
170 
171  void add_position(const std::string & name_,
172  const vector_3d & v_,
173  const std::string & unit_str_);
174 
175  void add_rotation(const std::string & name_,
176  const std::string & axis_,
177  double angle_,
178  const std::string & unit_str_);
179 
180  // Rotation using GDML convention through XYZ Euler angles:
181  void add_rotation(const std::string & name_,
182  const rotation_3d & rot_,
183  const std::string & unit_str_);
184 
185  void add_scale(const std::string & name_,
186  double x_, double y_, double z_);
187 
188  /* ************ Materials section ****************** */
189 
190  void add_isotope(const std::string & name_,
191  size_t atomic_number_,
192  size_t number_of_nucleons_,
193  double a_);
194 
195  void add_element(const std::string & name_,
196  size_t atomic_number_,
197  const std::string & formula_,
198  double a_);
199 
200  void add_element(const std::string & name_,
201  const std::map<std::string, double> & fractions_);
202 
203  void add_element(const std::string & name_,
204  const std::string & ref_);
205 
206  void add_element(const std::string & name_,
207  const std::string & ref1_, double fraction1_,
208  const std::string & ref2_, double fraction2_);
209 
210  void add_element(const std::string & name_,
211  const std::string & ref1_, double fraction1_,
212  const std::string & ref2_, double fraction2_,
213  const std::string & ref3_, double fraction3_);
214 
215  void add_element(const std::string & name_,
216  const std::string & ref1_, double fraction1_,
217  const std::string & ref2_, double fraction2_,
218  const std::string & ref3_, double fraction3_,
219  const std::string & ref4_, double fraction4_);
220 
221  void add_element(const std::string & name_,
222  const std::string & ref1_, double fraction1_,
223  const std::string & ref2_, double fraction2_,
224  const std::string & ref3_, double fraction3_,
225  const std::string & ref4_, double fraction4_,
226  const std::string & ref5_, double fraction5_);
227 
228  void add_material(const std::string & name_,
229  double atomic_number_,
230  double density_,
231  double a_,
232  const std::string & state_label_ = "",
233  double temperature_ = std::numeric_limits<double>::quiet_NaN(),
234  double pressure_ = std::numeric_limits<double>::quiet_NaN()
235  );
236 
237  void add_material(const std::string & name_,
238  const std::string & formula_,
239  double density_,
240  const std::map<std::string, size_t> & composites_,
241  const std::string & state_label_ = "",
242  double temperature_ = std::numeric_limits<double>::quiet_NaN(),
243  double pressure_ = std::numeric_limits<double>::quiet_NaN()
244  );
245 
246  void add_material(const std::string & name_,
247  const std::string & formula_,
248  double density_,
249  const std::map<std::string, double> & fractions_,
250  const std::string & state_label_ = "",
251  double temperature_ = std::numeric_limits<double>::quiet_NaN(),
252  double pressure_ = std::numeric_limits<double>::quiet_NaN()
253  );
254 
255  /* *************** Solids section ****************** */
256  // GDML USER’S GUIDE Version 2.3 page 14
257 
259  static bool solid_type_is_valid(const std::string & solid_type_);
260 
262  static bool solid_type_is_supported(const std::string & solid_type_);
263 
264  // GDML USER’S GUIDE Version 2.3 page 14
265  void add_gdml_box(const std::string & name_,
266  double x_, double y_, double z_,
267  const std::string & lunit_str_ = "mm");
268 
269  void add_box(const std::string & name_,
270  const box & b_,
271  const std::string & lunit_str_ = "mm");
272 
273  // GDML USER’S GUIDE Version 2.3 page 14
274  void add_gdml_cone_segment(const std::string & name_,
275  double rmin1_, double rmax1_,
276  double rmin2_, double rmax2_,
277  double z_,
278  double startphi_, double deltaphi_,
279  const std::string & lunit_str_ = "mm",
280  const std::string & aunit_str_ = "radian");
281 
282  void add_cone_segment(const std::string & name_,
284  const std::string & lunit_str_ = "mm",
285  const std::string & aunit_str_ = "radian");
286 
287  // GDML USER’S GUIDE Version 2.3 page 14
288  void add_gdml_ellipsoid(const std::string & name_,
289  double rx_, double ry, double rz_,
290  double bottom_z_, double top_z_,
291  const std::string & lunit_str_ = "mm",
292  const std::string & aunit_str_ = "radian");
293 
294  void add_ellipsoid(const std::string & name_,
295  const ellipsoid & e_,
296  const std::string & lunit_str_ = "mm",
297  const std::string & aunit_str_ = "radian");
298 
299  // GDML USER’S GUIDE Version 2.3 page 14
300  void add_gdml_elliptical_tube(const std::string & name_,
301  double rx_, double ry, double z_,
302  const std::string & lunit_str_ = "mm",
303  const std::string & aunit_str_ = "radian");
304 
305  void add_elliptical_tube(const std::string & name_,
306  const elliptical_cylinder & t_,
307  const std::string & lunit_str_ = "mm",
308  const std::string & aunit_str_ = "radian");
309 
310  // GDML USER’S GUIDE Version 2.3 page 15
311  void add_gdml_orb(const std::string & name_,
312  double r_,
313  const std::string & lunit_str_ = "mm");
314 
315  void add_orb(const std::string & name_,
316  const sphere & s_,
317  const std::string & lunit_str_ = "mm",
318  const std::string & aunit_str_ = "radian");
319 
320  // GDML USER’S GUIDE Version 2.3 page 17
321  void add_gdml_polycone(const std::string & name_,
322  std::map<double, std::pair<double, double> > zplanes_,
323  double start_phi_, double delta_phi_,
324  const std::string & lunit_str_ = "mm",
325  const std::string & aunit_str_ = "radian");
326 
327  void add_polycone(const std::string & name_,
328  const polycone & s_,
329  const std::string & lunit_str_ = "mm",
330  const std::string & aunit_str_ = "radian");
331 
332 
333  // GDML USER’S GUIDE Version 2.3 page 17
334  void add_gdml_generic_polycone(const std::string & name_,
335  std::map<double, double> rzpoints_,
336  double start_phi_, double delta_phi_,
337  const std::string & lunit_str_ = "mm",
338  const std::string & aunit_str_ = "radian");
339 
340  // GDML USER’S GUIDE Version 2.3 page 19
341  void add_gdml_polyhedra(const std::string & name_,
342  size_t num_sides_,
343  std::map<double, std::pair<double, double> > zplanes_,
344  double start_phi_, double delta_phi_,
345  const std::string & lunit_str_ = "mm",
346  const std::string & aunit_str_ = "radian");
347 
348  void add_polyhedra(const std::string & name_,
349  const polyhedra & s_,
350  const std::string & lunit_str_ = "mm",
351  const std::string & aunit_str_ = "radian");
352 
353  // GDML USER’S GUIDE Version 2.3 page 17
354  void add_gdml_generic_polyhedra(const std::string & name_,
355  size_t num_sides_,
356  std::map<double, double> rzpoints_,
357  double start_phi_, double delta_phi_,
358  const std::string & lunit_str_ = "mm",
359  const std::string & aunit_str_ = "radian");
360 
361  // GDML USER’S GUIDE Version 2.3 page 19
362  void add_gdml_sphere(const std::string & name_,
363  double rmin_, double rmax,
364  double start_phi_, double delta_phi_,
365  double start_theta_, double delta_theta_,
366  const std::string & lunit_str_ = "mm",
367  const std::string & aunit_str_ = "radian");
368 
369  void add_sphere(const std::string & name_,
370  const sphere & s_,
371  const std::string & lunit_str_ = "mm",
372  const std::string & aunit_str_ = "radian");
373 
374  // GDML USER’S GUIDE Version 2.3 page 22
375  void add_gdml_tube(const std::string & name_,
376  double rmin_, double rmax, double z_,
377  double start_phi_, double delta_phi_,
378  const std::string & lunit_str_ = "mm",
379  const std::string & aunit_str_ = "radian");
380 
381  void add_tube(const std::string & name_,
382  const tube & t_,
383  const std::string & lunit_str_ = "mm",
384  const std::string & aunit_str_ = "radian");
385 
386  void add_gdml_torus(const std::string & name_,
387  double rsweep_,
388  double rmin_, double rmax,
389  double start_phi_, double delta_phi_,
390  const std::string & lunit_str_ = "mm",
391  const std::string & aunit_str_ = "radian");
392 
393  void add_torus(const std::string & name_,
394  const torus & t_,
395  const std::string & lunit_str_ = "mm",
396  const std::string & aunit_str_ = "radian");
397 
398  void add_cylinder(const std::string & name_,
399  const cylinder & c_,
400  const std::string & lunit_str_ = "mm",
401  const std::string & aunit_str_ = "radian");
402 
403  // GDML USER’S GUIDE Version 2.3 page 26
404  void add_tessellated(const std::string & name_,
405  const tessellated_solid & ts_,
406  const std::string & lunit_str_ = "mm");
407 
408  // GDML USER’S GUIDE Version 2.3 page 26
409  void add_wall(const std::string & name_,
410  const wall_solid & ts_,
411  const std::string & lunit_str_ = "mm");
412 
413  // GDML USER’S GUIDE Version 2.3 page 28
414  void add_gdml_boolean(const std::string & name_,
415  const std::string & boolean_type_,
416  const std::string & first_ref_,
417  const std::string & second_ref_,
418  const std::string & position_ref_,
419  const std::string & rotation_ref_);
420 
421  void add_gdml_union(const std::string & name_,
422  const std::string & first_ref_,
423  const std::string & second_ref_,
424  const std::string & position_ref_,
425  const std::string & rotation_ref_);
426 
427  void add_gdml_subtraction(const std::string & name_,
428  const std::string & first_ref_,
429  const std::string & second_ref_,
430  const std::string & position_ref_,
431  const std::string & rotation_ref_);
432 
433  void add_gdml_intersection(const std::string & name_,
434  const std::string & first_ref_,
435  const std::string & second_ref_,
436  const std::string & position_ref_,
437  const std::string & rotation_ref_);
438 
439  /* *************** Structures section ****************** */
440  // GDML USER’S GUIDE Version 2.3 page 29
441 
443  class physvol
444  {
445  public:
446  std::string volumeref;
447  std::string positionref;
448  std::string rotationref;
449  std::string scaleref;
450  physvol(const std::string & volumeref_ = "",
451  const std::string & positionref_ = "",
452  const std::string & rotationref_ = "",
453  const std::string & scaleref_ = "");
454  };
455 
458  {
459  public:
460  static const std::string & replicated_along_axis();
461  std::string volumeref;
462  size_t number;
463  std::string mode;
464  std::string direction;
465  double width;
466  double offset;
467  };
468 
469  void add_volume_auxiliaries(const std::map<std::string, std::string> & aux_);
470 
471  void add_volume(const std::string & name_,
472  const std::string & material_ref_,
473  const std::string & solid_ref_,
474  const std::map<std::string, std::string> & aux_);
475 
476  void add_volume(const std::string & name_,
477  const std::string & material_ref_,
478  const std::string & solid_ref_);
479 
480  void add_volume(const std::string & name_,
481  const std::string & material_ref_,
482  const std::string & solid_ref_,
483  const std::list<physvol> & phys_vols_,
484  const std::map<std::string, std::string> & aux_);
485 
486  void add_volume(const std::string & name_,
487  const std::string & material_ref_,
488  const std::string & solid_ref_,
489  const std::list<physvol> & phys_vols_);
490 
491  void add_replica_volume(const std::string & name_,
492  const std::string & material_ref_,
493  const std::string & solid_ref_,
494  const replicavol & replicavol_,
495  const std::string & lunit_str_,
496  const std::string & aunit_str_,
497  const std::map<std::string, std::string> & aux_);
498 
499  void add_replica_volume(const std::string & name_,
500  const std::string & material_ref_,
501  const std::string & solid_ref_,
502  const replicavol & replicavol_,
503  const std::string & lunit_str_ = "mm",
504  const std::string & aunit_str_ = "radian");
505 
506  /* *************** Setups section ****************** */
507 
508  void add_setup(const std::string & name_,
509  const std::string & world_ref_,
510  const std::string & version_ = "1.0");
511 
512 
513 
514  /* *************** Header/Section ****************** */
515 
516  void xml_header(std::ostream &,
517  const std::string & xml_version_ = "",
518  const std::string & xml_encoding_ = "",
519  bool standalone_ = false);
520 
521  void gdml_begin(std::ostream &,
522  const std::string & schema_ = "",
523  const std::string & xsi_ = "<default>");
524 
525  void gdml_end(std::ostream &);
526 
527  void gdml_section_begin(std::ostream &,
528  const std::string & section_);
529  void gdml_section_end(std::ostream &,
530  const std::string & section_);
531 
532 
533  /* *************** Utilities ****************** */
534 
536  void full_write(std::ostream & out_,
537  const std::string & version_ = "",
538  const std::string & encoding_ = "",
539  const std::string & schema_ = "",
540  const std::string & xsi_ = "<default>");
541 
543  void save_file(const std::string & filename_,
544  const std::string & version_ = "",
545  const std::string & encoding_ = "",
546  const std::string & schema_ = "",
547  const std::string & xsi_ = "<default>");
548 
549 
551  void dump(std::ostream &) const;
552 
553  protected:
554 
556  void _allocate_streams();
557 
559  void _free_streams();
560 
562  const std::ostringstream & _get_stream(const std::string & section_) const;
563 
565  std::ostringstream & _get_stream(const std::string & section_);
566 
567  private:
568 
569  bool _initialized_;
570  bool _verbose_;
571  streams_col_type _streams_;
572  const std::ostringstream * _external_materials_stream_;
573  bool _using_html_symbols_;
574 
575  };
576 
577 
578 } // end of namespace geomtools
579 
580 #endif // GEOMTOOLS_GDML_WRITER_H
581 
582 /*
583 ** Local Variables: --
584 ** mode: c++ --
585 ** c-file-style: "gnu" --
586 ** tab-width: 2 --
587 ** End: --
588 */
Right circular conical frustrum (3D shape)
Definition: right_circular_conical_frustrum.h:32
void add_gdml_polyhedra(const std::string &name_, size_t num_sides_, std::map< double, std::pair< double, double > > zplanes_, double start_phi_, double delta_phi_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
void full_write(std::ostream &out_, const std::string &version_="", const std::string &encoding_="", const std::string &schema_="", const std::string &xsi_="<default>")
Write the full GDML description in an output stream.
void add_cone_segment(const std::string &name_, const right_circular_conical_frustrum &cf_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
void add_gdml_elliptical_tube(const std::string &name_, double rx_, double ry, double z_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
std::string rotationref
Definition: gdml_writer.h:448
void gdml_end(std::ostream &)
static std::string to_ascii(const std::string &, bool using_html_symbols_=true)
Convert string to ASCII.
void add_gdml_union(const std::string &name_, const std::string &first_ref_, const std::string &second_ref_, const std::string &position_ref_, const std::string &rotation_ref_)
A spherical volume (3D solid)
Definition: sphere.h:44
void set_using_html_symbols(bool u_)
Set flag for using HTML symbol.
bool is_initialized() const
Check initialization flag.
const std::ostringstream & get_stream(const std::string &section_) const
Return output stream associated to a GDML section.
void set_verbose(bool)
Set verbosity flag.
void add_sphere(const std::string &name_, const sphere &s_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
void add_volume(const std::string &name_, const std::string &material_ref_, const std::string &solid_ref_, const std::map< std::string, std::string > &aux_)
void add_gdml_generic_polyhedra(const std::string &name_, size_t num_sides_, std::map< double, double > rzpoints_, double start_phi_, double delta_phi_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
static const std::string & default_remote_gdml_schema()
Return default remote GDML schema.
bool is_using_html_symbols() const
Check flag for using HTML symbol.
void add_gdml_generic_polycone(const std::string &name_, std::map< double, double > rzpoints_, double start_phi_, double delta_phi_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
void add_constant(const std::string &name_, double value_)
Polycone 3D solid shape.
Definition: polycone.h:39
void add_cylinder(const std::string &name_, const cylinder &c_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
The 3D shape model for a solid torus.
Definition: torus.h:43
static const std::string & default_gdml_schema()
Return default GDML schema.
The 3D shape model for a box.
Definition: box.h:44
The 3D shape model for an ellipsoid.
Definition: ellipsoid.h:42
void add_scale(const std::string &name_, double x_, double y_, double z_)
virtual ~gdml_writer()
Destructor.
Tessellated solid made of facets.
Definition: tessellation.h:294
Description of a replica volume.
Definition: gdml_writer.h:457
void add_orb(const std::string &name_, const sphere &s_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
static const std::string & state_convert(::materials::material::state_type)
Convert material state (gas, liquid, solid...) to GDML supported label.
void add_position(const std::string &name_, double x_, double y_, double z_, const std::string &unit_str_)
void add_torus(const std::string &name_, const torus &t_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
physvol(const std::string &volumeref_="", const std::string &positionref_="", const std::string &rotationref_="", const std::string &scaleref_="")
double width
Definition: gdml_writer.h:465
static bool solid_type_is_valid(const std::string &solid_type_)
Check if a solid type given by name is valid.
static const std::string & default_xml_version()
Return default XML version.
void add_gdml_torus(const std::string &name_, double rsweep_, double rmin_, double rmax, double start_phi_, double delta_phi_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
static const std::string & default_xsi()
Return default XSI.
static const std::string & solids_section()
Return solids section tag.
void gdml_section_end(std::ostream &, const std::string &section_)
std::string direction
Definition: gdml_writer.h:464
void add_tube(const std::string &name_, const tube &t_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
The 3D shape model for an elliptical cylinder.
Definition: elliptical_cylinder.h:43
void add_replica_volume(const std::string &name_, const std::string &material_ref_, const std::string &solid_ref_, const replicavol &replicavol_, const std::string &lunit_str_, const std::string &aunit_str_, const std::map< std::string, std::string > &aux_)
void add_gdml_tube(const std::string &name_, double rmin_, double rmax, double z_, double start_phi_, double delta_phi_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
static std::string to_html(const std::string &, bool using_html_symbols_=false)
Convert string to HTML.
void add_setup(const std::string &name_, const std::string &world_ref_, const std::string &version_="1.0")
void add_gdml_subtraction(const std::string &name_, const std::string &first_ref_, const std::string &second_ref_, const std::string &position_ref_, const std::string &rotation_ref_)
void save_file(const std::string &filename_, const std::string &version_="", const std::string &encoding_="", const std::string &schema_="", const std::string &xsi_="<default>")
Write the full GDML description in a file.
The 3D shape model for a tube.
Definition: tube.h:45
static const std::string & define_section()
Return define section tag.
void add_isotope(const std::string &name_, size_t atomic_number_, size_t number_of_nucleons_, double a_)
void add_tessellated(const std::string &name_, const tessellated_solid &ts_, const std::string &lunit_str_="mm")
void initialize()
Initialize.
void add_volume_auxiliaries(const std::map< std::string, std::string > &aux_)
const std::ostringstream & _get_stream(const std::string &section_) const
Return a const reference to an output stream associated to a given GDML section.
void reset_external_materials_stream()
Detach the external output stream dedicated to GDML description of materials.
Polyhedra 3D solid shape.
Definition: polyhedra.h:35
static bool solid_type_is_supported(const std::string &solid_type_)
Check if a solid type given by name is supported.
static const std::string & materials_section()
Return materials section tag.
void add_elliptical_tube(const std::string &name_, const elliptical_cylinder &t_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
The 3D shape model for a wall solid.
Definition: wall_solid.h:43
gdml_writer()
Default constructor.
void add_wall(const std::string &name_, const wall_solid &ts_, const std::string &lunit_str_="mm")
static const std::string & setup_section()
Return setup section tag.
std::map< std::string, std::ostringstream * > streams_col_type
Dictionary of output stream associated by section name.
Definition: gdml_writer.h:60
void add_variable(const std::string &name_, double value_)
CLHEP::HepRotation rotation_3d
Alias for the CLHEP 3D-rotation class.
Definition: clhep.h:66
size_t number
Definition: gdml_writer.h:462
state_type
State of the material.
Definition: material.h:122
void add_box(const std::string &name_, const box &b_, const std::string &lunit_str_="mm")
double offset
Definition: gdml_writer.h:466
void add_gdml_cone_segment(const std::string &name_, double rmin1_, double rmax1_, double rmin2_, double rmax2_, double z_, double startphi_, double deltaphi_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
static const std::string & structure_section()
Return structure section tag.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
void add_gdml_polycone(const std::string &name_, std::map< double, std::pair< double, double > > zplanes_, double start_phi_, double delta_phi_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
std::string positionref
Definition: gdml_writer.h:447
void dump(std::ostream &) const
Basic print.
Utilities for logging information.
The 3D shape model for a cylinder.
Definition: cylinder.h:41
void gdml_section_begin(std::ostream &, const std::string &section_)
void add_gdml_intersection(const std::string &name_, const std::string &first_ref_, const std::string &second_ref_, const std::string &position_ref_, const std::string &rotation_ref_)
void attach_external_materials(const std::ostringstream &oss_)
Attach an external output stream dedicated to GDML description of materials.
std::string volumeref
Definition: gdml_writer.h:461
std::string mode
Definition: gdml_writer.h:463
void xml_header(std::ostream &, const std::string &xml_version_="", const std::string &xml_encoding_="", bool standalone_=false)
void add_gdml_orb(const std::string &name_, double r_, const std::string &lunit_str_="mm")
void _free_streams()
Deallocate the output streams associated to GDML sections.
void add_gdml_sphere(const std::string &name_, double rmin_, double rmax, double start_phi_, double delta_phi_, double start_theta_, double delta_theta_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
void add_gdml_ellipsoid(const std::string &name_, double rx_, double ry, double rz_, double bottom_z_, double top_z_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
bool has_external_materials_stream() const
Check if an external output stream dedicated to GDML description of materials is defined.
bool is_verbose() const
Check verbosity flag.
void init()
Initialize.
Description of a physical volume.
Definition: gdml_writer.h:443
void add_material(const std::string &name_, double atomic_number_, double density_, double a_, const std::string &state_label_="", double temperature_=std::numeric_limits< double >::quiet_NaN(), double pressure_=std::numeric_limits< double >::quiet_NaN())
void add_polyhedra(const std::string &name_, const polyhedra &s_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
void _allocate_streams()
Allocate the output streams associated to GDML sections.
void add_ellipsoid(const std::string &name_, const ellipsoid &e_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
std::string scaleref
Definition: gdml_writer.h:449
void gdml_begin(std::ostream &, const std::string &schema_="", const std::string &xsi_="<default>")
std::string volumeref
Definition: gdml_writer.h:446
GDML writer class used by the geomtools GDML export functionalities.
Definition: gdml_writer.h:55
void add_element(const std::string &name_, size_t atomic_number_, const std::string &formula_, double a_)
void add_gdml_boolean(const std::string &name_, const std::string &boolean_type_, const std::string &first_ref_, const std::string &second_ref_, const std::string &position_ref_, const std::string &rotation_ref_)
void add_rotation(const std::string &name_, const std::string &axis_, double angle_, const std::string &unit_str_)
void add_gdml_box(const std::string &name_, double x_, double y_, double z_, const std::string &lunit_str_="mm")
static const std::string & replicated_along_axis()
void add_polycone(const std::string &name_, const polycone &s_, const std::string &lunit_str_="mm", const std::string &aunit_str_="radian")
void add_quantity(const std::string &name_, const std::string &quantity_type_, const std::string &unit_str_, double value_)
static const std::string & default_xml_encoding()
Return default XML encoding.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39