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

#include <G4VisCommandsSceneHandler.hh>

+ Inheritance diagram for G4VisCommandSceneHandlerList:

Public Member Functions

 G4VisCommandSceneHandlerList ()
 
 ~G4VisCommandSceneHandlerList ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
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 63 of file G4VisCommandsSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneHandlerList()

G4VisCommandSceneHandlerList::G4VisCommandSceneHandlerList ( )

Definition at line 326 of file G4VisCommandsSceneHandler.cc.

326 {
327 G4bool omitable;
328 fpCommand = new G4UIcommand ("/vis/sceneHandler/list", this);
329 fpCommand -> SetGuidance ("Lists scene handler(s).");
330 fpCommand -> SetGuidance
331 ("\"help /vis/verbose\" for definition of verbosity.");
332 G4UIparameter* parameter;
333 parameter = new G4UIparameter("scene-handler-name", 's', omitable = true);
334 parameter -> SetDefaultValue ("all");
335 fpCommand -> SetParameter (parameter);
336 parameter = new G4UIparameter ("verbosity", 's', omitable = true);
337 parameter -> SetDefaultValue ("warnings");
338 fpCommand -> SetParameter (parameter);
339}
bool G4bool
Definition: G4Types.hh:67

◆ ~G4VisCommandSceneHandlerList()

G4VisCommandSceneHandlerList::~G4VisCommandSceneHandlerList ( )

Definition at line 341 of file G4VisCommandsSceneHandler.cc.

341 {
342 delete fpCommand;
343}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneHandlerList::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 345 of file G4VisCommandsSceneHandler.cc.

345 {
346 return "";
347}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 349 of file G4VisCommandsSceneHandler.cc.

350 {
351 G4String name, verbosityString;
352 std::istringstream is (newValue);
353 is >> name >> verbosityString;
354 G4VisManager::Verbosity verbosity =
355 fpVisManager->GetVerbosityValue(verbosityString);
356 const G4VSceneHandler* currentSceneHandler =
357 fpVisManager -> GetCurrentSceneHandler ();
358 G4String currentName;
359 if (currentSceneHandler) currentName = currentSceneHandler->GetName();
360
361 const G4SceneHandlerList& list = fpVisManager -> GetAvailableSceneHandlers ();
362 G4bool found = false;
363 for (size_t iSH = 0; iSH < list.size (); iSH++) {
364 const G4String& iName = list [iSH] -> GetName ();
365 if (name != "all") {
366 if (name != iName) continue;
367 }
368 found = true;
369 if (iName == currentName) {
370 G4cout << " (current)";
371 }
372 else {
373 G4cout << " ";
374 }
375 G4cout << " scene handler \"" << list [iSH] -> GetName () << "\""
376 << " (" << list [iSH] -> GetGraphicsSystem () -> GetName () << ")";
377 if (verbosity >= G4VisManager::parameters) {
378 G4cout << "\n " << *(list [iSH]);
379 }
380 G4cout << G4endl;
381 }
382 if (!found) {
383 G4cout << "No scene handlers found";
384 if (name != "all") {
385 G4cout << " of name \"" << name << "\"";
386 }
387 G4cout << "." << G4endl;
388 }
389}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
const G4String & GetName() const
static G4VisManager * fpVisManager
static Verbosity GetVerbosityValue(const G4String &)

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