SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
VRML2Writer.hh
Go to the documentation of this file.
1 #ifndef SLIC_VRML2WRITER_HH_
2 #define SLIC_VRML2WRITER_HH_ 1
3 
4 #include <fstream>
5 #include <iostream>
6 #include <string>
7 
8 #include "G4ThreeVector.hh"
9 #include "G4RotationMatrix.hh"
10 
11 class G4VPhysicalVolume;
12 class G4Box;
13 class G4VSolid;
14 class G4Polyhedron;
15 
16 namespace slic {
21 class VRML2Writer {
22 
23  public:
24 
28  VRML2Writer(const std::string& filename);
29 
33  ~VRML2Writer();
34 
38  void write();
39 
40  private:
41 
46  void processTopVolume(G4VPhysicalVolume* volume);
47 
52  void processPhysicalVolume(G4VPhysicalVolume* volume);
53 
58  void processVisualization(G4VPhysicalVolume* volume);
59 
64  void processSolid(G4VSolid* solid);
65 
70  void processBox(G4Box* box);
71 
76  void processPolyhedron(G4Polyhedron* poly);
77 
82  void writeLine(const std::string& line);
83 
87  void indent();
88 
92  void unindent();
93 
94  private:
95 
96  std::ofstream _out;
98 };
99 }
100 
101 #endif
A simple, standalone VRML2 writer that dumps the detector geometry in a hierarchical format.
Definition: VRML2Writer.hh:21
void processBox(G4Box *box)
Definition: VRML2Writer.cc:139
void processSolid(G4VSolid *solid)
Definition: VRML2Writer.cc:131
std::ofstream _out
Definition: VRML2Writer.hh:96
VRML2Writer(const std::string &filename)
Definition: VRML2Writer.cc:24
void processPolyhedron(G4Polyhedron *poly)
Definition: VRML2Writer.cc:151
void processVisualization(G4VPhysicalVolume *volume)
Definition: VRML2Writer.cc:107
void writeLine(const std::string &line)
Definition: VRML2Writer.cc:196
void processTopVolume(G4VPhysicalVolume *volume)
Definition: VRML2Writer.cc:39
void processPhysicalVolume(G4VPhysicalVolume *volume)
Definition: VRML2Writer.cc:51