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