100 fInitialised (false),
101 fpGraphicsSystem (0),
105 fpStateDependent (0),
106 fEventRefreshing (false),
107 fTransientsDrawnThisRun (false),
108 fTransientsDrawnThisEvent (false),
109 fNoOfEventsDrawnThisRun (0),
111 fEventKeepingSuspended (false),
112 fDrawEventOnlyIfToBeKept (false),
113 fpRequestedEvent (0),
114 fReviewingKeptEvents (false),
115 fAbortReviewKeptEvents (false),
116 fIsDrawGroup (false),
117 fDrawGroupNestingDepth (0),
118 fIgnoreStateChanges (false)
119#ifdef G4MULTITHREADED
120, fMaxEventQueueSize (100)
121, fWaitOnEventQueueFull (true)
131 (
"Simple graded message scheme - digit or string (1st character defines):");
133 (
" 0) quiet, // Nothing is printed.");
135 (
" 1) startup, // Startup and endup messages are printed...");
137 (
" 2) errors, // ...and errors...");
139 (
" 3) warnings, // ...and warnings...");
141 (
" 4) confirmations, // ...and confirming messages...");
143 (
" 5) parameters, // ...and parameters of scenes and views...");
145 (
" 6) all // ...and everything available.");
149 (
"G4VisManager::G4VisManager",
151 "Attempt to Construct more than one VisManager");
163 <<
"Visualization Manager instantiating with verbosity \""
194 directory -> SetGuidance (
"Visualization commands.");
228 G4cout <<
"Visualization Manager deleting..." <<
G4endl;
247 (
"G4VisManager::GetInstance",
256 G4cout <<
"WARNING: G4VisManager::Initialise: already initialised."
262 G4cout <<
"Visualization Manager initialising..." <<
G4endl;
267 "\nYou have instantiated your own Visualization Manager, inheriting"
268 "\n G4VisManager and implementing RegisterGraphicsSystems(), in which"
269 "\n you should, normally, instantiate drivers which do not need"
270 "\n external packages or libraries, and, optionally, drivers under"
271 "\n control of environment variables."
272 "\n Also you should implement RegisterModelFactories()."
273 "\n See visualization/management/include/G4VisExecutive.hh/icc, for example."
274 "\n In your main() you will have something like:"
275 "\n G4VisManager* visManager = new G4VisExecutive;"
276 "\n visManager -> SetVerboseLevel (Verbose);"
277 "\n visManager -> Initialize ();"
278 "\n (Don't forget to delete visManager;)"
291 "\nYou have successfully registered the following graphics systems."
301 directory -> SetGuidance (
"Modeling commands.");
303 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/");
304 directory -> SetGuidance (
"Trajectory model commands.");
306 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/create/");
307 directory -> SetGuidance (
"Create trajectory models and messengers.");
312 directory -> SetGuidance (
"Filtering commands.");
314 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/");
315 directory -> SetGuidance (
"Trajectory filtering commands.");
317 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/create/");
318 directory -> SetGuidance (
"Create trajectory filters and messengers.");
321 directory -> SetGuidance (
"Hit filtering commands.");
323 directory =
new G4UIdirectory (
"/vis/filtering/hits/create/");
324 directory -> SetGuidance (
"Create hit filters and messengers.");
327 directory -> SetGuidance (
"Digi filtering commands.");
329 directory =
new G4UIdirectory (
"/vis/filtering/digi/create/");
330 directory -> SetGuidance (
"Create digi filters and messengers.");
343 "\nYou have successfully registered the following model factories."
358 "Some /vis commands (optionally) take a string to specify colour."
359 "\n\"/vis/list\" to see available colours."
375#define TOOLS_COLORS_STAT(name,r,g,b) \
376G4Colour::AddToMap(#name, G4Colour(r,g,b));
457#undef TOOLS_COLORS_STAT
468 directory -> SetGuidance(
"Operations on vis attributes of Geant4 geometry.");
474 directory -> SetGuidance(
"Set vis attributes of Geant4 geometry.");
487#ifdef G4MULTITHREADED
489 directory -> SetGuidance(
"Commands unique to multithreading mode.");
496 directory -> SetGuidance
497 (
"Set quantities for use in future commands where appropriate.");
510 directory -> SetGuidance (
"Operations on Geant4 scenes.");
523 directory -> SetGuidance (
"Add model to current scene.");
564 directory -> SetGuidance (
"Operations on Geant4 scene handlers.");
572 directory -> SetGuidance (
"Operations on touchables.");
577 directory -> SetGuidance (
"Set vis attributes of current touchable.");
582 directory -> SetGuidance (
"Operations on Geant4 viewers.");
610 directory -> SetGuidance(
"Set default values for future viewers.");
616 directory -> SetGuidance (
"Set view parameters of current viewer.");
666 G4cout <<
"G4VisManager::Enable: visualization enabled." <<
G4endl;
669 G4int nKeptEvents = 0;
671 if (
run) nKeptEvents =
run->GetEventVector()->size();
673 "There are " << nKeptEvents <<
" kept events."
674 "\n \"/vis/reviewKeptEvents\" to review them one by one."
675 "\n \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\" to see them accumulated."
682 "G4VisManager::Enable: WARNING: visualization remains disabled for"
683 "\n above reasons. Rectifying with valid vis commands will"
684 "\n automatically enable."
694 "G4VisManager::Disable: visualization disabled."
695 "\n The pointer returned by GetConcreteInstance will be zero."
696 "\n Note that it will become enabled after some valid vis commands."
700 G4int currentTrajectoryType =
702 if (currentTrajectoryType > 0) {
704 "You may wish to disable trajectory production too:"
705 "\n \"/tracking/storeTrajectory 0\""
706 "\nbut don't forget to re-enable with"
708 "\n \"/tracking/storeTrajectory " << currentTrajectoryType
709 <<
"\"\n and maybe \"/vis/viewer/rebuild\""
719 G4cout <<
"G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
720 "\n graphics system available!"
721 "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
722 "\n when you compiled/built the visualization code?"
723 "\n 2) Did you instantiate your own Visualization Manager and forget"
724 "\n to implement RegisterGraphicsSystems correctly?"
725 "\n 3) You can register your own graphics system, e.g.,"
726 "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
727 "\n after instantiating your vis manager and before"
728 "\n visManager->Initialize()."
740 G4cout <<
"G4VisManager::RegisterGraphicsSystem: "
741 << pSystem -> GetName ();
742 if (pSystem -> GetNickname () !=
"") {
743 G4cout <<
" (" << pSystem -> GetNickname () <<
")";
750 G4cout <<
"G4VisManager::RegisterGraphicsSystem: null pointer!"
770 G4cout<<
"G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model."<<
G4endl;
771 G4cout<<
"See commands in /vis/modeling/trajectories/ for other options."<<
G4endl;
832#ifdef G4MULTITHREADED
838 (
"G4VisManager::BeginDraw",
840 "Nesting detected. It is illegal to nest Begin/EndDraw."
853#ifdef G4MULTITHREADED
869#ifdef G4MULTITHREADED
875 (
"G4VisManager::BeginDraw2D",
877 "Nesting detected. It is illegal to nest Begin/EndDraw2D."
890#ifdef G4MULTITHREADED
905(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
906#ifdef G4MULTITHREADED
912 (
"G4VSceneHandler::DrawT",
914 "Different transform detected in Begin/EndDraw group.");
928(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
929#ifdef G4MULTITHREADED
935 (
"G4VSceneHandler::DrawT",
937 "Different transform detected in Begin/EndDraw2D group.");
953 DrawT (circle, objectTransform);
959 DrawT (polyhedron, objectTransform);
965 DrawT (line, objectTransform);
971 DrawT (polymarker, objectTransform);
977 DrawT (square, objectTransform);
983 DrawT (text, objectTransform);
989 DrawT2D (circle, objectTransform);
995 DrawT2D (polyhedron, objectTransform);
1001 DrawT2D (line, objectTransform);
1007 DrawT2D (polymarker, objectTransform);
1013 DrawT2D (square, objectTransform);
1019 DrawT2D (text, objectTransform);
1023#ifdef G4MULTITHREADED
1037#ifdef G4MULTITHREADED
1051#ifdef G4MULTITHREADED
1084#ifdef G4MULTITHREADED
1089 Draw (*pSol, attribs, objectTransform);
1095#ifdef G4MULTITHREADED
1115#ifdef G4MULTITHREADED
1131 G4VSolid* pSol = pLV -> GetSolid ();
1132 Draw (*pSol, attribs, objectTransform);
1140 if (pSceneHandler) {
1146 G4cout <<
"ERROR in G4VisManager::CreateSceneHandler during "
1148 <<
" scene handler creation.\n No action taken."
1171 G4cerr <<
"ERROR in G4VisManager::CreateViewer: null pointer during "
1173 <<
" viewer creation.\n No action taken."
1179 if (p -> GetViewId() < 0) {
1181 G4cerr <<
"ERROR in G4VisManager::CreateViewer during "
1183 <<
" viewer instantiation.\n No action taken."
1194 p -> SetViewParameters(initialvp);
1196 if (p -> GetViewId() < 0) {
1198 G4cerr <<
"ERROR in G4VisManager::CreateViewer during "
1200 <<
" viewer initialisation.\n No action taken."
1210 G4cout <<
"G4VisManager::CreateViewer: new viewer created."
1220 static G4bool warned =
false;
1224 "NOTE: objects with visibility flag set to \"false\""
1225 " will not be drawn!"
1226 "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1227 "\n Also see other \"/vis/viewer/set\" commands."
1234 static G4bool warned =
false;
1238 "WARNING: covered objects in solid mode will not be rendered!"
1239 "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1240 "\n Also see other \"/vis/viewer/set\" commands."
1250 G4cout <<
"G4VisManager::GeometryHasChanged() called." <<
G4endl;
1256 -> GetNavigatorForTracking () -> GetWorldVolume ();
1259 G4cout <<
"WARNING: There is no world volume!" <<
G4endl;
1265 G4int iScene, nScenes = sceneList.size ();
1266 for (iScene = 0; iScene < nScenes; iScene++) {
1267 G4Scene* pScene = sceneList [iScene];
1268 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1269 if (modelList.size ()) {
1272 modelInvalid =
false;
1273 std::vector<G4Scene::Model>::iterator iterModel;
1274 for (iterModel = modelList.begin();
1275 iterModel != modelList.end();
1281 G4cout <<
"WARNING: Model \""
1282 << iterModel->fpModel->GetGlobalDescription ()
1284 "\" is no longer valid - being removed\n from scene \""
1285 << pScene -> GetName () <<
"\""
1288 modelList.erase (iterModel);
1292 }
while (modelInvalid);
1294 if (modelList.size () == 0) {
1296 G4cout <<
"WARNING: No models left in this scene \""
1297 << pScene -> GetName ()
1305 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1311 if (
fpScene &&
fpScene -> GetRunDurationModelList ().size () == 0) {
1313 G4cout <<
"WARNING: The current scene \""
1315 <<
"\" has no run duration models."
1316 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1336 G4cout <<
"G4VisManager::NotifyHandler() called." <<
G4endl;
1343 G4int iScene, nScenes = sceneList.size ();
1344 for (iScene = 0; iScene < nScenes; iScene++) {
1345 G4Scene* pScene = sceneList [iScene];
1346 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1348 if (modelList.size ()) {
1351 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1356 if (
fpScene &&
fpScene -> GetRunDurationModelList ().size () == 0) {
1358 G4cout <<
"WARNING: The current scene \""
1360 <<
"\" has no run duration models."
1361 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1408 assert (0 != trajectoryModel);
1411 trajectoryModel->
Draw(trajectory, visible);
1425 "WARNING: No extent set for user vis action \"" <<
name <<
"\"."
1431 <<
"Run duration user vis action \"" <<
name <<
"\" registered"
1446 "WARNING: No extent set for user vis action \"" <<
name <<
"\"."
1452 <<
"End of event user vis action \"" <<
name <<
"\" registered"
1467 "WARNING: No extent set for user vis action \"" <<
name <<
"\"."
1473 <<
"End of run user vis action \"" <<
name <<
"\" registered"
1490 G4cout <<
"G4VisManager::SetCurrentGraphicsSystem: system now "
1491 << pSystem -> GetName () <<
G4endl;
1498 G4int nSH = sceneHandlerList.size ();
1500 for (iSH = nSH - 1; iSH >= 0; iSH--) {
1501 if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem)
break;
1506 G4cout <<
" Scene Handler now "
1512 G4cout <<
" Scene now \""
1517 if (viewerList.size ()) {
1537 G4cout <<
"G4VisManager::SetCurrentSceneHandler: scene handler now \""
1538 << pSceneHandler -> GetName () <<
"\"" <<
G4endl;
1543 G4cout <<
" Scene now \""
1550 G4cout <<
" Graphics system now \""
1555 G4int nViewers = viewerList.size ();
1558 for (iViewer = 0; iViewer < nViewers; iViewer++) {
1559 if (
fpViewer == viewerList [iViewer])
break;
1561 if (iViewer >= nViewers) {
1571 "WARNING: Problem setting scene handler - please report circumstances."
1580 "WARNING: No viewers for this scene handler - please create one."
1590 G4cout <<
"G4VisManager::SetCurrentViewer: current viewer pointer zeroed "
1596 G4cout <<
"G4VisManager::SetCurrentViewer: viewer now "
1597 << pViewer -> GetName ()
1604 "WARNING: No scene handler for this viewer - please create one."
1617 "WARNING: Problem setting viewer - please report circumstances."
1625 G4cout <<
"Registered graphics systems are:\n";
1629 const std::vector<G4String>& nicknames = gs->GetNicknames();
1633 for (
size_t i = 0; i < nicknames.size(); ++i) {
1647 G4cout <<
" NONE!!! None registered - yet! Mmmmm!" <<
G4endl;
1656 const std::vector<G4VModelFactory<G4VTrajectoryModel>*>& factoryList =
1660 std::vector<G4VModelFactory<G4VTrajectoryModel>*>::const_iterator i;
1661 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1668 const std::map<G4String, G4VTrajectoryModel*>& modelMap =
1672 std::map<G4String, G4VTrajectoryModel*>::const_iterator i;
1673 for (i = modelMap.begin(); i != modelMap.end(); ++i) {
1674 G4cout <<
" " << i->second->Name();
1675 if (i->second == listManager->
Current())
G4cout <<
" (Current)";
1687 const std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>&
1691 std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>::const_iterator i;
1692 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1698 const std::vector<G4VFilter<G4VTrajectory>*>&
1702 std::vector<G4VFilter<G4VTrajectory>*>::const_iterator i;
1703 for (i = filterList.begin(); i != filterList.end(); ++i) {
1714 "You have successfully registered the following user vis actions."
1716 G4cout <<
"Run Duration User Vis Actions:";
1726 G4cout <<
"End of Event User Vis Actions:";
1736 G4cout <<
"End of Run User Vis Actions:";
1749 "Some /vis commands (optionally) take a string to specify colour."
1750 "\nAvailable colours:\n ";
1752 for (std::map<G4String, G4Colour>::const_iterator i =
map.begin();
1762 G4cerr <<
"ERROR: G4VisManager::PrintInvalidPointers:";
1764 G4cerr <<
"\n null graphics system pointer.";
1771 "\n Null scene pointer. Use \"/vis/drawVolume\" or"
1772 " \"/vis/scene/create\".";
1775 "\n Null scene handler pointer. Use \"/vis/open\" or"
1776 " \"/vis/sceneHandler/create\".";
1779 "\n Null viewer pointer. Use \"/vis/viewer/create\".";
1785#ifdef G4MULTITHREADED
1788 G4bool mtRunInProgress =
false;
1789 std::deque<const G4Event*> mtVisEventQueue;
1798 if (!pSceneHandler)
return 0;
1800 if (!pScene)
return 0;
1802 if (!pViewer)
return 0;
1817 pViewer->SwitchToVisSubThread();
1822 G4int eventQueueSize = mtVisEventQueue.size();
1826 while (eventQueueSize) {
1829 const G4Event*
event = mtVisEventQueue.front();
1870 mtVisEventQueue.pop_front();
1871 event->PostProcessingFinished();
1872 eventQueueSize = mtVisEventQueue.size();
1878 G4int runInProgress = mtRunInProgress;
1880 if (!runInProgress) {
1887 std::this_thread::sleep_for(std::chrono::milliseconds(100));
1891 pViewer->DoneWithVisSubThread();
1892 pViewer->MovingToMasterThread();
1910#ifdef G4MULTITHREADED
1920 if (nEventsToBeProcessed == 0)
return;
1934#ifdef G4MULTITHREADED
1948 mtRunInProgress =
true;
1974#ifndef G4MULTITHREADED
1996#ifdef G4MULTITHREADED
2005 if (!currentRun)
return;
2010 if (!currentEvent)
return;
2015 if (!currentEvent->
ToBeKept())
return;
2020#ifdef G4MULTITHREADED
2024 G4int eventQueueSize = mtVisEventQueue.size();
2028 G4bool eventQueueFull =
false;
2029 while (fMaxEventQueueSize > 0 && eventQueueSize >= fMaxEventQueueSize) {
2032 if (fWaitOnEventQueueFull) {
2033 static G4bool warned =
false;
2036 "WARNING: The number of events in the visualisation queue has exceeded"
2038 << fMaxEventQueueSize <<
2039 ".\n If, during a multithreaded run, the simulation gets ahead of the"
2040 "\n visualisation by more than this maximum, the simulation is delayed"
2041 "\n until the vis sub-thread has drawn a few more events and removed them"
2042 "\n from the queue. You may change this maximum number of events with"
2043 "\n \"/vis/multithreading/maxEventQueueSize <N>\", where N is the maximum"
2044 "\n number you wish to allow. N <= 0 means \"unlimited\"."
2045 "\n Alternatively you may choose to discard events for drawing by setting"
2046 "\n \"/vis/multithreading/actionOnEventQueueFull discard\"."
2047 "\n To avoid visualisation altogether: \"/vis/disable\"."
2048 "\n And maybe \"/tracking/storeTrajectories 0\"."
2054 std::this_thread::sleep_for(std::chrono::milliseconds(100));
2057 static G4bool warned =
false;
2060 "WARNING: The number of events in the visualisation queue has exceeded"
2062 << fMaxEventQueueSize <<
2063 ".\n Some events have been discarded for drawing. You may change this"
2064 "\n behaviour with \"/vis/multithreading/actionOnEventQueueFull wait\"."
2065 "\n To avoid visualisation altogether: \"/vis/disable\"."
2066 "\n And maybe \"/tracking/storeTrajectories 0\"."
2070 eventQueueFull =
true;
2075 eventQueueSize = mtVisEventQueue.size();
2079 if (!eventQueueFull) {
2090 mtVisEventQueue.push_back(currentEvent);
2105 G4int nEventsToBeProcessed = 0;
2106 G4int nKeptEvents = 0;
2111 const std::vector<const G4Event*>* events = currentRun->
GetEventVector();
2112 if (events) nKeptEvents = events->size();
2132 if (eventID < nEventsToBeProcessed - 1) {
2139 if (nKeptEvents == 0) {
2157 if (maxNumberOfKeptEvents >= 0 &&
2161 static G4bool warned =
false;
2165 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended."
2166 "\n The number of events exceeds the maximum, "
2167 << maxNumberOfKeptEvents <<
2168 ", that may be kept by\n the vis manager."
2174 }
else if (maxNumberOfKeptEvents != 0) {
2193#ifdef G4MULTITHREADED
2204 if (nEventsToBeProcessed == 0)
return;
2207 if (!currentRun)
return;
2209#ifdef G4MULTITHREADED
2214 mtRunInProgress =
false;
2218 delete mtVisSubThread;
2223#ifdef G4MULTITHREADED
2233 <<
"WARNING: Number of events drawn this run, "
2235 << noOfEventsRequested <<
2236 ".\n (This is because you requested \"/vis/multithreading/actionOnEventQueueFull discard\".)"
2243 G4int nKeptEvents = 0;
2244 const std::vector<const G4Event*>* events = currentRun->
GetEventVector();
2245 if (events) nKeptEvents = events->size();
2248 if (nKeptEvents == 1)
G4cout <<
" event has";
2249 else G4cout <<
" events have";
2250 G4cout <<
" been kept for refreshing and/or reviewing." <<
G4endl;
2254 G4cout <<
"No keep requests were";
2256 G4cout <<
"1 keep request was";
2260 G4cout <<
" made by the vis manager.";
2263 "\n The kept events are those you have asked to be kept in your user action(s).)";
2266 "\n The same or further events may have been kept by you in your user action(s).)";
2271 " \"/vis/reviewKeptEvents\" to review them one by one."
2272 "\n \"/vis/enable\", then \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\" to see them accumulated."
2295 "WARNING: G4VisManager::EndOfRun: Automatic event keeping was suspended."
2296 "\n The number of events in the run exceeded the maximum, "
2298 ", that may be\n kept by the vis manager." <<
2299 "\n The number of events kept by the vis manager can be changed with"
2300 "\n \"/vis/scene/endOfEventAction accumulate <N>\", where N is the"
2301 "\n maximum number you wish to allow. N < 0 means \"unlimited\"."
2332 G4cout <<
"\"/vis/viewer/update\" to close file." <<
G4endl;
2362 (*i)->SetTransientsDrawnThisEvent(
false);
2363 (*i)->SetTransientsDrawnThisRun(
false);
2368 G4String viewerShortName = viewerName.substr(0, viewerName.find (
' '));
2375 size_t iHandler, iViewer;
2378 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2380 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2381 for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2382 viewer = viewerList [iViewer];
2383 if (viewerShortName == viewer -> GetShortName ()) {
2390 if (found)
return viewer;
2398 switch (verbosity) {
2399 case quiet: rs =
"quiet (0)";
break;
2400 case startup: rs =
"startup (1)";
break;
2401 case errors: rs =
"errors (2)";
break;
2402 case warnings: rs =
"warnings (3)";
break;
2404 case parameters: rs =
"parameters (5)";
break;
2405 case all: rs =
"all (6)";
break;
2414 if (ss[0] ==
'q') verbosity =
quiet;
2415 else if (ss[0] ==
's') verbosity =
startup;
2416 else if (ss[0] ==
'e') verbosity =
errors;
2417 else if (ss[0] ==
'w') verbosity =
warnings;
2419 else if (ss[0] ==
'p') verbosity =
parameters;
2420 else if (ss[0] ==
'a') verbosity =
all;
2423 std::istringstream is(ss);
2426 G4cerr <<
"ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2427 << verbosityString <<
"\"";
2445 else if (intVerbosity >
all) verbosity =
all;
2446 else verbosity =
Verbosity(intVerbosity);
2466 static G4bool noGSPrinting =
true;
2471 noGSPrinting =
false;
2474 "WARNING: G4VisManager::IsValidView(): Attempt to draw when no graphics system"
2475 "\n has been instantiated. Use \"/vis/open\" or \"/vis/sceneHandler/create\"."
2476 "\n Alternatively, to avoid this message, suppress instantiation of vis"
2477 "\n manager (G4VisExecutive) and ensure drawing code is executed only if"
2478 "\n G4VVisManager::GetConcreteInstance() is non-zero."
2488 "ERROR: G4VisManager::IsValidView(): Current view is not valid."
2497 G4cerr <<
"ERROR: G4VisManager::IsValidView ():";
2500 "\n The current scene \""
2502 <<
"\" is not handled by"
2503 "\n the current scene handler \""
2506 "\n (it currently handles scene \""
2510 "\n (a) attach it to the scene handler with"
2511 "\n /vis/sceneHandler/attach "
2514 "\n (b) create a new scene handler with "
2515 "\n /vis/sceneHandler/create <graphics-system>,"
2516 "\n in which case it should pick up the the new scene."
2520 G4cout <<
"\n Scene handler \""
2522 <<
"\" has null scene pointer."
2523 "\n Attach a scene with /vis/sceneHandler/attach [<scene-name>]"
2531 if (viewerList.size () == 0) {
2534 "ERROR: G4VisManager::IsValidView (): the current scene handler\n \""
2536 <<
"\" has no viewers. Do /vis/viewer/create."
2546 if (!successful ||
fpScene -> IsEmpty ()) {
2548 G4cerr <<
"ERROR: G4VisManager::IsValidView ():";
2550 "\n Attempt at some drawing operation when scene is empty."
2551 "\n Maybe the geometry has not yet been defined."
2552 " Try /run/initialize."
2553 "\n Or use \"/vis/scene/add/extent\"."
2562 "WARNING: G4VisManager: the scene was empty, \"world\" has been"
2563 "\n added and the scene handlers notified.";
2575 G4cout<<
"G4VisManager: No model factories registered with G4VisManager."<<
G4endl;
2576 G4cout<<
"G4VisManager::RegisterModelFactories() should be overridden in derived"<<
G4endl;
2577 G4cout<<
"class. See G4VisExecutive for an example."<<
G4endl;
2581#ifdef G4MULTITHREADED
2582void G4VisManager::SetUpForAThread()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4VSceneHandler * >::const_iterator G4SceneHandlerListConstIterator
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4THREADJOIN(worker)
void G4THREADCREATE(_Worker *&worker, _Func func, _Args... args)
#define G4MUTEXUNLOCK(mutex)
void * G4ThreadFunReturnType
void * G4ThreadFunArgType
#define TOOLS_COLORS_STAT(name, r, g, b)
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
static void InitialiseColourMap()
static const std::map< G4String, G4Colour > & GetMap()
void KeepTheCurrentEvent()
const G4Event * GetConstCurrentEvent()
static G4EventManager * GetEventManager()
void KeepForPostProcessing() const
static pool_type * GetPool()
G4VSolid * GetSolid() const
static G4RunManager * GetMasterRunManager()
static G4RunManagerKernel * GetMasterRunManagerKernel()
static G4RunManagerKernel * GetRunManagerKernel()
G4TrackingManager * GetTrackingManager() const
G4int GetNumberOfEventsToBeProcessed() const
static G4RunManager * GetRunManager()
const G4Run * GetCurrentRun() const
const std::vector< const G4Event * > * GetEventVector() const
G4bool GetRefreshAtEndOfEvent() const
const G4String & GetName() const
G4bool GetRefreshAtEndOfRun() const
G4int GetMaxNumberOfKeptEvents() const
static pool_type * GetPool()
void CreateAndUseWorkspace()
G4int GetStoreTrajectory() const
void SetCurrentTrajectory(const G4VTrajectory *pTraj)
void SetEventID(G4int eventID)
void SetRunID(G4int runID)
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const
void SetCoutDestination(G4UIsession *const value)
G4int ApplyCommand(const char *aCommand)
void SetUpForSpecialThread(G4String aPrefix)
static G4UImanager * GetUIpointer()
Functionality GetFunctionality() const
G4LogicalVolume * GetLogicalVolume() const
virtual void ClearTransientStore()
G4bool GetTransientsDrawnThisEvent() const
void SetTransientsDrawnThisRun(G4bool)
void DrawEvent(const G4Event *)
void SetMarkForClearingTransientStore(G4bool)
G4Scene * GetScene() const
void SetTransientsDrawnThisEvent(G4bool)
void DrawEndOfRunModels()
const G4Transform3D & GetObjectTransformation() const
G4bool GetTransientsDrawnThisRun() const
virtual void ClearStore()
G4bool GetMarkForClearingTransientStore() const
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const =0
virtual void Draw(const G4VTrajectory &trajectory, const G4bool &visible=true) const =0
const G4ViewParameters & GetViewParameters() const
virtual void FinishView()
virtual void ClearView()=0
static void SetVisManager(G4VisManager *pVisManager)
static G4VVisManager * GetConcreteInstance()
static void SetConcreteInstance(G4VVisManager *)
void SetXGeometryString(const G4String &)
G4bool IsCullingInvisible() const
G4bool IsAutoRefresh() const
G4bool IsCullingCovered() const
G4double GetExtentRadius() const
FilterMode::Mode GetMode() const
G4String Placement() const
const std::vector< Filter * > & FilterList() const
const std::vector< Factory * > & FactoryList() const
const std::map< G4String, T * > & Map() const
const T * Current() const
std::vector< G4UImessenger * > fMessengerList
void SelectTrajectoryModel(const G4String &model)
void RegisterRunDurationUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
void SetCurrentGraphicsSystem(G4VGraphicsSystem *)
void Draw2D(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
static G4VisManager * fpInstance
G4bool fEventKeepingSuspended
std::vector< G4UIcommand * > fDirectoryList
virtual void RegisterGraphicsSystems()=0
G4GraphicsSystemList fAvailableGraphicsSystems
void InitialiseG4ColourMap() const
void BeginDraw2D(const G4Transform3D &objectTransformation=G4Transform3D())
void CreateSceneHandler(const G4String &name="")
void DrawT2D(const T &graphics_primitive, const G4Transform3D &objectTransform)
G4VSceneHandler * fpSceneHandler
void SetCurrentSceneHandler(G4VSceneHandler *)
void ClearTransientStoreIfMarked()
void PrintAvailableModels(Verbosity) const
const G4VTrajectoryModel * CurrentTrajDrawModel() const
G4int fNoOfEventsDrawnThisRun
static Verbosity fVerbosity
G4bool FilterDigi(const G4VDigi &)
void SetTransientsDrawnThisEvent(G4bool)
void SetCurrentScene(G4Scene *)
static std::vector< G4String > VerbosityGuidanceStrings
static G4String VerbosityString(Verbosity)
void RegisterEndOfEventUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())
G4VisFilterManager< G4VHit > * fpHitFilterMgr
G4String ViewerShortName(const G4String &viewerName) const
G4VisModelManager< G4VTrajectoryModel > * fpTrajDrawModelMgr
void RegisterModel(G4VTrajectoryModel *model)
void RegisterMessenger(G4UImessenger *messenger)
void SetCurrentViewer(G4VViewer *)
void DrawT(const T &graphics_primitive, const G4Transform3D &objectTransform)
std::vector< UserVisAction > fRunDurationUserVisActions
G4VisFilterManager< G4VTrajectory > * fpTrajFilterMgr
void RegisterModelFactory(G4TrajDrawModelFactory *factory)
G4bool FilterHit(const G4VHit &)
std::map< G4VUserVisAction *, G4VisExtent > fUserVisActionExtents
std::vector< UserVisAction > fEndOfRunUserVisActions
G4bool fIgnoreStateChanges
G4VViewer * GetCurrentViewer() const
G4bool RegisterGraphicsSystem(G4VGraphicsSystem *)
void PrintAvailableGraphicsSystems(Verbosity) const
G4VisFilterManager< G4VDigi > * fpDigiFilterMgr
virtual void RegisterModelFactories()
G4int fDrawGroupNestingDepth
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
void RegisterMessengers()
G4VisStateDependent * fpStateDependent
void ResetTransientsDrawnFlags()
std::vector< UserVisAction > fEndOfEventUserVisActions
G4bool FilterTrajectory(const G4VTrajectory &)
void PrintAvailableColours(Verbosity) const
void SetVerboseLevel(G4int)
void PrintAvailableUserVisActions(Verbosity) const
void IgnoreStateChanges(G4bool)
friend class G4VisStateDependent
G4bool fDrawEventOnlyIfToBeKept
void PrintInvalidPointers() const
G4VisManager(const G4String &verbosityString="warnings")
G4SceneHandlerList fAvailableSceneHandlers
static Verbosity GetVerbosityValue(const G4String &)
static G4VisManager * GetInstance()
void GeometryHasChanged()
const G4GraphicsSystemList & GetAvailableGraphicsSystems()
G4VGraphicsSystem * fpGraphicsSystem
G4bool fTransientsDrawnThisEvent
void RegisterEndOfRunUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())
void BeginDraw(const G4Transform3D &objectTransformation=G4Transform3D())
void CreateViewer(const G4String &name="", const G4String &XGeometry="")
void DispatchToModel(const G4VTrajectory &)
G4bool fTransientsDrawnThisRun
G4VViewer * GetViewer(const G4String &viewerName) const
const List * ListManager() const
const Model * Current() const
void SetCurrent(const G4String &)
const std::vector< Factory * > & FactoryList() const
G4String Placement() const
const G4double al
Mysterious coefficient that appears in the wavefunctions.
const char * name(G4int ptype)
G4String to_lower_copy(G4String str)
Return lowercased copy of string.
G4String strip_copy(G4String str, char c=' ')
Return copy of string with leading and trailing characters removed.
G4bool IsMultithreadedApplication()