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

#include <G4VisCommandsViewer.hh>

+ Inheritance diagram for G4VisCommandViewerUpdate:

Public Member Functions

 G4VisCommandViewerUpdate ()
 
virtual ~G4VisCommandViewerUpdate ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandViewer
 G4VVisCommandViewer ()
 
virtual ~G4VVisCommandViewer ()
 
- 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 G4VVisCommandViewer
void SetViewParameters (G4VViewer *, const G4ViewParameters &)
 
void RefreshIfRequired (G4VViewer *)
 
- 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 287 of file G4VisCommandsViewer.hh.

Constructor & Destructor Documentation

◆ G4VisCommandViewerUpdate()

G4VisCommandViewerUpdate::G4VisCommandViewerUpdate ( )

Definition at line 1550 of file G4VisCommandsViewer.cc.

1550 {
1551 G4bool omitable, currentAsDefault;
1552 fpCommand = new G4UIcmdWithAString ("/vis/viewer/update", this);
1553 fpCommand -> SetGuidance
1554 ("Triggers graphical database post-processing for viewers"
1555 "\nusing that technique.");
1556 fpCommand -> SetGuidance
1557 ("For such viewers the view only becomes visible with this command."
1558 "\nBy default, acts on current viewer. \"/vis/viewer/list\""
1559 "\nto see possible viewers. Viewer becomes current.");
1560 fpCommand -> SetParameterName ("viewer-name",
1561 omitable = true,
1562 currentAsDefault = true);
1563}
bool G4bool
Definition: G4Types.hh:67

◆ ~G4VisCommandViewerUpdate()

G4VisCommandViewerUpdate::~G4VisCommandViewerUpdate ( )
virtual

Definition at line 1565 of file G4VisCommandsViewer.cc.

1565 {
1566 delete fpCommand;
1567}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandViewerUpdate::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1569 of file G4VisCommandsViewer.cc.

1569 {
1570 G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
1571 if (viewer) {
1572 return viewer -> GetName ();
1573 }
1574 else {
1575 return "none";
1576 }
1577}
static G4VisManager * fpVisManager

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 1579 of file G4VisCommandsViewer.cc.

1579 {
1580
1582
1583 G4String& updateName = newValue;
1584
1585 G4VViewer* viewer = fpVisManager -> GetViewer (updateName);
1586 if (!viewer) {
1587 if (verbosity >= G4VisManager::errors) {
1588 G4cout <<
1589 "ERROR: G4VisCommandsViewerUpdate::SetNewValue: no current viewer."
1590 << G4endl;
1591 }
1592 return;
1593 }
1594
1595 G4VSceneHandler* sceneHandler = viewer->GetSceneHandler();
1596 if (!sceneHandler) {
1597 if (verbosity >= G4VisManager::errors) {
1598 G4cout << "ERROR: Viewer \"" << updateName << "\"" <<
1599 " has no scene handler - report serious bug."
1600 << G4endl;
1601 }
1602 return;
1603 }
1604
1605 G4Scene* scene = sceneHandler->GetScene();
1606 if (!scene) {
1607 if (verbosity >= G4VisManager::confirmations) {
1608 G4cout << "NOTE: SceneHandler \"" << sceneHandler->GetName()
1609 << "\", to which viewer \"" << updateName << "\"" <<
1610 "\n is attached, has no scene - \"/vis/scene/create\" and"
1611 " \"/vis/sceneHandler/attach\""
1612 "\n (or use compound command \"/vis/drawVolume\")."
1613 << G4endl;
1614 }
1615 return;
1616 }
1617
1618 if (verbosity >= G4VisManager::confirmations) {
1619 G4cout << "Viewer \"" << viewer -> GetName () << "\"";
1620 G4cout << " post-processing triggered." << G4endl;
1621 }
1622 viewer -> ShowView ();
1623 // Assume future need to "refresh" transients...
1624 sceneHandler -> SetMarkForClearingTransientStore(true);
1625}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4Scene * GetScene() const
const G4String & GetName() const
G4VSceneHandler * GetSceneHandler() const
static Verbosity GetVerbosity()

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