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 // 00030 00031 // class description: 00032 // 00033 // This is a concrete class of G4VTrajectory which represents a trajectory of a ray. 00034 // This class is used by G4RayTracer. Objects of this class are created by G4RTTrackingAction. 00035 // This class does not have concrete implementations of draw and print methods but 00036 // information stored in this class is used by determining a colour of a pixel of the picture. 00037 // 00038 00040 //G4RayTrajectory.hh 00042 00043 #ifndef G4RayTrajectory_h 00044 #define G4RayTrajectory_h 1 00045 00046 class G4Step; 00047 00048 #include "G4VTrajectory.hh" 00049 #include "G4Allocator.hh" 00050 #include <stdlib.h> 00051 #include <vector> 00052 #include "globals.hh" 00053 #include "G4Track.hh" 00054 #include "G4RayTrajectoryPoint.hh" 00055 00056 00057 class G4RayTrajectory : public G4VTrajectory 00058 { 00059 public: 00060 00061 G4RayTrajectory(); 00062 G4RayTrajectory(G4RayTrajectory & right); 00063 virtual ~G4RayTrajectory(); 00064 00065 private: 00066 00067 G4RayTrajectory& operator= (const G4RayTrajectory&); 00068 00069 public: 00070 00071 inline void* operator new(size_t); 00072 inline void operator delete(void*); 00073 // inline int operator == (const G4RayTrajectory& right){return (this==&right);} 00074 00075 virtual void AppendStep(const G4Step*); 00076 virtual void ShowTrajectory(std::ostream&) const; 00077 virtual void DrawTrajectory() const {;} 00078 virtual void DrawTrajectory(G4int) const {;} 00079 virtual int GetPointEntries() const {return positionRecord->size();} 00080 virtual G4VTrajectoryPoint* GetPoint(G4int i) const 00081 { return (*positionRecord)[i]; } 00082 G4RayTrajectoryPoint* GetPointC(G4int i) const 00083 { return (*positionRecord)[i]; } 00084 virtual void MergeTrajectory(G4VTrajectory* secondTrajectory); 00085 00086 // Get/Set functions to satisfy pure virtual functions of base class. 00087 inline G4int GetTrackID() const { return 0; } 00088 inline G4int GetParentID() const { return 0; } 00089 inline G4String GetParticleName() const { return ""; } 00090 inline G4double GetCharge() const { return 0.; } 00091 inline G4int GetPDGEncoding() const { return 0; } 00092 inline G4ThreeVector GetInitialMomentum() const { return G4ThreeVector(); } 00093 00094 private: 00095 00096 std::vector<G4RayTrajectoryPoint*>* positionRecord; 00097 }; 00098 00099 #if defined G4VIS_ALLOC_EXPORT 00100 extern G4DLLEXPORT G4Allocator<G4RayTrajectory> G4RayTrajectoryAllocator; 00101 #else 00102 extern G4DLLIMPORT G4Allocator<G4RayTrajectory> G4RayTrajectoryAllocator; 00103 #endif 00104 00105 inline void* G4RayTrajectory::operator new(size_t) 00106 { 00107 void* aTrajectory; 00108 aTrajectory = (void*)G4RayTrajectoryAllocator.MallocSingle(); 00109 return aTrajectory; 00110 } 00111 00112 inline void G4RayTrajectory::operator delete(void* aTrajectory) 00113 { 00114 G4RayTrajectoryAllocator.FreeSingle((G4RayTrajectory*)aTrajectory); 00115 } 00116 00117 00118 #endif 00119