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 G4VTrajectoryPoint which represents a point where 00034 // a ray crosses upon a surface of a volume regardless of its visibility. Objects 00035 // of this class are created by G4RayTrajectory class object. 00036 // 00037 00039 //G4RayTrajectoryPoint.hh 00041 00042 #ifndef G4RayTrajectoryPoint_h 00043 #define G4RayTrajectoryPoint_h 1 00044 00045 class G4VisAttributes; 00046 #include "globals.hh" 00047 #include "G4VTrajectoryPoint.hh" 00048 #include "G4Allocator.hh" 00049 #include "G4ThreeVector.hh" 00050 00051 class G4RayTrajectoryPoint :public G4VTrajectoryPoint 00052 { 00053 public: 00054 G4RayTrajectoryPoint(); 00055 virtual ~G4RayTrajectoryPoint(); 00056 00057 inline void *operator new(size_t); 00058 inline void operator delete(void *aTrajectoryPoint); 00059 // inline int operator==(const G4RayTrajectoryPoint& right) const 00060 // { return (this==&right); }; 00061 00062 private: 00063 const G4VisAttributes* preStepAtt; 00064 const G4VisAttributes* postStepAtt; 00065 G4ThreeVector surfaceNormal; 00066 G4double stepLength; 00067 00068 public: 00069 inline void SetPreStepAtt(const G4VisAttributes* val) { preStepAtt = val; } 00070 inline const G4VisAttributes* GetPreStepAtt() const { return preStepAtt; } 00071 inline void SetPostStepAtt(const G4VisAttributes* val) { postStepAtt = val; } 00072 inline const G4VisAttributes* GetPostStepAtt() const { return postStepAtt; } 00073 inline void SetSurfaceNormal(G4ThreeVector val) { surfaceNormal = val; } 00074 inline G4ThreeVector GetSurfaceNormal() const { return surfaceNormal; } 00075 inline void SetStepLength(G4double val) { stepLength = val; } 00076 inline G4double GetStepLength() const { return stepLength; } 00077 00078 inline const G4ThreeVector GetPosition() const { return G4ThreeVector();} 00079 // Dummy function (not used) to satisfy base class pure virtual function. 00080 }; 00081 00082 #if defined G4VIS_ALLOC_EXPORT 00083 extern G4DLLEXPORT G4Allocator<G4RayTrajectoryPoint> G4RayTrajectoryPointAllocator; 00084 #else 00085 extern G4DLLIMPORT G4Allocator<G4RayTrajectoryPoint> G4RayTrajectoryPointAllocator; 00086 #endif 00087 00088 inline void* G4RayTrajectoryPoint::operator new(size_t) 00089 { 00090 void *aTrajectoryPoint; 00091 aTrajectoryPoint = (void *) G4RayTrajectoryPointAllocator.MallocSingle(); 00092 return aTrajectoryPoint; 00093 } 00094 00095 inline void G4RayTrajectoryPoint::operator delete(void *aTrajectoryPoint) 00096 { 00097 G4RayTrajectoryPointAllocator.FreeSingle((G4RayTrajectoryPoint *) aTrajectoryPoint); 00098 } 00099 00100 #endif 00101