Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VisCommandSceneList Class Reference

#include <G4VisCommandsScene.hh>

Inheritance diagram for G4VisCommandSceneList:
Collaboration diagram for G4VisCommandSceneList:

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
 
G4bool CommandsShouldBeInMaster () const
 

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 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
 
G4bool commandsShouldBeInMaster
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4int fErrorCode = 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 104 of file G4VisCommandsScene.hh.

Constructor & Destructor Documentation

G4VisCommandSceneList::G4VisCommandSceneList ( )

Definition at line 486 of file G4VisCommandsScene.cc.

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

Definition at line 501 of file G4VisCommandsScene.cc.

501  {
502  delete fpCommand;
503 }

Member Function Documentation

G4String G4VisCommandSceneList::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 505 of file G4VisCommandsScene.cc.

505  {
506  return "";
507 }
void G4VisCommandSceneList::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 509 of file G4VisCommandsScene.cc.

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

Here is the call graph for this function:


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