[531] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 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. * |
---|
| 10 | // * * |
---|
| 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. * |
---|
| 17 | // * * |
---|
| 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 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4VisExecutive.hh,v 1.6 2006/06/29 21:28:50 gunter Exp $ |
---|
[593] | 28 | // GEANT4 tag $Name: geant4-09-00-ref-01 $ |
---|
[531] | 29 | // |
---|
| 30 | // |
---|
| 31 | // John Allison 2nd February 2005 (based on MyVisManager, 24th January 1998). |
---|
| 32 | // |
---|
| 33 | // Class description |
---|
| 34 | // |
---|
| 35 | // Concrete Visualization Manager that implements the virtual |
---|
| 36 | // functions RegisterGraphicsSystems and RegisterModelFactories. This |
---|
| 37 | // is executed when you Initialise() or Initialize() the vis manager. |
---|
| 38 | // It exploits C-pre-processor variables G4VIS_USE_DAWN, etc., which |
---|
| 39 | // are set by the GNUmakefiles if environment variables of the same |
---|
| 40 | // name are set. |
---|
| 41 | // |
---|
| 42 | // Include this file and write code to instantiate G4VisExecutive just |
---|
| 43 | // once as beginning of operations. Before you compile, set |
---|
| 44 | // appropriate environment variables. If you change your environment |
---|
| 45 | // you must force recompilation (the make files will not detect the |
---|
| 46 | // need to do this). Typically, your main program file will contain: |
---|
| 47 | // |
---|
| 48 | // #ifdef G4VIS_USE |
---|
| 49 | // #include "G4VisExecutive.hh" |
---|
| 50 | // #endif |
---|
| 51 | // ... |
---|
| 52 | // int main() { |
---|
| 53 | // ... |
---|
| 54 | // #ifdef G4VIS_USE |
---|
| 55 | // // Instantiate and initialise Visualization Manager. |
---|
| 56 | // G4VisManager* visManager = new G4VisExecutive; |
---|
| 57 | // // visManager -> SetVerboseLevel (verbosityString); |
---|
| 58 | // // visManager -> RegisterGraphicsSystem (new G4XXX); |
---|
| 59 | // visManager -> Initialize (); |
---|
| 60 | // #endif |
---|
| 61 | // ... |
---|
| 62 | // #ifdef G4VIS_USE |
---|
| 63 | // G4cout << "Deleting vis manager..." << G4endl; |
---|
| 64 | // delete visManager; |
---|
| 65 | // G4cout << "Vis manager deleted." << G4endl; |
---|
| 66 | // #endif |
---|
| 67 | // |
---|
| 68 | // The implementation is included as an .icc file because - for those |
---|
| 69 | // graphics systems that need external libraries - only those |
---|
| 70 | // systems that have been selected by the flags may be instantiated |
---|
| 71 | // without causing unresolved references (only the user knows which |
---|
| 72 | // libraries are available on his/her computer). It also ensures |
---|
| 73 | // that libraries can be linked in the right order, without circular |
---|
| 74 | // dependencies. (Note that some graphics systems, notable those |
---|
| 75 | // that write files for off-line viewing, do not suffer these |
---|
| 76 | // restrictions and are always registered.) Additional graphics |
---|
| 77 | // systems, XXX say, can be individually registered before |
---|
| 78 | // invocation of Initialise() with RegisterGraphicsSystem(new XXX). |
---|
| 79 | // |
---|
| 80 | // Alternatively, you can implement an empty function here and just |
---|
| 81 | // register the systems you want in your main(), e.g.: |
---|
| 82 | // G4VisManager* visManager = new G4VisExecutive; |
---|
| 83 | // visManager -> RegisterGraphicsSystem (new MyGraphicsSystem); |
---|
| 84 | // |
---|
| 85 | // See class description of G4VisManager for more details. |
---|
| 86 | |
---|
| 87 | #ifndef G4VISEXECUTIVE_HH |
---|
| 88 | #define G4VISEXECUTIVE_HH |
---|
| 89 | |
---|
| 90 | #include "G4VisManager.hh" |
---|
| 91 | |
---|
| 92 | class G4VisExecutive: public G4VisManager { |
---|
| 93 | |
---|
| 94 | public: // With description |
---|
| 95 | |
---|
| 96 | G4VisExecutive (); |
---|
| 97 | |
---|
| 98 | private: |
---|
| 99 | |
---|
| 100 | void RegisterGraphicsSystems(); |
---|
| 101 | void RegisterModelFactories(); |
---|
| 102 | |
---|
| 103 | }; |
---|
| 104 | |
---|
| 105 | #include "G4VisExecutive.icc" |
---|
| 106 | |
---|
| 107 | #endif |
---|