Changeset 1171 for trunk


Ignore:
Timestamp:
Nov 16, 2009, 5:03:28 PM (15 years ago)
Author:
garnier
Message:

update contre CVS

Location:
trunk/source/visualization/modeling
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/modeling/GNUmakefile

    r834 r1171  
    1 # $Id: GNUmakefile,v 1.11 2006/05/22 08:49:27 allison Exp $
     1# $Id: GNUmakefile,v 1.12 2009/11/04 12:44:39 allison Exp $
    22# --------------------------------------------------------------
    33# GNUmakefile for modeling library.  John Allison, 31/12/1997.
     
    3232CPPFLAGS += -I$(G4BASE)/particles/management/include
    3333CPPFLAGS += -I$(G4BASE)/event/include
     34CPPFLAGS += -I$(G4BASE)/digits_hits/utils/include
    3435CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
    3536CPPFLAGS += -I$(G4BASE)/digits_hits/digits/include
  • trunk/source/visualization/modeling/History

    r1140 r1171  
    1 $Id: History,v 1.114 2009/10/22 15:40:00 allison Exp $
     1$Id: History,v 1.115 2009/11/04 12:44:39 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2121---------------------------------------
    2222
     234th 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
    232822nd October 2009  John Allison  (modeling-V09-02-05 coworks greps-V09-02-02)
    2429- Added G4PSHitsModel for gMocren driver.
     30- G4PhysicalVolumeModel.cc: Makes use of HepPolyhedronProcessor.
    2531
    263221st October 2009  John Allison  (modeling-V09-02-04 coworks greps-V09-02-02)
  • trunk/source/visualization/modeling/include/G4PSHitsModel.hh

    r1141 r1171  
    2525//
    2626//
    27 // $Id: G4PSHitsModel.hh,v 1.3 2009/10/22 07:35:06 akimura Exp $
     27// $Id: G4PSHitsModel.hh,v 1.4 2009/11/04 12:44:39 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    3939#include "G4VModel.hh"
    4040
    41 class G4VHit;
     41template <typename T> class G4THitsMap;
    4242
    4343class G4PSHitsModel: public G4VModel {
     
    4545public: // With description
    4646
    47   G4PSHitsModel ();
     47  G4PSHitsModel (const G4String& requestedMapName = "all");
    4848   
    4949  virtual ~G4PSHitsModel ();
     
    5252  // The main task of a model is to describe itself to the graphics scene.
    5353
    54   const G4VHit* GetCurrentHit() const
    55   {return kpCurrentHit;}
     54  const G4THitsMap<G4double>* GetCurrentHits() const
     55  {return fpCurrentHits;}
    5656
    5757private:
    5858
    59   const G4VHit* kpCurrentHit;
     59  G4String fRequestedMapName;
     60  const G4THitsMap<G4double>* fpCurrentHits;
    6061};
    6162
  • trunk/source/visualization/modeling/src/G4LogicalVolumeModel.cc

    r1136 r1171  
    102102        const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron ();
    103103        sceneHandler.BeginPrimitives (transform);
    104         sceneHandler.AddPrimitive (polyhedron);
     104        sceneHandler.AddPrimitive (polyhedron);
    105105        sceneHandler.EndPrimitives ();
    106106      }
  • trunk/source/visualization/modeling/src/G4PSHitsModel.cc

    r1141 r1171  
    2525//
    2626//
    27 // $Id: G4PSHitsModel.cc,v 1.3 2009/10/22 07:35:06 akimura Exp $
     27// $Id: G4PSHitsModel.cc,v 1.4 2009/11/04 12:44:39 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    3838#include "G4VGraphicsScene.hh"
    3939#include "G4Event.hh"
    40 #include "G4THitsMap.hh"
     40#include "G4ScoringManager.hh"
    4141
    4242G4PSHitsModel::~G4PSHitsModel () {}
    4343
    44 G4PSHitsModel::G4PSHitsModel ():
    45   kpCurrentHit(0)
     44G4PSHitsModel::G4PSHitsModel (const G4String& requestedMapName):
     45  fRequestedMapName(requestedMapName), fpCurrentHits(0)
    4646{
    4747  fGlobalTag = "G4PSHitsModel for G4THitsMap<G4double> hits.";
     
    5151void G4PSHitsModel::DescribeYourselfTo (G4VGraphicsScene& sceneHandler)
    5252{
    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        }
    6270      }
    6371    }
  • trunk/source/visualization/modeling/src/G4PhysicalVolumeModel.cc

    r1140 r1171  
    740740
    741741  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(),""));
    766764  return values;
    767765}
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc

    r959 r1171  
    241241    // Draw without time slice information
    242242
    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     //   
    254243    G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
    255244    if (0 == pVVisManager) return;
Note: See TracChangeset for help on using the changeset viewer.