- Timestamp:
- Nov 16, 2009, 5:03:28 PM (15 years ago)
- Location:
- trunk/source/visualization/modeling
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/modeling/GNUmakefile
r834 r1171 1 # $Id: GNUmakefile,v 1.1 1 2006/05/22 08:49:27allison Exp $1 # $Id: GNUmakefile,v 1.12 2009/11/04 12:44:39 allison Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for modeling library. John Allison, 31/12/1997. … … 32 32 CPPFLAGS += -I$(G4BASE)/particles/management/include 33 33 CPPFLAGS += -I$(G4BASE)/event/include 34 CPPFLAGS += -I$(G4BASE)/digits_hits/utils/include 34 35 CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include 35 36 CPPFLAGS += -I$(G4BASE)/digits_hits/digits/include -
trunk/source/visualization/modeling/History
r1140 r1171 1 $Id: History,v 1.11 4 2009/10/22 15:40:00allison Exp $1 $Id: History,v 1.115 2009/11/04 12:44:39 allison Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 21 21 --------------------------------------- 22 22 23 4th November 2009 John Allison 24 - G4PSHitsModel: 25 o Now intended as end-of-run model. 26 o Picks up hits from G4ScoringManager instead of event. 27 23 28 22nd October 2009 John Allison (modeling-V09-02-05 coworks greps-V09-02-02) 24 29 - Added G4PSHitsModel for gMocren driver. 30 - G4PhysicalVolumeModel.cc: Makes use of HepPolyhedronProcessor. 25 31 26 32 21st October 2009 John Allison (modeling-V09-02-04 coworks greps-V09-02-02) -
trunk/source/visualization/modeling/include/G4PSHitsModel.hh
r1141 r1171 25 25 // 26 26 // 27 // $Id: G4PSHitsModel.hh,v 1. 3 2009/10/22 07:35:06 akimuraExp $27 // $Id: G4PSHitsModel.hh,v 1.4 2009/11/04 12:44:39 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 39 39 #include "G4VModel.hh" 40 40 41 class G4VHit;41 template <typename T> class G4THitsMap; 42 42 43 43 class G4PSHitsModel: public G4VModel { … … 45 45 public: // With description 46 46 47 G4PSHitsModel ( );47 G4PSHitsModel (const G4String& requestedMapName = "all"); 48 48 49 49 virtual ~G4PSHitsModel (); … … 52 52 // The main task of a model is to describe itself to the graphics scene. 53 53 54 const G4 VHit* GetCurrentHit() const55 {return kpCurrentHit;}54 const G4THitsMap<G4double>* GetCurrentHits() const 55 {return fpCurrentHits;} 56 56 57 57 private: 58 58 59 const G4VHit* kpCurrentHit; 59 G4String fRequestedMapName; 60 const G4THitsMap<G4double>* fpCurrentHits; 60 61 }; 61 62 -
trunk/source/visualization/modeling/src/G4LogicalVolumeModel.cc
r1136 r1171 102 102 const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron (); 103 103 sceneHandler.BeginPrimitives (transform); 104 104 sceneHandler.AddPrimitive (polyhedron); 105 105 sceneHandler.EndPrimitives (); 106 106 } -
trunk/source/visualization/modeling/src/G4PSHitsModel.cc
r1141 r1171 25 25 // 26 26 // 27 // $Id: G4PSHitsModel.cc,v 1. 3 2009/10/22 07:35:06 akimuraExp $27 // $Id: G4PSHitsModel.cc,v 1.4 2009/11/04 12:44:39 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 38 38 #include "G4VGraphicsScene.hh" 39 39 #include "G4Event.hh" 40 #include "G4 THitsMap.hh"40 #include "G4ScoringManager.hh" 41 41 42 42 G4PSHitsModel::~G4PSHitsModel () {} 43 43 44 G4PSHitsModel::G4PSHitsModel ( ):45 kpCurrentHit(0)44 G4PSHitsModel::G4PSHitsModel (const G4String& requestedMapName): 45 fRequestedMapName(requestedMapName), fpCurrentHits(0) 46 46 { 47 47 fGlobalTag = "G4PSHitsModel for G4THitsMap<G4double> hits."; … … 51 51 void G4PSHitsModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler) 52 52 { 53 const G4Event* event = fpMP->GetEvent(); 54 if (event) { 55 G4HCofThisEvent * HCE = event->GetHCofThisEvent(); 56 if (HCE) { 57 G4int nHC = HCE -> GetCapacity (); 58 for (int iHC = 0; iHC < nHC; iHC++) { 59 G4THitsMap<G4double> * hits = dynamic_cast<G4THitsMap<G4double> *>(HCE -> GetHC (iHC)); 60 if(hits) sceneHandler.AddCompound (*hits); 61 53 G4ScoringManager* scoringManager = 54 G4ScoringManager::GetScoringManagerIfExist(); 55 if (scoringManager) { 56 size_t nMeshes = scoringManager->GetNumberOfMesh(); 57 for (size_t i = 0; i < nMeshes; ++i) { 58 G4VScoringMesh* mesh = scoringManager->GetMesh(i); 59 if (mesh && mesh->IsActive()) { 60 MeshScoreMap scoreMap = mesh->GetScoreMap(); 61 for(MeshScoreMap::const_iterator i = scoreMap.begin(); 62 i != scoreMap.end(); ++i) { 63 const G4String& name = i->first; 64 if (fRequestedMapName == "all" || name == fRequestedMapName) { 65 fpCurrentHits = i->second; 66 //G4cout << name << ": " << fpCurrentHits << G4endl; 67 if (fpCurrentHits) sceneHandler.AddCompound(*fpCurrentHits); 68 } 69 } 62 70 } 63 71 } -
trunk/source/visualization/modeling/src/G4PhysicalVolumeModel.cc
r1140 r1171 740 740 741 741 values->push_back(G4AttValue("PVPath", oss.str(),"")); 742 if (fpCurrentLV) { 743 values->push_back(G4AttValue("LVol", fpCurrentLV->GetName(),"")); 744 G4VSolid* pSol = fpCurrentLV->GetSolid(); 745 values->push_back(G4AttValue("Solid", pSol->GetName(),"")); 746 values->push_back(G4AttValue("EType", pSol->GetEntityType(),"")); 747 oss.str(""); oss << '\n' << *pSol; 748 values->push_back(G4AttValue("DmpSol", oss.str(),"")); 749 oss.str(""); oss << '\n' << *fpCurrentTransform; 750 values->push_back(G4AttValue("Trans", oss.str(),"")); 751 G4String matName = fpCurrentMaterial? fpCurrentMaterial->GetName(): G4String("No material"); 752 values->push_back(G4AttValue("Material", matName,"")); 753 G4double matDensity = fpCurrentMaterial? fpCurrentMaterial->GetDensity(): 0.; 754 values->push_back(G4AttValue("Density", G4BestUnit(matDensity,"Volumic Mass"),"")); 755 G4State matState = fpCurrentMaterial? fpCurrentMaterial->GetState(): kStateUndefined; 756 oss.str(""); oss << matState; 757 values->push_back(G4AttValue("State", oss.str(),"")); 758 G4double matRadlen = fpCurrentMaterial? fpCurrentMaterial->GetRadlen(): 0.; 759 values->push_back(G4AttValue("Radlen", G4BestUnit(matRadlen,"Length"),"")); 760 G4Region* region = fpCurrentLV->GetRegion(); 761 G4String regionName = region? region->GetName(): G4String("No region"); 762 values->push_back(G4AttValue("Region", regionName,"")); 763 oss.str(""); oss << fpCurrentLV->IsRootRegion(); 764 values->push_back(G4AttValue("RootRegion", oss.str(),"")); 765 } 742 values->push_back(G4AttValue("LVol", fpCurrentLV->GetName(),"")); 743 G4VSolid* pSol = fpCurrentLV->GetSolid(); 744 values->push_back(G4AttValue("Solid", pSol->GetName(),"")); 745 values->push_back(G4AttValue("EType", pSol->GetEntityType(),"")); 746 oss.str(""); oss << '\n' << *pSol; 747 values->push_back(G4AttValue("DmpSol", oss.str(),"")); 748 oss.str(""); oss << '\n' << *fpCurrentTransform; 749 values->push_back(G4AttValue("Trans", oss.str(),"")); 750 G4String matName = fpCurrentMaterial? fpCurrentMaterial->GetName(): G4String("No material"); 751 values->push_back(G4AttValue("Material", matName,"")); 752 G4double matDensity = fpCurrentMaterial? fpCurrentMaterial->GetDensity(): 0.; 753 values->push_back(G4AttValue("Density", G4BestUnit(matDensity,"Volumic Mass"),"")); 754 G4State matState = fpCurrentMaterial? fpCurrentMaterial->GetState(): kStateUndefined; 755 oss.str(""); oss << matState; 756 values->push_back(G4AttValue("State", oss.str(),"")); 757 G4double matRadlen = fpCurrentMaterial? fpCurrentMaterial->GetRadlen(): 0.; 758 values->push_back(G4AttValue("Radlen", G4BestUnit(matRadlen,"Length"),"")); 759 G4Region* region = fpCurrentLV->GetRegion(); 760 G4String regionName = region? region->GetName(): G4String("No region"); 761 values->push_back(G4AttValue("Region", regionName,"")); 762 oss.str(""); oss << fpCurrentLV->IsRootRegion(); 763 values->push_back(G4AttValue("RootRegion", oss.str(),"")); 766 764 return values; 767 765 } -
trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc
r959 r1171 241 241 // Draw without time slice information 242 242 243 //244 // for (size_t iPoint = 0; iPoint < trajectoryLine.size (); iPoint++) {245 // printf("DrawLineAndPoints trajectory i:%d/%d center:%f,%f,%f\n",iPoint,trajectoryLine.size (),trajectoryLine[iPoint].x(),trajectoryLine[iPoint].y(),trajectoryLine[iPoint].z());246 // }247 // for (size_t iPoint = 0; iPoint < auxiliaryPoints.size (); iPoint++) {248 // printf("DrawLineAndPoints aux i:%d/%d center:%f,%f,%f\n",iPoint,auxiliaryPoints.size (),auxiliaryPoints[iPoint].x(),auxiliaryPoints[iPoint].y(),auxiliaryPoints[iPoint].z());249 // }250 // for (size_t iPoint = 0; iPoint < stepPoints.size (); iPoint++) {251 // printf("DrawLineAndPoints step i:%d/%d center:%f,%f,%f\n",iPoint,stepPoints.size (),stepPoints[iPoint].x(),stepPoints[iPoint].y(),stepPoints[iPoint].z());252 // }253 //254 243 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); 255 244 if (0 == pVVisManager) return;
Note: See TracChangeset
for help on using the changeset viewer.