Geant4  10.02.p03
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
 

Private Attributes

G4GDMLParsermyParser
 
G4LogicalVolumetopvol
 
G4UIdirectorypersistencyDir
 
G4UIdirectorygdmlDir
 
G4UIcmdWithAStringReaderCmd
 
G4UIcmdWithAStringWriterCmd
 
G4UIcmdWithAStringTopVolCmd
 
G4UIcmdWithoutParameterClearCmd
 
G4UIcmdWithABoolRegionCmd
 
G4UIcmdWithABoolEcutsCmd
 

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::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);
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);
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  ClearCmd = new G4UIcmdWithoutParameter("/persistency/gdml/clear",this);
89  ClearCmd->SetGuidance("Clear geometry (before reading a new one from GDML).");
91 }
G4LogicalVolume * topvol
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIdirectory * persistencyDir
G4UIcmdWithAString * WriterCmd
G4UIcmdWithABool * EcutsCmd
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:239
G4GDMLParser * myParser
G4UIcmdWithAString * ReaderCmd
G4UIcmdWithAString * TopVolCmd
G4UIcmdWithoutParameter * ClearCmd
G4UIcmdWithABool * RegionCmd
G4UIdirectory * gdmlDir
Here is the call graph for this function:

◆ ~G4GDMLMessenger()

G4GDMLMessenger::~G4GDMLMessenger ( )

Definition at line 93 of file G4GDMLMessenger.cc.

94 {
95  delete ReaderCmd;
96  delete WriterCmd;
97  delete ClearCmd;
98  delete TopVolCmd;
99  delete RegionCmd;
100  delete EcutsCmd;
101  delete persistencyDir;
102  delete gdmlDir;
103 }
G4UIdirectory * persistencyDir
G4UIcmdWithAString * WriterCmd
G4UIcmdWithABool * EcutsCmd
G4UIcmdWithAString * ReaderCmd
G4UIcmdWithAString * TopVolCmd
G4UIcmdWithoutParameter * ClearCmd
G4UIcmdWithABool * RegionCmd
G4UIdirectory * gdmlDir

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 105 of file G4GDMLMessenger.cc.

106 {
107  if( command == ReaderCmd )
108  {
110  myParser->Read(newValue);
112  }
113 
114  if( command == RegionCmd )
115  {
116  G4bool mode = RegionCmd->GetNewBoolValue(newValue);
117  myParser->SetRegionExport(mode);
118  }
119 
120  if( command == EcutsCmd )
121  {
122  G4bool mode = EcutsCmd->GetNewBoolValue(newValue);
124  }
125 
126  if( command == TopVolCmd )
127  {
129  }
130 
131  if( command == WriterCmd )
132  {
133  myParser->Write(newValue, topvol);
134  }
135 
136  if( command == ClearCmd )
137  {
138  myParser->Clear();
140  }
141 }
G4LogicalVolume * topvol
G4UIcmdWithAString * WriterCmd
void SetRegionExport(G4bool)
static G4bool GetNewBoolValue(const char *paramString)
G4UIcmdWithABool * EcutsCmd
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
bool G4bool
Definition: G4Types.hh:79
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
static G4LogicalVolumeStore * GetInstance()
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
static G4GeometryManager * GetInstance()
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
void SetEnergyCutsExport(G4bool)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4GDMLParser * myParser
void Read(const G4String &filename, G4bool Validate=true)
G4UIcmdWithAString * ReaderCmd
G4UIcmdWithAString * TopVolCmd
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4UIcmdWithoutParameter * ClearCmd
G4UIcmdWithABool * RegionCmd
Here is the call graph for this function:

Member Data Documentation

◆ ClearCmd

G4UIcmdWithoutParameter* G4GDMLMessenger::ClearCmd
private

Definition at line 73 of file G4GDMLMessenger.hh.

◆ EcutsCmd

G4UIcmdWithABool* G4GDMLMessenger::EcutsCmd
private

Definition at line 75 of file G4GDMLMessenger.hh.

◆ gdmlDir

G4UIdirectory* G4GDMLMessenger::gdmlDir
private

Definition at line 69 of file G4GDMLMessenger.hh.

◆ myParser

G4GDMLParser* G4GDMLMessenger::myParser
private

Definition at line 65 of file G4GDMLMessenger.hh.

◆ persistencyDir

G4UIdirectory* G4GDMLMessenger::persistencyDir
private

Definition at line 68 of file G4GDMLMessenger.hh.

◆ ReaderCmd

G4UIcmdWithAString* G4GDMLMessenger::ReaderCmd
private

Definition at line 70 of file G4GDMLMessenger.hh.

◆ RegionCmd

G4UIcmdWithABool* G4GDMLMessenger::RegionCmd
private

Definition at line 74 of file G4GDMLMessenger.hh.

◆ topvol

G4LogicalVolume* G4GDMLMessenger::topvol
private

Definition at line 66 of file G4GDMLMessenger.hh.

◆ TopVolCmd

G4UIcmdWithAString* G4GDMLMessenger::TopVolCmd
private

Definition at line 72 of file G4GDMLMessenger.hh.

◆ WriterCmd

G4UIcmdWithAString* G4GDMLMessenger::WriterCmd
private

Definition at line 71 of file G4GDMLMessenger.hh.


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