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

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerUpdate:
G4VVisCommandViewer G4VVisCommand G4UImessenger

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, 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 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, 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 287 of file G4VisCommandsViewer.hh.

Constructor & Destructor Documentation

G4VisCommandViewerUpdate::G4VisCommandViewerUpdate ( )

Definition at line 1559 of file G4VisCommandsViewer.cc.

1559  {
1560  G4bool omitable, currentAsDefault;
1561  fpCommand = new G4UIcmdWithAString ("/vis/viewer/update", this);
1562  fpCommand -> SetGuidance
1563  ("Triggers graphical database post-processing for viewers"
1564  "\nusing that technique.");
1565  fpCommand -> SetGuidance
1566  ("For such viewers the view only becomes visible with this command."
1567  "\nBy default, acts on current viewer. \"/vis/viewer/list\""
1568  "\nto see possible viewers. Viewer becomes current.");
1569  fpCommand -> SetParameterName ("viewer-name",
1570  omitable = true,
1571  currentAsDefault = true);
1572 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandViewerUpdate::~G4VisCommandViewerUpdate ( )
virtual

Definition at line 1574 of file G4VisCommandsViewer.cc.

1574  {
1575  delete fpCommand;
1576 }

Member Function Documentation

G4String G4VisCommandViewerUpdate::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1578 of file G4VisCommandsViewer.cc.

References G4VVisCommand::fpVisManager.

1578  {
1579  G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
1580  if (viewer) {
1581  return viewer -> GetName ();
1582  }
1583  else {
1584  return "none";
1585  }
1586 }
static G4VisManager * fpVisManager
void G4VisCommandViewerUpdate::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 1588 of file G4VisCommandsViewer.cc.

References G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4VSceneHandler::GetName(), G4VSceneHandler::GetScene(), G4VViewer::GetSceneHandler(), and G4VisManager::GetVerbosity().

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

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