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

#include <PerspectiveVisActionMessenger.hh>

Inheritance diagram for PerspectiveVisActionMessenger:
G4UImessenger

Public Member Functions

 PerspectiveVisActionMessenger (PerspectiveVisAction *)
 
 ~PerspectiveVisActionMessenger ()
 
virtual 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 41 of file PerspectiveVisActionMessenger.hh.

Constructor & Destructor Documentation

PerspectiveVisActionMessenger::PerspectiveVisActionMessenger ( PerspectiveVisAction PVA)

Definition at line 44 of file PerspectiveVisActionMessenger.cc.

44  :
45  G4UImessenger(),
46  fPVA(PVA),
47  fpDirectory(0),
48  fpCommandOS(0),
49  fpCommandScene(0)
50 {
51  G4bool omitable;
52 
53  fpDirectory = new G4UIdirectory ("/perspectiveDemo/");
54  fpDirectory -> SetGuidance ("Perspective demonstration commands.");
55 
56  fpCommandOS = new G4UIcmdWithAString ("/perspectiveDemo/optionString", this);
57  fpCommandOS -> SetGuidance
58  ("Option string - any combination of \"x\", \"y\", \"z\", \"a[ll]\".");
59  fpCommandOS -> SetGuidance
60  ("Controls direction of perspective lines.");
61  fpCommandOS -> SetParameterName ("option-string", omitable = true);
62  fpCommandOS -> SetDefaultValue("all");
63 
64  fpCommandScene = new G4UIcmdWithAString ("/perspectiveDemo/scene", this);
65  fpCommandScene -> SetGuidance
66  ("Scene name.");
67  fpCommandScene -> SetParameterName ("scene-name", omitable = true);
68  fpCommandScene -> SetDefaultValue("room-and-chair");
69  fpCommandScene -> SetCandidates("room-and-chair");
70 }
bool G4bool
Definition: G4Types.hh:79
PerspectiveVisActionMessenger::~PerspectiveVisActionMessenger ( )

Definition at line 74 of file PerspectiveVisActionMessenger.cc.

75 {
76  delete fpCommandScene;
77  delete fpCommandOS;
78  delete fpDirectory;
79 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 84 of file PerspectiveVisActionMessenger.cc.

References G4UImanager::ApplyCommand(), and G4UImanager::GetUIpointer().

85 {
86  if (command == fpCommandOS)
87  {
88  fPVA->SetOptionString(newValue);
89  }
90 
91  else if (command == fpCommandScene)
92  {
93  fPVA->SetScene(newValue);
94  }
95 
96  G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild");
97 }
void SetScene(const G4String &scene)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void SetOptionString(const G4String &optionString)
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419

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