Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:57:06

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 //
0029 // John Allison 24th January 1998.
0030 
0031 #ifndef G4VISEXECUTIVE_ICC
0032 #define G4VISEXECUTIVE_ICC
0033 
0034 // Filter/Model Factories
0035 #include "G4HitFilterFactories.hh"
0036 #include "G4DigiFilterFactories.hh"
0037 #include "G4TrajectoryFilterFactories.hh"
0038 #include "G4TrajectoryModelFactories.hh"
0039 
0040 // Supported drivers...
0041 // Not needing external packages or libraries...
0042 #include "G4ASCIITree.hh"        // no_geant4_module_check
0043 #include "G4DAWNFILE.hh"         // no_geant4_module_check
0044 #include "G4HepRepFile.hh"       // no_geant4_module_check
0045 #include "G4RayTracer.hh"        // no_geant4_module_check
0046 #include "G4VRML2File.hh"        // no_geant4_module_check
0047 #include "G4GMocrenFile.hh"      // no_geant4_module_check
0048 #include "G4ToolsSGOffscreen.hh" // no_geant4_module_check
0049 
0050 // Needing external packages or libraries...
0051 #ifdef G4VIS_USE_OPENGLX
0052 #include "G4OpenGLImmediateX.hh" // no_geant4_module_check
0053 #include "G4OpenGLStoredX.hh"    // no_geant4_module_check
0054 #endif
0055 
0056 #ifdef G4VIS_USE_OPENGLWIN32
0057 #include "G4OpenGLImmediateWin32.hh" // no_geant4_module_check
0058 #include "G4OpenGLStoredWin32.hh"    // no_geant4_module_check
0059 #endif
0060 
0061 #ifdef G4VIS_USE_OPENGLXM
0062 #include "G4OpenGLImmediateXm.hh" // no_geant4_module_check
0063 #include "G4OpenGLStoredXm.hh"    // no_geant4_module_check
0064 #endif
0065 
0066 #ifdef G4VIS_USE_OPENGLQT
0067 #include "G4OpenGLImmediateQt.hh" // no_geant4_module_check
0068 #include "G4OpenGLStoredQt.hh"    // no_geant4_module_check
0069 #endif
0070 
0071 #ifdef G4VIS_USE_OIX
0072 #include "G4OpenInventorX.hh"          // no_geant4_module_check
0073 #include "G4OpenInventorXtExtended.hh" // no_geant4_module_check
0074 #endif
0075 
0076 #ifdef G4VIS_USE_OIQT
0077 #include "G4OpenInventorQt.hh" // no_geant4_module_check
0078 #endif
0079 
0080 #ifdef G4VIS_USE_OIWIN32
0081 #include "G4OpenInventorWin32.hh" // no_geant4_module_check
0082 #endif
0083 
0084 #ifdef G4VIS_USE_RAYTRACERX
0085 #include "G4RayTracerX.hh" // no_geant4_module_check
0086 #endif
0087 
0088 #ifdef G4VIS_USE_QT3D
0089 #include "G4Qt3D.hh" // no_geant4_module_check
0090 #endif
0091 
0092 #ifdef G4VIS_USE_TOOLSSG_X11_GLES
0093 #include "G4ToolsSGX11GLES.hh" // no_geant4_module_check
0094 #endif
0095 
0096 #ifdef G4VIS_USE_TOOLSSG_X11_ZB
0097 #include "G4ToolsSGX11ZB.hh" // no_geant4_module_check
0098 #endif
0099 
0100 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_GLES
0101 #include "G4ToolsSGWindowsGLES.hh" // no_geant4_module_check
0102 #endif
0103 
0104 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_ZB
0105 #include "G4ToolsSGWindowsZB.hh" // no_geant4_module_check
0106 #endif
0107 
0108 #ifdef G4VIS_USE_TOOLSSG_XT_GLES
0109 #include "G4ToolsSGXtGLES.hh" // no_geant4_module_check
0110 #endif
0111 
0112 #ifdef G4VIS_USE_TOOLSSG_XT_ZB
0113 #include "G4ToolsSGXtZB.hh" // no_geant4_module_check
0114 #endif
0115 
0116 #ifdef G4VIS_USE_TOOLSSG_QT_GLES
0117 #include "G4ToolsSGQtGLES.hh" // no_geant4_module_check
0118 #endif
0119 
0120 #ifdef G4VIS_USE_TOOLSSG_QT_ZB
0121 #include "G4ToolsSGQtZB.hh" // no_geant4_module_check
0122 #endif
0123 
0124 #ifdef G4VIS_USE_VTK
0125 #include "G4Vtk.hh" // no_geant4_module_check
0126 #include "G4VtkOffscreen.hh" // no_geant4_module_check
0127 #undef G4VIS_USE_TOOLSSG_X11_GLES
0128 #undef G4VIS_USE_TOOLSSG_XT_GLES
0129 #undef G4VIS_USE_TOOLSSG_QT_GLES
0130 #undef G4VIS_USE_TOOLSSG_WINDOWS_GLES
0131 #undef G4VIS_USE_OPENGLQT
0132 #undef G4VIS_USE_OPENGLXM
0133 #undef G4VIS_USE_OPENGLX
0134 #undef G4VIS_USE_OPENGLWIN32
0135 #endif
0136 
0137 #ifdef G4VIS_USE_VTK_QT
0138 #include "G4VtkQt.hh" // no_geant4_module_check
0139 #endif
0140 
0141 #include "G4UImanager.hh"
0142 #include "G4UIsession.hh"
0143 #include "G4UIbatch.hh"
0144 
0145 #include <cstdlib>
0146 #include <sstream>
0147 
0148 #define G4warn G4cout
0149 
0150 // The inline keyword prevents the compiler making an external
0151 // reference even though they cannot actually be inlined since they
0152 // are virtual functions.  This prevents a "multiple definition" error
0153 // if it is included in more than one file.  However, as explained in
0154 // the class description in G4VisExecutive.hh, it should never be
0155 // necessary to #include "G4VisExecutive.hh" in more than one file
0156 // since after instantiation the object can be treated as a
0157 // G4VisManager.
0158 
0159 inline
0160 G4VisExecutive::G4VisExecutive(int argc, char** argv, const G4String& system,
0161 const G4String& verbosityString):
0162 G4VisManager(verbosityString),
0163 fSelected(false)
0164 {
0165   fUserArgc = argc;
0166   fUserArgv = argv;
0167   fUserSpecifiedSystem = system;
0168 }
0169 
0170 inline
0171 G4VisExecutive::G4VisExecutive (const G4String& verbosityString):
0172 G4VisManager(verbosityString)
0173 , fUserArgc(0)  // >0 if argc is provided by the user...
0174 , fUserArgv(nullptr)
0175 , fSelected(false)
0176 {}
0177 
0178 inline
0179 const G4String& G4VisExecutive::GetDefaultGraphicsSystemName ()
0180 {
0181   if (fSelected) return fDefaultGraphicsSystemName;
0182   if (fUserArgc > 0)               SetDefaultsByArgument(fUserSpecifiedSystem);
0183   if (!fSelected)                  SetDefaultsByEnvironment();
0184   if (!fSelected && fUserArgc > 0) SetDefaultsByFile(fUserArgc, fUserArgv);
0185   if (!fSelected) {                SetDefaultsByBatch();
0186     if (fSelected) {  // No UI session
0187       // Deal with this later - the user may have specified a system
0188       // on the command line - see G4VisCommandSceneHandlerCreate.
0189       return fDefaultGraphicsSystemName;
0190     }
0191   }
0192   if (!fSelected)                  SetDefaultsByBuildFlags();
0193   if (GetVerbosity() >= warnings) {
0194     G4warn << "Default graphics system is: " << fDefaultGraphicsSystemName
0195     << " (based on " << fDefaultGraphicsSystemBasis << ")."
0196     << "\nDefault window size hint is: " << fDefaultXGeometryString
0197     << " (based on " << fDefaultXGeometryStringBasis << ")."
0198     << "\nNote: Parameters specified on the command line will override these defaults."
0199     << "\n      Use \"vis/open\" without parameters to get these defaults."
0200     << G4endl;
0201   }
0202   return fDefaultGraphicsSystemName;
0203 }
0204 
0205 inline
0206 void G4VisExecutive::SetDefaultsByArgument(const G4String& system)
0207 {
0208   // 1st priority: selection by G4VisExecutive argument
0209   if (!system.empty()) {
0210     fDefaultGraphicsSystemName = system;
0211     fDefaultGraphicsSystemBasis = "G4VisExecuitive argument";
0212     fSelected = true;
0213   }
0214 }
0215 
0216 inline
0217 void G4VisExecutive::SetDefaultsByEnvironment()
0218 {
0219   // 2nd priority: by environment variable
0220   if (auto g4env = std::getenv("G4VIS_DEFAULT_DRIVER")) {
0221     G4String graphicsSystem, windowSizeHint;
0222     std::istringstream iss(g4env);
0223     iss >> graphicsSystem >> windowSizeHint;
0224     if (!graphicsSystem.empty()) {
0225       fDefaultGraphicsSystemName = graphicsSystem;
0226       fDefaultGraphicsSystemBasis = "environment G4VIS_DEFAULT_DRIVER";
0227       fSelected = true;
0228     }
0229     if (!windowSizeHint.empty()) {
0230       fDefaultXGeometryString = windowSizeHint;
0231       fDefaultXGeometryStringBasis  = "environment G4VIS_DEFAULT_DRIVER";
0232     }
0233   }
0234 }
0235 
0236 inline
0237 void G4VisExecutive::SetDefaultsByFile(int argc, char** argv)
0238 {
0239   // 3rd priority: in $HOME/.g4session
0240 
0241   // Find ~/.g4session - simply return if it does not exist
0242   const char* home = std::getenv("HOME");
0243   if (home == nullptr) return;
0244   G4String homedir = home;
0245 #ifndef WIN32
0246   G4String filename = homedir + "/.g4session";
0247 #else
0248   G4String filename = homedir + "\\.g4session";
0249 #endif
0250   std::ifstream g4session(filename);
0251   if (g4session.fail()) return;
0252 
0253   // Find app name
0254   if (argc < 1) return;
0255   G4String appInput = argv[0];
0256   G4String appName = "";
0257   size_t islash = appInput.find_last_of("/\\");
0258   if (islash == G4String::npos) appName = appInput;
0259   else appName = appInput.substr(islash + 1, appInput.size() - islash - 1);
0260 
0261   // Scan ~/.g4session
0262   G4String line;
0263   // First line is the user-chosen default: session, graphics system, windo wize hint
0264   G4String applicableSession, applicableGraphicsSystem, applicableWindowSizeHint;
0265   std::getline(g4session,line);
0266   auto hash = line.find_first_of('#'); line = line.substr(0,hash);
0267   std::istringstream iss(line);
0268   iss >> applicableSession >> applicableGraphicsSystem >> applicableWindowSizeHint;
0269   // Read subsequent lines
0270   while (g4session.good()) {
0271     G4String app, session, graphicsSystem, windowSizeHint;
0272     std::getline(g4session,line);
0273     hash = line.find_first_of('#'); line = line.substr(0,hash);
0274     std::istringstream iss1(line);
0275     iss1 >> app >> session >> graphicsSystem >> windowSizeHint;
0276     if (app == appName) {
0277       if (!session.empty())        applicableSession        = session;  // See G4UIExecutive
0278       if (!graphicsSystem.empty()) applicableGraphicsSystem = graphicsSystem;
0279       if (!windowSizeHint.empty()) applicableWindowSizeHint = windowSizeHint;
0280     }
0281   }
0282 
0283   if (!applicableGraphicsSystem.empty()) {
0284     fDefaultGraphicsSystemName = applicableGraphicsSystem;
0285     fDefaultGraphicsSystemBasis = "~/.g4session";
0286     fSelected = true;
0287   }
0288   if (!applicableWindowSizeHint.empty()) {
0289     fDefaultXGeometryString = applicableWindowSizeHint;
0290     fDefaultXGeometryStringBasis = "~/.g4session";
0291   }
0292 }
0293 
0294 inline
0295 void G4VisExecutive::SetDefaultsByBatch()
0296 {
0297   // 4th, special case for batch session
0298   G4UIsession* session = G4UImanager::GetUIpointer()->GetBaseSession();
0299   if (session == nullptr                   // Usual case - pure batch
0300   || dynamic_cast<G4UIbatch*>(session)) {  // From a macro from batch
0301     // Actually, in this case, we wish to force the user to specify a driver
0302     fDefaultGraphicsSystemName = "NO_UI_SESSION";
0303     fDefaultGraphicsSystemBasis = "no UI session";
0304     fSelected = true;  // To prevent any further selection
0305   }
0306 }
0307 
0308 inline
0309 void G4VisExecutive::SetDefaultsByBuildFlags()
0310 {
0311   // 5th, by cpp flags
0312 #if defined G4VIS_USE_OPENGLQT || G4VIS_USE_OPENGLXM ||\
0313             G4VIS_USE_OPENGLX  || G4VIS_USE_OPENGLWIN32
0314   fDefaultGraphicsSystemName = "OGL";
0315 #elif defined G4VIS_USE_OI || G4VIS_USE_OIX
0316   fDefaultGraphicsSystemName = "OI";
0317 #elif defined G4VIS_USE_TOOLSSG_QT_GLES || G4VIS_USE_TOOLSSG_X11_GLES ||\
0318               G4VIS_USE_TOOLSSG_XT_GLES || G4VIS_USE_TOOLSSG_WINDOWS_GLES
0319   fDefaultGraphicsSystemName = "TSG";
0320 #elif defined G4VIS_USE_VTK || G4VIS_USE_VTK_QT
0321   fDefaultGraphicsSystemName = "Vtk";
0322 #elif defined G4VIS_USE_TOOLSSG_QT_ZB || G4VIS_USE_TOOLSSG_X11_ZB ||\
0323               G4VIS_USE_TOOLSSG_XT_ZB || G4VIS_USE_TOOLSSG_WINDOWS_ZB
0324   fDefaultGraphicsSystemName = "TSG";
0325 #elif defined G4VIS_USE_QT3D
0326   fDefaultGraphicsSystemName = "Qt3D";
0327 #else
0328   // Choose a graphics system not needing external packages or libraries
0329   fDefaultGraphicsSystemName = "TSG_OFFSCREEN";
0330 #endif
0331   fDefaultGraphicsSystemBasis = "build flags";
0332   fSelected = true;
0333 }
0334 
0335 inline
0336 void G4VisExecutive::RegisterGraphicsSystems () {
0337 
0338  // Graphics Systems not needing external packages or libraries...
0339   RegisterGraphicsSystem (new G4ASCIITree);
0340   RegisterGraphicsSystem (new G4DAWNFILE);
0341   RegisterGraphicsSystem (new G4HepRepFile);
0342   RegisterGraphicsSystem (new G4RayTracer);
0343   RegisterGraphicsSystem (new G4VRML2File);
0344   RegisterGraphicsSystem (new G4GMocrenFile);
0345   G4VGraphicsSystem* tsg_offscreen = new G4ToolsSGOffscreen;
0346   RegisterGraphicsSystem(tsg_offscreen);
0347   tsg_offscreen->AddNickname("TSG_FILE");
0348 
0349 // Graphics systems needing external packages or libraries...
0350 // Register OGL family of drivers with their normal names,
0351 // super-abbreviated names and fallback names where approproiate.
0352 
0353 #ifdef G4VIS_USE_OPENGLQT
0354   G4VGraphicsSystem* ogliqt = new G4OpenGLImmediateQt;
0355   G4VGraphicsSystem* oglsqt = new G4OpenGLStoredQt;
0356   RegisterGraphicsSystem(ogliqt);
0357   RegisterGraphicsSystem(oglsqt);
0358   ogliqt->AddNickname("OGLI");
0359   oglsqt->AddNickname("OGL");
0360   oglsqt->AddNickname("OGLS");
0361 #endif
0362 
0363 #ifdef G4VIS_USE_OPENGLXM
0364   G4VGraphicsSystem* oglixm = new G4OpenGLImmediateXm;
0365   G4VGraphicsSystem* oglsxm = new G4OpenGLStoredXm;
0366   RegisterGraphicsSystem(oglixm);
0367   RegisterGraphicsSystem(oglsxm);
0368 #  ifdef G4VIS_USE_OPENGLQT
0369   oglixm->AddNickname("OGLIQt_FALLBACK");
0370   oglsxm->AddNickname("OGLSQt_FALLBACK");
0371 #  else
0372   oglixm->AddNickname("OGLI");
0373   oglsxm->AddNickname("OGL");
0374   oglsxm->AddNickname("OGLS");
0375 #  endif
0376 #endif
0377 
0378 #ifdef G4VIS_USE_OPENGLX
0379   G4VGraphicsSystem* oglix = new G4OpenGLImmediateX;
0380   G4VGraphicsSystem* oglsx = new G4OpenGLStoredX;
0381   RegisterGraphicsSystem(oglix);
0382   RegisterGraphicsSystem(oglsx);
0383 #  ifdef G4VIS_USE_OPENGLQT
0384   oglix->AddNickname("OGLIQt_FALLBACK");
0385   oglsx->AddNickname("OGLSQt_FALLBACK");
0386 #  endif
0387 #  ifdef G4VIS_USE_OPENGLXM
0388   oglix->AddNickname("OGLIXm_FALLBACK");
0389   oglsx->AddNickname("OGLSXm_FALLBACK");
0390 #  endif
0391 #  if defined(G4VIS_USE_OPENGLQT) || (G4VIS_USE_OPENGLXM)
0392 #  else
0393   oglix->AddNickname("OGLI");
0394   oglsx->AddNickname("OGL");
0395   oglsx->AddNickname("OGLS");
0396 #  endif
0397 #endif
0398 
0399 #ifdef G4VIS_USE_OPENGLWIN32
0400   G4VGraphicsSystem* ogliwin32 = new G4OpenGLImmediateWin32;
0401   G4VGraphicsSystem* oglswin32 = new G4OpenGLStoredWin32;
0402   RegisterGraphicsSystem(ogliwin32);
0403   RegisterGraphicsSystem(oglswin32);
0404 #  ifdef G4VIS_USE_OPENGLQT
0405   ogliwin32->AddNickname("OGLIQt_FALLBACK");
0406   oglswin32->AddNickname("OGLSQt_FALLBACK");
0407 #  else
0408   ogliwin32->AddNickname("OGLI");
0409   oglswin32->AddNickname("OGL");
0410   oglswin32->AddNickname("OGLS");
0411 #  endif
0412 #endif
0413 
0414 // Register OI graphics system with super-abbreviated nickname
0415 #ifdef G4VIS_USE_OI
0416   G4VGraphicsSystem* oi = 0;
0417 #  ifdef G4VIS_USE_OIX
0418   oi = new G4OpenInventorX;
0419 #  elif defined(G4VIS_USE_OIQT)
0420   oi = new G4OpenInventorQt;
0421 #  elif defined(G4VIS_USE_OIWIN32)
0422   oi = new G4OpenInventorWin32;
0423 #  endif
0424   if(oi)
0425   {
0426     RegisterGraphicsSystem(oi);
0427     oi->AddNickname("OI");
0428   }
0429 #endif
0430 
0431 // The new, extended OI is registered separately for now.
0432 #ifdef G4VIS_USE_OIX
0433   RegisterGraphicsSystem(new G4OpenInventorXtExtended);
0434 #endif
0435 
0436 #ifdef G4VIS_USE_RAYTRACERX
0437   RegisterGraphicsSystem(new G4RayTracerX);
0438 #endif
0439 
0440 #ifdef G4VIS_USE_QT3D
0441   RegisterGraphicsSystem(new G4Qt3D);
0442 #endif
0443 
0444 #ifdef G4VIS_USE_TOOLSSG_X11_GLES
0445   G4VGraphicsSystem* tsg_x11_gles = new G4ToolsSGX11GLES;
0446   RegisterGraphicsSystem(tsg_x11_gles);
0447   tsg_x11_gles->AddNickname("TSGX11");
0448 #ifdef G4VIS_USE_TOOLSSG_XT_GLES
0449   tsg_x11_gles->AddNickname("TSG_XT_GLES_FALLBACK");
0450 #endif
0451 #ifdef G4VIS_USE_TOOLSSG_QT_GLES
0452 #ifndef G4VIS_USE_TOOLSSG_XT_GLES
0453   tsg_x11_gles->AddNickname("TSG_QT_GLES_FALLBACK");
0454 #endif
0455 #endif
0456 #endif
0457 
0458 #ifdef G4VIS_USE_TOOLSSG_X11_ZB
0459   G4VGraphicsSystem* tsg_x11_zb = new G4ToolsSGX11ZB;
0460   RegisterGraphicsSystem(tsg_x11_zb);
0461   tsg_x11_zb->AddNickname("TSGX11ZB");
0462 #endif
0463 
0464 #ifdef G4VIS_USE_TOOLSSG_XT_GLES
0465   G4VGraphicsSystem* tsg_xt_gles = new G4ToolsSGXtGLES;
0466   RegisterGraphicsSystem(tsg_xt_gles);
0467   tsg_xt_gles->AddNickname("TSGXt");
0468 #ifdef G4VIS_USE_TOOLSSG_QT_GLES
0469   tsg_xt_gles->AddNickname("TSG_QT_GLES_FALLBACK");
0470 #endif
0471 #endif
0472 
0473 #ifdef G4VIS_USE_TOOLSSG_XT_ZB
0474   G4VGraphicsSystem* tsg_xt_zb = new G4ToolsSGXtZB;
0475   RegisterGraphicsSystem(tsg_xt_zb);
0476   tsg_xt_zb->AddNickname("TSGXtZB");
0477 #endif
0478 
0479 #ifdef G4VIS_USE_TOOLSSG_QT_GLES
0480   G4VGraphicsSystem* tsg_qt_gles = new G4ToolsSGQtGLES;
0481   RegisterGraphicsSystem(tsg_qt_gles);
0482   tsg_qt_gles->AddNickname("TSGQt");
0483 #endif
0484 
0485 #ifdef G4VIS_USE_TOOLSSG_QT_ZB
0486   G4VGraphicsSystem* tsg_qt_zb = new G4ToolsSGQtZB;
0487   RegisterGraphicsSystem(tsg_qt_zb);
0488   tsg_qt_zb->AddNickname("TSGQtZB");
0489 #endif
0490 
0491 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_GLES
0492   G4VGraphicsSystem* tsg_windows_gles = new G4ToolsSGWindowsGLES;
0493   RegisterGraphicsSystem(tsg_windows_gles);
0494 #endif
0495 
0496 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_ZB
0497   G4VGraphicsSystem* tsg_windows_zb = new G4ToolsSGWindowsZB;
0498   RegisterGraphicsSystem(tsg_windows_zb);
0499 #endif
0500 
0501 #ifdef G4VIS_USE_TOOLSSG_QT_GLES
0502   tsg_qt_gles->AddNickname("TSG");
0503 #elif defined(G4VIS_USE_TOOLSSG_XT_GLES)
0504   tsg_xt_gles->AddNickname("TSG");
0505 #elif defined(G4VIS_USE_TOOLSSG_X11_GLES)
0506   tsg_x11_gles->AddNickname("TSG");
0507 #elif defined(G4VIS_USE_TOOLSSG_WINDOWS_GLES)
0508   tsg_windows_gles->AddNickname("TSG");
0509 #else
0510 #ifdef G4VIS_USE_TOOLSSG_QT_ZB
0511   tsg_qt_zb->AddNickname("TSG");
0512 #elif G4VIS_USE_TOOLSSG_WINDOWS_ZB
0513   tsg_windows_zb->AddNickname("TSG");
0514 #else
0515   tsg_offscreen->AddNickname("TSG");
0516 #endif
0517 #endif
0518 
0519 #ifdef G4VIS_USE_VTK
0520   if (GetVerbosity() >= startup) {
0521     G4cout
0522     << "  VTK: OpenGL-based drivers suppressed because of compatibility issues."
0523     << G4endl;
0524   }
0525   G4Vtk* vtkN = new G4Vtk();
0526   G4VtkOffscreen* vtkOS = new G4VtkOffscreen();
0527   RegisterGraphicsSystem(vtkN);
0528   RegisterGraphicsSystem(vtkOS);
0529 #  ifdef G4VIS_USE_VTK_QT
0530   vtkN->AddNickname("VTKQt_FALLBACK");
0531 #  endif
0532 #endif
0533 
0534 #ifdef G4VIS_USE_VTK_QT
0535   G4VtkQt* vtkQt = new G4VtkQt();
0536   RegisterGraphicsSystem(vtkQt);
0537   vtkQt->AddNickname("VTKQt");
0538 #endif
0539 
0540 #ifdef G4VIS_USE_VTK_QT
0541   vtkQt->AddNickname("Vtk");
0542   vtkQt->AddNickname("VTK");
0543 #elif defined(G4VIS_USE_VTK)
0544   vtkN->AddNickname("Vtk");
0545   vtkN->AddNickname("VTK");
0546 #endif
0547 }
0548 
0549 // See comments about inlining above.
0550 inline void
0551 G4VisExecutive::RegisterModelFactories()
0552 {
0553    // Trajectory draw models
0554    RegisterModelFactory(new G4TrajectoryGenericDrawerFactory());
0555    RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory());
0556    RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
0557    RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory());
0558    RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
0559    RegisterModelFactory(new G4TrajectoryDrawByEncounteredVolumeFactory());
0560 
0561    // Trajectory filter models
0562    RegisterModelFactory(new G4TrajectoryAttributeFilterFactory());
0563    RegisterModelFactory(new G4TrajectoryChargeFilterFactory());
0564    RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory());
0565    RegisterModelFactory(new G4TrajectoryParticleFilterFactory());
0566    RegisterModelFactory(new G4TrajectoryEncounteredVolumeFilterFactory());
0567 
0568    // Hit filter models
0569    RegisterModelFactory(new G4HitAttributeFilterFactory());
0570 
0571    // Digi filter models
0572    RegisterModelFactory(new G4DigiAttributeFilterFactory());
0573 }
0574 
0575 #endif