Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TrajectoriesModel Class Reference

#include <G4TrajectoriesModel.hh>

+ Inheritance diagram for G4TrajectoriesModel:

Public Member Functions

 G4TrajectoriesModel ()
 
 G4TrajectoriesModel (G4int drawingMode)
 
virtual ~G4TrajectoriesModel ()
 
virtual void DescribeYourselfTo (G4VGraphicsScene &)
 
G4bool IsDrawingModeSet () const
 
G4int GetDrawingMode () const
 
void SetDrawingMode (G4int drawingMode)
 
const G4VTrajectoryGetCurrentTrajectory () const
 
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 ()
 
virtual void DescribeYourselfTo (G4VGraphicsScene &)=0
 
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() [1/2]

G4TrajectoriesModel::G4TrajectoriesModel ( )

Definition at line 44 of file G4TrajectoriesModel.cc.

44 :
45 fDrawingModeSet(false),
46 fDrawingMode(0),
47 fpCurrentTrajectory(0)
48{
49 fType = "G4TrajectoriesModel";
50 fGlobalTag = "G4TrajectoriesModel for all trajectories.";
52}
G4String fGlobalDescription
Definition: G4VModel.hh:110
G4String fType
Definition: G4VModel.hh:108
G4String fGlobalTag
Definition: G4VModel.hh:109

◆ G4TrajectoriesModel() [2/2]

G4TrajectoriesModel::G4TrajectoriesModel ( G4int  drawingMode)

Definition at line 54 of file G4TrajectoriesModel.cc.

54 :
55 fDrawingModeSet(true),
56 fDrawingMode(drawingMode),
57 fpCurrentTrajectory(0) {
58 fGlobalTag = "G4TrajectoriesModel for all trajectories.";
60}

◆ ~G4TrajectoriesModel()

G4TrajectoriesModel::~G4TrajectoriesModel ( )
virtual

Definition at line 62 of file G4TrajectoriesModel.cc.

62{}

Member Function Documentation

◆ CreateCurrentAttValues()

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

Definition at line 145 of file G4TrajectoriesModel.cc.

146{
147 std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
148 values->push_back
149 (G4AttValue("EventID",G4UIcommand::ConvertToString(fEventID),""));
150 return values;
151}
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:349

Referenced by G4VSceneHandler::LoadAtts().

◆ DescribeYourselfTo()

void G4TrajectoriesModel::DescribeYourselfTo ( G4VGraphicsScene sceneHandler)
virtual

Implements G4VModel.

Definition at line 67 of file G4TrajectoriesModel.cc.

68{
69 const G4Event* event = fpMP->GetEvent();
70 if (!event) return;
71
72 G4TrajectoryContainer* TC = event -> GetTrajectoryContainer ();
73 if (!TC) return;
74
76 if (!pVVisManager) return;
77
78 fEventID = event->GetEventID();
79
80 pVVisManager->BeginDraw();
81 // The use of Begin/EndDraw (optional methods to improve drawing
82 // speed) assumes all trajectories are drawn with the same
83 // transformation. If not, a fatal exception with be raised in
84 // G4VisManager::DrawT.
85 for (G4int iT = 0; iT < TC->entries(); iT++) {
86 fpCurrentTrajectory = (*TC) [iT];
87 // Debug trajectory:
88 // fpCurrentTrajectory->ShowTrajectory(); G4cout << G4endl;
89 // Debug G4AttValues:
90 // G4TrajectoriesModelDebugG4AttValues(fpCurrentTrajectory);
91 if (fpCurrentTrajectory)
92 sceneHandler.AddCompound (*fpCurrentTrajectory);
93 }
94 pVVisManager->EndDraw();
95}
int G4int
Definition: G4Types.hh:66
const G4Event * GetEvent() const
virtual void AddCompound(const G4VTrajectory &)=0
const G4ModelingParameters * fpMP
Definition: G4VModel.hh:113
virtual void EndDraw()=0
static G4VVisManager * GetConcreteInstance()
virtual void BeginDraw(const G4Transform3D &objectTransformation=G4Transform3D())=0

◆ GetAttDefs()

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

Definition at line 133 of file G4TrajectoriesModel.cc.

134{
135 G4bool isNew;
136 std::map<G4String,G4AttDef>* store
137 = G4AttDefStore::GetInstance("G4TrajectoriesModel", isNew);
138 if (isNew) {
139 (*store)["EventID"] =
140 G4AttDef("EventID","Event ID","Physics","","G4int");
141 }
142 return store;
143}
bool G4bool
Definition: G4Types.hh:67
std::map< G4String, G4AttDef > * GetInstance(G4String storeKey, G4bool &isNew)

Referenced by G4VSceneHandler::LoadAtts(), G4VisCommandList::SetNewValue(), and G4VisCommandSceneAddTrajectories::SetNewValue().

◆ GetCurrentTrajectory()

const G4VTrajectory * G4TrajectoriesModel::GetCurrentTrajectory ( ) const
inline

Definition at line 68 of file G4TrajectoriesModel.hh.

69 {return fpCurrentTrajectory;}

Referenced by G4GMocrenFileSceneHandler::AddCompound(), and G4VSceneHandler::LoadAtts().

◆ GetDrawingMode()

G4int G4TrajectoriesModel::GetDrawingMode ( ) const

Definition at line 102 of file G4TrajectoriesModel.cc.

103{
104 if (fDrawingModeSet) return fDrawingMode;
105 else {
107 ("G4TrajectoriesModel::GetDrawingMode",
108 "modeling0010",
110 "Illegal attempt to obtain i_mode."
111 "\n i_mode is an old trajectories parameter that is DEPRECATED"
112 "\n and will be removed at the next major release."
113 );
114 return 0;
115 }
116}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4VSceneHandler::AddCompound(), and G4GMocrenFileSceneHandler::AddCompound().

◆ IsDrawingModeSet()

G4bool G4TrajectoriesModel::IsDrawingModeSet ( ) const

Definition at line 97 of file G4TrajectoriesModel.cc.

98{
99 return fDrawingModeSet;
100}

Referenced by G4VSceneHandler::AddCompound(), and G4VisManager::DispatchToModel().

◆ SetDrawingMode()

void G4TrajectoriesModel::SetDrawingMode ( G4int  drawingMode)

Definition at line 118 of file G4TrajectoriesModel.cc.

119{
120 if (fDrawingModeSet) fDrawingMode = drawingMode;
121 else {
123 ("G4TrajectoriesModel::SetDrawingMode",
124 "modeling0011",
126 "Illegal attempt to set i_mode."
127 "\n i_mode is an old trajectories parameter that is DEPRECATED"
128 "\n and will be removed at the next major release."
129 );
130 }
131}

Referenced by G4VisManager::Draw().


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