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

#include <ExG4DetectorConstruction01Messenger.hh>

Inheritance diagram for ExG4DetectorConstruction01Messenger:
G4UImessenger

Public Member Functions

 ExG4DetectorConstruction01Messenger (ExG4DetectorConstruction01 *)
 
virtual ~ExG4DetectorConstruction01Messenger ()
 
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 ExG4DetectorConstruction01.

It implements commands:

Definition at line 51 of file ExG4DetectorConstruction01Messenger.hh.

Constructor & Destructor Documentation

ExG4DetectorConstruction01Messenger::ExG4DetectorConstruction01Messenger ( ExG4DetectorConstruction01 detectorConstruction)

Definition at line 41 of file ExG4DetectorConstruction01Messenger.cc.

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

43  : G4UImessenger(),
44  fDetectorConstruction(detectorConstruction),
45  fTopDirectory(0),
46  fDirectory(0),
47  fSetMaterialCmd(0),
48  fSetDimensionsCmd(0)
49 
50 {
51  fTopDirectory = new G4UIdirectory("/ExG4/");
52  fTopDirectory->SetGuidance("UI commands of common example classes");
53 
54  fDirectory = new G4UIdirectory("/ExG4/det/");
55  fDirectory->SetGuidance("Detector control");
56 
57  fSetMaterialCmd
58  = new G4UIcmdWithAString("/ExG4/det/setBoxMaterial",this);
59  fSetMaterialCmd->SetGuidance("Select material of the box.");
60  fSetMaterialCmd->SetParameterName("BoxMaterial", false);
62 
63  fSetDimensionsCmd
64  = new G4UIcmdWith3VectorAndUnit("/ExG4/det/setBoxDimensions",this);
65  fSetDimensionsCmd->SetGuidance("Set box dimensions (in half lentgh).");
66  fSetDimensionsCmd->SetParameterName(
67  "BoxDimensionsHx", "BoxDimensionsHy","BoxDimensionsHz",
68  false);
69  //fSetDimensionsCmd->SetUnitCategory("Length");
70  fSetDimensionsCmd->AvailableForStates(G4State_PreInit);
71 }
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 SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
ExG4DetectorConstruction01Messenger::~ExG4DetectorConstruction01Messenger ( )
virtual

Definition at line 75 of file ExG4DetectorConstruction01Messenger.cc.

76 {
77  delete fTopDirectory;
78  delete fDirectory;
79  delete fSetMaterialCmd;
80  delete fSetDimensionsCmd;
81 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 85 of file ExG4DetectorConstruction01Messenger.cc.

References G4UIcmdWith3VectorAndUnit::GetNew3VectorValue(), ExG4DetectorConstruction01::SetDimensions(), ExG4DetectorConstruction01::SetMaterial(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

87 {
88  if( command == fSetMaterialCmd ) {
89  fDetectorConstruction->SetMaterial(newValue);
90  }
91  else if( command == fSetDimensionsCmd ) {
92  G4ThreeVector newDimensions
93  = fSetDimensionsCmd->GetNew3VectorValue(newValue);
94  fDetectorConstruction
95  ->SetDimensions(
96  newDimensions.x(), newDimensions.y(), newDimensions.z());
97  }
98 }
double x() const
void SetDimensions(G4double hx, G4double hy, G4double hz)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
double z() const
void SetMaterial(const G4String &materialName)
double y() const

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