G4VisExecutive.icc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // John Allison 24th January 1998.
00031 
00032 #ifndef G4VISEXECUTIVE_ICC
00033 #define G4VISEXECUTIVE_ICC
00034 
00035 // Supported drivers...
00036 
00037 // Not needing external packages or libraries...
00038 #include "G4ASCIITree.hh"
00039 #include "G4DAWNFILE.hh"
00040 #include "G4HepRep.hh"
00041 #include "G4HepRepFile.hh"
00042 #include "G4RayTracer.hh"
00043 #include "G4HitFilterFactories.hh"
00044 #include "G4DigiFilterFactories.hh"
00045 #include "G4TrajectoryFilterFactories.hh"
00046 #include "G4TrajectoryModelFactories.hh"
00047 #include "G4VRML1File.hh"
00048 #include "G4VRML2File.hh"
00049 #include "G4GMocrenFile.hh"
00050 
00051 // Needing external packages or libraries...
00052 
00053 #ifdef G4VIS_USE_DAWN
00054 #include "G4FukuiRenderer.hh"
00055 #endif
00056 
00057 #ifdef G4VIS_USE_OPENGLX
00058 #include "G4OpenGLImmediateX.hh"
00059 #include "G4OpenGLStoredX.hh"
00060 #endif
00061 
00062 #ifdef G4VIS_USE_OPENGLWIN32
00063 #include "G4OpenGLImmediateWin32.hh"
00064 #include "G4OpenGLStoredWin32.hh"
00065 #endif
00066 
00067 #ifdef G4VIS_USE_OPENGLXM
00068 #include "G4OpenGLImmediateXm.hh"
00069 #include "G4OpenGLStoredXm.hh"
00070 #endif
00071 
00072 #ifdef G4VIS_USE_OPENGLQT
00073 #include "G4OpenGLImmediateQt.hh"
00074 #include "G4OpenGLStoredQt.hh"
00075 #endif
00076 
00077 #ifdef G4VIS_USE_OPENGLWT
00078 #include "G4OpenGLImmediateWt.hh"
00079 #endif
00080 
00081 #ifdef G4VIS_USE_OIX
00082 #include "G4OpenInventorX.hh"
00083 #include "G4OpenInventorXtExtended.hh"
00084 #endif
00085 
00086 #ifdef G4VIS_USE_OIWIN32
00087 #include "G4OpenInventorWin32.hh"
00088 #endif
00089 
00090 #ifdef G4VIS_USE_RAYTRACERX
00091 #include "G4RayTracerX.hh"
00092 #endif
00093 
00094 #ifdef G4VIS_USE_VRML
00095 #include "G4VRML1.hh"
00096 #include "G4VRML2.hh"
00097 #endif
00098 
00099 inline
00100 G4VisExecutive::G4VisExecutive (const G4String& verbosityString):
00101   G4VisManager(verbosityString) 
00102 {}
00103 
00104 // The inline keyword prevents the compiler making an external
00105 // reference even though they cannot actually be inlined since they
00106 // are virtual functions.  This prevents a "multiple definition" error
00107 // if it is included in more than one file.  However, as explained in
00108 // the class description in G4VisExecutive.hh, it should never be
00109 // necessary to #include "G4VisExecutive.hh" in more than one file
00110 // since after instantiation the object can be treated as a
00111 // G4VisManager.
00112 inline void
00113 G4VisExecutive::RegisterGraphicsSystems () {
00114 
00115   // Graphics Systems not needing external packages or libraries...
00116   RegisterGraphicsSystem (new G4ASCIITree);
00117   RegisterGraphicsSystem (new G4DAWNFILE);
00118   RegisterGraphicsSystem (new G4HepRep);
00119   RegisterGraphicsSystem (new G4HepRepFile);
00120   RegisterGraphicsSystem (new G4RayTracer);
00121   RegisterGraphicsSystem (new G4VRML1File);
00122   RegisterGraphicsSystem (new G4VRML2File);
00123   RegisterGraphicsSystem (new G4GMocrenFile);
00124   // Graphics systems needing external packages or libraries...
00125 
00126 #ifdef G4VIS_USE_DAWN
00127   RegisterGraphicsSystem (new G4FukuiRenderer);
00128 #endif
00129 
00130 // Register OGL graphics system with generic nicknames.
00131 // Note: Any graphics system can be used with any UI session except
00132 // OPENGLQT - this must have a UI Qt session unless in batch mode.  This
00133 // is handled in /vis/sceneHandler/create but a potential fallback is
00134 // defined here.
00135 #ifdef G4VIS_USE_OPENGL
00136   G4VGraphicsSystem* ogl  = 0;
00137   G4VGraphicsSystem* ogli = 0;
00138   G4VGraphicsSystem* ogls = 0;
00139   G4VGraphicsSystem* ogl_fallback = 0;
00140   G4VGraphicsSystem* ogli_fallback = 0;
00141   G4VGraphicsSystem* ogls_fallback = 0;
00142 #ifdef G4VIS_USE_OPENGLQT
00143   ogl  = new G4OpenGLStoredQt;
00144   ogli = new G4OpenGLImmediateQt;
00145   ogls = new G4OpenGLStoredQt;
00146 #if defined G4VIS_USE_OPENGLXM
00147   ogl_fallback  = new G4OpenGLStoredXm;
00148   ogli_fallback = new G4OpenGLImmediateXm;
00149   ogls_fallback = new G4OpenGLStoredXm;
00150 #elif defined G4VIS_USE_OPENGLX
00151   ogl_fallback  = new G4OpenGLStoredX;
00152   ogli_fallback = new G4OpenGLImmediateX;
00153   ogls_fallback = new G4OpenGLStoredX;
00154 #elif defined G4VIS_USE_OPENGLWIN32
00155   ogl_fallback  = new G4OpenGLStoredWin32;
00156   ogli_fallback = new G4OpenGLImmediateWin32;
00157   ogls_fallback = new G4OpenGLStoredWin32;
00158 #endif
00159 #elif defined G4VIS_USE_OPENGLWT
00160   ogl  = new G4OpenGLImmediateWt;
00161   ogli = new G4OpenGLImmediateWt;
00162   ogls = new G4OpenGLImmediateWt;
00163 #elif defined G4VIS_USE_OPENGLXM
00164   ogl  = new G4OpenGLStoredXm;
00165   ogli = new G4OpenGLImmediateXm;
00166   ogls = new G4OpenGLStoredXm;
00167 #elif defined G4VIS_USE_OPENGLWIN32
00168   ogl  = new G4OpenGLStoredWin32;
00169   ogli = new G4OpenGLImmediateWin32;
00170   ogls = new G4OpenGLStoredWin32;
00171 #elif defined G4VIS_USE_OPENGLX
00172   ogl  = new G4OpenGLStoredX;
00173   ogli = new G4OpenGLImmediateX;
00174   ogls = new G4OpenGLStoredX;
00175 #endif
00176   if (ogl) {
00177     ogl->SetNickname("OGL");
00178     RegisterGraphicsSystem (ogl);
00179   }
00180   if (ogli) {
00181     ogli->SetNickname("OGLI");
00182     RegisterGraphicsSystem (ogli);
00183   }
00184   if (ogls) {
00185     ogls->SetNickname("OGLS");
00186     RegisterGraphicsSystem (ogls);
00187   }
00188   if (ogl_fallback) {
00189     ogl_fallback->SetNickname("OGL_FALLBACK");
00190     RegisterGraphicsSystem (ogl_fallback);
00191   }
00192   if (ogli_fallback) {
00193     ogli_fallback->SetNickname("OGLI_FALLBACK");
00194     RegisterGraphicsSystem (ogli_fallback);
00195   }
00196   if (ogls_fallback) {
00197     ogls_fallback->SetNickname("OGLS_FALLBACK");
00198     RegisterGraphicsSystem (ogls_fallback);
00199   }
00200 #endif
00201 
00202 #ifdef G4VIS_USE_OPENGLX
00203   RegisterGraphicsSystem (new G4OpenGLImmediateX);
00204   RegisterGraphicsSystem (new G4OpenGLStoredX);
00205 #endif
00206 
00207 #ifdef G4VIS_USE_OPENGLWIN32
00208   RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
00209   RegisterGraphicsSystem (new G4OpenGLStoredWin32);
00210 #endif
00211 
00212 #ifdef G4VIS_USE_OPENGLXM
00213   RegisterGraphicsSystem (new G4OpenGLImmediateXm);
00214   RegisterGraphicsSystem (new G4OpenGLStoredXm);
00215 #endif
00216 
00217 #ifdef G4VIS_USE_OPENGLQT
00218   G4VGraphicsSystem* gsi = new G4OpenGLImmediateQt;
00219   G4VGraphicsSystem* gss = new G4OpenGLStoredQt;
00220   RegisterGraphicsSystem (gsi);
00221   RegisterGraphicsSystem (gss);
00222   G4VGraphicsSystem* gsi_fallback = 0;
00223   G4VGraphicsSystem* gss_fallback = 0;
00224 #if defined G4VIS_USE_OPENGLXM
00225   gsi_fallback = new G4OpenGLImmediateXm;
00226   gss_fallback = new G4OpenGLStoredXm;
00227 #elif defined G4VIS_USE_OPENGLX
00228   gsi_fallback = new G4OpenGLImmediateX;
00229   gss_fallback = new G4OpenGLStoredX;
00230 #elif defined G4VIS_USE_OPENGLWIN32
00231   gsi_fallback = new G4OpenGLImmediateWin32;
00232   gss_fallback = new G4OpenGLStoredWin32;
00233 #endif
00234   if (gsi_fallback) {
00235     gsi_fallback->SetNickname(gsi->GetNickname()+"_FALLBACK");
00236     RegisterGraphicsSystem (gsi_fallback);
00237   }
00238   if (gss_fallback) {
00239     gss_fallback->SetNickname(gss->GetNickname()+"_FALLBACK");
00240     RegisterGraphicsSystem (gss_fallback);
00241   }
00242 #endif
00243 
00244 #ifdef G4VIS_USE_OPENGLWT
00245   RegisterGraphicsSystem (new G4OpenGLImmediateWt);
00246 #endif
00247 
00248 // Register OI graphics system with generic nickname
00249 #ifdef G4VIS_USE_OI
00250   G4VGraphicsSystem* oi  = 0;
00251 #ifdef G4VIS_USE_OIX
00252   oi = new G4OpenInventorX;
00253 #endif
00254 #ifdef G4VIS_USE_OIWIN32
00255   oi = new G4OpenInventorWin32;
00256 #endif
00257   if (oi) {
00258     oi->SetNickname("OI");
00259     RegisterGraphicsSystem (oi);
00260   }
00261 #endif
00262 
00263 #ifdef G4VIS_USE_OIX
00264   RegisterGraphicsSystem (new G4OpenInventorX);
00265   RegisterGraphicsSystem (new G4OpenInventorXtExtended);
00266 #endif
00267 
00268 #ifdef G4VIS_USE_OIWIN32
00269   RegisterGraphicsSystem (new G4OpenInventorWin32);
00270 #endif
00271 
00272 #ifdef G4VIS_USE_RAYTRACERX
00273   RegisterGraphicsSystem (new G4RayTracerX);
00274 #endif
00275 
00276 #ifdef G4VIS_USE_VRML
00277   RegisterGraphicsSystem (new G4VRML1);
00278   RegisterGraphicsSystem (new G4VRML2);
00279 #endif
00280 
00281 }
00282 
00283 // See comments about inlining above.
00284 inline void 
00285 G4VisExecutive::RegisterModelFactories()
00286 {
00287    // Trajectory draw models
00288    RegisterModelFactory(new G4TrajectoryGenericDrawerFactory());       
00289    RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
00290    RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
00291    RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory());  
00292    RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory());  
00293 
00294    // Trajectory filter models
00295    RegisterModelFactory(new G4TrajectoryChargeFilterFactory());
00296    RegisterModelFactory(new G4TrajectoryParticleFilterFactory());
00297    RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory());
00298    RegisterModelFactory(new G4TrajectoryAttributeFilterFactory());
00299 
00300    // Hit filter models
00301    RegisterModelFactory(new G4HitAttributeFilterFactory());
00302 
00303    // Digi filter models
00304    RegisterModelFactory(new G4DigiAttributeFilterFactory());
00305 }
00306 
00307 #endif

Generated on Mon May 27 17:50:16 2013 for Geant4 by  doxygen 1.4.7