2 // ********************************************************************
 
    3 // * License and Disclaimer                                           *
 
    5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
 
    6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
 
    7 // * conditions of the Geant4 Software License,  included in the file *
 
    8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
 
    9 // * include a list of copyright holders.                             *
 
   11 // * Neither the authors of this software system, nor their employing *
 
   12 // * institutes,nor the agencies providing financial support for this *
 
   13 // * work  make  any representation or  warranty, express or implied, *
 
   14 // * regarding  this  software system or assume any liability for its *
 
   15 // * use.  Please see the license in the file  LICENSE  and URL above *
 
   16 // * for the full disclaimer and the limitation of liability.         *
 
   18 // * This  code  implementation is the result of  the  scientific and *
 
   19 // * technical work of the GEANT4 collaboration.                      *
 
   20 // * By using,  copying,  modifying or  distributing the software (or *
 
   21 // * any work based  on the software)  you  agree  to acknowledge its *
 
   22 // * use  in  resulting  scientific  publications,  and indicate your *
 
   23 // * acceptance of all terms of the Geant4 Software license.          *
 
   24 // ********************************************************************
 
   27 // $Id: G4VisExecutive.icc 91686 2015-07-31 09:40:08Z gcosmo $
 
   30 // John Allison 24th January 1998.
 
   32 #ifndef G4VISEXECUTIVE_ICC
 
   33 #define G4VISEXECUTIVE_ICC
 
   35 // Supported drivers...
 
   37 // Not needing external packages or libraries...
 
   38 #include "G4ASCIITree.hh"
 
   39 #include "G4DAWNFILE.hh"
 
   40 #include "G4HepRep.hh"
 
   41 #include "G4HepRepFile.hh"
 
   42 #include "G4RayTracer.hh"
 
   43 #include "G4HitFilterFactories.hh"
 
   44 #include "G4DigiFilterFactories.hh"
 
   45 #include "G4TrajectoryFilterFactories.hh"
 
   46 #include "G4TrajectoryModelFactories.hh"
 
   47 #include "G4VRML1File.hh"
 
   48 #include "G4VRML2File.hh"
 
   49 #include "G4GMocrenFile.hh"
 
   51 // FIXME : avoid mix with QT/WT driver (should be done by cmake??)
 
   52 #if defined(G4VIS_USE_OPENGLWT)
 
   53   // do not want GL2P2 in WT case
 
   54   #undef G4VIS_BUILD_OPENGL_GL2PS
 
   57 // Needing external packages or libraries...
 
   60 #include "G4FukuiRenderer.hh"
 
   63 #ifdef G4VIS_USE_OPENGLX
 
   64 #include "G4OpenGLImmediateX.hh"
 
   65 #include "G4OpenGLStoredX.hh"
 
   68 #ifdef G4VIS_USE_OPENGLWIN32
 
   69 #include "G4OpenGLImmediateWin32.hh"
 
   70 #include "G4OpenGLStoredWin32.hh"
 
   73 #ifdef G4VIS_USE_OPENGLXM
 
   74 #include "G4OpenGLImmediateXm.hh"
 
   75 #include "G4OpenGLStoredXm.hh"
 
   78 #ifdef G4VIS_USE_OPENGLQT
 
   79 #include "G4OpenGLImmediateQt.hh"
 
   80 #include "G4OpenGLStoredQt.hh"
 
   83 #ifdef G4VIS_USE_OPENGLWT
 
   84 #include "G4OpenGLImmediateWt.hh"
 
   88 #include "G4OpenInventorX.hh"
 
   89 #include "G4OpenInventorXtExtended.hh"
 
   92 #ifdef G4VIS_USE_OIWIN32
 
   93 #include "G4OpenInventorWin32.hh"
 
   96 #ifdef G4VIS_USE_RAYTRACERX
 
   97 #include "G4RayTracerX.hh"
 
  100 #ifdef G4VIS_USE_VRML
 
  101 #include "G4VRML1.hh"
 
  102 #include "G4VRML2.hh"
 
  105 // The inline keyword prevents the compiler making an external
 
  106 // reference even though they cannot actually be inlined since they
 
  107 // are virtual functions.  This prevents a "multiple definition" error
 
  108 // if it is included in more than one file.  However, as explained in
 
  109 // the class description in G4VisExecutive.hh, it should never be
 
  110 // necessary to #include "G4VisExecutive.hh" in more than one file
 
  111 // since after instantiation the object can be treated as a
 
  115 G4VisExecutive::G4VisExecutive (const G4String& verbosityString):
 
  116 G4VisManager(verbosityString)
 
  120 G4VisExecutive::RegisterGraphicsSystems () {
 
  122  // Graphics Systems not needing external packages or libraries...
 
  123   RegisterGraphicsSystem (new G4ASCIITree);
 
  124   RegisterGraphicsSystem (new G4DAWNFILE);
 
  125   RegisterGraphicsSystem (new G4HepRep);
 
  126   RegisterGraphicsSystem (new G4HepRepFile);
 
  127   RegisterGraphicsSystem (new G4RayTracer);
 
  128   RegisterGraphicsSystem (new G4VRML1File);
 
  129   RegisterGraphicsSystem (new G4VRML2File);
 
  130   RegisterGraphicsSystem (new G4GMocrenFile);
 
  132 // Graphics systems needing external packages or libraries...
 
  134 #ifdef G4VIS_USE_DAWN
 
  135   RegisterGraphicsSystem (new G4FukuiRenderer);
 
  138 #ifdef G4VIS_USE_VRML
 
  139   RegisterGraphicsSystem (new G4VRML1);
 
  140   RegisterGraphicsSystem (new G4VRML2);
 
  143 // Register OGL family of drivers with their normal names,
 
  144 // super-abbreviated names and fallback names where approproiate.
 
  146 #ifdef G4VIS_USE_OPENGLQT
 
  147   G4VGraphicsSystem* ogliqt = new G4OpenGLImmediateQt;
 
  148   G4VGraphicsSystem* oglsqt = new G4OpenGLStoredQt;
 
  149   RegisterGraphicsSystem (ogliqt);
 
  150   RegisterGraphicsSystem (oglsqt);
 
  151   ogliqt->AddNickname("OGLI");
 
  152   oglsqt->AddNickname("OGL");
 
  153   oglsqt->AddNickname("OGLS");
 
  156 #ifdef G4VIS_USE_OPENGLXM
 
  157   G4VGraphicsSystem* oglixm = new G4OpenGLImmediateXm;
 
  158   G4VGraphicsSystem* oglsxm = new G4OpenGLStoredXm;
 
  159   RegisterGraphicsSystem (oglixm);
 
  160   RegisterGraphicsSystem (oglsxm);
 
  161 #ifdef G4VIS_USE_OPENGLQT
 
  162   oglixm->AddNickname("OGLIQt_FALLBACK");
 
  163   oglsxm->AddNickname("OGLSQt_FALLBACK");
 
  165   oglixm->AddNickname("OGLI");
 
  166   oglsxm->AddNickname("OGL");
 
  167   oglsxm->AddNickname("OGLS");
 
  171 #ifdef G4VIS_USE_OPENGLX
 
  172   G4VGraphicsSystem* oglix = new G4OpenGLImmediateX;
 
  173   G4VGraphicsSystem* oglsx = new G4OpenGLStoredX;
 
  174   RegisterGraphicsSystem (oglix);
 
  175   RegisterGraphicsSystem (oglsx);
 
  176 #ifdef G4VIS_USE_OPENGLQT
 
  177   oglix->AddNickname("OGLIQt_FALLBACK");
 
  178   oglsx->AddNickname("OGLSQt_FALLBACK");
 
  180 #ifdef G4VIS_USE_OPENGLXM
 
  181   oglix->AddNickname("OGLIXm_FALLBACK");
 
  182   oglsx->AddNickname("OGLSXm_FALLBACK");
 
  184 #if defined (G4VIS_USE_OPENGLQT) || (G4VIS_USE_OPENGLXM)
 
  186   oglix->AddNickname("OGLI");
 
  187   oglsx->AddNickname("OGL");
 
  188   oglsx->AddNickname("OGLS");
 
  192 #ifdef G4VIS_USE_OPENGLWIN32
 
  193   G4VGraphicsSystem* ogliwin32 = new G4OpenGLImmediateWin32;
 
  194   G4VGraphicsSystem* oglswin32 = new G4OpenGLStoredWin32;
 
  195   RegisterGraphicsSystem (ogliwin32);
 
  196   RegisterGraphicsSystem (oglswin32);
 
  197 #ifdef G4VIS_USE_OPENGLQT
 
  198   ogliwin32->AddNickname("OGLIQt_FALLBACK");
 
  199   oglswin32->AddNickname("OGLSQt_FALLBACK");
 
  203 #ifdef G4VIS_USE_OPENGLWT
 
  204   RegisterGraphicsSystem (new G4OpenGLImmediateWt);
 
  207 // Register OI graphics system with super-abbreviated nickname
 
  209   G4VGraphicsSystem* oi  = 0;
 
  211   oi = new G4OpenInventorX;
 
  212 #elif G4VIS_USE_OIWIN32
 
  213   oi = new G4OpenInventorWin32;
 
  216     RegisterGraphicsSystem (oi);
 
  217     oi->AddNickname("OI");
 
  221 // The new, extended OI is registered separately for now.
 
  223   RegisterGraphicsSystem (new G4OpenInventorXtExtended);
 
  226 #ifdef G4VIS_USE_RAYTRACERX
 
  227   RegisterGraphicsSystem (new G4RayTracerX);
 
  232 // See comments about inlining above.
 
  234 G4VisExecutive::RegisterModelFactories()
 
  236    // Trajectory draw models
 
  237    RegisterModelFactory(new G4TrajectoryGenericDrawerFactory());       
 
  238    RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
 
  239    RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
 
  240    RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory());  
 
  241    RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory());  
 
  243    // Trajectory filter models
 
  244    RegisterModelFactory(new G4TrajectoryChargeFilterFactory());
 
  245    RegisterModelFactory(new G4TrajectoryParticleFilterFactory());
 
  246    RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory());
 
  247    RegisterModelFactory(new G4TrajectoryAttributeFilterFactory());
 
  250    RegisterModelFactory(new G4HitAttributeFilterFactory());
 
  252    // Digi filter models
 
  253    RegisterModelFactory(new G4DigiAttributeFilterFactory());