Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LBNFWormPlotMessenger Class Reference

#include <LBNFWormPlotMessenger.hh>

Inheritance diagram for LBNFWormPlotMessenger:

Public Member Functions

virtual ~LBNFWormPlotMessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 

Static Public Member Functions

static LBNFWormPlotMessengerGetInstance (LBNFWormPlotter *wPlot)
 

Private Member Functions

 LBNFWormPlotMessenger (LBNFWormPlotter *wPlot)
 

Private Attributes

LBNFWormPlottertheWorm
 
G4UIdirectory * wormDir
 
G4UIcmdWith3Vector * xAxisCmd
 
G4UIcmdWithAString * xNameCmd
 
G4UIcmdWith3Vector * yAxisCmd
 
G4UIcmdWithAString * yNameCmd
 
G4UIcmdWithADoubleAndUnit * xMinCmd
 
G4UIcmdWithADoubleAndUnit * xMaxCmd
 
G4UIcmdWithADoubleAndUnit * yMinCmd
 
G4UIcmdWithADoubleAndUnit * yMaxCmd
 
G4UIcmdWithADoubleAndUnit * z0Cmd
 
G4UIcmdWithAString * fileCmd
 

Static Private Attributes

static LBNFWormPlotMessengerfpInstance = 0
 

Detailed Description

Definition at line 49 of file LBNFWormPlotMessenger.hh.

Constructor & Destructor Documentation

LBNFWormPlotMessenger::~LBNFWormPlotMessenger ( )
virtual

Definition at line 117 of file LBNFWormPlotMessenger.cc.

118 {
119  delete fileCmd;
120  delete z0Cmd;
121  delete yMaxCmd;
122  delete yMinCmd;
123  delete xMaxCmd;
124  delete xMinCmd;
125  delete yNameCmd;
126  delete yAxisCmd;
127  delete xNameCmd;
128  delete xAxisCmd;
129  delete wormDir;
130 }
G4UIcmdWithAString * yNameCmd
G4UIcmdWithADoubleAndUnit * yMaxCmd
G4UIcmdWith3Vector * yAxisCmd
G4UIcmdWithAString * fileCmd
G4UIcmdWithADoubleAndUnit * xMaxCmd
G4UIcmdWithAString * xNameCmd
G4UIcmdWith3Vector * xAxisCmd
G4UIcmdWithADoubleAndUnit * yMinCmd
G4UIcmdWithADoubleAndUnit * z0Cmd
G4UIcmdWithADoubleAndUnit * xMinCmd
LBNFWormPlotMessenger::LBNFWormPlotMessenger ( LBNFWormPlotter wPlot)
private

Definition at line 52 of file LBNFWormPlotMessenger.cc.

