80 #ifdef G4MULTITHREADED
97 fEventRefreshing (false),
98 fTransientsDrawnThisRun (false),
99 fTransientsDrawnThisEvent (false),
101 fEventKeepingSuspended (false),
102 fKeptLastEvent (false),
103 fpRequestedEvent (0),
104 fAbortReviewKeptEvents (false),
105 fIsDrawGroup (false),
106 fDrawGroupNestingDepth (0),
107 fIgnoreStateChanges (false)
116 (
"Simple graded message scheme - digit or string (1st character defines):");
118 (
" 0) quiet, // Nothing is printed.");
120 (
" 1) startup, // Startup and endup messages are printed...");
122 (
" 2) errors, // ...and errors...");
124 (
" 3) warnings, // ...and warnings...");
126 (
" 4) confirmations, // ...and confirming messages...");
128 (
" 5) parameters, // ...and parameters of scenes and views...");
130 (
" 6) all // ...and everything available.");
134 (
"G4VisManager::G4VisManager",
136 "Attempt to Construct more than one VisManager");
148 <<
"Visualization Manager instantiating with verbosity \""
181 directory -> SetGuidance (
"Visualization commands.");
211 G4cout <<
"Visualization Manager deleting..." <<
G4endl;
229 (
"G4VisManager::GetInstance",
238 G4cout <<
"WARNING: G4VisManager::Initialise: already initialised."
244 G4cout <<
"Visualization Manager initialising..." <<
G4endl;
249 "\nYou have instantiated your own Visualization Manager, inheriting"
250 "\n G4VisManager and implementing RegisterGraphicsSystems(), in which"
251 "\n you should, normally, instantiate drivers which do not need"
252 "\n external packages or libraries, and, optionally, drivers under"
253 "\n control of environment variables."
254 "\n Also you should implement RegisterModelFactories()."
255 "\n See visualization/include/G4VisExecutive.hh/icc, for example."
256 "\n In your main() you will have something like:"
257 "\n #ifdef G4VIS_USE"
258 "\n G4VisManager* visManager = new G4VisExecutive;"
259 "\n visManager -> SetVerboseLevel (Verbose);"
260 "\n visManager -> Initialize ();"
262 "\n (Don't forget to delete visManager;)"
275 "\nYou have successfully registered the following graphics systems."
285 directory -> SetGuidance (
"Modeling commands.");
287 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/");
288 directory -> SetGuidance (
"Trajectory model commands.");
290 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/create/");
291 directory -> SetGuidance (
"Create trajectory models and messengers.");
296 directory -> SetGuidance (
"Filtering commands.");
298 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/");
299 directory -> SetGuidance (
"Trajectory filtering commands.");
301 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/create/");
302 directory -> SetGuidance (
"Create trajectory filters and messengers.");
305 directory -> SetGuidance (
"Hit filtering commands.");
307 directory =
new G4UIdirectory (
"/vis/filtering/hits/create/");
308 directory -> SetGuidance (
"Create hit filters and messengers.");
311 directory -> SetGuidance (
"Digi filtering commands.");
313 directory =
new G4UIdirectory (
"/vis/filtering/digi/create/");
314 directory -> SetGuidance (
"Create digi filters and messengers.");
327 "\nYou have successfully registered the following model factories."
372 directory -> SetGuidance(
"Operations on vis attributes of Geant4 geometry.");
378 directory -> SetGuidance(
"Set vis attributes of Geant4 geometry.");
391 directory -> SetGuidance
392 (
"Set quantities for use in future commands where appropriate.");
402 directory -> SetGuidance (
"Operations on Geant4 scenes.");
413 directory -> SetGuidance (
"Add model to current scene.");
439 directory -> SetGuidance (
"Operations on Geant4 scene handlers.");
447 directory -> SetGuidance (
"Operations on touchables.");
452 directory -> SetGuidance (
"Set vis attributes of current touchable.");
457 directory -> SetGuidance (
"Operations on Geant4 viewers.");
481 directory -> SetGuidance(
"Set default values for future viewers.");
487 directory -> SetGuidance (
"Set view parameters of current viewer.");
520 G4cout <<
"G4VisManager::Enable: visualization enabled." <<
G4endl;
526 "G4VisManager::Enable: WARNING: visualization remains disabled for"
527 "\n above reasons. Rectifying with valid vis commands will"
528 "\n automatically enable."
538 "G4VisManager::Disable: visualization disabled."
539 "\n The pointer returned by GetConcreteInstance will be zero."
540 "\n Note that it will become enabled after some valid vis commands."
549 G4cout <<
"G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
550 "\n graphics system available!"
551 "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
552 "\n when you compiled/built the visualization code?"
553 "\n 2) Did you instantiate your own Visualization Manager and forget"
554 "\n to implement RegisterGraphicsSystems correctly?"
555 "\n 3) You can register your own graphics system, e.g.,"
556 "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
557 "\n after instantiating your vis manager and before"
558 "\n visManager->Initialize()."
570 G4cout <<
"G4VisManager::RegisterGraphicsSystem: "
571 << pSystem -> GetName ();
572 if (pSystem -> GetNickname () !=
"") {
573 G4cout <<
" (" << pSystem -> GetNickname () <<
")";
580 G4cout <<
"G4VisManager::RegisterGraphicsSystem: null pointer!"
601 G4cout<<
"G4VisManager: Using G4TrajectoryDrawByCharge as default trajectory model."<<
G4endl;
602 G4cout<<
"See commands in /vis/modeling/trajectories/ for other options."<<
G4endl;
663 #ifdef G4MULTITHREADED
669 (
"G4VisManager::BeginDraw",
671 "Nesting detected. It is illegal to nest Begin/EndDraw."
684 #ifdef G4MULTITHREADED
700 #ifdef G4MULTITHREADED
706 (
"G4VisManager::BeginDraw2D",
708 "Nesting detected. It is illegal to nest Begin/EndDraw2D."
721 #ifdef G4MULTITHREADED
737 #ifdef G4MULTITHREADED
741 if (objectTransform != fpSceneHandler->GetObjectTransformation()) {
743 (
"G4VSceneHandler::DrawT",
745 "Different transform detected in Begin/EndDraw group.");
747 fpSceneHandler -> AddPrimitive (graphics_primitive);
749 if (IsValidView ()) {
750 ClearTransientStoreIfMarked();
751 fpSceneHandler -> BeginPrimitives (objectTransform);
752 fpSceneHandler -> AddPrimitive (graphics_primitive);
753 fpSceneHandler -> EndPrimitives ();
760 #ifdef G4MULTITHREADED
764 if (objectTransform != fpSceneHandler->GetObjectTransformation()) {
766 (
"G4VSceneHandler::DrawT",
768 "Different transform detected in Begin/EndDraw2D group.");
770 fpSceneHandler -> AddPrimitive (graphics_primitive);
772 if (IsValidView ()) {
773 ClearTransientStoreIfMarked();
774 fpSceneHandler -> BeginPrimitives2D (objectTransform);
775 fpSceneHandler -> AddPrimitive (graphics_primitive);
776 fpSceneHandler -> EndPrimitives2D ();
784 DrawT (circle, objectTransform);
790 DrawT (polyhedron, objectTransform);
796 DrawT (line, objectTransform);
802 DrawT (polymarker, objectTransform);
808 DrawT (scale, objectTransform);
814 DrawT (square, objectTransform);
820 DrawT (text, objectTransform);
826 DrawT2D (circle, objectTransform);
832 DrawT2D (polyhedron, objectTransform);
838 DrawT2D (line, objectTransform);
844 DrawT2D (polymarker, objectTransform);
850 DrawT2D (square, objectTransform);
856 DrawT2D (text, objectTransform);
860 #ifdef G4MULTITHREADED
874 #ifdef G4MULTITHREADED
888 #ifdef G4MULTITHREADED
920 #ifdef G4MULTITHREADED
925 Draw (*pSol, attribs, objectTransform);
931 #ifdef G4MULTITHREADED
951 #ifdef G4MULTITHREADED
967 G4VSolid* pSol = pLV -> GetSolid ();
968 Draw (*pSol, attribs, objectTransform);
982 G4cout <<
"ERROR in G4VisManager::CreateSceneHandler during "
984 <<
" scene handler creation.\n No action taken."
996 if (!fInitialised) Initialise ();
998 if (!fpSceneHandler) {
999 PrintInvalidPointers ();
1003 G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
1006 if (fVerbosity >= errors) {
1007 G4cerr <<
"ERROR in G4VisManager::CreateViewer during "
1008 << fpGraphicsSystem -> GetName ()
1009 <<
" viewer creation.\n No action taken."
1015 if (p -> GetViewId() < 0) {
1016 if (fVerbosity >= errors) {
1017 G4cerr <<
"ERROR in G4VisManager::CreateViewer during "
1018 << fpGraphicsSystem -> GetName ()
1019 <<
" viewer initialisation.\n No action taken."
1030 p -> SetViewParameters(initialvp);
1034 fpSceneHandler -> AddViewerToList (fpViewer);
1035 fpSceneHandler -> SetCurrentViewer (fpViewer);
1036 if (fVerbosity >= confirmations) {
1037 G4cout <<
"G4VisManager::CreateViewer: new viewer created."
1042 if (fVerbosity >= parameters) {
1047 static G4bool warned =
false;
1048 if (fVerbosity >= confirmations) {
1051 "NOTE: objects with visibility flag set to \"false\""
1052 " will not be drawn!"
1053 "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1054 "\n Also see other \"/vis/viewer/set\" commands."
1061 static G4bool warned =
false;
1062 if (fVerbosity >= warnings) {
1065 "WARNING: covered objects in solid mode will not be rendered!"
1066 "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1067 "\n Also see other \"/vis/viewer/set\" commands."
1077 G4cout <<
"G4VisManager::GeometryHasChanged() called." <<
G4endl;
1083 -> GetNavigatorForTracking () -> GetWorldVolume ();
1086 G4cout <<
"WARNING: There is no world volume!" <<
G4endl;
1092 G4int iScene, nScenes = sceneList.size ();
1093 for (iScene = 0; iScene < nScenes; iScene++) {
1094 G4Scene* pScene = sceneList [iScene];
1095 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1096 if (modelList.size ()) {
1099 modelInvalid =
false;
1100 std::vector<G4Scene::Model>::iterator iterModel;
1101 for (iterModel = modelList.begin();
1102 iterModel != modelList.end();
1108 G4cout <<
"WARNING: Model \""
1109 << iterModel->fpModel->GetGlobalDescription ()
1111 "\" is no longer valid - being removed\n from scene \""
1112 << pScene -> GetName () <<
"\""
1115 modelList.erase (iterModel);
1119 }
while (modelInvalid);
1121 if (modelList.size () == 0) {
1123 G4cout <<
"WARNING: No models left in this scene \""
1124 << pScene -> GetName ()
1132 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1138 if (
fpScene &&
fpScene -> GetRunDurationModelList ().size () == 0) {
1140 G4cout <<
"WARNING: The current scene \""
1142 <<
"\" has no models."
1151 G4cout <<
"G4VisManager::NotifyHandler() called." <<
G4endl;
1156 G4int iScene, nScenes = sceneList.size ();
1157 for (iScene = 0; iScene < nScenes; iScene++) {
1158 G4Scene* pScene = sceneList [iScene];
1159 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1161 if (modelList.size ()) {
1164 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1169 if (
fpScene &&
fpScene -> GetRunDurationModelList ().size () == 0) {
1171 G4cout <<
"WARNING: The current scene \""
1173 <<
"\" has no models."
1213 assert (0 != trajectoryModel);
1216 trajectoryModel->
Draw(trajectory, visible);
1224 fRunDurationUserVisActions.push_back(
UserVisAction(name,pVisAction));
1226 fUserVisActionExtents[pVisAction] = extent;
1228 if (fVerbosity >= warnings) {
1230 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1240 fEndOfEventUserVisActions.push_back(
UserVisAction(name,pVisAction));
1242 fUserVisActionExtents[pVisAction] = extent;
1244 if (fVerbosity >= warnings) {
1246 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1256 fEndOfRunUserVisActions.push_back(
UserVisAction(name,pVisAction));
1258 fUserVisActionExtents[pVisAction] = extent;
1260 if (fVerbosity >= warnings) {
1262 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1280 G4cout <<
"G4VisManager::SetCurrentGraphicsSystem: system now "
1281 << pSystem -> GetName () <<
G4endl;
1288 G4int nSH = sceneHandlerList.size ();
1290 for (iSH = nSH - 1; iSH >= 0; iSH--) {
1291 if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem)
break;
1296 G4cout <<
" Scene Handler now "
1302 G4cout <<
" Scene now \""
1307 if (viewerList.size ()) {
1327 G4cout <<
"G4VisManager::SetCurrentSceneHandler: scene handler now \""
1328 << pSceneHandler -> GetName () <<
"\"" <<
G4endl;
1333 G4cout <<
" Scene now \""
1340 G4cout <<
" Graphics system now \""
1345 G4int nViewers = viewerList.size ();
1348 for (iViewer = 0; iViewer < nViewers; iViewer++) {
1349 if (
fpViewer == viewerList [iViewer])
break;
1351 if (iViewer >= nViewers) {
1361 "WARNING: Problem setting scene handler - please report circumstances."
1370 "WARNING: No viewers for this scene handler - please create one."
1379 G4cout <<
"G4VisManager::SetCurrentViewer: viewer now "
1380 << pViewer -> GetName ()
1387 "WARNING: No scene handler for this viewer - please create one."
1398 "WARNING: Problem setting viewer - please report circumstances."
1405 struct NicknameComparison {
1407 {
return lhs.length()<rhs.length();}
1413 G4cout <<
"Current available graphics systems are:";
1418 std::map<G4String,std::set<G4String,NicknameComparison> > systemMap;
1419 for (
G4int i = 0; i < nSystems; i++) {
1424 std::map<G4String,std::set<G4String,NicknameComparison> >::const_iterator i;
1425 for (i = systemMap.begin(); i != systemMap.end(); ++i) {
1426 G4cout <<
"\n " << i->first <<
" (";
1427 const std::set<G4String,NicknameComparison>& nicknames = i->second;
1428 std::set<G4String,NicknameComparison>::const_iterator j;
1429 for (j = nicknames.begin(); j != nicknames.end(); ++j) {
1430 if (j != nicknames.begin())
G4cout <<
", ";
1437 G4cout <<
"\n NONE!!! None registered - yet! Mmmmm!";
1447 const std::vector<G4VModelFactory<G4VTrajectoryModel>*>& factoryList =
1449 if (factoryList.empty())
G4cout <<
" None" << G4endl;
1451 std::vector<G4VModelFactory<G4VTrajectoryModel>*>::const_iterator i;
1452 for (i = factoryList.begin(); i != factoryList.end(); ++i)
1457 const std::map<G4String, G4VTrajectoryModel*>& modelMap =
1459 if (!modelMap.empty()) {
1461 std::map<G4String, G4VTrajectoryModel*>::const_iterator i;
1462 for (i = modelMap.begin(); i != modelMap.end(); ++i) {
1463 G4cout <<
" " << i->second->Name();
1464 if (i->second == listManager->
Current())
G4cout <<
" (Current)";
1476 const std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>&
1478 if (factoryList.empty())
G4cout <<
" None" << G4endl;
1480 std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>::const_iterator i;
1481 for (i = factoryList.begin(); i != factoryList.end(); ++i)
1484 const std::vector<G4VFilter<G4VTrajectory>*>&
1486 if (!filterList.empty()) {
1488 std::vector<G4VFilter<G4VTrajectory>*>::const_iterator i;
1489 for (i = filterList.begin(); i != filterList.end(); ++i) {
1500 "You have successfully registered the following user vis actions."
1502 G4cout <<
"Run Duration User Vis Actions:";
1512 G4cout <<
"End of Event User Vis Actions:";
1522 G4cout <<
"End of Run User Vis Actions:";
1535 "Some /vis commands (optionally) take a string to specify colour."
1536 "\nAvailable colours:\n ";
1538 for (std::map<G4String, G4Colour>::const_iterator i = map.begin();
1541 if (++i != map.end())
G4cout <<
", ";
1548 G4cerr <<
"ERROR: G4VisManager::PrintInvalidPointers:";
1550 G4cerr <<
"\n null graphics system pointer.";
1557 "\n Null scene pointer. Use \"/vis/drawVolume\" or"
1558 " \"/vis/scene/create\".";
1561 "\n Null scene handler pointer. Use \"/vis/open\" or"
1562 " \"/vis/sceneHandler/create\".";
1565 "\n Null viewer pointer. Use \"/vis/viewer/create\".";
1571 #ifdef G4MULTITHREADED
1628 if (maxNumberOfKeptEvents > 0 &&
fNKeepRequests >= maxNumberOfKeptEvents) {
1630 static G4bool warned =
false;
1634 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended."
1635 "\n The number of events exceeds the maximum, "
1636 << maxNumberOfKeptEvents <<
1637 ", that may be kept by \n the vis manager."
1642 }
else if (maxNumberOfKeptEvents != 0) {
1666 if (!currentRun)
return;
1668 const std::vector<const G4Event*>*
1670 G4int nKeptEvents = eventsFromThreads ? eventsFromThreads->size() : 0;
1673 G4cout <<
"WARNING: " << nKeptEvents;
1674 if (nKeptEvents == 1)
G4cout <<
" event has";
1675 else G4cout <<
" events have";
1676 G4cout <<
" been kept for refreshing and/or reviewing." <<
G4endl;
1680 G4cout <<
"No keep requests were";
1682 G4cout <<
"Only 1 keep request was";
1688 G4cout <<
" \"/vis/reviewKeptEvents\" to review them." <<
G4endl;
1694 "WARNING: G4VisManager::EndOfRun: Automatic event keeping was suspended."
1695 "\n The number of events in the run exceeded the maximum, "
1697 ", that may be\n kept by the vis manager." <<
1698 "\n The number of events kept by the vis manager can be changed with"
1699 "\n \"/vis/scene/endOfEventAction [accumulate|refresh] <N>\", where N"
1700 "\n is the maximum number you wish to allow. N < 0 means \"unlimited\"."
1705 std::vector<const G4Event*>::const_iterator i;
1708 for (i = eventsFromThreads->begin(); i != eventsFromThreads->end(); ++i) {
1710 G4cout <<
"Drawing event " << (*i)->GetEventID() <<
G4endl;
1725 std::vector<G4Scene::Model> tmpEoeModels = eoeModels;
1726 std::vector<G4Scene::Model>::iterator iEoe;
1727 for (iEoe = eoeModels.begin(); iEoe != eoeModels.end(); ++iEoe) {
1728 iEoe->fActive =
false;
1731 std::vector<G4Scene::Model> tmpEorModels = eorModels;
1732 std::vector<G4Scene::Model>::iterator iEor;
1733 for (iEor = eoeModels.begin(); iEor != eoeModels.end(); ++iEor) {
1734 iEor->fActive =
false;
1738 eoeModels = tmpEoeModels;
1739 eorModels = tmpEorModels;
1768 std::vector<G4Scene::Model> tmpEoeModels = eoeModels;
1769 std::vector<G4Scene::Model>::iterator iEoe;
1770 for (iEoe = eoeModels.begin(); iEoe != eoeModels.end(); ++iEoe) {
1771 iEoe->fActive =
false;
1774 std::vector<G4Scene::Model> tmpEorModels = eorModels;
1775 std::vector<G4Scene::Model>::iterator iEor;
1776 for (iEor = eoeModels.begin(); iEor != eoeModels.end(); ++iEor) {
1777 iEor->fActive =
false;
1781 eoeModels = tmpEoeModels;
1782 eorModels = tmpEorModels;
1784 for (i = eventsFromThreads->begin(); i != eventsFromThreads->end(); ++i) {
1786 G4cout <<
"Drawing event " << (*i)->GetEventID() <<
G4endl;
1804 G4cout <<
"\"/vis/viewer/update\" to close file." <<
G4endl;
1850 if (!currentEvent)
return;
1865 G4int nKeptEvents = 0;
1866 const std::vector<const G4Event*>* events =
1868 if (events) nKeptEvents = events->size();
1872 G4cout <<
"WARNING: " << nKeptEvents;
1873 if (nKeptEvents == 1)
G4cout <<
" event has";
1874 else G4cout <<
" events have";
1875 G4cout <<
" been kept for refreshing and/or reviewing." <<
G4endl;
1879 G4cout <<
"No keep requests were";
1881 G4cout <<
"Only 1 keep request was";
1887 G4cout <<
" \"/vis/reviewKeptEvents\" to review them." <<
G4endl;
1908 "WARNING: G4VisManager::EndOfRun: Automatic event keeping was suspended."
1909 "\n The number of events in the run exceeded the maximum, "
1911 ", that may be\n kept by the vis manager." <<
1912 "\n The number of events kept by the vis manager can be changed with"
1913 "\n \"/vis/scene/endOfEventAction accumulate <N>\", where N is the"
1914 "\n maximum number you wish to allow. N < 0 means \"unlimited\"."
1941 G4cout <<
"\"/vis/viewer/update\" to close file." <<
G4endl;
1956 if (!currentRun)
return;
1971 G4int nEventsToBeProcessed = 0;
1972 G4int nKeptEvents = 0;
1976 eventID =
event->GetEventID();
1977 const std::vector<const G4Event*>* events =
1979 if (events) nKeptEvents = events->size();
1985 if (eventID < nEventsToBeProcessed - 1) {
2005 if (maxNumberOfKeptEvents > 0 &&
fNKeepRequests >= maxNumberOfKeptEvents) {
2007 static G4bool warned =
false;
2011 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended."
2012 "\n The number of events exceeds the maximum, "
2013 << maxNumberOfKeptEvents <<
2014 ", that may be kept by\n the vis manager."
2019 }
else if (maxNumberOfKeptEvents != 0) {
2030 #endif // End of sequential versions of Begin/EndOfRun/Event.
2053 (*i)->SetTransientsDrawnThisEvent(
false);
2054 (*i)->SetTransientsDrawnThisRun(
false);
2059 G4String viewerShortName (viewerName);
2060 viewerShortName = viewerShortName (0, viewerShortName.find (
' '));
2061 return viewerShortName.
strip ();
2067 size_t iHandler, iViewer;
2070 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2072 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2073 for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2074 viewer = viewerList [iViewer];
2075 if (viewerShortName == viewer -> GetShortName ()) {
2082 if (found)
return viewer;
2090 switch (verbosity) {
2091 case quiet: rs =
"quiet (0)";
break;
2092 case startup: rs =
"startup (1)";
break;
2093 case errors: rs =
"errors (2)";
break;
2094 case warnings: rs =
"warnings (3)";
break;
2096 case parameters: rs =
"parameters (5)";
break;
2097 case all: rs =
"all (6)";
break;
2106 if (ss(0) ==
'q') verbosity =
quiet;
2107 else if (ss(0) ==
's') verbosity =
startup;
2108 else if (ss(0) ==
'e') verbosity =
errors;
2109 else if (ss(0) ==
'w') verbosity =
warnings;
2111 else if (ss(0) ==
'p') verbosity =
parameters;
2112 else if (ss(0) ==
'a') verbosity =
all;
2115 std::istringstream is(ss);
2118 G4cerr <<
"ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2119 << verbosityString <<
"\"";
2137 else if (intVerbosity >
all) verbosity =
all;
2138 else verbosity =
Verbosity(intVerbosity);
2158 static G4bool noGSPrinting =
true;
2163 noGSPrinting =
false;
2166 "WARNING: G4VisManager::IsValidView(): Attempt to draw when no graphics system"
2167 "\n has been instantiated. Use \"/vis/open\" or \"/vis/sceneHandler/create\"."
2168 "\n Alternatively, to avoid this message, suppress instantiation of vis"
2169 "\n manager (G4VisExecutive), possibly by setting G4VIS_NONE, and ensure"
2170 "\n drawing code is executed only if G4VVisManager::GetConcreteInstance()"
2181 "ERROR: G4VisManager::IsValidView(): Current view is not valid."
2190 G4cerr <<
"ERROR: G4VisManager::IsValidView ():";
2193 "\n The current scene \""
2195 <<
"\" is not handled by"
2196 "\n the current scene handler \""
2199 "\n (it currently handles scene \""
2203 "\n (a) attach it to the scene handler with"
2204 "\n /vis/sceneHandler/attach "
2207 "\n (b) create a new scene handler with "
2208 "\n /vis/sceneHandler/create <graphics-system>,"
2209 "\n in which case it should pick up the the new scene."
2213 G4cout <<
"\n Scene handler \""
2215 <<
"\" has null scene pointer."
2216 "\n Attach a scene with /vis/sceneHandler/attach [<scene-name>]"
2224 if (viewerList.size () == 0) {
2227 "ERROR: G4VisManager::IsValidView (): the current scene handler\n \""
2229 <<
"\" has no viewers. Do /vis/viewer/create."
2239 if (!successful ||
fpScene -> IsEmpty ()) {
2241 G4cerr <<
"ERROR: G4VisManager::IsValidView ():";
2243 "\n Attempt at some drawing operation when scene is empty."
2244 "\n Maybe the geometry has not yet been defined."
2245 " Try /run/initialize."
2246 "\n Or use \"/vis/scene/add/extent\"."
2255 "WARNING: G4VisManager: the scene was empty, \"world\" has been"
2256 "\n added and the scene handlers notified.";
2268 G4cout<<
"G4VisManager: No model factories registered with G4VisManager."<<
G4endl;
2269 G4cout<<
"G4VisManager::RegisterModelFactories() should be overridden in derived"<<
G4endl;
2270 G4cout<<
"class. See G4VisExecutive for an example."<<
G4endl;
2274 #ifdef G4MULTITHREADED
2275 void G4VisManager::SetUpForAThread()
G4bool FilterDigi(const G4VDigi &)
void RegisterEndOfEventUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent::NullExtent)
void RegisterModelFactory(G4TrajDrawModelFactory *factory)
G4VisFilterManager< G4VTrajectory > * fpTrajFilterMgr
static Verbosity fVerbosity
const std::vector< Factory * > & FactoryList() const
void PrintAvailableColours(Verbosity) const
G4VisFilterManager< G4VHit > * fpHitFilterMgr
void DrawEvent(const G4Event *)
void PrintAvailableUserVisActions(Verbosity) const
virtual void RegisterModelFactories()
void PrintAvailableModels(Verbosity) const
void SetCurrentSceneHandler(G4VSceneHandler *)
static G4VVisManager * GetConcreteInstance()
void SetEventID(G4int eventID)
G4String strip(G4int strip_Type=trailing, char c=' ')
G4bool IsCullingInvisible() const
void RegisterEndOfRunUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent::NullExtent)
G4VisStateDependent * fpStateDependent
void PrintInvalidPointers() const
void SetVerboseLevel(G4int)
void SetRunID(G4int runID)
const G4ViewParameters & GetViewParameters() const
void GeometryHasChanged()
const std::vector< const G4Event * > * GetEventVector() const
const Model * Current() const
void SetCurrentScene(G4Scene *)
std::vector< Model > & SetEndOfRunModelList()
G4bool GetMarkForClearingTransientStore() const
G4bool GetRefreshAtEndOfEvent() const
static std::vector< G4String > VerbosityGuidanceStrings
const G4String & GetName() const
static Verbosity GetVerbosityValue(const G4String &)
const G4Run * GetCurrentRun() const
#define G4MUTEX_INITIALIZER
void BeginDraw(const G4Transform3D &objectTransformation=G4Transform3D())
const G4VTrajectoryModel * CurrentTrajDrawModel() const
G4bool fTransientsDrawnThisEvent
const std::vector< Filter * > & FilterList() const
std::vector< G4UIcommand * > fDirectoryList
std::vector< G4UImessenger * > fMessengerList
static G4UImanager * GetUIpointer()
void RegisterMessengers()
std::vector< G4VSceneHandler * >::const_iterator G4SceneHandlerListConstIterator
static G4VisManager * fpInstance
G4String Placement() const
void RegisterMessenger(G4UImessenger *messenger)
void SelectTrajectoryModel(const G4String &model)
void SetCurrentTrajectory(const G4VTrajectory *pTraj)
G4VSceneHandler * fpSceneHandler
void PrintAvailableGraphicsSystems() const
void SetTransientsDrawnThisEvent(G4bool)
std::vector< UserVisAction > fEndOfRunUserVisActions
G4double GetExtentRadius() const
G4int fDrawGroupNestingDepth
void IgnoreStateChanges(G4bool)
G4bool fEventKeepingSuspended
G4String ViewerShortName(const G4String &viewerName) const
friend class G4VisStateDependent
G4GLOB_DLL std::ostream G4cout
std::vector< UserVisAction > fRunDurationUserVisActions
G4VisModelManager< G4VTrajectoryModel > * fpTrajDrawModelMgr
G4SceneHandlerList fAvailableSceneHandlers
const std::map< G4String, T * > & Map() const
G4bool FilterTrajectory(const G4VTrajectory &)
virtual void Draw(const G4VTrajectory &trajectory, const G4bool &visible=true) const =0
G4bool GetRefreshAtEndOfRun() const
void ResetTransientsDrawnFlags()
G4bool GetTransientsDrawnThisRun() const
static G4VisManager * GetInstance()
void SetCurrentGraphicsSystem(G4VGraphicsSystem *)
void SetXGeometryString(const G4String &)
const T * Current() const
void DrawEndOfRunModels()
G4bool GetTransientsDrawnThisEvent() const
G4bool IsCullingCovered() const
G4VisFilterManager< G4VDigi > * fpDigiFilterMgr
const G4String & GetNickname() const
G4String Placement() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
void RegisterRunDurationUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent::NullExtent)
void SetCurrentViewer(G4VViewer *)
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const =0
static G4RunManager * GetRunManager()
G4Scene * GetScene() const
void SetCurrent(const G4String &)
G4GraphicsSystemList fAvailableGraphicsSystems
const G4String & GetName() const
G4VisManager(const G4String &verbosityString="warnings")
G4bool FilterHit(const G4VHit &)
G4LogicalVolume * GetLogicalVolume() const
void DrawEvent(const G4Event *)
G4VViewer * GetViewer(const G4String &viewerName) const
void DrawT(const T &graphics_primitive, const G4Transform3D &objectTransform)
std::vector< UserVisAction > fEndOfEventUserVisActions
std::vector< Model > & SetEndOfEventModelList()
void BeginDraw2D(const G4Transform3D &objectTransformation=G4Transform3D())
static G4String VerbosityString(Verbosity)
static G4EventManager * GetEventManager()
const List * ListManager() const
FilterMode::Mode GetMode() const
static Verbosity GetVerbosity()
G4bool fIgnoreStateChanges
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
static void SetVisManager(G4VisManager *)
virtual void RegisterGraphicsSystems()=0
G4int GetNumberOfEventToBeProcessed() const
void RegisterModel(G4VTrajectoryModel *model)
const std::vector< Factory * > & FactoryList() const
G4bool RegisterGraphicsSystem(G4VGraphicsSystem *)
void DispatchToModel(const G4VTrajectory &)
static const std::map< G4String, G4Colour > & GetMap()
void CreateViewer(const G4String &name="", const G4String &XGeometry="")
virtual void ClearTransientStore()
void SetTransientsDrawnThisRun(G4bool)
const G4Event * GetConstCurrentEvent()
void CreateSceneHandler(const G4String &name="")
G4VGraphicsSystem * fpGraphicsSystem
Functionality GetFunctionality() const
void DrawT2D(const T &graphics_primitive, const G4Transform3D &objectTransform)
const G4GraphicsSystemList & GetAvailableGraphicsSystems()
G4int GetMaxNumberOfKeptEvents() const
static void SetConcreteInstance(G4VVisManager *)
void Draw2D(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
void ClearTransientStoreIfMarked()
void SetMarkForClearingTransientStore(G4bool)
void KeepTheCurrentEvent()
G4bool IsAutoRefresh() const
G4int ApplyCommand(const char *aCommand)
G4VSolid * GetSolid() const
G4GLOB_DLL std::ostream G4cerr
G4bool fTransientsDrawnThisRun