00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // class G4NavigationLevelRep 00030 // 00031 // Class description: 00032 // 00033 // A data representation class, used to hold the data for a single level 00034 // of the Navigation history tree. 00035 // 00036 // This is the body of a handle/body pair of classes, that implement 00037 // reference counting for NavigationLevels. 00038 // The corresponding handle class is G4NavigationLevel 00039 00040 // History: 00041 // 00042 // - 1 October 1997, J.Apostolakis: initial version. 00043 // ---------------------------------------------------------------------- 00044 #ifndef G4NAVIGATIONLEVELREP_HH 00045 #define G4NAVIGATIONLEVELREP_HH 00046 00047 #include "G4Types.hh" 00048 00049 #include "G4AffineTransform.hh" 00050 #include "G4VPhysicalVolume.hh" 00051 #include "G4Allocator.hh" 00052 00053 class G4NavigationLevelRep 00054 { 00055 00056 public: // with description 00057 00058 G4NavigationLevelRep( G4VPhysicalVolume* newPtrPhysVol, 00059 const G4AffineTransform& newT, 00060 EVolume newVolTp, 00061 G4int newRepNo= -1 ); 00062 00063 G4NavigationLevelRep( G4VPhysicalVolume* newPtrPhysVol, 00064 const G4AffineTransform& levelAbove, 00065 const G4AffineTransform& relativeCurrent, 00066 EVolume newVolTp, 00067 G4int newRepNo= -1 ); 00068 // As the previous constructor, but instead of giving Transform, give 00069 // the AffineTransform to the level above and the current level's 00070 // Transform relative to that. 00071 00072 G4NavigationLevelRep(); 00073 G4NavigationLevelRep( G4NavigationLevelRep& ); 00074 00075 ~G4NavigationLevelRep(); 00076 00077 G4NavigationLevelRep& operator=(const G4NavigationLevelRep &right); 00078 00079 inline G4VPhysicalVolume* GetPhysicalVolume(); 00080 00081 inline const G4AffineTransform* GetTransformPtr() const ; // New 00082 inline const G4AffineTransform& GetTransform() const ; // Old 00083 00084 inline EVolume GetVolumeType() const ; 00085 inline G4int GetReplicaNo() const ; 00086 00087 inline void AddAReference(); 00088 inline G4bool RemoveAReference(); 00089 // Take care of the reference counts. 00090 00091 inline void *operator new(size_t); 00092 // Override "new" to use "G4Allocator". 00093 inline void operator delete(void *aTrack); 00094 // Override "delete" to use "G4Allocator". 00095 00096 private: 00097 00098 G4AffineTransform sTransform; 00099 // Compounded global->local transformation (takes a point in the 00100 // global reference system to the system of the volume at this level) 00101 00102 G4VPhysicalVolume* sPhysicalVolumePtr; 00103 // Physical volume ptrs, for this level's volume 00104 00105 G4int sReplicaNo; 00106 EVolume sVolumeType; 00107 // Volume `type' 00108 00109 G4int fCountRef; 00110 00111 }; 00112 00113 #include "G4NavigationLevelRep.icc" 00114 00115 #endif