|
||||
File indexing completed on 2025-01-18 09:59:25
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 31st December 1997. 0030 // 0031 // Class Description: 0032 // 0033 // G4VModel is a base class for visualization models. A model is a 0034 // graphics-system-indepedent description of a Geant4 component. 0035 // The key fuctionality of a model is to know how to describe itself 0036 // to a scene handler. A scene is a collection of models. 0037 0038 #ifndef G4VMODEL_HH 0039 #define G4VMODEL_HH 0040 0041 #include "globals.hh" 0042 #include "G4VisExtent.hh" 0043 0044 class G4VGraphicsScene; 0045 class G4ModelingParameters; 0046 0047 class G4VModel { 0048 0049 public: // With description 0050 0051 friend std::ostream& operator << (std::ostream& os, const G4VModel&); 0052 0053 G4VModel(const G4ModelingParameters* = 0); 0054 0055 virtual ~G4VModel (); 0056 0057 virtual void DescribeYourselfTo (G4VGraphicsScene&) = 0; 0058 // The main task of a model is to describe itself to the graphics scene. 0059 0060 const G4ModelingParameters* GetModelingParameters () const; 0061 0062 const G4String& GetType() const; 0063 // The sub-class should set its type, which could be the class 0064 // name, or, in the case of G4CallBackModel, it could be the type of 0065 // object it is coding. 0066 0067 virtual G4String GetCurrentDescription () const; 0068 // A description which depends on the current state of the model. 0069 0070 virtual G4String GetCurrentTag () const; 0071 // A tag which depends on the current state of the model. 0072 0073 const G4VisExtent& GetExtent () const; 0074 // Extent of visible objects in local coordinate system. 0075 0076 const G4String& GetGlobalDescription () const; 0077 // A description which does not change and lasts the life of the model. 0078 0079 const G4String& GetGlobalTag () const; 0080 // A tag which does not change and lasts the life of the model. 0081 0082 // Set methods for above... 0083 void SetModelingParameters (const G4ModelingParameters*); 0084 void SetExtent (const G4VisExtent&); 0085 void SetType (const G4String&); 0086 void SetGlobalDescription (const G4String&); 0087 void SetGlobalTag (const G4String&); 0088 0089 virtual G4bool Validate (G4bool warn = true); 0090 // Validate, but allow internal changes (hence non-const function). 0091 0092 protected: 0093 0094 G4String fType; 0095 G4String fGlobalTag; 0096 G4String fGlobalDescription; 0097 G4VisExtent fExtent; 0098 const G4ModelingParameters* fpMP; 0099 0100 private: 0101 0102 // Private copy constructor and assigment operator - copying and 0103 // assignment not allowed. Keeps CodeWizard happy. 0104 G4VModel (const G4VModel&); 0105 G4VModel& operator = (const G4VModel&); 0106 }; 0107 0108 #include "G4VModel.icc" 0109 0110 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |