Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VisCommandDrawTree Class Reference

#include <G4VisCommandsCompound.hh>

Inheritance diagram for G4VisCommandDrawTree:
Collaboration diagram for G4VisCommandDrawTree:

Public Member Functions

 G4VisCommandDrawTree ()
 
virtual ~G4VisCommandDrawTree ()
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- 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
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
static const G4ColourGetCurrentColour ()
 
static G4double GetCurrentLineWidth ()
 
static const G4ColourGetCurrentTextColour ()
 
static G4Text::Layout GetCurrentTextLayout ()
 
static G4double GetCurrentTextSize ()
 
- Protected Member Functions inherited from G4VVisCommand
void UpdateVisManagerScene (const G4String &sceneName="")
 
- 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)
 
- Static Protected Member Functions inherited from G4VVisCommand
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 
static void ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4int fErrorCode = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4double fCurrentLineWidth = 1.
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentTextSize = 12.
 
static
G4ModelingParameters::PVNameCopyNoPath 
fCurrentTouchablePath
 

Detailed Description

Definition at line 36 of file G4VisCommandsCompound.hh.

Constructor & Destructor Documentation

G4VisCommandDrawTree::G4VisCommandDrawTree ( )

Definition at line 42 of file G4VisCommandsCompound.cc.

42  {
43  G4bool omitable;
44  fpCommand = new G4UIcommand("/vis/drawTree", this);
45  fpCommand->SetGuidance
46  ("(DTREE) Creates a scene consisting of this physical volume and"
47  "\n produces a representation of the geometry hieracrhy.");
48  fpCommand->SetGuidance("The scene becomes current.");
49  G4UIparameter* parameter;
50  parameter = new G4UIparameter("physical-volume-name", 's', omitable = true);
51  parameter -> SetDefaultValue("world");
52  fpCommand -> SetParameter (parameter);
53  parameter = new G4UIparameter("system", 's', omitable = true);
54  parameter -> SetDefaultValue("ATree");
55  fpCommand -> SetParameter (parameter);
56 }
bool G4bool
Definition: G4Types.hh:79
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161

Here is the call graph for this function:

G4VisCommandDrawTree::~G4VisCommandDrawTree ( )
virtual

Definition at line 58 of file G4VisCommandsCompound.cc.

58  {
59  delete fpCommand;
60 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 62 of file G4VisCommandsCompound.cc.

62  {
63 
64  G4String pvname, system;
65  std::istringstream is(newValue);
66  is >> pvname >> system;
67 
68  // Note: The second parameter, "system", is intended to allow the user
69  // a choice of dedicated tree printing/displaying systems but at present
70  // the only such dedicated system is ASCIITree. It doesn't make sense to
71  // specify OGLSX, for example. So to avoid confusion we restrict this
72  // feature to systems that have "Tree" in the name or nickname.
73 
74  // Of course, some other systems, such as OGLSQt, have a tree browser
75  // built-in. The HepRApp offline browser also has a tree browser
76  // built in.
77 
78  if (!system.contains("Tree")) {
79  system = "ATree";
80  }
81 
83  G4Scene* keepScene = fpVisManager->GetCurrentScene();
85  G4VViewer* keepViewer = fpVisManager->GetCurrentViewer();
86 
88  G4int keepVerbose = UImanager->GetVerboseLevel();
89  G4int newVerbose(0);
90  if (keepVerbose >= 2 ||
92  newVerbose = 2;
93  UImanager->SetVerboseLevel(newVerbose);
94  UImanager->ApplyCommand(G4String("/vis/open " + system));
95  if (fErrorCode == 0) {
96  UImanager->ApplyCommand(G4String("/vis/drawVolume " + pvname));
97  UImanager->ApplyCommand("/vis/viewer/flush");
98  if (keepViewer) {
100  G4cout << "Reverting to " << keepViewer->GetName() << G4endl;
101  }
103  fpVisManager->SetCurrentScene(keepScene);
104  fpVisManager->SetCurrentSceneHandler(keepSceneHandler);
105  fpVisManager->SetCurrentViewer(keepViewer);
106  }
107  }
108  UImanager->SetVerboseLevel(keepVerbose);
109 }
const G4String & GetName() const
void SetCurrentSceneHandler(G4VSceneHandler *)
G4VGraphicsSystem * GetCurrentGraphicsSystem() const
void SetCurrentScene(G4Scene *)
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:227
int G4int
Definition: G4Types.hh:78
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:225
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4GLOB_DLL std::ostream G4cout
void SetCurrentGraphicsSystem(G4VGraphicsSystem *)
void SetCurrentViewer(G4VViewer *)
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
static G4int fErrorCode
G4VViewer * GetCurrentViewer() const
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
G4Scene * GetCurrentScene() const
static G4VisManager * fpVisManager

Here is the call graph for this function:


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