source: trunk/examples/extended/medical/DICOM/include/DicomNestedPhantomParameterisation.hh @ 1161

Last change on this file since 1161 was 807, checked in by garnier, 16 years ago

update

File size: 5.0 KB
Line 
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#ifndef RE02NESTEDPARAMETERISATION_HH
27#define RE02NESTEDPARAMETERISATION_HH
28
29#include "G4Types.hh"
30#include "G4VNestedParameterisation.hh"
31#include "G4ThreeVector.hh"
32#include <vector>
33
34class G4VPhysicalVolume;
35class G4VTouchable; 
36class G4VSolid;
37class G4Material;
38
39// CSG Entities which may be parameterised/replicated
40//
41class G4Box;
42class G4Tubs;
43class G4Trd;
44class G4Trap;
45class G4Cons;
46class G4Sphere;
47class G4Orb;
48class G4Torus;
49class G4Para;
50class G4Polycone;
51class G4Polyhedra;
52class G4Hype;
53
54class DicomNestedPhantomParameterisation: public G4VNestedParameterisation
55{
56  public:  // with description
57
58    DicomNestedPhantomParameterisation(const G4ThreeVector& voxelSize,
59                                      std::vector<G4Material*>& mat);
60    virtual ~DicomNestedPhantomParameterisation(); 
61
62    // Methods required in derived classes
63    // -----------------------------------
64    virtual G4Material* ComputeMaterial(G4VPhysicalVolume *currentVol,
65                                        const G4int repNo, 
66                                        const G4VTouchable *parentTouch=0
67                                        );
68  // Required method, as it is the reason for this class.
69  //   Must cope with parentTouch=0 for navigator's SetupHierarchy
70
71    virtual G4int       GetNumberOfMaterials() const;
72    virtual G4Material* GetMaterial(G4int idx) const;
73      // Needed to define materials for instances of Nested Parameterisation
74      //   Current convention: each call should return the materials
75      //   of all instances with the same mother/ancestor volume.
76    size_t GetMaterialIndex( size_t nx, size_t ny, size_t nz) const;
77    size_t GetMaterialIndex( size_t copyNo) const;
78    void SetMaterialIndices( size_t* matInd ){
79      fMaterialIndices = matInd; }
80    void SetNoVoxel( size_t nx, size_t ny, size_t nz );
81
82    virtual void ComputeTransformation(const G4int no,
83                                       G4VPhysicalVolume *currentPV) const;
84
85    // Methods optional in derived classes
86    // -----------------------------------
87
88    // Additional standard Parameterisation methods,
89    //   which can be optionally defined, in case solid is used.
90
91    virtual void ComputeDimensions(G4Box &,
92                                   const G4int,
93                                   const G4VPhysicalVolume *) const;
94
95private:  // Dummy declarations to get rid of warnings ...
96  void ComputeDimensions (G4Trd&,const G4int,const G4VPhysicalVolume*) 
97    const {}
98  void ComputeDimensions (G4Trap&,const G4int,const G4VPhysicalVolume*) 
99    const {}
100  void ComputeDimensions (G4Cons&,const G4int,const G4VPhysicalVolume*) 
101    const {}
102  void ComputeDimensions (G4Sphere&,const G4int,const G4VPhysicalVolume*) 
103    const {}
104  void ComputeDimensions (G4Orb&,const G4int,const G4VPhysicalVolume*) 
105    const {}
106  void ComputeDimensions (G4Torus&,const G4int,const G4VPhysicalVolume*) 
107    const {}
108  void ComputeDimensions (G4Para&,const G4int,const G4VPhysicalVolume*) 
109    const {}
110  void ComputeDimensions (G4Hype&,const G4int,const G4VPhysicalVolume*) 
111    const {}
112  void ComputeDimensions (G4Tubs&,const G4int,const G4VPhysicalVolume*) 
113    const {}
114  void ComputeDimensions (G4Polycone&,const G4int,const G4VPhysicalVolume*)
115    const {}
116  void ComputeDimensions (G4Polyhedra&,const G4int,const G4VPhysicalVolume*) 
117    const {}
118
119private:
120  G4double fdX,fdY,fdZ;
121  G4int fnX,fnY,fnZ;
122 
123  //
124  std::vector<G4Material*> fMaterials;
125
126  size_t* fMaterialIndices;
127      // Index in fMaterials that correspond to each voxel.
128};
129
130#endif
Note: See TracBrowser for help on using the repository browser.