Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // >> 24 // $Id: G4VisExecutive.hh,v 1.5 2005/11/22 16:57:16 allison Exp $ >> 25 // GEANT4 tag $Name: geant4-08-00 $ 27 // 26 // 28 // 27 // 29 // John Allison 2nd February 2005 (based on My 28 // John Allison 2nd February 2005 (based on MyVisManager, 24th January 1998). 30 // 29 // 31 // Class description 30 // Class description 32 // 31 // 33 // Concrete Visualization Manager that impleme 32 // Concrete Visualization Manager that implements the virtual 34 // functions RegisterGraphicsSystems and Regis 33 // functions RegisterGraphicsSystems and RegisterModelFactories. This 35 // is executed when you Initialise() or Initia 34 // is executed when you Initialise() or Initialize() the vis manager. 36 // It exploits C-pre-processor variables G4VIS 35 // It exploits C-pre-processor variables G4VIS_USE_DAWN, etc., which 37 // are set by the GNUmakefiles if environment 36 // are set by the GNUmakefiles if environment variables of the same 38 // name are set. 37 // name are set. 39 // 38 // 40 // Include this file and write code to instant 39 // Include this file and write code to instantiate G4VisExecutive just 41 // once at beginning of operations. Before yo << 40 // once as beginning of operations. Before you compile, set 42 // appropriate environment variables (usually << 41 // appropriate environment variables. If you change your environment 43 // If you change your environment you must for << 42 // you must force recompilation (the make files will not detect the 44 // make files will not detect the need to do t << 43 // need to do this). Typically, your main program file will contain: 45 // << 46 // Typically, your main program file will cont << 47 // 44 // 48 // #ifdef G4VIS_USE 45 // #ifdef G4VIS_USE 49 // #include "G4VisExecutive.hh" 46 // #include "G4VisExecutive.hh" 50 // #endif 47 // #endif 51 // ... 48 // ... 52 // int main() { 49 // int main() { 53 // ... 50 // ... 54 // #ifdef G4VIS_USE 51 // #ifdef G4VIS_USE 55 // // Instantiate and initialise Visualizati 52 // // Instantiate and initialise Visualization Manager. 56 // G4VisManager* visManager = new G4VisExecu << 53 // G4VisManager* visManager = new G4VisExecutive; 57 // visManager -> SetVerboseLevel (verbosityS << 54 // // visManager -> SetVerboseLevel (verbosityString); 58 // visManager -> RegisterGraphicsSystem (new << 55 // // visManager -> RegisterGraphicsSystem (new G4XXX); 59 // visManager -> Initialize (); << 56 // visManager -> Initialize (); 60 // #endif 57 // #endif 61 // ... 58 // ... 62 // #ifdef G4VIS_USE 59 // #ifdef G4VIS_USE 63 // G4cout << "Deleting vis manager..." << G4 60 // G4cout << "Deleting vis manager..." << G4endl; 64 // delete visManager; 61 // delete visManager; 65 // G4cout << "Vis manager deleted." << G4end 62 // G4cout << "Vis manager deleted." << G4endl; 66 // #endif 63 // #endif 67 // 64 // 68 // Notes: << 69 // (a) After instantiation, all references to << 70 // a G4VisManager. The functions Register << 71 // RegisterModelFactories defined in G4Vis << 72 // virtual functions of G4VisManager. The << 73 // G4VisManager::Initialise. If you need << 74 // separate file, see advice below. << 75 // (b) The verbosityString ("quiet", "errors", << 76 // "confirmations", etc. - "help /vis/verb << 77 // set here or with /vis/verbose. Alterna << 78 // with a verbosity string. e.g: << 79 // G4VisManager* visManager = new G4VisE << 80 // (c) You can register your own graphics syst << 81 // (d) Your can intialise like this with C++ c << 82 // << 83 // If you need to perform the instantiation an << 84 // separate files, e.g., to establish the verb << 85 // initialisation, then the code that initiali << 86 // course, to the G4VisExecutive object, but t << 87 // G4VisManager object, i.e., #include "G4VisM << 88 // RegisterGraphicsSystems and RegisterModelFa << 89 // virtual methods of G4VisManager called from << 90 // First file: << 91 // #include "G4VisExecutive.hh" << 92 // ... << 93 // fpVisManager = new G4VisExecutive; << 94 // where fpVisManager is a G4VisManager*. << 95 // Second file: << 96 // #include "G4VisManager.hh" << 97 // ... << 98 // fpVisManager -> Initialize (); << 99 // where there is some mechanism for getting a << 100 // fpVisManager. << 101 // << 102 // The implementation is included as an .icc f 65 // The implementation is included as an .icc file because - for those 103 // graphics systems that need external librari << 66 // graphics systems that need external libraries - only those 104 // that have been selected by the flags may be << 67 // systems that have been selected by the flags may be instantiated 105 // causing unresolved references (only the use << 68 // without causing unresolved references (only the user knows which 106 // are available on his/her computer). It als << 69 // libraries are available on his/her computer). It also ensures 107 // can be linked in the right order, without c << 70 // that libraries can be linked in the right order, without circular 108 // (Note that some graphics systems, notable t << 71 // dependencies. (Note that some graphics systems, notable those 109 // for off-line viewing, do not suffer these r << 72 // that write files for off-line viewing, do not suffer these 110 // always registered.) << 73 // restrictions and are always registered.) Additional graphics >> 74 // systems, XXX say, can be individually registered before >> 75 // invocation of Initialise() with RegisterGraphicsSystem(new XXX). >> 76 // >> 77 // Alternatively, you can implement an empty function here and just >> 78 // register the systems you want in your main(), e.g.: >> 79 // G4VisManager* visManager = new G4VisExecutive; >> 80 // visManager -> RegisterGraphicsSystem (new MyGraphicsSystem); 111 // 81 // 112 // See class description of G4VisManager for m 82 // See class description of G4VisManager for more details. 113 83 114 #ifndef G4VISEXECUTIVE_HH 84 #ifndef G4VISEXECUTIVE_HH 115 #define G4VISEXECUTIVE_HH 85 #define G4VISEXECUTIVE_HH 116 86 117 #include "G4VisManager.hh" 87 #include "G4VisManager.hh" 118 88 119 class G4VisExecutive: public G4VisManager { 89 class G4VisExecutive: public G4VisManager { 120 90 121 public: // With description 91 public: // With description 122 92 123 G4VisExecutive(const G4String& verbosityStri << 93 G4VisExecutive (); 124 G4VisExecutive(int argc, char** argv, const << 125 const G4String& verbosityStri << 126 94 127 private: 95 private: 128 96 129 const G4String& GetDefaultGraphicsSystemName << 97 void RegisterGraphicsSystems(); 130 void SetDefaultsByArgument(const G4String& s << 98 void RegisterModelFactories(); 131 void SetDefaultsByEnvironment(); << 132 void SetDefaultsByFile(int argc, char** argv << 133 void SetDefaultsByBatch(); << 134 void SetDefaultsByBuildFlags(); << 135 int fUserArgc; << 136 char** fUserArgv; << 137 G4String fUserSpecifiedSystem; << 138 G4bool fSelected; << 139 << 140 void RegisterGraphicsSystems() override; << 141 void RegisterModelFactories() override; << 142 99 143 }; 100 }; 144 101 145 #include "G4VisExecutive.icc" 102 #include "G4VisExecutive.icc" 146 103 147 #endif 104 #endif 148 105