12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Communication and Controlfalse. If you assign this extra argument as true, the default value of the parameter will be overriden by thecurrent value of the target class.7.2.3. An example messengerThis example is of G4ParticleGunMessenger, which is made by inheriting G4UIcommand.Example 7.1. An example of G4ParticleGunMessenger.hh.#ifndef G4ParticleGunMessenger_h#define G4ParticleGunMessenger_h 1class G4ParticleGun;class G4ParticleTable;class G4UIcommand;class G4UIdirectory;class G4UIcmdWithoutParameter;class G4UIcmdWithAString;class G4UIcmdWithADoubleAndUnit;class G4UIcmdWith3Vector;class G4UIcmdWith3VectorAndUnit;#include "G4UImessenger.hh"#include "globals.hh"class G4ParticleGunMessenger: public G4UImessenger{public:G4ParticleGunMessenger(G4ParticleGun * fPtclGun);~G4ParticleGunMessenger();};public:void SetNewValue(G4UIcommand * command,G4String newValues);G4String GetCurrentValue(G4UIcommand * command);private:G4ParticleGun * fParticleGun;G4ParticleTable * particleTable;private: //commandsG4UIdirectory *gunDirectory;G4UIcmdWithoutParameter * listCmd;G4UIcmdWithAString * particleCmd;G4UIcmdWith3Vector * directionCmd;G4UIcmdWithADoubleAndUnit * energyCmd;G4UIcmdWith3VectorAndUnit * positionCmd;G4UIcmdWithADoubleAndUnit * timeCmd;#endif210

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!