[807] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
[1230] | 26 | // $Id: DicomNestedPhantomParameterisation.hh,v 1.3 2009/01/27 10:44:58 gcosmo Exp $ |
---|
| 27 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
| 28 | // |
---|
| 29 | // -------------------------------------------------------------------- |
---|
| 30 | #ifndef DICOMNESTEDPARAMETERISATION_HH |
---|
| 31 | #define DICOMNESTEDPARAMETERISATION_HH |
---|
[807] | 32 | |
---|
[1230] | 33 | #include <vector> |
---|
| 34 | |
---|
[807] | 35 | #include "G4Types.hh" |
---|
[1230] | 36 | #include "G4ThreeVector.hh" |
---|
[807] | 37 | #include "G4VNestedParameterisation.hh" |
---|
| 38 | |
---|
| 39 | class G4VPhysicalVolume; |
---|
| 40 | class G4VTouchable; |
---|
| 41 | class G4VSolid; |
---|
| 42 | class G4Material; |
---|
| 43 | |
---|
| 44 | // CSG Entities which may be parameterised/replicated |
---|
| 45 | // |
---|
| 46 | class G4Box; |
---|
| 47 | class G4Tubs; |
---|
| 48 | class G4Trd; |
---|
| 49 | class G4Trap; |
---|
| 50 | class G4Cons; |
---|
| 51 | class G4Sphere; |
---|
| 52 | class G4Orb; |
---|
| 53 | class G4Torus; |
---|
| 54 | class G4Para; |
---|
| 55 | class G4Polycone; |
---|
| 56 | class G4Polyhedra; |
---|
| 57 | class G4Hype; |
---|
| 58 | |
---|
[1230] | 59 | class DicomNestedPhantomParameterisation : public G4VNestedParameterisation |
---|
[807] | 60 | { |
---|
[1230] | 61 | public: |
---|
[807] | 62 | |
---|
| 63 | DicomNestedPhantomParameterisation(const G4ThreeVector& voxelSize, |
---|
[1230] | 64 | std::vector<G4Material*>& mat); |
---|
[807] | 65 | virtual ~DicomNestedPhantomParameterisation(); |
---|
| 66 | |
---|
[1230] | 67 | G4Material* ComputeMaterial(G4VPhysicalVolume *currentVol, |
---|
| 68 | const G4int repNo, |
---|
| 69 | const G4VTouchable *parentTouch ); |
---|
| 70 | // Must cope with parentTouch for navigator's SetupHierarchy |
---|
[807] | 71 | |
---|
[1230] | 72 | G4int GetNumberOfMaterials() const; |
---|
| 73 | G4Material* GetMaterial(G4int idx) const; |
---|
[807] | 74 | // Needed to define materials for instances of Nested Parameterisation |
---|
[1230] | 75 | // Current convention: each call should return the materials |
---|
| 76 | // of all instances with the same mother/ancestor volume |
---|
| 77 | |
---|
[807] | 78 | size_t GetMaterialIndex( size_t nx, size_t ny, size_t nz) const; |
---|
| 79 | size_t GetMaterialIndex( size_t copyNo) const; |
---|
[1230] | 80 | void SetMaterialIndices( size_t* matInd ) { fMaterialIndices = matInd; } |
---|
[807] | 81 | void SetNoVoxel( size_t nx, size_t ny, size_t nz ); |
---|
| 82 | |
---|
[1230] | 83 | void ComputeTransformation(const G4int no, |
---|
| 84 | G4VPhysicalVolume *currentPV) const; |
---|
[807] | 85 | |
---|
| 86 | // Additional standard Parameterisation methods, |
---|
[1230] | 87 | // which can be optionally defined, in case solid is used. |
---|
[807] | 88 | |
---|
[1230] | 89 | void ComputeDimensions(G4Box &, const G4int, |
---|
| 90 | const G4VPhysicalVolume *) const; |
---|
[807] | 91 | |
---|
[1230] | 92 | private: // Dummy declarations to get rid of warnings ... |
---|
[807] | 93 | |
---|
[1230] | 94 | void ComputeDimensions (G4Trd&, const G4int, |
---|
| 95 | const G4VPhysicalVolume*) const {} |
---|
| 96 | void ComputeDimensions (G4Trap&, const G4int, |
---|
| 97 | const G4VPhysicalVolume*) const {} |
---|
| 98 | void ComputeDimensions (G4Cons&, const G4int, |
---|
| 99 | const G4VPhysicalVolume*) const {} |
---|
| 100 | void ComputeDimensions (G4Sphere&, const G4int, |
---|
| 101 | const G4VPhysicalVolume*) const {} |
---|
| 102 | void ComputeDimensions (G4Orb&, const G4int, |
---|
| 103 | const G4VPhysicalVolume*) const {} |
---|
| 104 | void ComputeDimensions (G4Torus&, const G4int, |
---|
| 105 | const G4VPhysicalVolume*) const {} |
---|
| 106 | void ComputeDimensions (G4Para&, const G4int, |
---|
| 107 | const G4VPhysicalVolume*) const {} |
---|
| 108 | void ComputeDimensions (G4Hype&, const G4int, |
---|
| 109 | const G4VPhysicalVolume*) const {} |
---|
| 110 | void ComputeDimensions (G4Tubs&, const G4int, |
---|
| 111 | const G4VPhysicalVolume*) const {} |
---|
| 112 | void ComputeDimensions (G4Polycone&, const G4int, |
---|
| 113 | const G4VPhysicalVolume*) const {} |
---|
| 114 | void ComputeDimensions (G4Polyhedra&, const G4int, |
---|
| 115 | const G4VPhysicalVolume*) const {} |
---|
[807] | 116 | |
---|
[1230] | 117 | private: |
---|
| 118 | |
---|
| 119 | G4double fdX,fdY,fdZ; |
---|
| 120 | G4int fnX,fnY,fnZ; |
---|
| 121 | std::vector<G4Material*> fMaterials; |
---|
| 122 | size_t* fMaterialIndices; // Index in materials corresponding to each voxel |
---|
[807] | 123 | }; |
---|
| 124 | |
---|
| 125 | #endif |
---|