52  {
53 
54  theWorm = wPlot;
55 
56  wormDir = new G4UIdirectory("/vis/wormPlot/");
57  wormDir->SetGuidance("WormPlot commands.");
58 
59  xAxisCmd = new G4UIcmdWith3Vector("/vis/wormPlot/xAxis",this);
60  xAxisCmd->SetGuidance("Define the xAxis direction vector");
61  xAxisCmd->SetParameterName("x", "y", "z", true);
62  xAxisCmd->SetDefaultValue(G4ThreeVector(0.0, 0.0, 1.0)); // global z axis
63 
64  xNameCmd = new G4UIcmdWithAString("/vis/wormPlot/xName",this);
65  xNameCmd->SetGuidance("Define the name of the plot xAxis");
66  xNameCmd->SetParameterName("xName", true);
67  xNameCmd->SetDefaultValue("z");
68 
69  yAxisCmd = new G4UIcmdWith3Vector("/vis/wormPlot/yAxis",this);
70  yAxisCmd->SetGuidance("Define the yAxis direction vector");
71  yAxisCmd->SetParameterName("x", "y", "z", true);
72  yAxisCmd->SetDefaultValue(G4ThreeVector(0.0, 1.0, 0.0)); // global y axis
73 
74  yNameCmd = new G4UIcmdWithAString("/vis/wormPlot/yName",this);
75  yNameCmd->SetGuidance("Define the name of the plot yAxis");
76  yNameCmd->SetParameterName("yName", true);
77  yNameCmd->SetDefaultValue("y");
78 
79  xMinCmd = new G4UIcmdWithADoubleAndUnit("/vis/wormPlot/xMin",this);
80  xMinCmd->SetGuidance("Set the minimum co-ordinate for the plot's x axis");
81  xMinCmd->SetParameterName("x", true);
82  xMinCmd->SetDefaultUnit("m");
83  xMinCmd->SetDefaultValue(-1.0); // -1 m
84 
85  xMaxCmd = new G4UIcmdWithADoubleAndUnit("/vis/wormPlot/xMax",this);
86  xMaxCmd->SetGuidance("Set the maximum co-ordinate for the plot's x axis");
87  xMaxCmd->SetParameterName("x", true);
88  xMaxCmd->SetDefaultUnit("m");
89  xMaxCmd->SetDefaultValue(1.0); // 1 m
90 
91  yMinCmd = new G4UIcmdWithADoubleAndUnit("/vis/wormPlot/yMin",this);
92  yMinCmd->SetGuidance("Set the minimum co-ordinate for the plot's y axis");
93  yMinCmd->SetParameterName("y", true);
94  yMinCmd->SetDefaultUnit("m");
95  yMinCmd->SetDefaultValue(-1.0); // -1 m
96 
97  yMaxCmd = new G4UIcmdWithADoubleAndUnit("/vis/wormPlot/yMax",this);
98  yMaxCmd->SetGuidance("Set the maximum co-ordinate for the plot's y axis");
99  yMaxCmd->SetParameterName("y", true);
100  yMaxCmd->SetDefaultUnit("m");
101  yMaxCmd->SetDefaultValue(1.0); // 1 m
102 
103  z0Cmd = new G4UIcmdWithADoubleAndUnit("/vis/wormPlot/z0",this);
104  z0Cmd->SetGuidance("Set the z (third axis) co-ordinate of the plot's x-y plane position");
105  z0Cmd->SetParameterName("z", true);
106  z0Cmd->SetDefaultUnit("m");
107  z0Cmd->SetDefaultValue(0.0);
108 
109  fileCmd = new G4UIcmdWithAString("/vis/wormPlot/createPlot",this);
110  fileCmd->SetGuidance("Create the worm plot; specify the name of the output file");
111  fileCmd->SetParameterName("fileName",true);
112  fileCmd->SetDefaultValue("wormPlot.png");
113  fileCmd->AvailableForStates(G4State_Idle);
114 
115 }
G4UIcmdWithAString * yNameCmd
G4UIcmdWithADoubleAndUnit * yMaxCmd
G4UIcmdWith3Vector * yAxisCmd
G4UIcmdWithAString * fileCmd
G4UIcmdWithADoubleAndUnit * xMaxCmd
G4UIcmdWithAString * xNameCmd
G4UIcmdWith3Vector * xAxisCmd
G4UIcmdWithADoubleAndUnit * yMinCmd
G4UIcmdWithADoubleAndUnit * z0Cmd
G4UIcmdWithADoubleAndUnit * xMinCmd

Member Function Documentation

G4String LBNFWormPlotMessenger::GetCurrentValue ( G4UIcommand *  command)
virtual

Definition at line 132 of file LBNFWormPlotMessenger.cc.

133 {
134 
135  G4String currentValue("");
136 
137  if (command == xAxisCmd) {
138  currentValue = xAxisCmd->ConvertToString(theWorm->GetXAxis());
139  } else if (command == yAxisCmd) {
140  currentValue = yAxisCmd->ConvertToString(theWorm->GetYAxis());
141  } else if (command == xMinCmd) {
142  currentValue = xMinCmd->ConvertToString(theWorm->GetXMin());
143  } else if (command == xMaxCmd) {
144  currentValue = xMaxCmd->ConvertToString(theWorm->GetXMax());
145  } else if (command == yMinCmd) {
146  currentValue = yMinCmd->ConvertToString(theWorm->GetYMin());
147  } else if (command == yMaxCmd) {
148  currentValue = yMaxCmd->ConvertToString(theWorm->GetYMax());
149  }
150 
151  return currentValue;
152 
153 }
int command
G4double GetYMax() const
G4UIcmdWithADoubleAndUnit * yMaxCmd
G4ThreeVector GetXAxis() const
G4double GetXMin() const
G4double GetYMin() const
G4UIcmdWith3Vector * yAxisCmd
G4double GetXMax() const
G4UIcmdWithADoubleAndUnit * xMaxCmd
G4UIcmdWith3Vector * xAxisCmd
G4UIcmdWithADoubleAndUnit * yMinCmd
G4ThreeVector GetYAxis() const
G4UIcmdWithADoubleAndUnit * xMinCmd
LBNFWormPlotMessenger * LBNFWormPlotMessenger::GetInstance ( LBNFWormPlotter wPlot)
static

Definition at line 45 of file LBNFWormPlotMessenger.cc.

45  {
46 
47  if (!fpInstance) fpInstance = new LBNFWormPlotMessenger(wPlot);
48  return fpInstance;
49 
50 }
LBNFWormPlotMessenger(LBNFWormPlotter *wPlot)
static LBNFWormPlotMessenger * fpInstance
void LBNFWormPlotMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)
virtual

