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

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

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