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

#include <ML2PhantomConstructionMessenger.hh>

Inheritance diagram for CML2PhantomConstructionMessenger:
G4UImessenger

Public Member Functions

 CML2PhantomConstructionMessenger (CML2PhantomConstruction *phantomConstructor)
 
 ~CML2PhantomConstructionMessenger (void)
 
void SetNewValue (G4UIcommand *cmd, G4String newValue)
 
void SetReferenceWorld (G4bool bOV)
 
- 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 62 of file ML2PhantomConstructionMessenger.hh.

Constructor & Destructor Documentation

CML2PhantomConstructionMessenger::CML2PhantomConstructionMessenger ( CML2PhantomConstruction phantomConstructor)

Definition at line 53 of file ML2PhantomConstructionMessenger.cc.

References G4UIcmdWith3VectorAndUnit::SetDefaultUnit(), G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWith3VectorAndUnit::SetDefaultValue(), G4UIcommand::SetGuidance(), CML2PhantomConstruction::setPhantomFileName(), and CML2PhantomConstruction::setPhantomName().

53  : pPhantomConstructor (phantomConstructor)
54 {
55  PhantomName=new G4UIcmdWithAString("/phantom/PhantomName",this);
56  PhantomName->SetDefaultValue("fullWater");
57  PhantomName->SetGuidance("phantom name to select among those implemented fullWater, boxInBox, Dicom1");
58  pPhantomConstructor->setPhantomName("fullWater");
59 
60  PhantomFileName =new G4UIcmdWithAString("/phantom/PhantomFileName",this);
61  PhantomFileName ->SetDefaultValue("");
62  PhantomFileName->SetGuidance("full path and macro file name containing specific setup data for the phantom chosen");
63  pPhantomConstructor->setPhantomFileName ("");
64 
65  phantomCentre=new G4UIcmdWith3VectorAndUnit("/phantom/centre", this);
66  phantomCentre->SetDefaultUnit("mm");
67  phantomCentre->SetGuidance("phantom centre coordinates in the world [mm]");
68  phantomCentre->SetDefaultValue(G4ThreeVector(0.,0.,0.));
69 }
CLHEP::Hep3Vector G4ThreeVector
void SetDefaultUnit(const char *defUnit)
void setPhantomFileName(G4String val)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetDefaultValue(G4ThreeVector defVal)
void SetDefaultValue(const char *defVal)
void setPhantomName(G4String val)
CML2PhantomConstructionMessenger::~CML2PhantomConstructionMessenger ( void  )

Definition at line 71 of file ML2PhantomConstructionMessenger.cc.

72 {
73  delete PhantomName;
74  delete phantomCentre;
75 }

Member Function Documentation

void CML2PhantomConstructionMessenger::SetNewValue ( G4UIcommand cmd,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 76 of file ML2PhantomConstructionMessenger.cc.

References CML2PhantomConstruction::addNewCentre(), G4UImanager::ApplyCommand(), CML2PhantomConstruction::applyNewCentre(), G4UIcmdWith3VectorAndUnit::GetNew3VectorRawValue(), G4UImanager::GetUIpointer(), CML2PhantomConstruction::setPhantomFileName(), and CML2PhantomConstruction::setPhantomName().

77 {
78  if (cmd==PhantomName)
79  {pPhantomConstructor->setPhantomName(newValue);}
80 
81  if (cmd==PhantomFileName )
82  {pPhantomConstructor->setPhantomFileName (newValue);}
83 
84  if (cmd==phantomCentre )
85  {
86  if (bOnlyVisio)
87  {
88  pPhantomConstructor->applyNewCentre(phantomCentre->GetNew3VectorRawValue(newValue));
89 // what follows seems to be necessary to have a good refresh
91  G4String command;
92  command = "/run/beamOn 0";
93  UI->ApplyCommand(command);
94  command = "/vis/viewer/flush";
95  UI->ApplyCommand(command);
96  }
97  else
98  {
99  pPhantomConstructor->addNewCentre(phantomCentre->GetNew3VectorRawValue(newValue));
100  }
101  }
102 }
void setPhantomFileName(G4String val)
void addNewCentre(G4ThreeVector val)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void setPhantomName(G4String val)
static G4ThreeVector GetNew3VectorRawValue(const char *paramString)
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419
void applyNewCentre(G4ThreeVector val)
void CML2PhantomConstructionMessenger::SetReferenceWorld ( G4bool  bOV)
inline

Definition at line 68 of file ML2PhantomConstructionMessenger.hh.

Referenced by CML2PhantomConstruction::Construct().

68 {bOnlyVisio=bOV;}

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