Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4VisCommandSceneHandlerList Class Reference

#include <G4VisCommandsSceneHandler.hh>

Inheritance diagram for G4VisCommandSceneHandlerList:
G4VVisCommand G4UImessenger

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
 

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, 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
 
- 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 ( )

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:79
G4VisCommandSceneHandlerList::~G4VisCommandSceneHandlerList ( )

Definition at line 341 of file G4VisCommandsSceneHandler.cc.

341  {
342  delete fpCommand;
343 }

Member Function Documentation

G4String G4VisCommandSceneHandlerList::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 345 of file G4VisCommandsSceneHandler.cc.

345  {
346  return "";
347 }
void G4VisCommandSceneHandlerList::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 349 of file G4VisCommandsSceneHandler.cc.

References G4VVisCommand::fpVisManager, G4cout, G4endl, G4VSceneHandler::GetName(), G4VisManager::GetVerbosityValue(), and G4VisManager::parameters.

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 }
const G4String & GetName() const
const XML_Char * name
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

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