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

#include <G4VisCommandsScene.hh>

+ Inheritance 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)
 
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 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)
 
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::G4VisCommandSceneList ( )

Definition at line 478 of file G4VisCommandsScene.cc.

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

◆ ~G4VisCommandSceneList()

G4VisCommandSceneList::~G4VisCommandSceneList ( )
virtual

Definition at line 493 of file G4VisCommandsScene.cc.

493 {
494 delete fpCommand;
495}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneList::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 497 of file G4VisCommandsScene.cc.

497 {
498 return "";
499}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 501 of file G4VisCommandsScene.cc.

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