Geant4  10.02.p03
G4VisCommandSceneHandlerList Class Reference

#include <G4VisCommandsSceneHandler.hh>

Inheritance diagram for G4VisCommandSceneHandlerList:
Collaboration 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, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

G4UIcommandfpCommand
 

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 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 63 of file G4VisCommandsSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneHandlerList()

G4VisCommandSceneHandlerList::G4VisCommandSceneHandlerList ( )

Definition at line 362 of file G4VisCommandsSceneHandler.cc.

362  {
363  G4bool omitable;
364  fpCommand = new G4UIcommand ("/vis/sceneHandler/list", this);
365  fpCommand -> SetGuidance ("Lists scene handler(s).");
366  fpCommand -> SetGuidance
367  ("\"help /vis/verbose\" for definition of verbosity.");
368  G4UIparameter* parameter;
369  parameter = new G4UIparameter("scene-handler-name", 's', omitable = true);
370  parameter -> SetDefaultValue ("all");
371  fpCommand -> SetParameter (parameter);
372  parameter = new G4UIparameter ("verbosity", 's', omitable = true);
373  parameter -> SetDefaultValue ("warnings");
374  fpCommand -> SetParameter (parameter);
375 }
bool G4bool
Definition: G4Types.hh:79

◆ ~G4VisCommandSceneHandlerList()

G4VisCommandSceneHandlerList::~G4VisCommandSceneHandlerList ( )

Definition at line 377 of file G4VisCommandsSceneHandler.cc.

377  {
378  delete fpCommand;
379 }

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneHandlerList::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 381 of file G4VisCommandsSceneHandler.cc.

381  {
382  return "";
383 }

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 385 of file G4VisCommandsSceneHandler.cc.

386  {
387  G4String name, verbosityString;
388  std::istringstream is (newValue);
389  is >> name >> verbosityString;
390  G4VisManager::Verbosity verbosity =
391  fpVisManager->GetVerbosityValue(verbosityString);
392  const G4VSceneHandler* currentSceneHandler =
393  fpVisManager -> GetCurrentSceneHandler ();
394  G4String currentName;
395  if (currentSceneHandler) currentName = currentSceneHandler->GetName();
396 
397  const G4SceneHandlerList& list = fpVisManager -> GetAvailableSceneHandlers ();
398  G4bool found = false;
399  for (size_t iSH = 0; iSH < list.size (); iSH++) {
400  const G4String& iName = list [iSH] -> GetName ();
401  if (name != "all") {
402  if (name != iName) continue;
403  }
404  found = true;
405  if (iName == currentName) {
406  G4cout << " (current)";
407  }
408  else {
409  G4cout << " ";
410  }
411  G4cout << " scene handler \"" << list [iSH] -> GetName () << "\""
412  << " (" << list [iSH] -> GetGraphicsSystem () -> GetName () << ")";
413  if (verbosity >= G4VisManager::parameters) {
414  G4cout << "\n " << *(list [iSH]);
415  }
416  G4cout << G4endl;
417  }
418  if (!found) {
419  G4cout << "No scene handlers found";
420  if (name != "all") {
421  G4cout << " of name \"" << name << "\"";
422  }
423  G4cout << "." << G4endl;
424  }
425 }
G4String name
Definition: TRTMaterials.hh:40
const G4String & GetName() const
static Verbosity GetVerbosityValue(const G4String &)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
static G4VisManager * fpVisManager
Here is the call graph for this function:

Member Data Documentation

◆ fpCommand

G4UIcommand* G4VisCommandSceneHandlerList::fpCommand
private

Definition at line 71 of file G4VisCommandsSceneHandler.hh.


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