Changeset 1171 for trunk/source/visualization/modeling/src
- Timestamp:
- Nov 16, 2009, 5:03:28 PM (15 years ago)
- Location:
- trunk/source/visualization/modeling/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.