Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4GDMLMessenger Class Reference

#include <G4GDMLMessenger.hh>

Inheritance diagram for G4GDMLMessenger:
Collaboration diagram for G4GDMLMessenger:

Public Member Functions

 G4GDMLMessenger (G4GDMLParser *)
 
 ~G4GDMLMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
- 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 54 of file G4GDMLMessenger.hh.

Constructor & Destructor Documentation

G4GDMLMessenger::G4GDMLMessenger ( G4GDMLParser myPars)

Definition at line 48 of file G4GDMLMessenger.cc.

49  : myParser(myPars), topvol(0)
50 {
51  persistencyDir = new G4UIdirectory("/persistency/");
52  persistencyDir->SetGuidance("UI commands specific to persistency.");
53 
54  gdmlDir = new G4UIdirectory("/persistency/gdml/");
55  gdmlDir->SetGuidance("GDML parser and writer.");
56 
57  ReaderCmd = new G4UIcmdWithAString("/persistency/gdml/read",this);
58  ReaderCmd->SetGuidance("Read GDML file.");
59  ReaderCmd->SetParameterName("filename",false);
61 
62  TopVolCmd = new G4UIcmdWithAString("/persistency/gdml/topvol",this);
63  TopVolCmd->SetGuidance("Set the top volume for writing the GDML file.");
64  TopVolCmd->SetParameterName("topvol",false);
65 
66  WriterCmd = new G4UIcmdWithAString("/persistency/gdml/write",this);
67  WriterCmd->SetGuidance("Write GDML file.");
68  WriterCmd->SetParameterName("filename",false);
69  WriterCmd->AvailableForStates(G4State_Idle);
70 
71  RegionCmd = new G4UIcmdWithABool("/persistency/gdml/export_regions",this);
72  RegionCmd->SetGuidance("Enable export of geometrical regions");
73  RegionCmd->SetGuidance("for storing production cuts.");
74  RegionCmd->SetParameterName("export_regions",false);
75  RegionCmd->SetDefaultValue(false);
76  RegionCmd->AvailableForStates(G4State_Idle);
77 
78  EcutsCmd = new G4UIcmdWithABool("/persistency/gdml/export_Ecuts",this);
79  EcutsCmd->SetGuidance("Enable export of energy cuts associated");
80  EcutsCmd->SetGuidance("to logical volumes.");
81  EcutsCmd->SetGuidance("NOTE: may increase considerably the size of the");
82  EcutsCmd->SetGuidance(" GDML file! Information is anyhow not used");
83  EcutsCmd->SetGuidance(" for import.");
84  EcutsCmd->SetParameterName("export_Ecuts",false);
85  EcutsCmd->SetDefaultValue(false);
87 
88  SDCmd = new G4UIcmdWithABool("/persistency/gdml/export_SD",this);
89  SDCmd->SetGuidance("Enable export of SD associated");
90  SDCmd->SetGuidance("to logical volumes.");
91  SDCmd->SetParameterName("export_SD",false);
92  SDCmd->SetDefaultValue(false);
94 
95  ClearCmd = new G4UIcmdWithoutParameter("/persistency/gdml/clear",this);
96  ClearCmd->SetGuidance("Clear geometry (before reading a new one from GDML).");
98 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
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

Here is the call graph for this function:

G4GDMLMessenger::~G4GDMLMessenger ( )

Definition at line 100 of file G4GDMLMessenger.cc.

101 {
102  delete ReaderCmd;
103  delete WriterCmd;
104  delete ClearCmd;
105  delete TopVolCmd;
106  delete RegionCmd;
107  delete EcutsCmd;
108  delete SDCmd;
109  delete persistencyDir;
110  delete gdmlDir;
111 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 113 of file G4GDMLMessenger.cc.

114 {
115  if( command == ReaderCmd )
116  {
118  myParser->Read(newValue);
120  }
121 
122  if( command == RegionCmd )
123  {
124  G4bool mode = RegionCmd->GetNewBoolValue(newValue);
125  myParser->SetRegionExport(mode);
126  }
127 
128  if( command == EcutsCmd )
129  {
130  G4bool mode = EcutsCmd->GetNewBoolValue(newValue);
131  myParser->SetEnergyCutsExport(mode);
132  }
133 
134  if( command == SDCmd )
135  {
136  G4bool mode = SDCmd->GetNewBoolValue(newValue);
137  myParser->SetSDExport(mode);
138  }
139 
140  if( command == TopVolCmd )
141  {
142  topvol = G4LogicalVolumeStore::GetInstance()->GetVolume(newValue);
143  }
144 
145  if( command == WriterCmd )
146  {
147  myParser->Write(newValue, topvol);
148  }
149 
150  if( command == ClearCmd )
151  {
152  myParser->Clear();
154  }
155 }
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
void SetRegionExport(G4bool)
static G4bool GetNewBoolValue(const char *paramString)
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
bool G4bool
Definition: G4Types.hh:79
static G4LogicalVolumeStore * GetInstance()
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
void SetSDExport(G4bool)
static G4GeometryManager * GetInstance()
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
void SetEnergyCutsExport(G4bool)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
void Read(const G4String &filename, G4bool Validate=true)
void OpenGeometry(G4VPhysicalVolume *vol=0)

Here is the call graph for this function:


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