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

#include <G4GDMLMessenger.hh>

Inheritance diagram for G4GDMLMessenger:
G4UImessenger

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
 

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

Definition at line 53 of file G4GDMLMessenger.hh.

Constructor & Destructor Documentation

G4GDMLMessenger::G4GDMLMessenger ( G4GDMLParser myPars)

Definition at line 47 of file G4GDMLMessenger.cc.

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

48  : myParser(myPars), topvol(0)
49 {
50  persistencyDir = new G4UIdirectory("/persistency/");
51  persistencyDir->SetGuidance("UI commands specific to persistency.");
52 
53  gdmlDir = new G4UIdirectory("/persistency/gdml/");
54  gdmlDir->SetGuidance("GDML parser and writer.");
55 
56  ReaderCmd = new G4UIcmdWithAString("/persistency/gdml/read",this);
57  ReaderCmd->SetGuidance("Read GDML file.");
58  ReaderCmd->SetParameterName("filename",false);
60 
61  TopVolCmd = new G4UIcmdWithAString("/persistency/gdml/topvol",this);
62  TopVolCmd->SetGuidance("Set the top volume for writing the GDML file.");
63  TopVolCmd->SetParameterName("topvol",false);
64 
65  WriterCmd = new G4UIcmdWithAString("/persistency/gdml/write",this);
66  WriterCmd->SetGuidance("Write GDML file.");
67  WriterCmd->SetParameterName("filename",false);
68  WriterCmd->AvailableForStates(G4State_Idle);
69 
70  ClearCmd = new G4UIcmdWithoutParameter("/persistency/gdml/clear",this);
71  ClearCmd->SetGuidance("Clear geometry (before reading a new one from GDML).");
73 }
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:225
G4GDMLMessenger::~G4GDMLMessenger ( )

Definition at line 75 of file G4GDMLMessenger.cc.

76 {
77  delete ReaderCmd;
78  delete WriterCmd;
79  delete ClearCmd;
80  delete TopVolCmd;
81  delete persistencyDir;
82  delete gdmlDir;
83 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 85 of file G4GDMLMessenger.cc.

References G4PhysicalVolumeStore::Clean(), G4LogicalVolumeStore::Clean(), G4SolidStore::Clean(), G4GDMLParser::Clear(), G4RunManager::DefineWorldVolume(), G4LogicalVolumeStore::GetInstance(), G4GeometryManager::GetInstance(), G4RunManager::GetRunManager(), G4LogicalVolumeStore::GetVolume(), G4GDMLParser::GetWorldVolume(), G4GeometryManager::OpenGeometry(), G4GDMLParser::Read(), and G4GDMLParser::Write().

86 {
87  if( command == ReaderCmd )
88  {
90  myParser->Read(newValue);
92  }
93 
94  if( command == TopVolCmd )
95  {
96  topvol = G4LogicalVolumeStore::GetInstance()->GetVolume(newValue);
97  }
98 
99  if( command == WriterCmd )
100  {
101  myParser->Write(newValue, topvol);
102  }
103 
104  if( command == ClearCmd )
105  {
106  myParser->Clear();
111  }
112 }
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
static void Clean()
Definition: G4SolidStore.cc:79
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
static G4LogicalVolumeStore * GetInstance()
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
static G4GeometryManager * GetInstance()
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
void Read(const G4String &filename, G4bool Validate=true)
void OpenGeometry(G4VPhysicalVolume *vol=0)

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