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

#include <G4BlineTracerMessenger.hh>

Inheritance diagram for G4BlineTracerMessenger:
Collaboration diagram for G4BlineTracerMessenger:

Public Member Functions

 G4BlineTracerMessenger (G4BlineTracer *aBlineTool)
 
virtual ~G4BlineTracerMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValues)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 62 of file G4BlineTracerMessenger.hh.

Constructor & Destructor Documentation

G4BlineTracerMessenger::G4BlineTracerMessenger ( G4BlineTracer aBlineTool)

Definition at line 57 of file G4BlineTracerMessenger.cc.

58 {
59  fTheBlineTool = aBlineTool;
60  fBlineToolDir = new G4UIdirectory("/vis/blineTracer/");
61  fBlineToolDir->SetGuidance("Commands to trace and visualise magnetic field lines.");
62  fBlineToolDir->SetGuidance("These commands work only if a magnetic-field is set");
63  fBlineToolDir->SetGuidance("in the application.");
64 
65  // commands
66 
67  fBlineCmd = new G4UIcmdWithAnInteger("/vis/blineTracer/computeBline",this);
68  fBlineCmd->SetGuidance("Compute magnetic field lines for visualisation.");
69  fBlineCmd->SetParameterName("nb_of_lines",false);
71 
72  fSetMaxTrackingStepCmd =
73  new G4UIcmdWithADoubleAndUnit("/vis/blineTracer/setMaxStepLength",this);
74  fSetMaxTrackingStepCmd->SetGuidance("Set the maximum length of tracking step");
75  fSetMaxTrackingStepCmd->SetGuidance("when integrating magnetic field line.");
76  fSetMaxTrackingStepCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
77 
78  fSetDrawColourCmd = new G4UIcmdWith3Vector("/vis/blineTracer/setColour",this);
79  fSetDrawColourCmd->SetGuidance("Set the colour drawing trajectories");
80  fSetDrawColourCmd->SetGuidance("and magnetic field lines.");
82 
83  fSetDrawBlineCmd = new G4UIcmdWithABool("/vis/blineTracer/stockLines",this);
84  fSetDrawBlineCmd->SetGuidance("If true field lines are stocked in lines");
85  fSetDrawBlineCmd->SetGuidance("to be drawn.");
86  fSetDrawBlineCmd->SetParameterName("StockLines",false);
88 
89  fSetDrawPointsCmd = new G4UIcmdWithABool("/vis/blineTracer/stockPoints",this);
90  fSetDrawPointsCmd->SetGuidance("If true step field line points are stocked");
91  fSetDrawPointsCmd->SetGuidance("in vector of points to be drawn.");
92  fSetDrawPointsCmd->SetParameterName("StockPoints",false);
94 
95  fSetPointSizeCmd = new G4UIcmdWithADouble("/vis/blineTracer/setPointSize",this);
96  fSetPointSizeCmd->SetGuidance("Set the size of points for drawing.");
97  fSetPointSizeCmd->SetParameterName("StepSize",false);
99 
100  fDrawCmd = new G4UIcmdWithoutParameter("/vis/blineTracer/show",this);
101  fDrawCmd->SetGuidance("Show the stored magnetic field lines.");
103 
104  fResetCmd =
105  new G4UIcmdWithoutParameter("/vis/blineTracer/resetMaterialToBeDrawn",this);
106  fResetCmd->SetGuidance("Clear the vectors of lines and points to be drawn.");
108 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

G4BlineTracerMessenger::~G4BlineTracerMessenger ( )
virtual

Definition at line 112 of file G4BlineTracerMessenger.cc.

113 {
114  delete fResetCmd;
115  delete fDrawCmd;
116  delete fSetPointSizeCmd;
117  delete fSetDrawPointsCmd;
118  delete fSetDrawBlineCmd;
119  delete fSetDrawColourCmd;
120  delete fSetMaxTrackingStepCmd;
121  delete fBlineCmd;
122  delete fBlineToolDir;
123 }

Member Function Documentation

void G4BlineTracerMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 127 of file G4BlineTracerMessenger.cc.

129 {
130  if (command == fBlineCmd)
131  fTheBlineTool->ComputeBlines(1);
132  else if( command == fSetMaxTrackingStepCmd )
133  fTheBlineTool->SetMaxTrackingStep(fSetMaxTrackingStepCmd
134  ->GetNewDoubleValue(newValues));
135  else if( command == fSetDrawBlineCmd )
136  fTheBlineTool->GetEventAction()->SetDrawBline(fSetDrawBlineCmd
137  ->GetNewBoolValue(newValues));
138  else if( command == fSetDrawColourCmd )
139  {
140  G4ThreeVector vec=fSetDrawColourCmd->GetNew3VectorValue(newValues);
141  fTheBlineTool->GetEventAction()->
142  SetDrawColour(G4Colour(vec.x(),vec.y(),vec.z()));
143  }
144  else if( command == fSetDrawPointsCmd )
145  fTheBlineTool->GetEventAction()->SetDrawPoints(fSetDrawPointsCmd
146  ->GetNewBoolValue(newValues));
147  else if( command == fSetPointSizeCmd )
148  fTheBlineTool->GetEventAction()->SetPointSize(fSetPointSizeCmd
149  ->GetNewDoubleValue(newValues));
150  else if( command == fDrawCmd )
151  fTheBlineTool->GetEventAction()->DrawFieldLines(.5,45.,45.);
152  else if( command == fResetCmd )
153  fTheBlineTool->GetEventAction()->ResetVectorObjectToBeDrawn();
154 }
void SetDrawBline(G4bool aBool)
double x() const
void DrawFieldLines(G4double zoom, G4double theta, G4double phi)
void SetDrawPoints(G4bool aBool)
double z() const
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void ComputeBlines(G4int nlines)
void SetMaxTrackingStep(G4double max_step)
void SetPointSize(G4double aVal)
double y() const
G4BlineEventAction * GetEventAction()

Here is the call graph for this function:


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