Geant4.10
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
ExG4DetectorConstruction02Messenger Class Reference

#include <ExG4DetectorConstruction02Messenger.hh>

Inheritance diagram for ExG4DetectorConstruction02Messenger:
G4UImessenger

Public Member Functions

 ExG4DetectorConstruction02Messenger (ExG4DetectorConstruction02 *)
 
virtual ~ExG4DetectorConstruction02Messenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
- 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
 

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
 

Detailed Description

Messenger class that defines commands for ExG4DetectorConstruction02.

It implements commands:

Definition at line 53 of file ExG4DetectorConstruction02Messenger.hh.

Constructor & Destructor Documentation

ExG4DetectorConstruction02Messenger::ExG4DetectorConstruction02Messenger ( ExG4DetectorConstruction02 detectorConstruction)

Definition at line 41 of file ExG4DetectorConstruction02Messenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithADouble::SetParameterName(), G4UIcmdWith3VectorAndUnit::SetParameterName(), and G4UIcommand::SetRange().

43  : G4UImessenger(),
44  fDetectorConstruction(detectorConstruction),
45  fTopDirectory(0),
46  fDirectory(0),
47  fSetBoxMaterialCmd(0),
48  fSetWorldMaterialCmd(0),
49  fSetBoxDimensionsCmd(0),
50  fSetWorldSizeFactorCmd(0)
51 
52 {
53  fTopDirectory = new G4UIdirectory("/ExG4/");
54  fTopDirectory->SetGuidance("UI commands of common example classes");
55 
56  fDirectory = new G4UIdirectory("/ExG4/det/");
57  fDirectory->SetGuidance("Detector control");
58 
59  fSetBoxMaterialCmd
60  = new G4UIcmdWithAString("/ExG4/det/setBoxMaterial",this);
61  fSetBoxMaterialCmd->SetGuidance("Select material of the box.");
62  fSetBoxMaterialCmd->SetParameterName("BoxMaterial", false);
63  fSetBoxMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
64 
65  fSetWorldMaterialCmd
66  = new G4UIcmdWithAString("/ExG4/det/setWorldMaterial",this);
67  fSetWorldMaterialCmd->SetGuidance("Select material of the world.");
68  fSetWorldMaterialCmd->SetParameterName("WorldMaterial", false);
69  fSetWorldMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
70 
71  fSetBoxDimensionsCmd
72  = new G4UIcmdWith3VectorAndUnit("/ExG4/det/setBoxDimensions",this);
73  fSetBoxDimensionsCmd->SetGuidance("Set box dimensions (in half lentgh).");
74  fSetBoxDimensionsCmd->SetParameterName(
75  "BoxDimensionsHx", "BoxDimensionsHy","BoxDimensionsHz",
76  false);
77  //fSetBoxDimensionsCmd->SetUnitCategory("Length");
78  fSetBoxDimensionsCmd->AvailableForStates(G4State_PreInit);
79 
80  fSetWorldSizeFactorCmd
81  = new G4UIcmdWithADouble("/ExG4/det/setWorldSizeFactor",this);
82  fSetWorldSizeFactorCmd->SetGuidance(
83  "Set the multiplication factor from box dimensions to world dimensions.");
84  fSetWorldSizeFactorCmd->SetParameterName("WorldSizeFactor", false);
85  fSetWorldSizeFactorCmd->SetRange("WorldSizeFactor >= 1");
86  fSetWorldSizeFactorCmd->AvailableForStates(G4State_PreInit);
87 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
ExG4DetectorConstruction02Messenger::~ExG4DetectorConstruction02Messenger ( )
virtual

Definition at line 91 of file ExG4DetectorConstruction02Messenger.cc.

92 {
93  delete fTopDirectory;
94  delete fDirectory;
95  delete fSetBoxMaterialCmd;
96  delete fSetWorldMaterialCmd;
97  delete fSetBoxDimensionsCmd;
98  delete fSetWorldSizeFactorCmd;
99 }

Member Function Documentation

void ExG4DetectorConstruction02Messenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 103 of file ExG4DetectorConstruction02Messenger.cc.

References G4UIcmdWith3VectorAndUnit::GetNew3VectorValue(), G4UIcmdWithADouble::GetNewDoubleValue(), ExG4DetectorConstruction02::SetBoxDimensions(), ExG4DetectorConstruction02::SetBoxMaterial(), ExG4DetectorConstruction02::SetWorldMaterial(), ExG4DetectorConstruction02::SetWorldSizeFactor(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

105 {
106  if( command == fSetBoxMaterialCmd ) {
107  fDetectorConstruction->SetBoxMaterial(newValue);
108  }
109  else if( command == fSetWorldMaterialCmd ) {
110  fDetectorConstruction->SetWorldMaterial(newValue);
111  }
112  else if( command == fSetBoxDimensionsCmd ) {
113  G4ThreeVector newDimensions
114  = fSetBoxDimensionsCmd->GetNew3VectorValue(newValue);
115  fDetectorConstruction
117  newDimensions.x(), newDimensions.y(), newDimensions.z());
118  }
119  else if ( command == fSetWorldSizeFactorCmd ) {
120  fDetectorConstruction
121  ->SetWorldSizeFactor(fSetWorldSizeFactorCmd->GetNewDoubleValue(newValue));
122  }
123 }
double x() const
void SetWorldMaterial(const G4String &materialName)
void SetBoxDimensions(G4double hx, G4double hy, G4double hz)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
double z() const
static G4double GetNewDoubleValue(const char *paramString)
void SetBoxMaterial(const G4String &materialName)
double y() const

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