File indexing completed on 2025-01-31 09:22:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef TETModelImport_h
0032 #define TETModelImport_h 1
0033
0034 #include <stdlib.h>
0035 #include <fstream>
0036 #include <sstream>
0037 #include <iomanip>
0038 #include <vector>
0039 #include <map>
0040
0041 #include "G4UIExecutive.hh"
0042 #include "G4SystemOfUnits.hh"
0043 #include "G4PhysicalConstants.hh"
0044 #include "G4ThreeVector.hh"
0045 #include "G4String.hh"
0046 #include "G4Tet.hh"
0047 #include "G4NistManager.hh"
0048 #include "G4Material.hh"
0049 #include "G4Colour.hh"
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 class TETModelImport
0066 {
0067 public:
0068 TETModelImport(G4bool isAF, G4UIExecutive* ui);
0069 virtual ~TETModelImport() {};
0070
0071
0072 G4String GetPhantomName() { return fPhantomName; };
0073 G4Material* GetMaterial(G4int idx) { return fMaterialMap[idx];}
0074 G4int GetNumTetrahedron() { return fTetVector.size();}
0075 G4int GetMaterialIndex(G4int idx){ return fMaterialVector[idx]; }
0076 G4Tet* GetTetrahedron(G4int idx) { return fTetVector[idx]; }
0077 G4double GetVolume(G4int idx) { return fVolumeMap[idx]; }
0078 std::map<G4int, G4double> GetMassMap() { return fMassMap; }
0079 std::map<G4int, G4Colour> GetColourMap() { return fColourMap; }
0080 G4ThreeVector GetPhantomSize() { return fPhantomSize; }
0081 G4ThreeVector GetPhantomBoxMin() { return fBoundingBox_Min; }
0082 G4ThreeVector GetPhantomBoxMax() { return fBoundingBox_Max; }
0083
0084 private:
0085
0086 void DataRead(G4String, G4String);
0087 void MaterialRead(G4String);
0088 void ColourRead();
0089 void PrintMaterialInfomation();
0090
0091 G4String fPhantomDataPath;
0092 G4String fPhantomName;
0093
0094 G4ThreeVector fBoundingBox_Min;
0095 G4ThreeVector fBoundingBox_Max;
0096 G4ThreeVector fPhantomSize;
0097
0098 std::vector<G4ThreeVector> fVertexVector;
0099 std::vector<G4Tet*> fTetVector;
0100 std::vector<G4int*> fEleVector;
0101 std::vector<G4int> fMaterialVector;
0102 std::map<G4int, G4int> fNumTetMap;
0103 std::map<G4int, G4double> fVolumeMap;
0104 std::map<G4int, G4double> fMassMap;
0105 std::map<G4int, G4Colour> fColourMap;
0106
0107 std::map<G4int, std::vector<std::pair<G4int, G4double>>> fMaterialIndexMap;
0108 std::vector<G4int> fMaterialIndex;
0109 std::map<G4int, G4Material*> fMaterialMap;
0110 std::map<G4int, G4double> fDensityMap;
0111 std::map<G4int, G4String> fOrganNameMap;
0112 };
0113
0114 #endif