Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4TrajectoriesModel Class Reference

#include <G4TrajectoriesModel.hh>

Inheritance diagram for G4TrajectoriesModel:
Collaboration diagram for G4TrajectoriesModel:

Public Member Functions

 G4TrajectoriesModel ()
 
virtual ~G4TrajectoriesModel ()
 
virtual void DescribeYourselfTo (G4VGraphicsScene &)
 
const G4VTrajectoryGetCurrentTrajectory () const
 
void SetCurrentTrajectory (const G4VTrajectory *pTraj)
 
void SetRunID (G4int runID)
 
void SetEventID (G4int eventID)
 
const std::map< G4String,
G4AttDef > * 
GetAttDefs () const
 
std::vector< G4AttValue > * CreateCurrentAttValues () const
 
- Public Member Functions inherited from G4VModel
 G4VModel (const G4Transform3D &modelTransformation=G4Transform3D(), const G4ModelingParameters *=0)
 
virtual ~G4VModel ()
 
const G4ModelingParametersGetModelingParameters () const
 
const G4StringGetType () const
 
virtual G4String GetCurrentDescription () const
 
virtual G4String GetCurrentTag () const
 
const G4VisExtentGetExtent () const
 
const G4StringGetGlobalDescription () const
 
const G4StringGetGlobalTag () const
 
const G4Transform3DGetTransformation () const
 
void SetModelingParameters (const G4ModelingParameters *)
 
void SetExtent (const G4VisExtent &)
 
void SetType (const G4String &)
 
void SetGlobalDescription (const G4String &)
 
void SetGlobalTag (const G4String &)
 
void SetTransformation (const G4Transform3D &)
 
virtual G4bool Validate (G4bool warn=true)
 

Additional Inherited Members

- Protected Attributes inherited from G4VModel
G4String fType
 
G4String fGlobalTag
 
G4String fGlobalDescription
 
G4VisExtent fExtent
 
G4Transform3D fTransform
 
const G4ModelingParametersfpMP
 

Detailed Description

Definition at line 52 of file G4TrajectoriesModel.hh.

Constructor & Destructor Documentation

G4TrajectoriesModel::G4TrajectoriesModel ( )

Definition at line 50 of file G4TrajectoriesModel.cc.

51 :fpCurrentTrajectory(0)
52 ,fRunID(-1)
53 ,fEventID(-1)
54 {
55  fType = "G4TrajectoriesModel";
56  fGlobalTag = "G4TrajectoriesModel for all trajectories.";
58 }
G4String fType
Definition: G4VModel.hh:108
G4String fGlobalTag
Definition: G4VModel.hh:109
G4String fGlobalDescription
Definition: G4VModel.hh:110
G4TrajectoriesModel::~G4TrajectoriesModel ( )
virtual

Definition at line 60 of file G4TrajectoriesModel.cc.

60 {}

Member Function Documentation

std::vector< G4AttValue > * G4TrajectoriesModel::CreateCurrentAttValues ( ) const

Definition at line 124 of file G4TrajectoriesModel.cc.

125 {
126  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
127  values->push_back
128  (G4AttValue("RunID",G4UIcommand::ConvertToString(fRunID),""));
129  values->push_back
130  (G4AttValue("EventID",G4UIcommand::ConvertToString(fEventID),""));
131  return values;
132 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372

Here is the call graph for this function:

Here is the caller graph for this function:

void G4TrajectoriesModel::DescribeYourselfTo ( G4VGraphicsScene sceneHandler)
virtual

Implements G4VModel.

Definition at line 64 of file G4TrajectoriesModel.cc.

65 {
67 #ifdef G4MULTITHREADED
69  { runManager = G4MTRunManager::GetMasterRunManager(); }
70 #endif
71  const G4Run* currentRun = runManager->GetCurrentRun();
72  if (currentRun) {
73  fRunID = currentRun->GetRunID();
74  } else {
75  fRunID = -1;
76  return;
77  }
78 
79  const G4Event* event = fpMP->GetEvent();
80  if (event) {
81  fEventID = event->GetEventID();
82  } else {
83  fEventID = -1;
84  return;
85  }
86 
87  G4TrajectoryContainer* TC = event -> GetTrajectoryContainer ();
88  if (!TC) return;
89 
91  if (!pVVisManager) return;
92 
93  pVVisManager->BeginDraw();
94  // The use of Begin/EndDraw (optional methods to improve drawing
95  // speed) assumes all trajectories are drawn with the same
96  // transformation. If not, a fatal exception with be raised in
97  // G4VisManager::DrawT.
98  for (G4int iT = 0; iT < TC->entries(); iT++) {
99  fpCurrentTrajectory = (*TC) [iT];
100  // Debug trajectory:
101  // fpCurrentTrajectory->ShowTrajectory(); G4cout << G4endl;
102  // Debug G4AttValues:
103  // G4TrajectoriesModelDebugG4AttValues(fpCurrentTrajectory);
104  if (fpCurrentTrajectory)
105  sceneHandler.AddCompound (*fpCurrentTrajectory);
106  }
107  pVVisManager->EndDraw();
108 }
static G4VVisManager * GetConcreteInstance()
int G4int
Definition: G4Types.hh:78
const G4Run * GetCurrentRun() const
const G4Event * GetEvent() const
virtual void EndDraw()=0
static G4MTRunManager * GetMasterRunManager()
G4int GetRunID() const
Definition: G4Run.hh:76
Definition: G4Run.hh:46
const G4ModelingParameters * fpMP
Definition: G4VModel.hh:113
virtual void BeginDraw(const G4Transform3D &objectTransformation=G4Transform3D())=0
G4bool IsMultithreadedApplication()
Definition: G4Threading.cc:152
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
virtual void AddCompound(const G4VTrajectory &)=0

Here is the call graph for this function:

const std::map< G4String, G4AttDef > * G4TrajectoriesModel::GetAttDefs ( ) const

Definition at line 110 of file G4TrajectoriesModel.cc.

111 {
112  G4bool isNew;
113  std::map<G4String,G4AttDef>* store
114  = G4AttDefStore::GetInstance("G4TrajectoriesModel", isNew);
115  if (isNew) {
116  (*store)["RunID"] =
117  G4AttDef("RunID","Run ID","Physics","","G4int");
118  (*store)["EventID"] =
119  G4AttDef("EventID","Event ID","Physics","","G4int");
120  }
121  return store;
122 }
bool G4bool
Definition: G4Types.hh:79
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)

Here is the call graph for this function:

Here is the caller graph for this function:

const G4VTrajectory* G4TrajectoriesModel::GetCurrentTrajectory ( ) const
inline

Definition at line 63 of file G4TrajectoriesModel.hh.

64  {return fpCurrentTrajectory;}

Here is the caller graph for this function:

void G4TrajectoriesModel::SetCurrentTrajectory ( const G4VTrajectory pTraj)
inline

Definition at line 66 of file G4TrajectoriesModel.hh.

67  {fpCurrentTrajectory = pTraj;}

Here is the caller graph for this function:

void G4TrajectoriesModel::SetEventID ( G4int  eventID)
inline

Definition at line 72 of file G4TrajectoriesModel.hh.

73  {fEventID = eventID;}

Here is the caller graph for this function:

void G4TrajectoriesModel::SetRunID ( G4int  runID)
inline

Definition at line 69 of file G4TrajectoriesModel.hh.

70  {fRunID = runID;}

Here is the caller graph for this function:


The documentation for this class was generated from the following files: