]>
Commit | Line | Data |
---|---|---|
240601e9 | 1 | // $Id$ |
2 | // Category: geometry | |
3 | // by I. Hrivnacova, 27.07.2000 | |
4 | // | |
5 | // XML convertor that converts G4 basic geometry objects | |
6 | // to XML defined by AGDD.dtd | |
7 | // (ATLAS Generic Detector Description) | |
8 | ||
9 | #ifndef TG4_XML_CONVERTOR_H | |
10 | #define TG4_XML_CONVERTOR_H | |
11 | ||
12 | #include "TG4VXMLConvertor.h" | |
13 | #include "TG4Globals.h" | |
14 | ||
15 | #include <globals.hh> | |
16 | #include <g4std/fstream> | |
17 | ||
18 | class G4Material; | |
19 | class G4VSolid; | |
20 | class G4LogicalVolume; | |
21 | class G4Box; | |
22 | class G4Tubs; | |
23 | class G4Trd; | |
4032dc03 | 24 | class G4Trap; |
240601e9 | 25 | |
26 | class TG4XMLConvertor : public TG4VXMLConvertor | |
27 | { | |
28 | public: | |
29 | TG4XMLConvertor(G4std::ofstream& outFile); | |
30 | virtual ~TG4XMLConvertor(); | |
31 | ||
32 | // methods | |
509c89ec | 33 | virtual void OpenMaterials(const G4String& version, const G4String& date, |
34 | const G4String& author, const G4String dtdVersion); | |
240601e9 | 35 | virtual void OpenSection(const G4String& name, const G4String& version, |
36 | const G4String& date, const G4String& author, | |
37 | const G4String& topVolume); | |
38 | virtual void OpenComposition(const G4String& name); | |
509c89ec | 39 | virtual void CloseMaterials(); |
240601e9 | 40 | virtual void CloseSection(); |
41 | virtual void CloseComposition(); | |
42 | ||
43 | virtual void WriteMaterial(const G4Material* material); | |
4032dc03 | 44 | virtual void WriteSolid(G4String lvName, const G4VSolid* solid, |
45 | G4String materialName); | |
240601e9 | 46 | virtual void WriteRotation(const G4RotationMatrix* rotation); |
4032dc03 | 47 | virtual void WritePosition(G4String lvName, G4ThreeVector position); |
240601e9 | 48 | virtual void WritePositionWithRotation( |
4032dc03 | 49 | G4String lvName, G4ThreeVector position, |
240601e9 | 50 | const G4RotationMatrix* rotation); |
51 | virtual void WriteEmptyLine(); | |
509c89ec | 52 | virtual void IncreaseIndention(); |
53 | virtual void DecreaseIndention(); | |
240601e9 | 54 | |
55 | private: | |
56 | //methods | |
57 | void CutName(G4String& name) const; | |
58 | void CutName(G4String& name, G4int size) const; | |
59 | void PutName(G4String& element, G4String name, G4String templ) const; | |
4032dc03 | 60 | void WriteBox (G4String lvName, const G4Box* box, G4String materialName); |
61 | void WriteTubs(G4String lvName, const G4Tubs* tubs, G4String materialName); | |
62 | void WriteTrd (G4String lvName, const G4Trd* trd, G4String materialName); | |
63 | void WriteTrap(G4String lvName, const G4Trap* trap, G4String materialName); | |
240601e9 | 64 | |
65 | // static data members | |
66 | static const G4int fgkMaxVolumeNameLength; | |
67 | static const G4int fgkMaxMaterialNameLength; | |
68 | ||
69 | // data members | |
509c89ec | 70 | G4std::ofstream& fOutFile; //output file |
509c89ec | 71 | const G4String fBasicIndention; //basic indention |
72 | G4String fIndention; //indention string | |
4032dc03 | 73 | G4int fRotationCounter; //counter of rotations |
74 | TG4RotationMatrixVector fRotations; // vector of rot matrices | |
240601e9 | 75 | }; |
76 | ||
77 | #endif //TG4_XML_CONVERTOR_H | |
78 |