source: trunk/source/digits_hits/utils/src/G4ScoringMessenger.cc @ 1337

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 20.8 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4ScoringMessenger.cc,v 1.39 2008/11/26 21:27:35 asaim Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30// ---------------------------------------------------------------------
31
32#include "G4ScoringMessenger.hh"
33#include "G4ScoringManager.hh"
34#include "G4VScoringMesh.hh"
35#include "G4ScoringBox.hh"
36#include "G4ScoringCylinder.hh"
37
38#include "G4UIdirectory.hh"
39#include "G4UIcmdWithoutParameter.hh"
40#include "G4UIcmdWithAnInteger.hh"
41#include "G4UIcmdWithAString.hh"
42#include "G4UIcmdWithABool.hh"
43#include "G4UIcmdWithADoubleAndUnit.hh"
44#include "G4UIcmdWith3VectorAndUnit.hh"
45#include "G4UIcommand.hh"
46#include "G4Tokenizer.hh"
47#include "G4UnitsTable.hh"
48#include "G4VScoreColorMap.hh"
49
50G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
51:fSMan(SManager)
52{
53  G4UIparameter* param;
54
55  scoreDir = new G4UIdirectory("/score/");
56  scoreDir->SetGuidance("Interactive scoring commands.");
57
58  listCmd = new G4UIcmdWithoutParameter("/score/list",this);
59  listCmd->SetGuidance("List scoring worlds.");
60
61  dumpCmd = new G4UIcmdWithoutParameter("/score/dump",this);
62  dumpCmd->SetGuidance("Dump results of scorers.");
63
64  verboseCmd = new G4UIcmdWithAnInteger("/score/verbose",this);
65  verboseCmd->SetGuidance("Verbosity.");
66  verboseCmd->SetGuidance("  0) errors or warnings,");
67  verboseCmd->SetGuidance("  1) information with 0)");
68
69  meshDir = new G4UIdirectory("/score/mesh/");
70  meshDir->SetGuidance("    Mesh processing commands.");
71
72  meshCreateDir = new G4UIdirectory("/score/create/");
73  meshCreateDir->SetGuidance("  Mesh creation commands.");
74  //
75  // Mesh commands
76  meshBoxCreateCmd = new G4UIcmdWithAString("/score/create/boxMesh",this);
77  meshBoxCreateCmd->SetGuidance("Create scoring box mesh.");
78  meshBoxCreateCmd->SetParameterName("MeshName",false);
79  //
80  meshCylinderCreateCmd = new G4UIcmdWithAString("/score/create/cylinderMesh",this);
81  meshCylinderCreateCmd->SetGuidance("Create scoring mesh.");
82  meshCylinderCreateCmd->SetParameterName("MeshName",false);
83  //
84//  meshSphereCreateCmd = new G4UIcmdWithAString("/score/create/sphereMesh",this);
85//  meshSphereCreateCmd->SetGuidance("Create scoring mesh.");
86//  meshSphereCreateCmd->SetParameterName("MeshName",false);
87  //
88  meshOpnCmd = new G4UIcmdWithAString("/score/open",this);
89  meshOpnCmd->SetGuidance("Open scoring mesh.");
90  meshOpnCmd->SetParameterName("MeshName",false);
91  //
92  meshClsCmd = new G4UIcmdWithoutParameter("/score/close",this);
93  meshClsCmd->SetGuidance("Close scoring mesh.");
94  //
95//  meshActCmd = new G4UIcmdWithABool("/score/mesh/activate",this);
96//  meshActCmd->SetGuidance("Activate scoring mesh.");
97//  meshActCmd->SetParameterName("MeshName",false);
98  //
99  mBoxSizeCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/boxSize",this);
100  mBoxSizeCmd->SetGuidance("Define size of the scoring mesh.");
101  mBoxSizeCmd->SetGuidance("Dx  Dy  Dz  unit");
102  mBoxSizeCmd->SetParameterName("Di","Dj","Dk",false,false);
103  mBoxSizeCmd->SetRange("Di>0. && Dj>0. && Dk>0.");
104  mBoxSizeCmd->SetDefaultUnit("mm");
105  //
106  mCylinderSizeCmd = new G4UIcommand("/score/mesh/cylinderSize",this);
107  mCylinderSizeCmd->SetGuidance("Define size of the scoring mesh.");
108  mCylinderSizeCmd->SetGuidance("R   Dz  unit");
109  param = new G4UIparameter("R",'d',false);
110  param->SetParameterRange("R>0");
111  mCylinderSizeCmd->SetParameter(param);
112  param = new G4UIparameter("Dz",'d',false);
113  param->SetParameterRange("Dz>0");
114  mCylinderSizeCmd->SetParameter(param);
115  param = new G4UIparameter("unit",'s',true);
116  param->SetDefaultValue("mm");
117  mCylinderSizeCmd->SetParameter(param);
118  //
119  //   Division command
120  mBinCmd = new G4UIcommand("/score/mesh/nBin",this);
121  mBinCmd->SetGuidance("Define segments of the scoring mesh.");
122  mBinCmd->SetGuidance("[usage] /score/mesh/nBin");
123  mBinCmd->SetGuidance(" In case of boxMesh, parameters are given in");
124  mBinCmd->SetGuidance("   Ni  :(int) Number of bins i (in x-axis) ");
125  mBinCmd->SetGuidance("   Nj  :(int) Number of bins j (in y-axis) ");
126  mBinCmd->SetGuidance("   Nk  :(int) Number of bins k (in z-axis) ");
127  mBinCmd->SetGuidance(" In case of cylinderMesh, parameters are given in");
128  mBinCmd->SetGuidance("   Nr  :(int) Number of bins in radial axis ");
129  mBinCmd->SetGuidance("   Nz  :(int) Number of bins in z axis ");
130  mBinCmd->SetGuidance("   Nphi:(int) Number of bins in phi axis ");
131  //mBinCmd->SetGuidance("  Axis:(int) Axis of division ");
132//  mBinCmd->SetGuidance("  P1..Pn-1  :(double) \"paramter from P1 to Pn-1 for division.\"");
133  param = new G4UIparameter("Ni",'i',false);
134  param->SetDefaultValue("1");
135  param->SetParameterRange("Ni>0");
136  mBinCmd->SetParameter(param);
137  param = new G4UIparameter("Nj",'i',false);
138  param->SetDefaultValue("1");
139  param->SetParameterRange("Nj>0");
140  mBinCmd->SetParameter(param);
141  param = new G4UIparameter("Nk",'i',false);
142  param->SetDefaultValue("1");
143  mBinCmd->SetParameter(param);
144  param->SetParameterRange("Nk>0");
145  //param = new G4UIparameter("Axis",'i',true);
146  //param->SetDefaultValue("3");
147  //mBinCmd->SetParameter(param);
148  //
149  //   Placement command
150  mTransDir = new G4UIdirectory("/score/mesh/translate/");
151  mTransDir->SetGuidance("Mesh translation commands.");
152  //
153  mTResetCmd = new G4UIcmdWithoutParameter("/score/mesh/translate/reset",this);
154  mTResetCmd->SetGuidance("Reset translated position of the scoring mesh.");
155  //
156  mTXyzCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/translate/xyz",this);
157  mTXyzCmd->SetGuidance("Translate the scoring mesh.");
158  mTXyzCmd->SetParameterName("X","Y","Z",false,false);
159  mTXyzCmd->SetDefaultUnit("mm");
160  //
161  mRotDir = new G4UIdirectory("/score/mesh/rotate/");
162  mRotDir->SetGuidance("Mesh rotation commands.");
163  //
164  mRResetCmd = new G4UIcmdWithoutParameter("/score/mesh/rotate/reset",this);
165  mRResetCmd->SetGuidance("Reset rotation angles of the scoring mesh.");
166  //
167  mRotXCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateX",this);
168  mRotXCmd->SetGuidance("Rotate the scoring mesh in X axis.");
169  mRotXCmd->SetParameterName("Rx",false);
170  mRotXCmd->SetDefaultUnit("deg");
171  //
172  mRotYCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateY",this);
173  mRotYCmd->SetGuidance("Rotate the scoring mesh in Y axis.");
174  mRotYCmd->SetParameterName("Ry",false);
175  mRotYCmd->SetDefaultUnit("deg");
176  //
177  mRotZCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateZ",this);
178  mRotZCmd->SetGuidance("Rotate the scoring mesh in Z axis.");
179  mRotZCmd->SetParameterName("Rz",false);
180  mRotZCmd->SetDefaultUnit("deg");
181  //
182
183  // Draw Scoring result
184  drawCmd = new G4UIcommand("/score/drawProjection",this);
185  drawCmd->SetGuidance("Draw projection(s) of scored quantities.");
186  drawCmd->SetGuidance("Parameter <proj> specified which projection(s) to be drawn.");
187  drawCmd->SetGuidance("  100 : xy-plane, 010 : yz-place, 001 : zx-plane -- default 111");
188  param = new G4UIparameter("meshName",'s',false);
189  drawCmd->SetParameter(param);
190  param = new G4UIparameter("psName",'s',false);
191  drawCmd->SetParameter(param);
192  param = new G4UIparameter("colorMapName",'s',true);
193  param->SetDefaultValue("defaultLinearColorMap");
194  drawCmd->SetParameter(param);
195  param = new G4UIparameter("proj",'i',true);
196  param->SetDefaultValue(111);
197  drawCmd->SetParameter(param);
198
199  // Draw column
200  drawColumnCmd = new G4UIcommand("/score/drawColumn",this);
201  drawColumnCmd->SetGuidance("Draw a cell column.");
202  drawColumnCmd->SetGuidance(" plane = 0 : xy, 1: yz, 2: zx");
203  param = new G4UIparameter("meshName",'s',false);
204  drawColumnCmd->SetParameter(param);
205  param = new G4UIparameter("psName",'s',false);
206  drawColumnCmd->SetParameter(param);
207  param = new G4UIparameter("plane",'i',false);
208  param->SetParameterRange("plane>=0 && plane<=2");
209  drawColumnCmd->SetParameter(param);
210  param = new G4UIparameter("column",'i',false);
211  drawColumnCmd->SetParameter(param);
212  param = new G4UIparameter("colorMapName",'s',true);
213  param->SetDefaultValue("defaultLinearColorMap");
214  drawColumnCmd->SetParameter(param);
215
216  colorMapDir = new G4UIdirectory("/score/colorMap/");
217  colorMapDir->SetGuidance("Color map commands.");
218
219  listColorMapCmd = new G4UIcmdWithoutParameter("/score/colorMap/listScoreColorMaps",this);
220  listColorMapCmd->SetGuidance("List registered score color maps.");
221
222  floatMinMaxCmd = new G4UIcmdWithAString("/score/colorMap/floatMinMax",this);
223  floatMinMaxCmd->SetGuidance("Min/Max of the color map is calculated accorging to the actual scores.");
224  floatMinMaxCmd->SetParameterName("colorMapName",true,false);
225  floatMinMaxCmd->SetDefaultValue("defaultLinearColorMap");
226
227  colorMapMinMaxCmd = new G4UIcommand("/score/colorMap/setMinMax",this);
228  colorMapMinMaxCmd->SetGuidance("Define min/max value of the color map.");
229  param = new G4UIparameter("colorMapMame",'s',true);
230  param->SetDefaultValue("defaultLinearColorMap");
231  colorMapMinMaxCmd->SetParameter(param);
232  param = new G4UIparameter("minValue",'d',false);
233  colorMapMinMaxCmd->SetParameter(param);
234  param = new G4UIparameter("maxValue",'d',false);
235  colorMapMinMaxCmd->SetParameter(param);
236
237  chartCmd = new G4UIcommand("/score/drawChart",this);
238  chartCmd->SetGuidance("Draw color chart on the screen.");
239  chartCmd->SetGuidance("[usage] /score/drawChart");
240  chartCmd->SetGuidance("  mesh    :(String) Mesh name.");
241  chartCmd->SetGuidance("  psname  :(String) PS name.");
242  chartCmd->SetGuidance("  On/Off  :(boolean) On or Off the color chart.");
243  chartCmd->SetGuidance("  scale   :(String) default=linear, or log ");
244  param = new G4UIparameter("meshName",'s',false);
245  chartCmd->SetParameter(param);
246  param = new G4UIparameter("psName",'s',false);
247  chartCmd->SetParameter(param);
248  param = new G4UIparameter("On",'s',true);
249  param->SetDefaultValue("true");
250  chartCmd->SetParameter(param);
251  param = new G4UIparameter("scale",'s',true);
252  param->SetDefaultValue("linear");
253  chartCmd->SetParameter(param);
254 
255  // Dump a scored quantity
256  dumpQtyToFileCmd = new G4UIcommand("/score/dumpQuantityToFile", this);
257  dumpQtyToFileCmd->SetGuidance("Dump one scored quantity to file.");
258  param = new G4UIparameter("meshName", 's', false);
259  dumpQtyToFileCmd->SetParameter(param);
260  param = new G4UIparameter("psName", 's', false);
261  dumpQtyToFileCmd->SetParameter(param);
262  param = new G4UIparameter("fileName", 's', false);
263  dumpQtyToFileCmd->SetParameter(param);
264  param = new G4UIparameter("option", 's', true);
265  dumpQtyToFileCmd->SetParameter(param);
266
267  // Dump all scored quantities
268  dumpAllQtsToFileCmd = new G4UIcommand("/score/dumpAllQuantitiesToFile", this);
269  dumpAllQtsToFileCmd->SetGuidance("Dump all quantities of the mesh to file.");
270  param = new G4UIparameter("meshName", 's', false);
271  dumpAllQtsToFileCmd->SetParameter(param);
272  param = new G4UIparameter("fileName", 's', false);
273  dumpAllQtsToFileCmd->SetParameter(param);
274  param = new G4UIparameter("option", 's', true);
275  dumpAllQtsToFileCmd->SetParameter(param);
276
277}
278
279G4ScoringMessenger::~G4ScoringMessenger()
280{
281    delete listCmd;
282    delete verboseCmd;
283    //
284    delete           meshCreateDir;
285    delete           meshBoxCreateCmd;
286    delete           meshCylinderCreateCmd;
287//    delete           meshSphereCreateCmd;
288    //
289    delete          meshOpnCmd;
290    //
291    delete    meshClsCmd;
292//    delete    meshActCmd;
293    delete          meshDir;
294    //
295    delete  mBoxSizeCmd;
296    delete  mCylinderSizeCmd;
297//    delete  mSphereSizeCmd;
298    //
299    delete      mBinCmd;
300    //
301    delete   mTResetCmd;
302    delete   mTXyzCmd;
303    delete   mTransDir;
304    delete   mRResetCmd;
305    delete   mRotXCmd;
306    delete   mRotYCmd;
307    delete   mRotZCmd;
308    delete   mRotDir;
309    //
310    delete     chartCmd;
311    delete     dumpCmd;
312    delete     drawCmd;
313    delete     drawColumnCmd;
314    delete     listColorMapCmd;
315    delete     floatMinMaxCmd;
316    delete     colorMapMinMaxCmd;
317    delete     colorMapDir;
318    delete     dumpQtyToFileCmd;
319    delete     dumpAllQtsToFileCmd;
320    //
321    delete scoreDir;
322}
323
324void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
325{
326  if(command==listCmd) { 
327      fSMan->List(); 
328  } else if(command==dumpCmd) { 
329      fSMan->Dump(); 
330  } else if(command==drawCmd) { 
331      G4Tokenizer next(newVal);
332      G4String meshName = next();
333      G4String psName = next();
334      G4String colorMapName = next();
335      G4int axflg = StoI(next());
336      fSMan->DrawMesh(meshName,psName,colorMapName,axflg);
337  } else if(command==drawColumnCmd) { 
338      G4Tokenizer next(newVal);
339      G4String meshName = next();
340      G4String psName = next();
341      G4int iPlane = StoI(next());
342      G4int iColumn = StoI(next());
343      G4String colorMapName = next();
344      fSMan->DrawMesh(meshName,psName,iPlane,iColumn,colorMapName);
345  } else if(command==chartCmd ){
346      G4Tokenizer next(newVal);
347      G4String meshName = next();
348      G4String psName = next();
349      //G4bool   onFlag = StoB(next());
350      G4String scaleOption = next();
351//      fSMan->DrawChart(meshName,psName,onFlag,scaleOption);
352
353  } else if(command==dumpQtyToFileCmd) { 
354      G4Tokenizer next(newVal);
355      G4String meshName = next();
356      G4String psName = next();
357      G4String fileName = next();
358      G4String option = next("\n");
359      fSMan->DumpQuantityToFile(meshName, psName, fileName, option);
360  } else if(command==dumpAllQtsToFileCmd) { 
361      G4Tokenizer next(newVal);
362      G4String meshName = next();
363      G4String fileName = next();
364      G4String option = next("\n");
365      fSMan->DumpAllQuantitiesToFile(meshName, fileName, option);
366  } else if(command==verboseCmd) { 
367      fSMan->SetVerboseLevel(verboseCmd->GetNewIntValue(newVal)); 
368  } else if(command==meshBoxCreateCmd) {
369      G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh(); 
370      if ( currentmesh ){
371        G4cerr << "ERROR[" << meshBoxCreateCmd->GetCommandPath()
372               << "] : Mesh <" << currentmesh->GetWorldName() 
373               << "> is still open. Close it first. Command ignored." << G4endl;
374      } else {
375
376        G4VScoringMesh*  mesh = fSMan->FindMesh(newVal);
377        if ( !mesh ){
378          mesh = new G4ScoringBox(newVal);
379          fSMan->RegisterScoringMesh(mesh);
380        }else{
381          G4cerr << "ERROR[" << meshBoxCreateCmd->GetCommandPath()
382                 << "] : Scoring mesh <" << newVal
383                 << "> already exists. Command ignored." << G4endl;
384        }
385      }
386  } else if(command==meshCylinderCreateCmd) {
387      G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh(); 
388      if ( currentmesh ){
389        G4cerr << "ERROR[" << meshBoxCreateCmd->GetCommandPath()
390               << "] : Mesh <" << currentmesh->GetWorldName() 
391               << "> is still open. Close it first. Command ignored." << G4endl;
392      } else {
393
394        G4VScoringMesh*  mesh = fSMan->FindMesh(newVal);
395        if ( !mesh ){
396          mesh = new G4ScoringCylinder(newVal);
397          fSMan->RegisterScoringMesh(mesh);
398        }else{
399          G4cerr << "ERROR[" << meshCylinderCreateCmd->GetCommandPath()
400                 << "] : Scoring mesh <" << newVal
401                 << "> already exists. Command ignored." << G4endl;
402        }
403      }
404  } else if(command==listColorMapCmd) {
405      fSMan->ListScoreColorMaps();
406  } else if(command==floatMinMaxCmd) {
407      G4VScoreColorMap* colorMap = fSMan->GetScoreColorMap(newVal);
408      if(colorMap)
409      { colorMap->SetFloatingMinMax(true); }
410      else
411      { G4cerr << "ERROR[" << floatMinMaxCmd->GetCommandPath()
412               << "] : color map <" << newVal << "> is not defined. Command ignored." 
413               << G4endl; 
414      }
415  } else if(command==colorMapMinMaxCmd) {
416      G4Tokenizer next(newVal);
417      G4String mapName = next();
418      G4double minVal = StoD(next());
419      G4double maxVal = StoD(next());
420      G4VScoreColorMap* colorMap = fSMan->GetScoreColorMap(mapName);
421      if(colorMap)
422      { colorMap->SetFloatingMinMax(false);
423        colorMap->SetMinMax(minVal,maxVal); }
424      else
425      { G4cerr << "ERROR[" << colorMapMinMaxCmd->GetCommandPath()
426               << "] : color map <" << newVal << "> is not defined. Command ignored." 
427               << G4endl; 
428      }
429  } else if(command==meshOpnCmd) {
430      G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh(); 
431      if ( currentmesh ){
432        G4cerr << "ERROR[" << meshOpnCmd->GetCommandPath()
433               << "] : Mesh <" << currentmesh->GetWorldName() << "> is still open. Close it first. Command ignored." << G4endl;
434      } else {
435        G4VScoringMesh* mesh = fSMan->FindMesh(newVal); 
436        if ( !mesh ){
437          G4cerr << "ERROR[" << meshOpnCmd->GetCommandPath()
438                 << "] : Scoring mesh <" << newVal << "> does not exist. Command ignored." << G4endl;
439        } else {
440          fSMan->SetCurrentMesh(mesh);
441        }
442      }
443  } else if(command==meshClsCmd) {
444      fSMan->CloseCurrentMesh();
445  } else {
446      //
447      // Get Current Mesh
448      //
449      G4VScoringMesh* mesh = fSMan->GetCurrentMesh();
450      //
451      // Commands for Current Mesh
452      if ( mesh ){
453          // Tokens
454          G4TokenVec token;
455          FillTokenVec(newVal,token);
456          //
457          // Mesh Geometry
458          //
459//        if(command==meshActCmd) {
460//            mesh->Activate(meshActCmd->GetNewBoolValue(newVal));
461//        } else
462          if(command==mBoxSizeCmd) {
463              MeshShape shape = mesh->GetShape();
464              if ( shape == boxMesh ){
465                  G4ThreeVector size = mBoxSizeCmd->GetNew3VectorValue(newVal);
466                  G4double vsize[3];
467                  vsize[0] = size.x();
468                  vsize[1] = size.y();
469                  vsize[2] = size.z();
470                  mesh->SetSize(vsize);
471              } else {
472                 G4cerr << "ERROR[" << mBoxSizeCmd->GetCommandPath()
473                        << "] : This mesh is not Box. Command ignored." << G4endl;
474              }
475          }else if(command==mCylinderSizeCmd) {
476              MeshShape shape = mesh->GetShape();
477              if ( shape == cylinderMesh ){
478                  G4double vsize[3];
479                  vsize[0]     = StoD(token[0]);
480                  vsize[1]     = StoD(token[1]);
481                  G4double unt = mCylinderSizeCmd->ValueOf(token[2]);
482                  vsize[0] *= unt;
483                  vsize[1] *= unt;
484                  vsize[2]  = 0.0;
485                  mesh->SetSize(vsize);
486              } else {
487                  G4cerr << "ERROR[" << mBoxSizeCmd->GetCommandPath()
488                         << "] : This mesh is not Box. Command ignored." << G4endl;
489              }
490          } else if(command==mBinCmd) {
491              MeshBinCommand(mesh,token);
492          } else if(command==mTResetCmd) {
493              G4double centerPosition[3] ={ 0., 0., 0.};
494              mesh->SetCenterPosition(centerPosition);
495          } else if(command==mTXyzCmd) {
496              G4ThreeVector xyz = mTXyzCmd->GetNew3VectorValue(newVal);
497              G4double centerPosition[3];
498              centerPosition[0] = xyz.x();
499              centerPosition[1] = xyz.y();
500              centerPosition[2] = xyz.z();
501              mesh->SetCenterPosition(centerPosition);
502          } else if(command==mRResetCmd) {
503          } else if(command==mRotXCmd) {
504              G4double value = mRotXCmd->GetNewDoubleValue(newVal);
505              mesh->RotateX(value);
506          } else if(command==mRotYCmd) {
507              G4double value = mRotYCmd->GetNewDoubleValue(newVal);
508              mesh->RotateY(value);
509          } else if(command==mRotZCmd) {
510              G4double value = mRotZCmd->GetNewDoubleValue(newVal);
511              mesh->RotateZ(value);
512          }
513      }else{
514        G4cerr << "ERROR: No mesh is currently open. Open/create a mesh first. Command ignored." << G4endl;
515      }
516  }
517}
518
519G4String G4ScoringMessenger::GetCurrentValue(G4UIcommand * command)
520{
521  G4String val;
522  if(command==verboseCmd)
523  { val = verboseCmd->ConvertToString(fSMan->GetVerboseLevel()); }
524
525  return val;
526}
527
528void G4ScoringMessenger::FillTokenVec(G4String newValues, G4TokenVec& token){
529
530    G4Tokenizer next(newValues);
531    G4String val;
532    while ( !(val = next()).isNull() ) {
533        token.push_back(val);
534    }
535}
536
537
538void G4ScoringMessenger::MeshBinCommand(G4VScoringMesh* mesh,G4TokenVec& token){
539    G4int Ni = StoI(token[0]);
540    G4int Nj = StoI(token[1]);
541    G4int Nk = StoI(token[2]);
542    G4int nSegment[3];
543    nSegment[0] = Ni;
544    nSegment[1] = Nj;
545    nSegment[2] = Nk;
546    //
547    mesh->SetNumberOfSegments(nSegment);
548}
549
550 
Note: See TracBrowser for help on using the repository browser.