G4VisCommandDrawTree Class Reference

#include <G4VisCommandsCompound.hh>

Inheritance diagram for G4VisCommandDrawTree:

G4VVisCommand G4UImessenger

Public Member Functions

 G4VisCommandDrawTree ()
virtual ~G4VisCommandDrawTree ()
void SetNewValue (G4UIcommand *command, G4String newValue)

Detailed Description

Definition at line 36 of file G4VisCommandsCompound.hh.


Constructor & Destructor Documentation

G4VisCommandDrawTree::G4VisCommandDrawTree (  ) 

Definition at line 41 of file G4VisCommandsCompound.cc.

References G4UIcommand::SetGuidance().

00041                                            {
00042   G4bool omitable;
00043   fpCommand = new G4UIcommand("/vis/drawTree", this);
00044   fpCommand->SetGuidance
00045     ("(DTREE) Creates a scene consisting of this physical volume and"
00046      "\n  produces a representation of the geometry hieracrhy.");
00047   fpCommand->SetGuidance("The scene becomes current.");
00048   G4UIparameter* parameter;
00049   parameter = new G4UIparameter("physical-volume-name", 's', omitable = true);
00050   parameter -> SetDefaultValue("world");
00051   fpCommand -> SetParameter (parameter);
00052   parameter = new G4UIparameter("system", 's', omitable = true);
00053   parameter -> SetDefaultValue("ATree");
00054   fpCommand -> SetParameter (parameter);
00055 }

G4VisCommandDrawTree::~G4VisCommandDrawTree (  )  [virtual]

Definition at line 57 of file G4VisCommandsCompound.cc.

00057                                             {
00058   delete fpCommand;
00059 }


Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 61 of file G4VisCommandsCompound.cc.

References G4UImanager::ApplyCommand(), G4VisManager::confirmations, G4VVisCommand::fpVisManager, G4cout, G4endl, G4VisManager::GetCurrentGraphicsSystem(), G4VisManager::GetCurrentScene(), G4VisManager::GetCurrentSceneHandler(), G4VisManager::GetCurrentViewer(), G4VViewer::GetName(), G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), G4VisManager::GetVerbosity(), G4VisManager::SetCurrentGraphicsSystem(), G4VisManager::SetCurrentScene(), G4VisManager::SetCurrentSceneHandler(), G4VisManager::SetCurrentViewer(), G4UImanager::SetVerboseLevel(), and G4VisManager::warnings.

00061                                                                       {
00062 
00063   G4String pvname, system;
00064   std::istringstream is(newValue);
00065   is >> pvname >> system;
00066 
00067   G4VGraphicsSystem* keepSystem = fpVisManager->GetCurrentGraphicsSystem();
00068   G4Scene* keepScene = fpVisManager->GetCurrentScene();
00069   G4VSceneHandler* keepSceneHandler = fpVisManager->GetCurrentSceneHandler();
00070   G4VViewer* keepViewer = fpVisManager->GetCurrentViewer();
00071 
00072   G4UImanager* UImanager = G4UImanager::GetUIpointer();
00073   G4int keepVerbose = UImanager->GetVerboseLevel();
00074   G4int newVerbose(0);
00075   if (keepVerbose >= 2 ||
00076       fpVisManager->GetVerbosity() >= G4VisManager::confirmations)
00077     newVerbose = 2;
00078   UImanager->SetVerboseLevel(newVerbose);
00079   UImanager->ApplyCommand(G4String("/vis/open " + system));
00080   UImanager->ApplyCommand(G4String("/vis/drawVolume " + pvname));
00081   UImanager->ApplyCommand("/vis/viewer/flush");
00082   UImanager->SetVerboseLevel(keepVerbose);
00083 
00084   if (keepViewer) {
00085     if (fpVisManager->GetVerbosity() >= G4VisManager::warnings) {
00086       G4cout << "Reverting to " << keepViewer->GetName() << G4endl;
00087     }
00088     fpVisManager->SetCurrentGraphicsSystem(keepSystem);
00089     fpVisManager->SetCurrentScene(keepScene);
00090     fpVisManager->SetCurrentSceneHandler(keepSceneHandler);
00091     fpVisManager->SetCurrentViewer(keepViewer);
00092   }
00093 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:44 2013 for Geant4 by  doxygen 1.4.7