Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GDMLMessenger Class Reference

#include <G4GDMLMessenger.hh>

+ Inheritance 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)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
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)
 
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::G4GDMLMessenger ( G4GDMLParser myPars)

Definition at line 47 of file G4GDMLMessenger.cc.

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);
69
70 ClearCmd = new G4UIcmdWithoutParameter("/persistency/gdml/clear",this);
71 ClearCmd->SetGuidance("Clear geometry (before reading a new one from GDML).");
73}
@ G4State_Idle
@ G4State_PreInit
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:219

◆ ~G4GDMLMessenger()

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

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 85 of file G4GDMLMessenger.cc.

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
void Read(const G4String &filename, G4bool Validate=true)
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
void OpenGeometry(G4VPhysicalVolume *vol=0)
static G4GeometryManager * GetInstance()
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
static G4LogicalVolumeStore * GetInstance()
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:62
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
static void Clean()
Definition: G4SolidStore.cc:73

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