]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant4/TG4XMLGeometryGenerator.h
Updated SDigitizer
[u/mrichter/AliRoot.git] / TGeant4 / TG4XMLGeometryGenerator.h
CommitLineData
240601e9 1// $Id$
2// Category: geometry
240601e9 3//
499b353a 4// Author: I. Hrivnacova, 27.07.2000
5//
6// Class TG4XMLGeometryGenerator
7// -----------------------------
240601e9 8// Singleton class for generation of geometry data files in XML,
9// the XML format is independent from G4 geometry
10// object model.
11
12#ifndef TG4_XML_GEOMETRY_GENERATOR_H
13#define TG4_XML_GEOMETRY_GENERATOR_H
14
5b6ecd36 15#include "TG4Verbose.h"
4032dc03 16#include "TG4Globals.h"
17
240601e9 18#include <globals.hh>
19#include <g4std/fstream>
20
21class TG4VXMLConvertor;
22
23class G4LogicalVolume;
24
5b6ecd36 25class TG4XMLGeometryGenerator : public TG4Verbose
240601e9 26{
27 public:
28 TG4XMLGeometryGenerator();
29 // --> protected
30 // TG4XMLGeometryGenerator(const TG4XMLGeometryGenerator& right);
31 virtual ~TG4XMLGeometryGenerator();
32
33 // static access method
34 static TG4XMLGeometryGenerator* Instance();
35
36 // methods
429ec6b8 37 void GenerateMaterials(const G4String& version, const G4String& date,
38 const G4String& author, const G4String dtdVersion,
39 G4LogicalVolume* lv);
240601e9 40 void GenerateSection(const G4String& name, const G4String& version,
41 const G4String& date, const G4String& author,
42 const G4String& topVolume, G4LogicalVolume* lv);
43 void OpenFile(G4String filePath);
44 void CloseFile();
45
46 protected:
47 TG4XMLGeometryGenerator(const TG4XMLGeometryGenerator& right);
48
49 // operators
50 TG4XMLGeometryGenerator& operator=(const TG4XMLGeometryGenerator& right);
51
52 private:
53 // methods
4032dc03 54 void CutName(G4String& name) const;
240601e9 55 void ProcessLogicalVolume(G4LogicalVolume* lv);
56 void ProcessMaterials(G4LogicalVolume* lv);
57 void ProcessSolids(G4LogicalVolume* lv);
429ec6b8 58 void ProcessRotations(G4LogicalVolume* lv);
4032dc03 59 void ClearMaterialNames();
60 void ClearVolumeNames();
240601e9 61
62 // static data members
63 static TG4XMLGeometryGenerator* fgInstance; //this instance
64
65 // data members
66 TG4VXMLConvertor* fConvertor; //interface to XML convertor
67 G4std::ofstream fOutFile; //output file
4032dc03 68 TG4StringSet fMaterialNames; //set of names of materials
69 TG4StringSet fVolumeNames; //set of names of solids
240601e9 70};
71
72
73// inline methods
74inline TG4XMLGeometryGenerator* TG4XMLGeometryGenerator::Instance()
75{ return fgInstance; }
76
77#endif //TG4_GEOMETRY_XML_MANAGER_H
78