Geant4  10.01.p02
DicomNestedPhantomParameterisation.hh
Go to the documentation of this file.
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 //
26 //$Id: DicomNestedPhantomParameterisation.hh 84839 2014-10-21 13:44:55Z gcosmo $
27 //
30 //
31 
32 #ifndef DICOMNESTEDPARAMETERISATION_HH
33 #define DICOMNESTEDPARAMETERISATION_HH
34 
35 #include <vector>
36 #include <map>
37 
38 #include "G4Types.hh"
39 #include "G4ThreeVector.hh"
41 
42 class G4VPhysicalVolume;
43 class G4VTouchable;
44 class G4VSolid;
45 class G4Material;
46 class G4VisAttributes;
47 
48 // CSG Entities which may be parameterised/replicated
49 //
50 class G4Box;
51 class G4Tubs;
52 class G4Trd;
53 class G4Trap;
54 class G4Cons;
55 class G4Sphere;
56 class G4Ellipsoid;
57 class G4Orb;
58 class G4Torus;
59 class G4Para;
60 class G4Polycone;
61 class G4Polyhedra;
62 class G4Hype;
63 
65 
67 {
68 public:
69 
71  std::vector<G4Material*>& mat,
72  G4int fnZ_ = 0, G4int fnY_ = 0, G4int fnX_ = 0);
74 
76  const G4int repNo,
77  const G4VTouchable *parentTouch );
78  // Must cope with parentTouch for navigator's SetupHierarchy
79 
81  G4Material* GetMaterial(G4int idx) const;
82  // Needed to define materials for instances of Nested Parameterisation
83  // Current convention: each call should return the materials
84  // of all instances with the same mother/ancestor volume
85 
86  unsigned int GetMaterialIndex( unsigned int nx, unsigned int ny, unsigned int nz) const;
87  unsigned int GetMaterialIndex( unsigned int copyNo) const;
88  void SetMaterialIndices( size_t* matInd ) { fMaterialIndices = matInd; }
89  void SetNoVoxel( unsigned int nx, unsigned int ny, unsigned int nz );
90 
91  void ComputeTransformation(const G4int no,
92  G4VPhysicalVolume *currentPV) const;
93 
94  // Additional standard Parameterisation methods,
95  // which can be optionally defined, in case solid is used.
96 
97  void ComputeDimensions(G4Box &, const G4int,
98  const G4VPhysicalVolume *) const;
99 
100 
101 private: // Dummy declarations to get rid of warnings ...
102 
104  const G4VPhysicalVolume*) const {}
106  const G4VPhysicalVolume*) const {}
108  const G4VPhysicalVolume*) const {}
110  const G4VPhysicalVolume*) const {}
112  const G4VPhysicalVolume*) const {}
114  const G4VPhysicalVolume*) const {}
116  const G4VPhysicalVolume*) const {}
118  const G4VPhysicalVolume*) const {}
120  const G4VPhysicalVolume*) const {}
122  const G4VPhysicalVolume*) const {}
124  const G4VPhysicalVolume*) const {}
126  const G4VPhysicalVolume*) const {}
127 
128  void ReadColourData();
129 
131 
132 private:
133 
136  std::vector<G4Material*> fMaterials;
137  size_t* fMaterialIndices; // Index in materials corresponding to each voxel
138  std::map<G4String,G4VisAttributes*> fColours;
139  std::vector<G4double> fpZ;
140 };
141 #endif
virtual G4Material * ComputeMaterial(G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch=0)=0
void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
Definition: G4Para.hh:77
void ComputeTransformation(const G4int no, G4VPhysicalVolume *currentPV) const
void ComputeDimensions(G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const
CLHEP::Hep3Vector G4ThreeVector
void ComputeDimensions(G4Trap &, const G4int, const G4VPhysicalVolume *) const
Definition: G4Box.hh:64
unsigned int GetMaterialIndex(unsigned int nx, unsigned int ny, unsigned int nz) const
Definition: G4Tubs.hh:85
Definition: G4Trd.hh:72
void ComputeDimensions(G4Trd &, const G4int, const G4VPhysicalVolume *) const
void ComputeDimensions(G4Torus &, const G4int, const G4VPhysicalVolume *) const
int G4int
Definition: G4Types.hh:78
void ComputeDimensions(G4Polycone &, const G4int, const G4VPhysicalVolume *) const
void ComputeDimensions(G4Tubs &, const G4int, const G4VPhysicalVolume *) const
Definition: G4Hype.hh:67
std::map< G4String, G4VisAttributes * > fColours
Definition: G4Cons.hh:83
Definition: G4Orb.hh:61
void ComputeDimensions(G4Para &, const G4int, const G4VPhysicalVolume *) const
void ComputeDimensions(G4Sphere &, const G4int, const G4VPhysicalVolume *) const
void ComputeDimensions(G4Orb &, const G4int, const G4VPhysicalVolume *) const
void SetNoVoxel(unsigned int nx, unsigned int ny, unsigned int nz)
void ComputeDimensions(G4Hype &, const G4int, const G4VPhysicalVolume *) const
DicomNestedPhantomParameterisation(const G4ThreeVector &voxelSize, std::vector< G4Material * > &mat, G4int fnZ_=0, G4int fnY_=0, G4int fnX_=0)
double G4double
Definition: G4Types.hh:76
void ComputeDimensions(G4Cons &, const G4int, const G4VPhysicalVolume *) const
G4Material * ComputeMaterial(G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch)
Implements a G4VNestedParameterisation.
void ComputeDimensions(G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const