635 std::istringstream is (newValue);
636 is >> sceneName >> refresh_flush;
638 if (refresh_flush(0) ==
'f') flush =
true;
645 const G4int nScenes = sceneList.size ();
647 for (iScene = 0; iScene < nScenes; iScene++) {
648 G4Scene* scene = sceneList [iScene];
649 if (sceneName == scene -> GetName ())
break;
651 if (iScene >= nScenes ) {
653 G4cout <<
"WARNING: Scene \"" << sceneName <<
"\" not found."
654 "\n /vis/scene/list to see scenes."
663 if (!pCurrentSceneHandler) {
665 G4cout <<
"WARNING: No current scene handler."
671 if (!pCurrentViewer) {
673 G4cout <<
"WARNING: No current viewer."
679 if (!pCurrentScene) {
681 G4cout <<
"WARNING: No current scene."
695 const G4int nSceneHandlers = sceneHandlerList.size ();
696 for (
G4int iSH = 0; iSH < nSceneHandlers; iSH++) {
698 G4Scene* aScene = aSceneHandler -> GetScene ();
700 const G4String& aSceneName = aScene -> GetName ();
701 if (sceneName == aSceneName) {
703 G4ViewerList& viewerList = aSceneHandler -> SetViewerList ();
704 const G4int nViewers = viewerList.size ();
705 for (
G4int iV = 0; iV < nViewers; iV++) {
708 aViewer -> NeedKernelVisit();
710 aSceneHandler -> SetCurrentViewer (aViewer);
715 aViewer -> SetView ();
716 aViewer -> ClearView ();
717 aViewer -> DrawView ();
718 if (flush) aViewer -> ShowView ();
720 G4cout <<
"Viewer \"" << aViewer -> GetName ()
721 <<
"\" of scene handler \"" << aSceneHandler -> GetName ()
723 if (flush)
G4cout <<
"flushed";
724 else G4cout <<
"refreshed";
725 G4cout <<
" at request of scene \"" << sceneName
730 G4cout <<
"NOTE: The scene, \""
732 <<
"\", of viewer \""
733 << aViewer -> GetName ()
734 <<
"\"\n of scene handler \""
735 << aSceneHandler -> GetName ()
736 <<
"\" has changed. To see effect,"
737 <<
"\n \"/vis/viewer/select "
738 << aViewer -> GetShortName ()
739 <<
"\" and \"/vis/viewer/rebuild\"."
748 G4cout <<
"WARNING: G4VisCommandSceneNotifyHandlers: scene handler \""
750 <<
"\" has a null scene."
763 fpVisManager -> SetCurrentSceneHandler(pCurrentSceneHandler);
767 if (pCurrentSceneHandler) {
768 G4ViewerList& viewerList = pCurrentSceneHandler -> SetViewerList ();
769 const G4int nViewers = viewerList.size ();
771 pCurrentSceneHandler -> SetCurrentViewer (pCurrentViewer);
772 if (pCurrentViewer && pCurrentSceneHandler->
GetScene()) {
773 pCurrentViewer -> SetView ();
const G4ViewParameters & GetViewParameters() const
const G4String & GetName() const
G4GLOB_DLL std::ostream G4cout
G4Scene * GetScene() const
static Verbosity GetVerbosity()
G4bool IsAutoRefresh() const
static G4VisManager * fpVisManager