Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandDrawTree Class Reference

#include <G4VisCommandsCompound.hh>

+ Inheritance 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)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
- 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)
 
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
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentLineWidth = 1.
 
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
 

Detailed Description

Definition at line 36 of file G4VisCommandsCompound.hh.

Constructor & Destructor Documentation

◆ G4VisCommandDrawTree()

G4VisCommandDrawTree::G4VisCommandDrawTree ( )

Definition at line 41 of file G4VisCommandsCompound.cc.

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

◆ ~G4VisCommandDrawTree()

G4VisCommandDrawTree::~G4VisCommandDrawTree ( )
virtual

Definition at line 57 of file G4VisCommandsCompound.cc.

57 {
58 delete fpCommand;
59}

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 61 of file G4VisCommandsCompound.cc.

61 {
62
63 G4String pvname, system;
64 std::istringstream is(newValue);
65 is >> pvname >> system;
66
68 G4Scene* keepScene = fpVisManager->GetCurrentScene();
71
73 G4int keepVerbose = UImanager->GetVerboseLevel();
74 G4int newVerbose(0);
75 if (keepVerbose >= 2 ||
77 newVerbose = 2;
78 UImanager->SetVerboseLevel(newVerbose);
79 UImanager->ApplyCommand(G4String("/vis/open " + system));
80 UImanager->ApplyCommand(G4String("/vis/drawVolume " + pvname));
81 UImanager->ApplyCommand("/vis/viewer/flush");
82 UImanager->SetVerboseLevel(keepVerbose);
83
84 if (keepViewer) {
86 G4cout << "Reverting to " << keepViewer->GetName() << G4endl;
87 }
89 fpVisManager->SetCurrentScene(keepScene);
90 fpVisManager->SetCurrentSceneHandler(keepSceneHandler);
91 fpVisManager->SetCurrentViewer(keepViewer);
92 }
93}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:369
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:218
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:51
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:216
const G4String & GetName() const
static G4VisManager * fpVisManager
void SetCurrentGraphicsSystem(G4VGraphicsSystem *)
G4Scene * GetCurrentScene() const
void SetCurrentSceneHandler(G4VSceneHandler *)
void SetCurrentScene(G4Scene *)
void SetCurrentViewer(G4VViewer *)
G4VGraphicsSystem * GetCurrentGraphicsSystem() const
G4VViewer * GetCurrentViewer() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()

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