|
||||
File indexing completed on 2025-01-18 09:59:23
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 // 0027 // 0028 // 0029 // John Allison 2nd February 2005 (based on MyVisManager, 24th January 1998). 0030 // 0031 // Class description 0032 // 0033 // Concrete Visualization Manager that implements the virtual 0034 // functions RegisterGraphicsSystems and RegisterModelFactories. This 0035 // is executed when you Initialise() or Initialize() the vis manager. 0036 // It exploits C-pre-processor variables G4VIS_USE_DAWN, etc., which 0037 // are set by the GNUmakefiles if environment variables of the same 0038 // name are set. 0039 // 0040 // Include this file and write code to instantiate G4VisExecutive just 0041 // once at beginning of operations. Before you compile, set 0042 // appropriate environment variables (usually using "./Configure"). 0043 // If you change your environment you must force recompilation (the 0044 // make files will not detect the need to do this). 0045 // 0046 // Typically, your main program file will contain: 0047 // 0048 // #ifdef G4VIS_USE 0049 // #include "G4VisExecutive.hh" 0050 // #endif 0051 // ... 0052 // int main() { 0053 // ... 0054 // #ifdef G4VIS_USE 0055 // // Instantiate and initialise Visualization Manager. 0056 // G4VisManager* visManager = new G4VisExecutive; // See Note (a). 0057 // visManager -> SetVerboseLevel (verbosityString); // See Note (b). 0058 // visManager -> RegisterGraphicsSystem (new myGS); // See Note (c). 0059 // visManager -> Initialize (); // See Note (d). 0060 // #endif 0061 // ... 0062 // #ifdef G4VIS_USE 0063 // G4cout << "Deleting vis manager..." << G4endl; 0064 // delete visManager; 0065 // G4cout << "Vis manager deleted." << G4endl; 0066 // #endif 0067 // 0068 // Notes: 0069 // (a) After instantiation, all references to this object should be as 0070 // a G4VisManager. The functions RegisterGraphicsSystems and 0071 // RegisterModelFactories defined in G4VisExecutive.icc are 0072 // virtual functions of G4VisManager. They are invoked by 0073 // G4VisManager::Initialise. If you need to initialise in a 0074 // separate file, see advice below. 0075 // (b) The verbosityString ("quiet", "errors", "warnings", 0076 // "confirmations", etc. - "help /vis/verbose" to see options) can be 0077 // set here or with /vis/verbose. Alternatively, you can instantiate 0078 // with a verbosity string. e.g: 0079 // G4VisManager* visManager = new G4VisExecutive("quiet"); 0080 // (c) You can register your own graphics system like this. 0081 // (d) Your can intialise like this with C++ code or use /vis/initialize. 0082 // 0083 // If you need to perform the instantiation and the initialisation in 0084 // separate files, e.g., to establish the verbosity before 0085 // initialisation, then the code that initialises must have access, of 0086 // course, to the G4VisExecutive object, but this should be as a 0087 // G4VisManager object, i.e., #include "G4VisManager.hh". 0088 // RegisterGraphicsSystems and RegisterModelFactories are (pure) 0089 // virtual methods of G4VisManager called from G4VisManager::Initialize. 0090 // First file: 0091 // #include "G4VisExecutive.hh" 0092 // ... 0093 // fpVisManager = new G4VisExecutive; 0094 // where fpVisManager is a G4VisManager*. 0095 // Second file: 0096 // #include "G4VisManager.hh" 0097 // ... 0098 // fpVisManager -> Initialize (); 0099 // where there is some mechanism for getting access to the pointer 0100 // fpVisManager. 0101 // 0102 // The implementation is included as an .icc file because - for those 0103 // graphics systems that need external libraries - only those systems 0104 // that have been selected by the flags may be instantiated without 0105 // causing unresolved references (only the user knows which libraries 0106 // are available on his/her computer). It also ensures that libraries 0107 // can be linked in the right order, without circular dependencies. 0108 // (Note that some graphics systems, notable those that write files 0109 // for off-line viewing, do not suffer these restrictions and are 0110 // always registered.) 0111 // 0112 // See class description of G4VisManager for more details. 0113 0114 #ifndef G4VISEXECUTIVE_HH 0115 #define G4VISEXECUTIVE_HH 0116 0117 #include "G4VisManager.hh" 0118 0119 class G4VisExecutive: public G4VisManager { 0120 0121 public: // With description 0122 0123 G4VisExecutive(const G4String& verbosityString = "warnings"); 0124 G4VisExecutive(int argc, char** argv, const G4String& system = "", 0125 const G4String& verbosityString = "warnings"); 0126 0127 private: 0128 0129 void SetDefaultsByArgument(const G4String& system); 0130 void SetDefaultsByEnvironment(); 0131 void SetDefaultsByFile(int argc, char** argv); 0132 void SetDefaultsByBatch(); 0133 void SetDefaultsByBuildFlags(); 0134 G4bool fSelected; 0135 0136 void RegisterGraphicsSystems(); 0137 void RegisterModelFactories(); 0138 0139 }; 0140 0141 #include "G4VisExecutive.icc" 0142 0143 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |