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 // Created: Mar. 31, 2009 Akinori Kimura 00031 // 00032 // G4GMocrenTouchable class 00033 // is used to get densities of each box cell of patient geometry 00034 // defined by using the nest parameterisation. 00035 // 00036 #ifndef G4GMOCRENTOUCHABLE_HH 00037 #define G4GMOCRENTOUCHABLE_HH 00038 00039 #include "G4VTouchable.hh" 00040 00041 class G4GMocrenTouchable : public G4VTouchable { 00042 00043 public: // with description 00044 00045 G4GMocrenTouchable() {;} 00046 G4GMocrenTouchable(G4int & _depth0, G4int & _depth1); 00047 virtual ~G4GMocrenTouchable() {;} 00048 // Constructor and destructor. 00049 00050 virtual const G4ThreeVector& GetTranslation(G4int depth=0) const; 00051 virtual const G4RotationMatrix* GetRotation(G4int depth=0) const; 00052 // Accessors for translation and rotation. 00053 00054 virtual G4int GetReplicaNumber(G4int depth=0) const; 00055 // Methods for touchables with history. 00056 00057 void SetReplicaNumber(G4int _depth0, G4int _depth1); 00058 00059 private: 00060 G4int repno[2]; 00061 }; 00062 00063 inline 00064 G4GMocrenTouchable::G4GMocrenTouchable(G4int & _depth0, G4int & _depth1) { 00065 repno[0] = _depth0; 00066 repno[1] = _depth1; 00067 } 00068 00069 const G4ThreeVector& G4GMocrenTouchable::GetTranslation(G4int depth) const { 00070 // never used 00071 // in the purpose to avoid a warning in the compile process 00072 G4ThreeVector * vec = new G4ThreeVector(); 00073 *vec *= static_cast<G4double>(depth); 00074 return *vec; 00075 } 00076 const G4RotationMatrix* G4GMocrenTouchable::GetRotation(G4int depth) const { 00077 // never used 00078 // in the puspose to avoid a warning in the compile process 00079 G4RotationMatrix * rot = new G4RotationMatrix(); 00080 rot->setPhi(static_cast<G4double>(depth)); 00081 return rot; 00082 } 00083 inline 00084 G4int G4GMocrenTouchable::GetReplicaNumber(G4int depth) const { 00085 if(depth > 1) { 00086 G4Exception("G4GMocrenTouchable::GetReplicaNumber(G4int)", "gMocren0001", 00087 FatalException, "depth number is less than 2."); 00088 } 00089 G4int rvalue; 00090 if(depth < 2) rvalue = depth; 00091 else rvalue = 0; 00092 return rvalue; 00093 } 00094 00095 00096 #endif