[531] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
[1288] | 27 | // $Id: G4VisExecutive.icc,v 1.26 2010/05/30 11:30:49 allison Exp $ |
---|
[944] | 28 | // GEANT4 tag $Name: $ |
---|
[531] | 29 | // |
---|
| 30 | // |
---|
| 31 | // John Allison 24th January 1998. |
---|
| 32 | |
---|
| 33 | #ifndef G4VISEXECUTIVE_ICC |
---|
| 34 | #define G4VISEXECUTIVE_ICC |
---|
| 35 | |
---|
| 36 | // Supported drivers... |
---|
| 37 | |
---|
| 38 | // Not needing external packages or libraries... |
---|
| 39 | #include "G4ASCIITree.hh" |
---|
| 40 | #include "G4DAWNFILE.hh" |
---|
| 41 | #include "G4HepRep.hh" |
---|
| 42 | #include "G4HepRepFile.hh" |
---|
| 43 | #include "G4RayTracer.hh" |
---|
| 44 | #include "G4HitFilterFactories.hh" |
---|
[1288] | 45 | #include "G4DigiFilterFactories.hh" |
---|
[531] | 46 | #include "G4TrajectoryFilterFactories.hh" |
---|
| 47 | #include "G4TrajectoryModelFactories.hh" |
---|
| 48 | #include "G4VRML1File.hh" |
---|
| 49 | #include "G4VRML2File.hh" |
---|
[1140] | 50 | #include "G4GMocrenFile.hh" |
---|
[531] | 51 | |
---|
| 52 | // Needing external packages or libraries... |
---|
| 53 | |
---|
| 54 | #ifdef G4VIS_USE_DAWN |
---|
| 55 | #include "G4FukuiRenderer.hh" |
---|
| 56 | #endif |
---|
| 57 | |
---|
| 58 | #ifdef G4VIS_USE_OPENGLX |
---|
| 59 | #include "G4OpenGLImmediateX.hh" |
---|
| 60 | #include "G4OpenGLStoredX.hh" |
---|
| 61 | #endif |
---|
| 62 | |
---|
| 63 | #ifdef G4VIS_USE_OPENGLWIN32 |
---|
| 64 | #include "G4OpenGLImmediateWin32.hh" |
---|
| 65 | #include "G4OpenGLStoredWin32.hh" |
---|
| 66 | #endif |
---|
| 67 | |
---|
| 68 | #ifdef G4VIS_USE_OPENGLXM |
---|
| 69 | #include "G4OpenGLImmediateXm.hh" |
---|
| 70 | #include "G4OpenGLStoredXm.hh" |
---|
| 71 | #endif |
---|
| 72 | |
---|
| 73 | #ifdef G4VIS_USE_OPENGLQT |
---|
[533] | 74 | #include "G4OpenGLImmediateQt.hh" |
---|
| 75 | #include "G4OpenGLStoredQt.hh" |
---|
[531] | 76 | #endif |
---|
| 77 | |
---|
| 78 | #ifdef G4VIS_USE_OIX |
---|
| 79 | #include "G4OpenInventorX.hh" |
---|
| 80 | #endif |
---|
| 81 | |
---|
| 82 | #ifdef G4VIS_USE_OIWIN32 |
---|
| 83 | #include "G4OpenInventorWin32.hh" |
---|
| 84 | #endif |
---|
| 85 | |
---|
| 86 | #ifdef G4VIS_USE_RAYTRACERX |
---|
| 87 | #include "G4RayTracerX.hh" |
---|
| 88 | #endif |
---|
| 89 | |
---|
| 90 | #ifdef G4VIS_USE_VRML |
---|
| 91 | #include "G4VRML1.hh" |
---|
| 92 | #include "G4VRML2.hh" |
---|
| 93 | #endif |
---|
| 94 | |
---|
[1288] | 95 | G4VisExecutive::G4VisExecutive (const G4String& verbosityString): |
---|
| 96 | G4VisManager(verbosityString) |
---|
| 97 | {} |
---|
| 98 | |
---|
[944] | 99 | // The inline keyword prevents the compiler making an external |
---|
| 100 | // reference even though they cannot actually be inlined since they |
---|
| 101 | // are virtual functions. This prevents a "multiple definition" error |
---|
| 102 | // if it is included in more than one file. However, as explained in |
---|
| 103 | // the class description in G4VisExecutive.hh, it should never be |
---|
| 104 | // necessary to #include "G4VisExecutive.hh" in more than one file |
---|
| 105 | // since after instantiation the object can be treated as a |
---|
| 106 | // G4VisManager. |
---|
| 107 | inline void |
---|
| 108 | G4VisExecutive::RegisterGraphicsSystems () { |
---|
[531] | 109 | |
---|
| 110 | // Graphics Systems not needing external packages or libraries... |
---|
| 111 | RegisterGraphicsSystem (new G4ASCIITree); |
---|
[704] | 112 | RegisterGraphicsSystem (new G4DAWNFILE); |
---|
[531] | 113 | RegisterGraphicsSystem (new G4HepRep); |
---|
| 114 | RegisterGraphicsSystem (new G4HepRepFile); |
---|
| 115 | RegisterGraphicsSystem (new G4RayTracer); |
---|
| 116 | RegisterGraphicsSystem (new G4VRML1File); |
---|
| 117 | RegisterGraphicsSystem (new G4VRML2File); |
---|
[1140] | 118 | RegisterGraphicsSystem (new G4GMocrenFile); |
---|
[531] | 119 | // Graphics systems needing external packages or libraries... |
---|
| 120 | |
---|
| 121 | #ifdef G4VIS_USE_DAWN |
---|
| 122 | RegisterGraphicsSystem (new G4FukuiRenderer); |
---|
| 123 | #endif |
---|
| 124 | |
---|
[1288] | 125 | // Register OGL graphics system with generic nicknames |
---|
| 126 | #ifdef G4VIS_USE_OPENGL |
---|
| 127 | G4VGraphicsSystem* ogl = 0; |
---|
| 128 | G4VGraphicsSystem* ogli = 0; |
---|
| 129 | G4VGraphicsSystem* ogls = 0; |
---|
| 130 | // Follow G4UIExecutive |
---|
| 131 | #if defined(G4UI_USE_QT) |
---|
| 132 | #ifdef G4VIS_USE_OPENGLQT |
---|
[1314] | 133 | #ifdef G4VIS_BUILD_OPENGLQT_DRIVER |
---|
[1288] | 134 | ogl = new G4OpenGLStoredQt; |
---|
| 135 | ogli = new G4OpenGLImmediateQt; |
---|
| 136 | ogls = new G4OpenGLStoredQt; |
---|
| 137 | #endif |
---|
[1314] | 138 | #endif |
---|
[1288] | 139 | #elif defined(G4UI_USE_XM) |
---|
| 140 | #ifdef G4VIS_USE_OPENGLXM |
---|
[1314] | 141 | #ifdef G4VIS_BUILD_OPENGLXM_DRIVER |
---|
[1288] | 142 | ogl = new G4OpenGLStoredXm; |
---|
| 143 | ogli = new G4OpenGLImmediateXm; |
---|
| 144 | ogls = new G4OpenGLStoredXm; |
---|
| 145 | #endif |
---|
[1314] | 146 | #endif |
---|
[1288] | 147 | #elif defined(G4UI_USE_WIN32) |
---|
| 148 | #ifdef G4VIS_USE_OPENGLWIN32 |
---|
[1314] | 149 | #ifdef G4VIS_BUILD_OPENGLWIN32_DRIVER |
---|
[1288] | 150 | ogl = new G4OpenGLStoredWin32; |
---|
| 151 | ogli = new G4OpenGLImmediateWin32; |
---|
| 152 | ogls = new G4OpenGLStoredWin32; |
---|
| 153 | #endif |
---|
[1314] | 154 | #endif |
---|
[1288] | 155 | #elif defined(G4UI_USE_TCSH) |
---|
| 156 | #if defined (G4VIS_USE_OPENGLX) |
---|
[1314] | 157 | #ifdef G4VIS_BUILD_OPENGLX_DRIVER |
---|
[1288] | 158 | ogl = new G4OpenGLStoredX; |
---|
| 159 | ogli = new G4OpenGLImmediateX; |
---|
| 160 | ogls = new G4OpenGLStoredX; |
---|
[1314] | 161 | #endif |
---|
[1288] | 162 | #elif defined (G4VIS_USE_OPENGLWIN32) |
---|
[1314] | 163 | #ifdef G4VIS_BUILD_OPENGWIN32_DRIVER |
---|
[1288] | 164 | ogl = new G4OpenGLStoredWin32; |
---|
| 165 | ogli = new G4OpenGLImmediateWin32; |
---|
| 166 | ogls = new G4OpenGLStoredWin32; |
---|
| 167 | #endif |
---|
[1314] | 168 | #endif |
---|
[1288] | 169 | #else |
---|
| 170 | #if defined (G4VIS_USE_OPENGLX) |
---|
[1314] | 171 | #ifdef G4VIS_BUILD_OPENGLX_DRIVER |
---|
[1288] | 172 | ogl = new G4OpenGLStoredX; |
---|
| 173 | ogli = new G4OpenGLImmediateX; |
---|
| 174 | ogls = new G4OpenGLStoredX; |
---|
[1314] | 175 | #endif |
---|
[1288] | 176 | #elif defined (G4VIS_USE_OPENGLWIN32) |
---|
[1314] | 177 | #ifdef G4VIS_BUILD_OPENGLWIN32_DRIVER |
---|
[1288] | 178 | ogl = new G4OpenGLStoredWin32; |
---|
| 179 | ogli = new G4OpenGLImmediateWin32; |
---|
| 180 | ogls = new G4OpenGLStoredWin32; |
---|
| 181 | #endif |
---|
| 182 | #endif |
---|
[1314] | 183 | #endif |
---|
[1288] | 184 | if (ogl) { |
---|
| 185 | ogl->SetNickName("OGL"); |
---|
| 186 | RegisterGraphicsSystem (ogl); |
---|
| 187 | } |
---|
| 188 | if (ogli) { |
---|
| 189 | ogli->SetNickName("OGLI"); |
---|
| 190 | RegisterGraphicsSystem (ogli); |
---|
| 191 | } |
---|
| 192 | if (ogls) { |
---|
| 193 | ogls->SetNickName("OGLS"); |
---|
| 194 | RegisterGraphicsSystem (ogls); |
---|
| 195 | } |
---|
| 196 | #endif |
---|
| 197 | |
---|
[531] | 198 | #ifdef G4VIS_USE_OPENGLX |
---|
[1314] | 199 | #ifdef G4VIS_BUILD_OPENGLX_DRIVER |
---|
[531] | 200 | RegisterGraphicsSystem (new G4OpenGLImmediateX); |
---|
| 201 | RegisterGraphicsSystem (new G4OpenGLStoredX); |
---|
| 202 | #endif |
---|
[1314] | 203 | #endif |
---|
[531] | 204 | |
---|
| 205 | #ifdef G4VIS_USE_OPENGLWIN32 |
---|
[1314] | 206 | #ifdef G4VIS_BUILD_OPENGLWIN32_DRIVER |
---|
[531] | 207 | RegisterGraphicsSystem (new G4OpenGLImmediateWin32); |
---|
| 208 | RegisterGraphicsSystem (new G4OpenGLStoredWin32); |
---|
| 209 | #endif |
---|
[1314] | 210 | #endif |
---|
[531] | 211 | |
---|
| 212 | #ifdef G4VIS_USE_OPENGLXM |
---|
[1314] | 213 | #ifdef G4VIS_BUILD_OPENGLXM_DRIVER |
---|
[531] | 214 | RegisterGraphicsSystem (new G4OpenGLImmediateXm); |
---|
| 215 | RegisterGraphicsSystem (new G4OpenGLStoredXm); |
---|
| 216 | #endif |
---|
[1314] | 217 | #endif |
---|
[531] | 218 | |
---|
| 219 | #ifdef G4VIS_USE_OPENGLQT |
---|
[1314] | 220 | #ifdef G4VIS_BUILD_OPENGLQT_DRIVER |
---|
[531] | 221 | RegisterGraphicsSystem (new G4OpenGLImmediateQt); |
---|
| 222 | RegisterGraphicsSystem (new G4OpenGLStoredQt); |
---|
| 223 | #endif |
---|
[1314] | 224 | #endif |
---|
[531] | 225 | |
---|
[1288] | 226 | // Register OI graphics system with generic nickname |
---|
| 227 | #ifdef G4VIS_USE_OI |
---|
| 228 | G4VGraphicsSystem* oi = 0; |
---|
[531] | 229 | #ifdef G4VIS_USE_OIX |
---|
[1314] | 230 | #ifdef G4VIS_BUILD_OI_DRIVER |
---|
[1288] | 231 | oi = new G4OpenInventorX; |
---|
| 232 | #endif |
---|
[1314] | 233 | #endif |
---|
[1288] | 234 | #ifdef G4VIS_USE_OIWIN32 |
---|
[1314] | 235 | #ifdef G4VIS_BUILD_OIWIN32_DRIVER |
---|
[1288] | 236 | oi = new G4OpenInventorWin32; |
---|
| 237 | #endif |
---|
[1314] | 238 | #endif |
---|
[1288] | 239 | if (oi) { |
---|
| 240 | oi->SetNickName("OI"); |
---|
| 241 | RegisterGraphicsSystem (oi); |
---|
| 242 | } |
---|
| 243 | #endif |
---|
| 244 | |
---|
| 245 | #ifdef G4VIS_USE_OIX |
---|
[1314] | 246 | #ifdef G4VIS_BUILD_OIX_DRIVER |
---|
[531] | 247 | RegisterGraphicsSystem (new G4OpenInventorX); |
---|
| 248 | #endif |
---|
[1314] | 249 | #endif |
---|
[531] | 250 | |
---|
| 251 | #ifdef G4VIS_USE_OIWIN32 |
---|
[1314] | 252 | #ifdef G4VIS_BUILD_OIWIN32_DRIVER |
---|
[531] | 253 | RegisterGraphicsSystem (new G4OpenInventorWin32); |
---|
| 254 | #endif |
---|
[1314] | 255 | #endif |
---|
[531] | 256 | |
---|
| 257 | #ifdef G4VIS_USE_RAYTRACERX |
---|
[1314] | 258 | #ifdef G4VIS_BUILD_RAYTRACERX_DRIVER |
---|
[531] | 259 | RegisterGraphicsSystem (new G4RayTracerX); |
---|
| 260 | #endif |
---|
[1314] | 261 | #endif |
---|
[531] | 262 | |
---|
| 263 | #ifdef G4VIS_USE_VRML |
---|
[1314] | 264 | #ifdef G4VIS_BUILD_VRML_DRIVER |
---|
[531] | 265 | RegisterGraphicsSystem (new G4VRML1); |
---|
| 266 | RegisterGraphicsSystem (new G4VRML2); |
---|
| 267 | #endif |
---|
[1314] | 268 | #endif |
---|
[531] | 269 | |
---|
| 270 | } |
---|
| 271 | |
---|
[944] | 272 | // See comments about inlining above. |
---|
| 273 | inline void |
---|
[531] | 274 | G4VisExecutive::RegisterModelFactories() |
---|
| 275 | { |
---|
| 276 | // Trajectory draw models |
---|
| 277 | RegisterModelFactory(new G4TrajectoryGenericDrawerFactory()); |
---|
| 278 | RegisterModelFactory(new G4TrajectoryDrawByChargeFactory()); |
---|
| 279 | RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory()); |
---|
| 280 | RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory()); |
---|
| 281 | RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory()); |
---|
| 282 | |
---|
| 283 | // Trajectory filter models |
---|
| 284 | RegisterModelFactory(new G4TrajectoryChargeFilterFactory()); |
---|
| 285 | RegisterModelFactory(new G4TrajectoryParticleFilterFactory()); |
---|
| 286 | RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory()); |
---|
| 287 | RegisterModelFactory(new G4TrajectoryAttributeFilterFactory()); |
---|
| 288 | |
---|
| 289 | // Hit filter models |
---|
| 290 | RegisterModelFactory(new G4HitAttributeFilterFactory()); |
---|
[1288] | 291 | |
---|
| 292 | // Digi filter models |
---|
| 293 | RegisterModelFactory(new G4DigiAttributeFilterFactory()); |
---|
[531] | 294 | } |
---|
| 295 | |
---|
| 296 | #endif |
---|