Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-05 09:17:39

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