]>
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; | |
c24553ac | 21 | class G4PVReplica; |
240601e9 | 22 | class G4Box; |
23 | class G4Tubs; | |
c24553ac | 24 | class G4Cons; |
240601e9 | 25 | class G4Trd; |
4032dc03 | 26 | class G4Trap; |
c24553ac | 27 | class G4Polycone; |
28 | class G4Polyhedra; | |
240601e9 | 29 | |
30 | class TG4XMLConvertor : public TG4VXMLConvertor | |
31 | { | |
32 | public: | |
33 | TG4XMLConvertor(G4std::ofstream& outFile); | |
34 | virtual ~TG4XMLConvertor(); | |
35 | ||
36 | // methods | |
509c89ec | 37 | virtual void OpenMaterials(const G4String& version, const G4String& date, |
38 | const G4String& author, const G4String dtdVersion); | |
240601e9 | 39 | virtual void OpenSection(const G4String& name, const G4String& version, |
40 | const G4String& date, const G4String& author, | |
41 | const G4String& topVolume); | |
42 | virtual void OpenComposition(const G4String& name); | |
509c89ec | 43 | virtual void CloseMaterials(); |
240601e9 | 44 | virtual void CloseSection(); |
45 | virtual void CloseComposition(); | |
46 | ||
47 | virtual void WriteMaterial(const G4Material* material); | |
4032dc03 | 48 | virtual void WriteSolid(G4String lvName, const G4VSolid* solid, |
49 | G4String materialName); | |
240601e9 | 50 | virtual void WriteRotation(const G4RotationMatrix* rotation); |
4032dc03 | 51 | virtual void WritePosition(G4String lvName, G4ThreeVector position); |
240601e9 | 52 | virtual void WritePositionWithRotation( |
4032dc03 | 53 | G4String lvName, G4ThreeVector position, |
c24553ac | 54 | const G4RotationMatrix* rotation); |
55 | virtual void WriteReplica(G4String lvName, G4PVReplica* pvr); | |
240601e9 | 56 | virtual void WriteEmptyLine(); |
509c89ec | 57 | virtual void IncreaseIndention(); |
58 | virtual void DecreaseIndention(); | |
240601e9 | 59 | |
60 | private: | |
61 | //methods | |
62 | void CutName(G4String& name) const; | |
63 | void CutName(G4String& name, G4int size) const; | |
64 | void PutName(G4String& element, G4String name, G4String templ) const; | |
c24553ac | 65 | |
66 | // writing solids | |
4032dc03 | 67 | void WriteBox (G4String lvName, const G4Box* box, G4String materialName); |
68 | void WriteTubs(G4String lvName, const G4Tubs* tubs, G4String materialName); | |
c24553ac | 69 | void WriteCons(G4String lvName, const G4Cons* cons, G4String materialName); |
4032dc03 | 70 | void WriteTrd (G4String lvName, const G4Trd* trd, G4String materialName); |
71 | void WriteTrap(G4String lvName, const G4Trap* trap, G4String materialName); | |
c24553ac | 72 | void WritePolycone(G4String lvName, const G4Polycone* polycone, |
73 | G4String materialName); | |
74 | void WritePolyhedra(G4String lvName, const G4Polyhedra* polyhedra, | |
75 | G4String materialName); | |
240601e9 | 76 | |
77 | // static data members | |
4b062c78 | 78 | static const G4int fgkMaxVolumeNameLength; //maximal volume name length |
79 | static const G4int fgkMaxMaterialNameLength;//maximal material name length | |
240601e9 | 80 | |
81 | // data members | |
509c89ec | 82 | G4std::ofstream& fOutFile; //output file |
4b062c78 | 83 | const G4String fkBasicIndention; //basic indention |
509c89ec | 84 | G4String fIndention; //indention string |
4032dc03 | 85 | G4int fRotationCounter; //counter of rotations |
86 | TG4RotationMatrixVector fRotations; // vector of rot matrices | |
240601e9 | 87 | }; |
88 | ||
89 | #endif //TG4_XML_CONVERTOR_H | |
90 |