Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/visualization/management/include/G4VisExecutive.icc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /visualization/management/include/G4VisExecutive.icc (Version 11.3.0) and /visualization/management/include/G4VisExecutive.icc (Version 10.6.p3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 //                                                 27 //
 28 //                                             <<  28 // 
 29 // John Allison 24th January 1998.                 29 // John Allison 24th January 1998.
 30                                                    30 
 31 #ifndef G4VISEXECUTIVE_ICC                         31 #ifndef G4VISEXECUTIVE_ICC
 32 #define G4VISEXECUTIVE_ICC                         32 #define G4VISEXECUTIVE_ICC
 33                                                    33 
 34 // Filter/Model Factories                      <<  34 // Supported drivers...
                                                   >>  35 
                                                   >>  36 // Not needing external packages or libraries...
                                                   >>  37 #include "G4ASCIITree.hh"
                                                   >>  38 #include "G4DAWNFILE.hh"
                                                   >>  39 #include "G4HepRep.hh"
                                                   >>  40 #include "G4HepRepFile.hh"
                                                   >>  41 #include "G4RayTracer.hh"
 35 #include "G4HitFilterFactories.hh"                 42 #include "G4HitFilterFactories.hh"
 36 #include "G4DigiFilterFactories.hh"                43 #include "G4DigiFilterFactories.hh"
 37 #include "G4TrajectoryFilterFactories.hh"          44 #include "G4TrajectoryFilterFactories.hh"
 38 #include "G4TrajectoryModelFactories.hh"           45 #include "G4TrajectoryModelFactories.hh"
 39                                                <<  46 #include "G4VRML1File.hh"
 40 // Supported drivers...                        <<  47 #include "G4VRML2File.hh"
 41 // Not needing external packages or libraries. <<  48 #include "G4GMocrenFile.hh"
 42 #include "G4ASCIITree.hh"        // no_geant4_ <<  49 
 43 #include "G4DAWNFILE.hh"         // no_geant4_ <<  50 // FIXME : avoid mix with QT/WT driver (should be done by cmake??)
 44 #include "G4HepRepFile.hh"       // no_geant4_ <<  51 #if defined(G4VIS_USE_OPENGLWT)
 45 #include "G4RayTracer.hh"        // no_geant4_ <<  52   // do not want GL2P2 in WT case
 46 #include "G4VRML2File.hh"        // no_geant4_ <<  53   #undef G4VIS_BUILD_OPENGL_GL2PS
 47 #include "G4GMocrenFile.hh"      // no_geant4_ <<  54 #endif
 48 #include "G4ToolsSGOffscreen.hh" // no_geant4_ << 
 49                                                    55 
 50 // Needing external packages or libraries...       56 // Needing external packages or libraries...
                                                   >>  57 
                                                   >>  58 #ifdef G4VIS_USE_DAWN
                                                   >>  59 #include "G4FukuiRenderer.hh"
                                                   >>  60 #endif
                                                   >>  61 
 51 #ifdef G4VIS_USE_OPENGLX                           62 #ifdef G4VIS_USE_OPENGLX
 52 #include "G4OpenGLImmediateX.hh" // no_geant4_ <<  63 #include "G4OpenGLImmediateX.hh"
 53 #include "G4OpenGLStoredX.hh"    // no_geant4_ <<  64 #include "G4OpenGLStoredX.hh"
 54 #endif                                             65 #endif
 55                                                    66 
 56 #ifdef G4VIS_USE_OPENGLWIN32                       67 #ifdef G4VIS_USE_OPENGLWIN32
 57 #include "G4OpenGLImmediateWin32.hh" // no_gea <<  68 #include "G4OpenGLImmediateWin32.hh"
 58 #include "G4OpenGLStoredWin32.hh"    // no_gea <<  69 #include "G4OpenGLStoredWin32.hh"
 59 #endif                                             70 #endif
 60                                                    71 
 61 #ifdef G4VIS_USE_OPENGLXM                          72 #ifdef G4VIS_USE_OPENGLXM
 62 #include "G4OpenGLImmediateXm.hh" // no_geant4 <<  73 #include "G4OpenGLImmediateXm.hh"
 63 #include "G4OpenGLStoredXm.hh"    // no_geant4 <<  74 #include "G4OpenGLStoredXm.hh"
 64 #endif                                             75 #endif
 65                                                    76 
 66 #ifdef G4VIS_USE_OPENGLQT                          77 #ifdef G4VIS_USE_OPENGLQT
 67 #include "G4OpenGLImmediateQt.hh" // no_geant4 <<  78 #include "G4OpenGLImmediateQt.hh"
 68 #include "G4OpenGLStoredQt.hh"    // no_geant4 <<  79 #include "G4OpenGLStoredQt.hh"
                                                   >>  80 #endif
                                                   >>  81 
                                                   >>  82 #ifdef G4VIS_USE_OPENGLWT
                                                   >>  83 #include "G4OpenGLImmediateWt.hh"
 69 #endif                                             84 #endif
 70                                                    85 
 71 #ifdef G4VIS_USE_OIX                               86 #ifdef G4VIS_USE_OIX
 72 #include "G4OpenInventorX.hh"          // no_g <<  87 #include "G4OpenInventorX.hh"
 73 #include "G4OpenInventorXtExtended.hh" // no_g <<  88 #include "G4OpenInventorXtExtended.hh"
 74 #endif                                             89 #endif
 75                                                    90 
 76 #ifdef G4VIS_USE_OIQT                              91 #ifdef G4VIS_USE_OIQT
 77 #include "G4OpenInventorQt.hh" // no_geant4_mo <<  92 #include "G4OpenInventorQt.hh"
 78 #endif                                             93 #endif
 79                                                    94 
 80 #ifdef G4VIS_USE_OIWIN32                           95 #ifdef G4VIS_USE_OIWIN32
 81 #include "G4OpenInventorWin32.hh" // no_geant4 <<  96 #include "G4OpenInventorWin32.hh"
 82 #endif                                             97 #endif
 83                                                    98 
 84 #ifdef G4VIS_USE_RAYTRACERX                        99 #ifdef G4VIS_USE_RAYTRACERX
 85 #include "G4RayTracerX.hh" // no_geant4_module << 100 #include "G4RayTracerX.hh"
 86 #endif                                         << 
 87                                                << 
 88 #ifdef G4VIS_USE_QT3D                          << 
 89 #include "G4Qt3D.hh" // no_geant4_module_check << 
 90 #endif                                         << 
 91                                                << 
 92 #ifdef G4VIS_USE_TOOLSSG_X11_GLES              << 
 93 #include "G4ToolsSGX11GLES.hh" // no_geant4_mo << 
 94 #endif                                            101 #endif
 95                                                   102 
 96 #ifdef G4VIS_USE_TOOLSSG_X11_ZB                << 103 #ifdef G4VIS_USE_VRML
 97 #include "G4ToolsSGX11ZB.hh" // no_geant4_modu << 104 #include "G4VRML1.hh"
                                                   >> 105 #include "G4VRML2.hh"
 98 #endif                                            106 #endif
 99                                                   107 
100 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_GLES          << 
101 #include "G4ToolsSGWindowsGLES.hh" // no_geant << 
102 #endif                                         << 
103                                                << 
104 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_ZB            << 
105 #include "G4ToolsSGWindowsZB.hh" // no_geant4_ << 
106 #endif                                         << 
107                                                << 
108 #ifdef G4VIS_USE_TOOLSSG_XT_GLES               << 
109 #include "G4ToolsSGXtGLES.hh" // no_geant4_mod << 
110 #endif                                         << 
111                                                << 
112 #ifdef G4VIS_USE_TOOLSSG_XT_ZB                 << 
113 #include "G4ToolsSGXtZB.hh" // no_geant4_modul << 
114 #endif                                         << 
115                                                << 
116 #ifdef G4VIS_USE_TOOLSSG_QT_GLES               << 
117 #include "G4ToolsSGQtGLES.hh" // no_geant4_mod << 
118 #endif                                         << 
119                                                << 
120 #ifdef G4VIS_USE_TOOLSSG_QT_ZB                 << 
121 #include "G4ToolsSGQtZB.hh" // no_geant4_modul << 
122 #endif                                         << 
123                                                << 
124 #ifdef G4VIS_USE_VTK                           << 
125 #include "G4Vtk.hh" // no_geant4_module_check  << 
126 #include "G4VtkOffscreen.hh" // no_geant4_modu << 
127 #undef G4VIS_USE_TOOLSSG_X11_GLES              << 
128 #undef G4VIS_USE_TOOLSSG_XT_GLES               << 
129 #undef G4VIS_USE_TOOLSSG_QT_GLES               << 
130 #undef G4VIS_USE_TOOLSSG_WINDOWS_GLES          << 
131 #undef G4VIS_USE_OPENGLQT                      << 
132 #undef G4VIS_USE_OPENGLXM                      << 
133 #undef G4VIS_USE_OPENGLX                       << 
134 #undef G4VIS_USE_OPENGLWIN32                   << 
135 #endif                                         << 
136                                                << 
137 #ifdef G4VIS_USE_VTK_QT                        << 
138 #include "G4VtkQt.hh" // no_geant4_module_chec << 
139 #endif                                         << 
140                                                << 
141 #include "G4UImanager.hh"                      << 
142 #include "G4UIsession.hh"                      << 
143 #include "G4UIbatch.hh"                        << 
144                                                << 
145 #include <cstdlib>                             << 
146 #include <sstream>                             << 
147                                                << 
148 #define G4warn G4cout                          << 
149                                                << 
150 // The inline keyword prevents the compiler ma    108 // The inline keyword prevents the compiler making an external
151 // reference even though they cannot actually     109 // reference even though they cannot actually be inlined since they
152 // are virtual functions.  This prevents a "mu    110 // are virtual functions.  This prevents a "multiple definition" error
153 // if it is included in more than one file.  H    111 // if it is included in more than one file.  However, as explained in
154 // the class description in G4VisExecutive.hh,    112 // the class description in G4VisExecutive.hh, it should never be
155 // necessary to #include "G4VisExecutive.hh" i    113 // necessary to #include "G4VisExecutive.hh" in more than one file
156 // since after instantiation the object can be    114 // since after instantiation the object can be treated as a
157 // G4VisManager.                                  115 // G4VisManager.
158                                                   116 
159 inline                                            117 inline
160 G4VisExecutive::G4VisExecutive(int argc, char* << 
161 const G4String& verbosityString):              << 
162 G4VisManager(verbosityString),                 << 
163 fSelected(false)                               << 
164 {                                              << 
165   fUserArgc = argc;                            << 
166   fUserArgv = argv;                            << 
167   fUserSpecifiedSystem = system;               << 
168 }                                              << 
169                                                << 
170 inline                                         << 
171 G4VisExecutive::G4VisExecutive (const G4String    118 G4VisExecutive::G4VisExecutive (const G4String& verbosityString):
172 G4VisManager(verbosityString)                     119 G4VisManager(verbosityString)
173 , fUserArgc(0)  // >0 if argc is provided by t << 
174 , fUserArgv(nullptr)                           << 
175 , fSelected(false)                             << 
176 {}                                                120 {}
177                                                   121 
178 inline                                         << 122 inline void
179 const G4String& G4VisExecutive::GetDefaultGrap << 123 G4VisExecutive::RegisterGraphicsSystems () {
180 {                                              << 
181   if (fSelected) return fDefaultGraphicsSystem << 
182   if (fUserArgc > 0)               SetDefaults << 
183   if (!fSelected)                  SetDefaults << 
184   if (!fSelected && fUserArgc > 0) SetDefaults << 
185   if (!fSelected) {                SetDefaults << 
186     if (fSelected) {  // No UI session         << 
187       // Deal with this later - the user may h << 
188       // on the command line - see G4VisComman << 
189       return fDefaultGraphicsSystemName;       << 
190     }                                          << 
191   }                                            << 
192   if (!fSelected)                  SetDefaults << 
193   if (GetVerbosity() >= warnings) {            << 
194     G4warn << "Default graphics system is: " < << 
195     << " (based on " << fDefaultGraphicsSystem << 
196     << "\nDefault window size hint is: " << fD << 
197     << " (based on " << fDefaultXGeometryStrin << 
198     << "\nNote: Parameters specified on the co << 
199     << "\n      Use \"vis/open\" without param << 
200     << G4endl;                                 << 
201   }                                            << 
202   return fDefaultGraphicsSystemName;           << 
203 }                                              << 
204                                                << 
205 inline                                         << 
206 void G4VisExecutive::SetDefaultsByArgument(con << 
207 {                                              << 
208   // 1st priority: selection by G4VisExecutive << 
209   if (!system.empty()) {                       << 
210     fDefaultGraphicsSystemName = system;       << 
211     fDefaultGraphicsSystemBasis = "G4VisExecui << 
212     fSelected = true;                          << 
213   }                                            << 
214 }                                              << 
215                                                << 
216 inline                                         << 
217 void G4VisExecutive::SetDefaultsByEnvironment( << 
218 {                                              << 
219   // 2nd priority: by environment variable     << 
220   if (auto g4env = std::getenv("G4VIS_DEFAULT_ << 
221     G4String graphicsSystem, windowSizeHint;   << 
222     std::istringstream iss(g4env);             << 
223     iss >> graphicsSystem >> windowSizeHint;   << 
224     if (!graphicsSystem.empty()) {             << 
225       fDefaultGraphicsSystemName = graphicsSys << 
226       fDefaultGraphicsSystemBasis = "environme << 
227       fSelected = true;                        << 
228     }                                          << 
229     if (!windowSizeHint.empty()) {             << 
230       fDefaultXGeometryString = windowSizeHint << 
231       fDefaultXGeometryStringBasis  = "environ << 
232     }                                          << 
233   }                                            << 
234 }                                              << 
235                                                << 
236 inline                                         << 
237 void G4VisExecutive::SetDefaultsByFile(int arg << 
238 {                                              << 
239   // 3rd priority: in $HOME/.g4session         << 
240                                                << 
241   // Find ~/.g4session - simply return if it d << 
242   const char* home = std::getenv("HOME");      << 
243   if (home == nullptr) return;                 << 
244   G4String homedir = home;                     << 
245 #ifndef WIN32                                  << 
246   G4String filename = homedir + "/.g4session"; << 
247 #else                                          << 
248   G4String filename = homedir + "\\.g4session" << 
249 #endif                                         << 
250   std::ifstream g4session(filename);           << 
251   if (g4session.fail()) return;                << 
252                                                << 
253   // Find app name                             << 
254   if (argc < 1) return;                        << 
255   G4String appInput = argv[0];                 << 
256   G4String appName = "";                       << 
257   size_t islash = appInput.find_last_of("/\\") << 
258   if (islash == G4String::npos) appName = appI << 
259   else appName = appInput.substr(islash + 1, a << 
260                                                << 
261   // Scan ~/.g4session                         << 
262   G4String line;                               << 
263   // First line is the user-chosen default: se << 
264   G4String applicableSession, applicableGraphi << 
265   std::getline(g4session,line);                << 
266   auto hash = line.find_first_of('#'); line =  << 
267   std::istringstream iss(line);                << 
268   iss >> applicableSession >> applicableGraphi << 
269   // Read subsequent lines                     << 
270   while (g4session.good()) {                   << 
271     G4String app, session, graphicsSystem, win << 
272     std::getline(g4session,line);              << 
273     hash = line.find_first_of('#'); line = lin << 
274     std::istringstream iss1(line);             << 
275     iss1 >> app >> session >> graphicsSystem > << 
276     if (app == appName) {                      << 
277       if (!session.empty())        applicableS << 
278       if (!graphicsSystem.empty()) applicableG << 
279       if (!windowSizeHint.empty()) applicableW << 
280     }                                          << 
281   }                                            << 
282                                                << 
283   if (!applicableGraphicsSystem.empty()) {     << 
284     fDefaultGraphicsSystemName = applicableGra << 
285     fDefaultGraphicsSystemBasis = "~/.g4sessio << 
286     fSelected = true;                          << 
287   }                                            << 
288   if (!applicableWindowSizeHint.empty()) {     << 
289     fDefaultXGeometryString = applicableWindow << 
290     fDefaultXGeometryStringBasis = "~/.g4sessi << 
291   }                                            << 
292 }                                              << 
293                                                << 
294 inline                                         << 
295 void G4VisExecutive::SetDefaultsByBatch()      << 
296 {                                              << 
297   // 4th, special case for batch session       << 
298   G4UIsession* session = G4UImanager::GetUIpoi << 
299   if (session == nullptr                   //  << 
300   || dynamic_cast<G4UIbatch*>(session)) {  //  << 
301     // Actually, in this case, we wish to forc << 
302     fDefaultGraphicsSystemName = "NO_UI_SESSIO << 
303     fDefaultGraphicsSystemBasis = "no UI sessi << 
304     fSelected = true;  // To prevent any furth << 
305   }                                            << 
306 }                                              << 
307                                                << 
308 inline                                         << 
309 void G4VisExecutive::SetDefaultsByBuildFlags() << 
310 {                                              << 
311   // 5th, by cpp flags                         << 
312 #if defined G4VIS_USE_OPENGLQT || G4VIS_USE_OP << 
313             G4VIS_USE_OPENGLX  || G4VIS_USE_OP << 
314   fDefaultGraphicsSystemName = "OGL";          << 
315 #elif defined G4VIS_USE_OI || G4VIS_USE_OIX    << 
316   fDefaultGraphicsSystemName = "OI";           << 
317 #elif defined G4VIS_USE_TOOLSSG_QT_GLES || G4V << 
318               G4VIS_USE_TOOLSSG_XT_GLES || G4V << 
319   fDefaultGraphicsSystemName = "TSG";          << 
320 #elif defined G4VIS_USE_VTK || G4VIS_USE_VTK_Q << 
321   fDefaultGraphicsSystemName = "Vtk";          << 
322 #elif defined G4VIS_USE_TOOLSSG_QT_ZB || G4VIS << 
323               G4VIS_USE_TOOLSSG_XT_ZB || G4VIS << 
324   fDefaultGraphicsSystemName = "TSG";          << 
325 #elif defined G4VIS_USE_QT3D                   << 
326   fDefaultGraphicsSystemName = "Qt3D";         << 
327 #else                                          << 
328   // Choose a graphics system not needing exte << 
329   fDefaultGraphicsSystemName = "TSG_OFFSCREEN" << 
330 #endif                                         << 
331   fDefaultGraphicsSystemBasis = "build flags"; << 
332   fSelected = true;                            << 
333 }                                              << 
334                                                << 
335 inline                                         << 
336 void G4VisExecutive::RegisterGraphicsSystems ( << 
337                                                   124 
338  // Graphics Systems not needing external pack    125  // Graphics Systems not needing external packages or libraries...
339   RegisterGraphicsSystem (new G4ASCIITree);       126   RegisterGraphicsSystem (new G4ASCIITree);
340   RegisterGraphicsSystem (new G4DAWNFILE);        127   RegisterGraphicsSystem (new G4DAWNFILE);
                                                   >> 128   RegisterGraphicsSystem (new G4HepRep);
341   RegisterGraphicsSystem (new G4HepRepFile);      129   RegisterGraphicsSystem (new G4HepRepFile);
342   RegisterGraphicsSystem (new G4RayTracer);       130   RegisterGraphicsSystem (new G4RayTracer);
                                                   >> 131   RegisterGraphicsSystem (new G4VRML1File);
343   RegisterGraphicsSystem (new G4VRML2File);       132   RegisterGraphicsSystem (new G4VRML2File);
344   RegisterGraphicsSystem (new G4GMocrenFile);     133   RegisterGraphicsSystem (new G4GMocrenFile);
345   G4VGraphicsSystem* tsg_offscreen = new G4Too << 
346   RegisterGraphicsSystem(tsg_offscreen);       << 
347   tsg_offscreen->AddNickname("TSG_FILE");      << 
348                                                   134 
349 // Graphics systems needing external packages     135 // Graphics systems needing external packages or libraries...
                                                   >> 136 
                                                   >> 137 #ifdef G4VIS_USE_DAWN
                                                   >> 138   RegisterGraphicsSystem (new G4FukuiRenderer);
                                                   >> 139 #endif
                                                   >> 140 
                                                   >> 141 #ifdef G4VIS_USE_VRML
                                                   >> 142   RegisterGraphicsSystem (new G4VRML1);
                                                   >> 143   RegisterGraphicsSystem (new G4VRML2);
                                                   >> 144 #endif
                                                   >> 145 
350 // Register OGL family of drivers with their n    146 // Register OGL family of drivers with their normal names,
351 // super-abbreviated names and fallback names     147 // super-abbreviated names and fallback names where approproiate.
352                                                   148 
353 #ifdef G4VIS_USE_OPENGLQT                         149 #ifdef G4VIS_USE_OPENGLQT
354   G4VGraphicsSystem* ogliqt = new G4OpenGLImme    150   G4VGraphicsSystem* ogliqt = new G4OpenGLImmediateQt;
355   G4VGraphicsSystem* oglsqt = new G4OpenGLStor    151   G4VGraphicsSystem* oglsqt = new G4OpenGLStoredQt;
356   RegisterGraphicsSystem(ogliqt);              << 152   RegisterGraphicsSystem (ogliqt);
357   RegisterGraphicsSystem(oglsqt);              << 153   RegisterGraphicsSystem (oglsqt);
358   ogliqt->AddNickname("OGLI");                    154   ogliqt->AddNickname("OGLI");
359   oglsqt->AddNickname("OGL");                     155   oglsqt->AddNickname("OGL");
360   oglsqt->AddNickname("OGLS");                    156   oglsqt->AddNickname("OGLS");
361 #endif                                            157 #endif
362                                                   158 
363 #ifdef G4VIS_USE_OPENGLXM                         159 #ifdef G4VIS_USE_OPENGLXM
364   G4VGraphicsSystem* oglixm = new G4OpenGLImme    160   G4VGraphicsSystem* oglixm = new G4OpenGLImmediateXm;
365   G4VGraphicsSystem* oglsxm = new G4OpenGLStor    161   G4VGraphicsSystem* oglsxm = new G4OpenGLStoredXm;
366   RegisterGraphicsSystem(oglixm);              << 162   RegisterGraphicsSystem (oglixm);
367   RegisterGraphicsSystem(oglsxm);              << 163   RegisterGraphicsSystem (oglsxm);
368 #  ifdef G4VIS_USE_OPENGLQT                    << 164 #ifdef G4VIS_USE_OPENGLQT
369   oglixm->AddNickname("OGLIQt_FALLBACK");         165   oglixm->AddNickname("OGLIQt_FALLBACK");
370   oglsxm->AddNickname("OGLSQt_FALLBACK");         166   oglsxm->AddNickname("OGLSQt_FALLBACK");
371 #  else                                        << 167 #else
372   oglixm->AddNickname("OGLI");                    168   oglixm->AddNickname("OGLI");
373   oglsxm->AddNickname("OGL");                     169   oglsxm->AddNickname("OGL");
374   oglsxm->AddNickname("OGLS");                    170   oglsxm->AddNickname("OGLS");
375 #  endif                                       << 171 #endif
376 #endif                                            172 #endif
377                                                   173 
378 #ifdef G4VIS_USE_OPENGLX                          174 #ifdef G4VIS_USE_OPENGLX
379   G4VGraphicsSystem* oglix = new G4OpenGLImmed    175   G4VGraphicsSystem* oglix = new G4OpenGLImmediateX;
380   G4VGraphicsSystem* oglsx = new G4OpenGLStore    176   G4VGraphicsSystem* oglsx = new G4OpenGLStoredX;
381   RegisterGraphicsSystem(oglix);               << 177   RegisterGraphicsSystem (oglix);
382   RegisterGraphicsSystem(oglsx);               << 178   RegisterGraphicsSystem (oglsx);
383 #  ifdef G4VIS_USE_OPENGLQT                    << 179 #ifdef G4VIS_USE_OPENGLQT
384   oglix->AddNickname("OGLIQt_FALLBACK");          180   oglix->AddNickname("OGLIQt_FALLBACK");
385   oglsx->AddNickname("OGLSQt_FALLBACK");          181   oglsx->AddNickname("OGLSQt_FALLBACK");
386 #  endif                                       << 182 #endif
387 #  ifdef G4VIS_USE_OPENGLXM                    << 183 #ifdef G4VIS_USE_OPENGLXM
388   oglix->AddNickname("OGLIXm_FALLBACK");          184   oglix->AddNickname("OGLIXm_FALLBACK");
389   oglsx->AddNickname("OGLSXm_FALLBACK");          185   oglsx->AddNickname("OGLSXm_FALLBACK");
390 #  endif                                       << 186 #endif
391 #  if defined(G4VIS_USE_OPENGLQT) || (G4VIS_US << 187 #if defined (G4VIS_USE_OPENGLQT) || (G4VIS_USE_OPENGLXM)
392 #  else                                        << 188 #else
393   oglix->AddNickname("OGLI");                     189   oglix->AddNickname("OGLI");
394   oglsx->AddNickname("OGL");                      190   oglsx->AddNickname("OGL");
395   oglsx->AddNickname("OGLS");                     191   oglsx->AddNickname("OGLS");
396 #  endif                                       << 192 #endif
397 #endif                                            193 #endif
398                                                   194 
399 #ifdef G4VIS_USE_OPENGLWIN32                      195 #ifdef G4VIS_USE_OPENGLWIN32
400   G4VGraphicsSystem* ogliwin32 = new G4OpenGLI    196   G4VGraphicsSystem* ogliwin32 = new G4OpenGLImmediateWin32;
401   G4VGraphicsSystem* oglswin32 = new G4OpenGLS    197   G4VGraphicsSystem* oglswin32 = new G4OpenGLStoredWin32;
402   RegisterGraphicsSystem(ogliwin32);           << 198   RegisterGraphicsSystem (ogliwin32);
403   RegisterGraphicsSystem(oglswin32);           << 199   RegisterGraphicsSystem (oglswin32);
404 #  ifdef G4VIS_USE_OPENGLQT                    << 200 #ifdef G4VIS_USE_OPENGLQT
405   ogliwin32->AddNickname("OGLIQt_FALLBACK");      201   ogliwin32->AddNickname("OGLIQt_FALLBACK");
406   oglswin32->AddNickname("OGLSQt_FALLBACK");      202   oglswin32->AddNickname("OGLSQt_FALLBACK");
407 #  else                                        << 203 #else
408   ogliwin32->AddNickname("OGLI");                 204   ogliwin32->AddNickname("OGLI");
409   oglswin32->AddNickname("OGL");                  205   oglswin32->AddNickname("OGL");
410   oglswin32->AddNickname("OGLS");                 206   oglswin32->AddNickname("OGLS");
411 #  endif                                       << 207 #endif
                                                   >> 208 #endif
                                                   >> 209 
                                                   >> 210 #ifdef G4VIS_USE_OPENGLWT
                                                   >> 211   RegisterGraphicsSystem (new G4OpenGLImmediateWt);
412 #endif                                            212 #endif
413                                                   213 
414 // Register OI graphics system with super-abbr    214 // Register OI graphics system with super-abbreviated nickname
415 #ifdef G4VIS_USE_OI                               215 #ifdef G4VIS_USE_OI
416   G4VGraphicsSystem* oi = 0;                   << 216   G4VGraphicsSystem* oi  = 0;
417 #  ifdef G4VIS_USE_OIX                         << 217 #ifdef G4VIS_USE_OIX
418   oi = new G4OpenInventorX;                       218   oi = new G4OpenInventorX;
419 #  elif defined(G4VIS_USE_OIQT)                << 219 #elif G4VIS_USE_OIWIN32
420   oi = new G4OpenInventorQt;                   << 
421 #  elif defined(G4VIS_USE_OIWIN32)             << 
422   oi = new G4OpenInventorWin32;                   220   oi = new G4OpenInventorWin32;
423 #  endif                                       << 221 #endif
424   if(oi)                                       << 222   if (oi) {
425   {                                            << 223     RegisterGraphicsSystem (oi);
426     RegisterGraphicsSystem(oi);                << 
427     oi->AddNickname("OI");                        224     oi->AddNickname("OI");
428   }                                               225   }
429 #endif                                            226 #endif
430                                                   227 
431 // The new, extended OI is registered separate    228 // The new, extended OI is registered separately for now.
432 #ifdef G4VIS_USE_OIX                              229 #ifdef G4VIS_USE_OIX
433   RegisterGraphicsSystem(new G4OpenInventorXtE << 230   RegisterGraphicsSystem (new G4OpenInventorXtExtended);
434 #endif                                         << 
435                                                << 
436 #ifdef G4VIS_USE_RAYTRACERX                    << 
437   RegisterGraphicsSystem(new G4RayTracerX);    << 
438 #endif                                         << 
439                                                << 
440 #ifdef G4VIS_USE_QT3D                          << 
441   RegisterGraphicsSystem(new G4Qt3D);          << 
442 #endif                                         << 
443                                                << 
444 #ifdef G4VIS_USE_TOOLSSG_X11_GLES              << 
445   G4VGraphicsSystem* tsg_x11_gles = new G4Tool << 
446   RegisterGraphicsSystem(tsg_x11_gles);        << 
447   tsg_x11_gles->AddNickname("TSGX11");         << 
448 #ifdef G4VIS_USE_TOOLSSG_XT_GLES               << 
449   tsg_x11_gles->AddNickname("TSG_XT_GLES_FALLB << 
450 #endif                                         << 
451 #ifdef G4VIS_USE_TOOLSSG_QT_GLES               << 
452 #ifndef G4VIS_USE_TOOLSSG_XT_GLES              << 
453   tsg_x11_gles->AddNickname("TSG_QT_GLES_FALLB << 
454 #endif                                         << 
455 #endif                                         << 
456 #endif                                         << 
457                                                << 
458 #ifdef G4VIS_USE_TOOLSSG_X11_ZB                << 
459   G4VGraphicsSystem* tsg_x11_zb = new G4ToolsS << 
460   RegisterGraphicsSystem(tsg_x11_zb);          << 
461   tsg_x11_zb->AddNickname("TSGX11ZB");         << 
462 #endif                                         << 
463                                                << 
464 #ifdef G4VIS_USE_TOOLSSG_XT_GLES               << 
465   G4VGraphicsSystem* tsg_xt_gles = new G4Tools << 
466   RegisterGraphicsSystem(tsg_xt_gles);         << 
467   tsg_xt_gles->AddNickname("TSGXt");           << 
468 #ifdef G4VIS_USE_TOOLSSG_QT_GLES               << 
469   tsg_xt_gles->AddNickname("TSG_QT_GLES_FALLBA << 
470 #endif                                         << 
471 #endif                                            231 #endif
472                                                   232 
473 #ifdef G4VIS_USE_TOOLSSG_XT_ZB                 << 233 #ifdef G4VIS_USE_OIQT
474   G4VGraphicsSystem* tsg_xt_zb = new G4ToolsSG << 234   RegisterGraphicsSystem(new G4OpenInventorQt);
475   RegisterGraphicsSystem(tsg_xt_zb);           << 
476   tsg_xt_zb->AddNickname("TSGXtZB");           << 
477 #endif                                         << 
478                                                << 
479 #ifdef G4VIS_USE_TOOLSSG_QT_GLES               << 
480   G4VGraphicsSystem* tsg_qt_gles = new G4Tools << 
481   RegisterGraphicsSystem(tsg_qt_gles);         << 
482   tsg_qt_gles->AddNickname("TSGQt");           << 
483 #endif                                         << 
484                                                << 
485 #ifdef G4VIS_USE_TOOLSSG_QT_ZB                 << 
486   G4VGraphicsSystem* tsg_qt_zb = new G4ToolsSG << 
487   RegisterGraphicsSystem(tsg_qt_zb);           << 
488   tsg_qt_zb->AddNickname("TSGQtZB");           << 
489 #endif                                         << 
490                                                << 
491 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_GLES          << 
492   G4VGraphicsSystem* tsg_windows_gles = new G4 << 
493   RegisterGraphicsSystem(tsg_windows_gles);    << 
494 #endif                                         << 
495                                                << 
496 #ifdef G4VIS_USE_TOOLSSG_WINDOWS_ZB            << 
497   G4VGraphicsSystem* tsg_windows_zb = new G4To << 
498   RegisterGraphicsSystem(tsg_windows_zb);      << 
499 #endif                                            235 #endif
500                                                   236 
501 #ifdef G4VIS_USE_TOOLSSG_QT_GLES               << 237 #ifdef G4VIS_USE_RAYTRACERX
502   tsg_qt_gles->AddNickname("TSG");             << 238   RegisterGraphicsSystem (new G4RayTracerX);
503 #elif defined(G4VIS_USE_TOOLSSG_XT_GLES)       << 
504   tsg_xt_gles->AddNickname("TSG");             << 
505 #elif defined(G4VIS_USE_TOOLSSG_X11_GLES)      << 
506   tsg_x11_gles->AddNickname("TSG");            << 
507 #elif defined(G4VIS_USE_TOOLSSG_WINDOWS_GLES)  << 
508   tsg_windows_gles->AddNickname("TSG");        << 
509 #else                                          << 
510 #ifdef G4VIS_USE_TOOLSSG_QT_ZB                 << 
511   tsg_qt_zb->AddNickname("TSG");               << 
512 #elif G4VIS_USE_TOOLSSG_WINDOWS_ZB             << 
513   tsg_windows_zb->AddNickname("TSG");          << 
514 #else                                          << 
515   tsg_offscreen->AddNickname("TSG");           << 
516 #endif                                         << 
517 #endif                                            239 #endif
518                                                   240 
519 #ifdef G4VIS_USE_VTK                           << 
520   if (GetVerbosity() >= startup) {             << 
521     G4cout                                     << 
522     << "  VTK: OpenGL-based drivers suppressed << 
523     << G4endl;                                 << 
524   }                                            << 
525   G4Vtk* vtkN = new G4Vtk();                   << 
526   G4VtkOffscreen* vtkOS = new G4VtkOffscreen() << 
527   RegisterGraphicsSystem(vtkN);                << 
528   RegisterGraphicsSystem(vtkOS);               << 
529 #  ifdef G4VIS_USE_VTK_QT                      << 
530   vtkN->AddNickname("VTKQt_FALLBACK");         << 
531 #  endif                                       << 
532 #endif                                         << 
533                                                << 
534 #ifdef G4VIS_USE_VTK_QT                        << 
535   G4VtkQt* vtkQt = new G4VtkQt();              << 
536   RegisterGraphicsSystem(vtkQt);               << 
537   vtkQt->AddNickname("VTKQt");                 << 
538 #endif                                         << 
539                                                << 
540 #ifdef G4VIS_USE_VTK_QT                        << 
541   vtkQt->AddNickname("Vtk");                   << 
542   vtkQt->AddNickname("VTK");                   << 
543 #elif defined(G4VIS_USE_VTK)                   << 
544   vtkN->AddNickname("Vtk");                    << 
545   vtkN->AddNickname("VTK");                    << 
546 #endif                                         << 
547 }                                                 241 }
548                                                   242 
549 // See comments about inlining above.             243 // See comments about inlining above.
550 inline void                                    << 244 inline void 
551 G4VisExecutive::RegisterModelFactories()          245 G4VisExecutive::RegisterModelFactories()
552 {                                                 246 {
553    // Trajectory draw models                      247    // Trajectory draw models
554    RegisterModelFactory(new G4TrajectoryGeneri << 248    RegisterModelFactory(new G4TrajectoryGenericDrawerFactory());       
555    RegisterModelFactory(new G4TrajectoryDrawBy    249    RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory());
556    RegisterModelFactory(new G4TrajectoryDrawBy    250    RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
557    RegisterModelFactory(new G4TrajectoryDrawBy    251    RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory());
558    RegisterModelFactory(new G4TrajectoryDrawBy    252    RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
559    RegisterModelFactory(new G4TrajectoryDrawBy    253    RegisterModelFactory(new G4TrajectoryDrawByEncounteredVolumeFactory());
560                                                   254 
561    // Trajectory filter models                    255    // Trajectory filter models
562    RegisterModelFactory(new G4TrajectoryAttrib    256    RegisterModelFactory(new G4TrajectoryAttributeFilterFactory());
563    RegisterModelFactory(new G4TrajectoryCharge    257    RegisterModelFactory(new G4TrajectoryChargeFilterFactory());
564    RegisterModelFactory(new G4TrajectoryOrigin    258    RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory());
565    RegisterModelFactory(new G4TrajectoryPartic    259    RegisterModelFactory(new G4TrajectoryParticleFilterFactory());
566    RegisterModelFactory(new G4TrajectoryEncoun    260    RegisterModelFactory(new G4TrajectoryEncounteredVolumeFilterFactory());
567                                                   261 
568    // Hit filter models                           262    // Hit filter models
569    RegisterModelFactory(new G4HitAttributeFilt    263    RegisterModelFactory(new G4HitAttributeFilterFactory());
570                                                   264 
571    // Digi filter models                          265    // Digi filter models
572    RegisterModelFactory(new G4DigiAttributeFil    266    RegisterModelFactory(new G4DigiAttributeFilterFactory());
573 }                                                 267 }
574                                                   268 
575 #endif                                            269 #endif
576                                                   270