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

#include <G4BlineEventAction.hh>

Inheritance diagram for G4BlineEventAction:
Collaboration diagram for G4BlineEventAction:

Public Member Functions

 G4BlineEventAction (G4BlineTracer *aBlineTool)
 
virtual ~G4BlineEventAction ()
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
void DrawFieldLines (G4double zoom, G4double theta, G4double phi)
 
void ResetVectorObjectToBeDrawn ()
 
void SetDrawColour (G4Colour aColour)
 
void SetDrawBline (G4bool aBool)
 
void SetDrawPoints (G4bool aBool)
 
void SetPointSize (G4double aVal)
 
G4bool GetDrawBline ()
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 61 of file G4BlineEventAction.hh.

Constructor & Destructor Documentation

G4BlineEventAction::G4BlineEventAction ( G4BlineTracer aBlineTool)

Definition at line 55 of file G4BlineEventAction.cc.

56 {
57  fBlineTool=aBlineTool;
58 }
G4BlineEventAction::~G4BlineEventAction ( )
virtual

Definition at line 62 of file G4BlineEventAction.cc.

63 {
64  for (size_t i=0; i<fTrajectoryVisAttributes.size(); i++)
65  delete fTrajectoryVisAttributes[i];
66 }

Member Function Documentation

void G4BlineEventAction::BeginOfEventAction ( const G4Event )
virtual

Reimplemented from G4UserEventAction.

Definition at line 70 of file G4BlineEventAction.cc.

71 {
72 }
void G4BlineEventAction::DrawFieldLines ( G4double  zoom,
G4double  theta,
G4double  phi 
)

Definition at line 115 of file G4BlineEventAction.cc.

116 {
117  size_t nline = fTrajectoryPolyline.size();
118  size_t npoints =fTrajectoryPoints.size();
119 
121  if (!pVVisManager)
122  {
123  G4Exception("G4BlineEventAction::DrawFieldLines()",
124  "NullPointer", JustWarning,
125  "Missing visualisation driver for visualising magnetic field lines!");
126  return;
127  }
128 
129  if (nline ==0)
130  {
131  G4cout << "WARNING - G4BlineEventAction::DrawFieldLines()" << G4endl
132  << " There is nothing to visualise !" << G4endl;
133  return;
134  }
135  ((G4VisManager*)pVVisManager)->GetCurrentSceneHandler()-> ClearStore ();
136  G4UImanager::GetUIpointer () -> ApplyCommand ("/vis/drawVolume");
137 
138  for (size_t i=0;i<nline;i++)
139  pVVisManager->Draw(fTrajectoryPolyline[i]);
140  for (size_t i=0;i<npoints;i++)
141  pVVisManager->Draw(fTrajectoryPoints[i]);
142 
143  // ((G4VisManager*)pVVisManager)->GetCurrentViewer()->DrawView();
144  // ((G4VisManager*)pVVisManager)->GetCurrentViewer()->ShowView();
145 }
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
static G4VVisManager * GetConcreteInstance()
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4BlineEventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 76 of file G4BlineEventAction.cc.

77 {
78  G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
79  if(trajectoryContainer)
80  {
81  // visualisation
82  // -------------
83 
84  if (fDrawBline || fDrawPoints)
85  {
86  G4int n_point = (*(evt->GetTrajectoryContainer()))[0]->GetPointEntries();
87 
88  G4Polyline pPolyline;
89  G4Polymarker stepPoints;
90  fTrajectoryVisAttributes.push_back(new G4VisAttributes(fDrawColour));
92  stepPoints.SetScreenSize(fPointSize);
93  stepPoints.SetFillStyle(G4VMarker::filled);
94  stepPoints.SetVisAttributes(fTrajectoryVisAttributes.back());
95 
96  for(G4int i=0; i<n_point; i++)
97  {
99  ((*(evt->GetTrajectoryContainer()))[0]->GetPoint(i)))->GetPosition();
100  if (fDrawBline) pPolyline.push_back( pos);
101  if (fDrawPoints) stepPoints.push_back(pos);
102  }
103 
104  pPolyline.SetVisAttributes(fTrajectoryVisAttributes.back());
105 
106  fTrajectoryPolyline.push_back(pPolyline);
107  fTrajectoryPoints.push_back(stepPoints);
108  }
109  }
110 }
void SetMarkerType(MarkerType)
void SetFillStyle(FillStyle)
int G4int
Definition: G4Types.hh:78
G4TrajectoryContainer * GetTrajectoryContainer() const
Definition: G4Event.hh:189
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:80
static const G4double pos
void SetScreenSize(G4double)

Here is the call graph for this function:

G4bool G4BlineEventAction::GetDrawBline ( )
inline

Definition at line 80 of file G4BlineEventAction.hh.

80 { return fDrawBline; }
void G4BlineEventAction::ResetVectorObjectToBeDrawn ( )

Definition at line 149 of file G4BlineEventAction.cc.

150 {
151  fTrajectoryVisAttributes.clear();
152  fTrajectoryPolyline.clear();
153  fTrajectoryPoints.clear();
154 }

Here is the caller graph for this function:

void G4BlineEventAction::SetDrawBline ( G4bool  aBool)
inline

Definition at line 77 of file G4BlineEventAction.hh.

77 { fDrawBline=aBool; }

Here is the caller graph for this function:

void G4BlineEventAction::SetDrawColour ( G4Colour  aColour)
inline

Definition at line 76 of file G4BlineEventAction.hh.

76 { fDrawColour = aColour; }
void G4BlineEventAction::SetDrawPoints ( G4bool  aBool)
inline

Definition at line 78 of file G4BlineEventAction.hh.

78 { fDrawPoints=aBool; }

Here is the caller graph for this function:

void G4BlineEventAction::SetPointSize ( G4double  aVal)
inline

Definition at line 79 of file G4BlineEventAction.hh.

79 { fPointSize=aVal; }

Here is the caller graph for this function:


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