Definition at line 155 of file LBNFWormPlotMessenger.cc.

156 {
157 
158  if (command == xAxisCmd) {
159  theWorm->SetXAxis(xAxisCmd->GetNew3VectorValue(newValue));
160  } else if (command == xNameCmd) {
161  theWorm->SetXName(newValue);
162  } else if (command == yAxisCmd) {
163  theWorm->SetYAxis(yAxisCmd->GetNew3VectorValue(newValue));
164  } else if (command == yNameCmd) {
165  theWorm->SetYName(newValue);
166  } else if (command == xMinCmd) {
167  theWorm->SetXMin(xMinCmd->GetNewDoubleValue(newValue));
168  } else if (command == xMaxCmd) {
169  theWorm->SetXMax(xMaxCmd->GetNewDoubleValue(newValue));
170  } else if (command == yMinCmd) {
171  theWorm->SetYMin(yMinCmd->GetNewDoubleValue(newValue));
172  } else if (command == yMaxCmd) {
173  theWorm->SetYMax(yMaxCmd->GetNewDoubleValue(newValue));
174  } else if (command == z0Cmd) {
175  theWorm->SetZ0(z0Cmd->GetNewDoubleValue(newValue));
176  } else if (command == fileCmd) {
177  theWorm->CreatePlot(newValue);
178  }
179 
180 }
void SetYMax(const G4double &val)
void SetYAxis(const G4ThreeVector &vect)
G4UIcmdWithAString * yNameCmd
void SetYMin(const G4double &val)
void CreatePlot(const G4String &fileName)
int command
G4UIcmdWithADoubleAndUnit * yMaxCmd
void SetXMax(const G4double &val)
G4UIcmdWith3Vector * yAxisCmd
G4UIcmdWithAString * fileCmd
void SetXAxis(const G4ThreeVector &vect)
G4UIcmdWithADoubleAndUnit * xMaxCmd
void SetYName(const G4String &word)
G4UIcmdWithAString * xNameCmd
G4UIcmdWith3Vector * xAxisCmd
G4UIcmdWithADoubleAndUnit * yMinCmd
void SetXName(const G4String &word)
G4UIcmdWithADoubleAndUnit * z0Cmd
void SetXMin(const G4double &val)
void SetZ0(const G4double &val)
G4UIcmdWithADoubleAndUnit * xMinCmd

Member Data Documentation

G4UIcmdWithAString* LBNFWormPlotMessenger::fileCmd
private

Definition at line 80 of file LBNFWormPlotMessenger.hh.

LBNFWormPlotMessenger * LBNFWormPlotMessenger::fpInstance = 0
staticprivate

Definition at line 63 of file LBNFWormPlotMessenger.hh.

LBNFWormPlotter* LBNFWormPlotMessenger::theWorm
private

Definition at line 65 of file LBNFWormPlotMessenger.hh.

G4UIdirectory* LBNFWormPlotMessenger::wormDir
private

Definition at line 67 of file LBNFWormPlotMessenger.hh.

G4UIcmdWith3Vector* LBNFWormPlotMessenger::xAxisCmd
private

Definition at line 68 of file LBNFWormPlotMessenger.hh.

G4UIcmdWithADoubleAndUnit* LBNFWormPlotMessenger::xMaxCmd
private

Definition at line 74 of file LBNFWormPlotMessenger.hh.

G4UIcmdWithADoubleAndUnit* LBNFWormPlotMessenger::xMinCmd
private

Definition at line 73 of file LBNFWormPlotMessenger.hh.

G4UIcmdWithAString* LBNFWormPlotMessenger::xNameCmd
private

Definition at line 69 of file LBNFWormPlotMessenger.hh.

G4UIcmdWith3Vector* LBNFWormPlotMessenger::yAxisCmd
private

Definition at line 70 of file LBNFWormPlotMessenger.hh.

G4UIcmdWithADoubleAndUnit* LBNFWormPlotMessenger::yMaxCmd
private

Definition at line 76 of file LBNFWormPlotMessenger.hh.

G4UIcmdWithADoubleAndUnit* LBNFWormPlotMessenger::yMinCmd
private

Definition at line 75 of file LBNFWormPlotMessenger.hh.

G4UIcmdWithAString* LBNFWormPlotMessenger::yNameCmd
private

Definition at line 71 of file LBNFWormPlotMessenger.hh.

G4UIcmdWithADoubleAndUnit* LBNFWormPlotMessenger::z0Cmd
private

Definition at line 78 of file LBNFWormPlotMessenger.hh.


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