WCSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WCSimVisManager.cc
Go to the documentation of this file.
1 // Visualization Manager
2 
3 
4 #ifdef G4VIS_USE
5 
6 #include "WCSimVisManager.hh"
7 #include "G4TrajectoryDrawByParticleID.hh"
8 
9 // Supported drivers...
10 
11 // Not needing external packages or libraries...
12 #include "G4ASCIITree.hh"
13 #include "G4DAWNFILE.hh"
14 //#include "G4GAGTree.hh"
15 #include "G4HepRepFile.hh"
16 #include "G4HepRep.hh"
17 #include "G4RayTracer.hh"
18 #include "G4VRML1File.hh"
19 #include "G4VRML2File.hh"
20 
21 // Needing external packages or libraries...
22 
23 #ifdef G4VIS_USE_DAWN
24 #include "G4FukuiRenderer.hh"
25 #endif
26 
27 #ifdef G4VIS_USE_OPACS
28 #include "G4Wo.hh"
29 #include "G4Xo.hh"
30 #endif
31 
32 #ifdef G4VIS_USE_OPENGLX
33 #include "G4OpenGLImmediateX.hh"
34 #include "G4OpenGLStoredX.hh"
35 #endif
36 
37 #ifdef G4VIS_USE_OPENGLWIN32
38 #include "G4OpenGLImmediateWin32.hh"
39 #include "G4OpenGLStoredWin32.hh"
40 #endif
41 
42 #ifdef G4VIS_USE_OPENGLXM
43 #include "G4OpenGLImmediateXm.hh"
44 #include "G4OpenGLStoredXm.hh"
45 #endif
46 
47 #ifdef G4VIS_USE_OPENGLQT
48 #include "G4OpenGLImmediateQt.hh"
49 #include "G4OpenGLStoredQt.hh"
50 #endif
51 
52 #ifdef G4VIS_USE_OIX
53 #include "G4OpenInventorX.hh"
54 #endif
55 
56 #ifdef G4VIS_USE_OIWIN32
57 #include "G4OpenInventorWin32.hh"
58 #endif
59 
60 #ifdef G4VIS_USE_VRML
61 #include "G4VRML1.hh"
62 #include "G4VRML2.hh"
63 #endif
64 
65 WCSimVisManager::WCSimVisManager () {}
66 
67 void WCSimVisManager::RegisterGraphicsSystems () {
68 
69  // Graphics Systems not needing external packages or libraries...
70  RegisterGraphicsSystem (new G4ASCIITree);
71  RegisterGraphicsSystem (new G4DAWNFILE);
72  //RegisterGraphicsSystem (new G4GAGTree);
73  RegisterGraphicsSystem (new G4HepRepFile);
74  RegisterGraphicsSystem (new G4HepRep);
75  RegisterGraphicsSystem (new G4RayTracer);
76  RegisterGraphicsSystem (new G4VRML1File);
77  RegisterGraphicsSystem (new G4VRML2File);
78 
79  // Graphics systems needing external packages or libraries...
80 
81 #ifdef G4VIS_USE_DAWN
82  RegisterGraphicsSystem (new G4FukuiRenderer);
83 #endif
84 
85 #ifdef G4VIS_USE_OPACS
86  RegisterGraphicsSystem (new G4Wo);
87  RegisterGraphicsSystem (new G4Xo);
88 #endif
89 
90 #ifdef G4VIS_USE_OPENGLX
91  RegisterGraphicsSystem (new G4OpenGLImmediateX);
92  RegisterGraphicsSystem (new G4OpenGLStoredX);
93 #endif
94 
95 #ifdef G4VIS_USE_OPENGLQT
96  RegisterGraphicsSystem (new G4OpenGLImmediateQt);
97  RegisterGraphicsSystem (new G4OpenGLStoredQt);
98 #endif
99 
100 #ifdef G4VIS_USE_OPENGLWIN32
101  RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
102  RegisterGraphicsSystem (new G4OpenGLStoredWin32);
103 #endif
104 
105 #ifdef G4VIS_USE_OPENGLXM
106  RegisterGraphicsSystem (new G4OpenGLImmediateXm);
107  RegisterGraphicsSystem (new G4OpenGLStoredXm);
108 #endif
109 
110 #ifdef G4VIS_USE_OIX
111  RegisterGraphicsSystem (new G4OpenInventorX);
112 #endif
113 
114 #ifdef G4VIS_USE_OIWIN32
115  RegisterGraphicsSystem (new G4OpenInventorWin32);
116 #endif
117 
118 #ifdef G4VIS_USE_VRML
119  RegisterGraphicsSystem (new G4VRML1);
120  RegisterGraphicsSystem (new G4VRML2);
121 #endif
122 
123  //create new drawByParticleID model
124  G4TrajectoryDrawByParticleID* mymodel = new G4TrajectoryDrawByParticleID;
125 
126  //Configure model
127  mymodel->SetDefault("cyan");
128  mymodel->Set("gamma","green");
129  mymodel->Set("nu_e","yellow");
130  mymodel->Set("nu_mu","yellow");
131  mymodel->Set("anti_nu_e","yellow");
132  mymodel->Set("anti_nu_mu","yellow");
133  mymodel->Set("e-","blue");
134  mymodel->Set("mu-","white");
135  mymodel->Set("e+","red");
136  mymodel->Set("mu+",G4Colour(0.78, 0.78, 0.78)); //to distinguish mu+ from mu- on black background.
137  mymodel->Set("proton","magenta");
138  mymodel->Set("neutron","cyan");
139 
140  if (fVerbose > 0) {
141  G4cout <<
142  "\nYou have successfully chosen to use the following graphics systems."
143  << G4endl;
144  PrintAvailableGraphicsSystems (); //use this version for Geant4.10.1
145  //PrintAvailableGraphicsSystems (GetVerbosityValue(fVerbose)); //use this version for Geant4.10.2+
146  }
147  RegisterModel(mymodel);
148 
149 
150 }
151 
152 #endif