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

#include <G4VisCommandsScene.hh>

Inheritance diagram for G4VisCommandSceneList:
G4VVisCommandScene G4VVisCommand G4UImessenger

Public Member Functions

 G4VisCommandSceneList ()
 
virtual ~G4VisCommandSceneList ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandScene
 G4VVisCommandScene ()
 
virtual ~G4VVisCommandScene ()
 
- 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 G4VVisCommandScene
G4String CurrentSceneName ()
 
- 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 104 of file G4VisCommandsScene.hh.

Constructor & Destructor Documentation

G4VisCommandSceneList::G4VisCommandSceneList ( )

Definition at line 479 of file G4VisCommandsScene.cc.

479  {
480  G4bool omitable;
481  fpCommand = new G4UIcommand ("/vis/scene/list", this);
482  fpCommand -> SetGuidance ("Lists scene(s).");
483  fpCommand -> SetGuidance
484  ("\"help /vis/verbose\" for definition of verbosity.");
485  G4UIparameter* parameter;
486  parameter = new G4UIparameter ("scene-name", 's', omitable = true);
487  parameter -> SetDefaultValue ("all");
488  fpCommand -> SetParameter (parameter);
489  parameter = new G4UIparameter ("verbosity", 's', omitable = true);
490  parameter -> SetDefaultValue ("warnings");
491  fpCommand -> SetParameter (parameter);
492 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandSceneList::~G4VisCommandSceneList ( )
virtual

Definition at line 494 of file G4VisCommandsScene.cc.

494  {
495  delete fpCommand;
496 }

Member Function Documentation

G4String G4VisCommandSceneList::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 498 of file G4VisCommandsScene.cc.

498  {
499  return "";
500 }
void G4VisCommandSceneList::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 502 of file G4VisCommandsScene.cc.

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

502  {
503  G4String name, verbosityString;
504  std::istringstream is (newValue);
505  is >> name >> verbosityString;
506  G4VisManager::Verbosity verbosity =
507  fpVisManager->GetVerbosityValue(verbosityString);
508  const G4Scene* currentScene = fpVisManager -> GetCurrentScene ();
509  G4String currentName;
510  if (currentScene) currentName = currentScene->GetName();
511 
512  G4SceneList& sceneList = fpVisManager -> SetSceneList ();
513  G4int iScene, nScenes = sceneList.size ();
514  G4bool found = false;
515  for (iScene = 0; iScene < nScenes; iScene++) {
516  G4Scene* pScene = sceneList [iScene];
517  const G4String& iName = pScene -> GetName ();
518  if (name != "all") {
519  if (name != iName) continue;
520  }
521  found = true;
522  if (iName == currentName) {
523  G4cout << " (current)";
524  }
525  else {
526  G4cout << " ";
527  }
528  G4cout << " scene \"" << iName << "\"";
529  if (verbosity >= G4VisManager::warnings) {
530  G4int i;
531  G4cout << "\n Run-duration models:";
532  G4int nRunModels = pScene -> GetRunDurationModelList ().size ();
533  if (nRunModels == 0) {
534  G4cout << " none.";
535  }
536  for (i = 0; i < nRunModels; i++) {
537  if (pScene -> GetRunDurationModelList()[i].fActive)
538  G4cout << "\n Active: ";
539  else G4cout << "\n Inactive: ";
540  G4VModel* pModel = pScene -> GetRunDurationModelList()[i].fpModel;
541  G4cout << pModel -> GetGlobalDescription ();
542  }
543  G4cout << "\n End-of-event models:";
544  G4int nEOEModels = pScene -> GetEndOfEventModelList ().size ();
545  if (nEOEModels == 0) {
546  G4cout << " none.";
547  }
548  for (i = 0; i < nEOEModels; i++) {
549  if (pScene -> GetEndOfEventModelList()[i].fActive)
550  G4cout << "\n Active: ";
551  else G4cout << "\n Inactive: ";
552  G4VModel* pModel = pScene -> GetEndOfEventModelList()[i].fpModel;
553  G4cout << pModel -> GetGlobalDescription ();
554  }
555  G4cout << "\n End-of-run models:";
556  G4int nEORModels = pScene -> GetEndOfRunModelList ().size ();
557  if (nEORModels == 0) {
558  G4cout << " none.";
559  }
560  for (i = 0; i < nEORModels; i++) {
561  if (pScene -> GetEndOfRunModelList()[i].fActive)
562  G4cout << "\n Active: ";
563  else G4cout << "\n Inactive: ";
564  G4VModel* pModel = pScene -> GetEndOfRunModelList()[i].fpModel;
565  G4cout << pModel -> GetGlobalDescription ();
566  }
567  }
568  if (verbosity >= G4VisManager::parameters) {
569  G4cout << "\n " << *sceneList [iScene];
570  }
571  G4cout << G4endl;
572  }
573  if (!found) {
574  G4cout << "No scenes found";
575  if (name != "all") {
576  G4cout << " of name \"" << name << "\"";
577  }
578  G4cout << "." << G4endl;
579  }
580 }
const XML_Char * name
const G4String & GetName() const
int G4int
Definition: G4Types.hh:78
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: