97 G4bool mtRunInProgress =
false;
98 std::deque<const G4Event*> mtVisEventQueue;
105 G4bool isSubEventRunManagerType =
false;
106 G4bool isValidViewForRun =
false;
121, fInitialised (false)
122, fpGraphicsSystem (0)
126, fpStateDependent (0)
127, fEventRefreshing (false)
128, fTransientsDrawnThisRun (false)
129, fTransientsDrawnThisEvent (false)
130, fNoOfEventsDrawnThisRun (0)
131, fNKeepForPostProcessingRequests (0)
132, fNKeepTheEventRequests (0)
133, fEventKeepingSuspended (false)
134, fDrawEventOnlyIfToBeKept (false)
135, fpRequestedEvent (0)
136, fReviewingKeptEvents (false)
137, fAbortReviewKeptEvents (false)
138, fReviewingPlots (false)
139, fAbortReviewPlots (false)
140, fIsDrawGroup (false)
141, fDrawGroupNestingDepth (0)
142, fIgnoreStateChanges (false)
143, fMaxEventQueueSize (100)
144, fWaitOnEventQueueFull (true)
153 (
"Simple graded message scheme - digit or string (1st character defines):");
155 (
" 0) quiet, // Nothing is printed.");
157 (
" 1) startup, // Startup and endup messages are printed...");
159 (
" 2) errors, // ...and errors...");
161 (
" 3) warnings, // ...and warnings...");
163 (
" 4) confirmations, // ...and confirming messages...");
165 (
" 5) parameters, // ...and parameters of scenes and views...");
167 (
" 6) all // ...and everything available.");
171 (
"G4VisManager::G4VisManager",
173 "Attempt to Construct more than one VisManager");
185 <<
"Visualization Manager instantiating with verbosity \""
215 G4bool propagateToWorkers;
216 auto directory =
new G4UIdirectory (
"/vis/",propagateToWorkers=
false);
217 directory -> SetGuidance (
"Visualization commands.");
220 fDirectoryList.push_back (directory);
236 for (i = 0; i < fSceneList.size (); ++i) {
237 delete fSceneList[i];
239 for (i = 0; i < fAvailableSceneHandlers.size (); ++i) {
240 if (fAvailableSceneHandlers[i] != NULL) {
241 delete fAvailableSceneHandlers[i];
244 for (i = 0; i < fAvailableGraphicsSystems.size (); ++i) {
245 if (fAvailableGraphicsSystems[i]) {
246 delete fAvailableGraphicsSystems[i];
251 G4cout <<
"Visualization Manager deleting..." <<
G4endl;
253 for (i = 0; i < fMessengerList.size (); ++i) {
254 delete fMessengerList[i];
256 for (i = 0; i < fDirectoryList.size (); ++i) {
257 delete fDirectoryList[i];
260 delete fpDigiFilterMgr;
261 delete fpHitFilterMgr;
262 delete fpTrajFilterMgr;
263 delete fpTrajDrawModelMgr;
270 (
"G4VisManager::GetInstance",
279 G4warn <<
"WARNING: G4VisManager::Initialise: already initialised."
285 G4cout <<
"Visualization Manager initialising..." <<
G4endl;
290 "\nYou have instantiated your own Visualization Manager, inheriting"
291 "\n G4VisManager and implementing RegisterGraphicsSystems(), in which"
292 "\n you should, normally, instantiate drivers which do not need"
293 "\n external packages or libraries, and, optionally, drivers under"
294 "\n control of environment variables."
295 "\n Also you should implement RegisterModelFactories()."
296 "\n See visualization/management/include/G4VisExecutive.hh/icc, for example."
297 "\n In your main() you will have something like:"
298 "\n G4VisManager* visManager = new G4VisExecutive;"
299 "\n visManager -> SetVerboseLevel (Verbose);"
300 "\n visManager -> Initialize ();"
301 "\n (Don't forget to delete visManager;)"
314 "\nYou have successfully registered the following graphics systems."
324 directory -> SetGuidance (
"Modeling commands.");
325 fDirectoryList.push_back (directory);
326 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/");
327 directory -> SetGuidance (
"Trajectory model commands.");
328 fDirectoryList.push_back (directory);
329 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/create/");
330 directory -> SetGuidance (
"Create trajectory models and messengers.");
331 fDirectoryList.push_back (directory);
335 directory -> SetGuidance (
"Filtering commands.");
336 fDirectoryList.push_back (directory);
337 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/");
338 directory -> SetGuidance (
"Trajectory filtering commands.");
339 fDirectoryList.push_back (directory);
340 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/create/");
341 directory -> SetGuidance (
"Create trajectory filters and messengers.");
342 fDirectoryList.push_back (directory);
344 directory -> SetGuidance (
"Hit filtering commands.");
345 fDirectoryList.push_back (directory);
346 directory =
new G4UIdirectory (
"/vis/filtering/hits/create/");
347 directory -> SetGuidance (
"Create hit filters and messengers.");
348 fDirectoryList.push_back (directory);
350 directory -> SetGuidance (
"Digi filtering commands.");
351 fDirectoryList.push_back (directory);
352 directory =
new G4UIdirectory (
"/vis/filtering/digi/create/");
353 directory -> SetGuidance (
"Create digi filters and messengers.");
354 fDirectoryList.push_back (directory);
366 "\nYou have successfully registered the following model factories."
377 InitialiseG4ColourMap();
381 "Some /vis commands (optionally) take a string to specify colour."
382 "\n\"/vis/list\" to see available colours."
389void G4VisManager::InitialiseG4ColourMap()
const
398#define TOOLS_COLORS_STAT(name,r,g,b) \
399G4Colour::AddToMap(#name, G4Colour(r,g,b));
480#undef TOOLS_COLORS_STAT
491 directory -> SetGuidance(
"Operations on vis attributes of Geant4 geometry.");
492 fDirectoryList.push_back (directory);
497 directory -> SetGuidance(
"Set vis attributes of Geant4 geometry.");
498 fDirectoryList.push_back (directory);
511 directory -> SetGuidance(
"Commands unique to multithreading mode.");
512 fDirectoryList.push_back (directory);
517 directory -> SetGuidance
518 (
"Set quantities for use in future commands where appropriate.");
519 fDirectoryList.push_back (directory);
531 directory -> SetGuidance (
"Operations on Geant4 scenes.");
532 fDirectoryList.push_back (directory);
544 directory -> SetGuidance (
"Add model to current scene.");
545 fDirectoryList.push_back (directory);
586 directory -> SetGuidance (
"Operations on Geant4 scene handlers.");
587 fDirectoryList.push_back (directory);
594 directory -> SetGuidance (
"Operations on touchables.");
595 fDirectoryList.push_back (directory);
599 directory -> SetGuidance (
"Set vis attributes of current touchable.");
600 fDirectoryList.push_back (directory);
604 directory -> SetGuidance (
"Operations on Geant4 viewers.");
605 fDirectoryList.push_back (directory);
633 directory -> SetGuidance(
"Set default values for future viewers.");
634 fDirectoryList.push_back (directory);
639 directory -> SetGuidance (
"Set view parameters of current viewer.");
640 fDirectoryList.push_back (directory);
665 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
667 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
671 (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
673 (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
677 (fpHitFilterMgr, fpHitFilterMgr->Placement()));
679 (fpHitFilterMgr, fpHitFilterMgr->Placement()));
683 (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
685 (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
688#include <tools/histo/h1d>
689#include <tools/histo/h2d>
693 std::size_t fNumberOfPlots = 0;
694 std::size_t fTotalEntries = 0;
696 template <
typename HT>
697 PlotResults ResultsOfHnPlots(
const G4String& plotType) {
698 PlotResults plotResults;
700 auto keepControlVerbose = ui->GetVerboseLevel();
701 ui->SetVerboseLevel(0);
702 auto status = ui->ApplyCommand(
"/analysis/" + plotType +
"/getVector");
703 ui->SetVerboseLevel(keepControlVerbose);
705 G4String hexString = ui->GetCurrentValues(
G4String(
"/analysis/" + plotType +
"/getVector"));
706 if(hexString.size()) {
707 void* ptr; std::istringstream is(hexString); is >> ptr;
708 auto vectorOfPlots = (
const std::vector<HT*>*)ptr;
709 for (std::size_t i = 0; i < vectorOfPlots->size(); ++i) {
710 auto plot = (*vectorOfPlots)[i];
711 if (plot ==
nullptr)
continue;
712 ++plotResults.fNumberOfPlots;
713 plotResults.fTotalEntries += plot->entries();
719 void PrintListOfPlots() {
720 std::size_t numberOfPlots = 0;
721 std::size_t numberOfEntries = 0;
722 PlotResults h1results = ResultsOfHnPlots<tools::histo::h1d>(
"h1");
723 numberOfPlots += h1results.fNumberOfPlots;
724 numberOfEntries += h1results.fTotalEntries;
725 PlotResults h2results = ResultsOfHnPlots<tools::histo::h2d>(
"h2");
726 numberOfPlots += h2results.fNumberOfPlots;
727 numberOfEntries += h2results.fTotalEntries;
728 if (numberOfPlots > 0) {
729 G4warn <<
"There are histograms that can be viewed with visualization:";
730 if (h1results.fNumberOfPlots > 0) {
731 G4warn <<
"\n " << h1results.fNumberOfPlots <<
" h1 histograms(s)";
733 if (h2results.fNumberOfPlots > 0) {
734 G4warn <<
"\n " << h2results.fNumberOfPlots <<
" h2 histograms(s)";
737 <<
"\n List them with \"/analysis/list\"."
738 <<
"\n View them immediately with \"/vis/plot\" or \"/vis/reviewPlots\"."
740 if (numberOfEntries == 0) {
742 " But...there are no entries. To make your histograms available for"
743 "\n plotting in this UI session, use CloseFile(false) in your"
744 "\n EndOfRunAction and Reset() in your BeginOfRunAction."
752 if (IsValidView ()) {
755 G4cout <<
"G4VisManager::Enable: visualization enabled." <<
G4endl;
758 std::size_t nKeptEvents = 0;
762 if (nKeptEvents == 1) {isare =
"is"; plural =
"";}
764 "There " << isare <<
' ' << nKeptEvents <<
" kept event" << plural <<
'.'
766 if (nKeptEvents > 0) {
768 " \"/vis/reviewKeptEvents\" to review one by one."
769 "\n To see accumulated, \"/vis/enable\", then \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\"."
778 "G4VisManager::Enable: WARNING: visualization remains disabled for"
779 "\n above reasons. Rectifying with valid vis commands will"
780 "\n automatically enable."
790 "G4VisManager::Disable: visualization disabled."
791 "\n The pointer returned by GetConcreteInstance will be zero."
792 "\n Note that it will become enabled after some valid vis commands."
796 G4int currentTrajectoryType =
798 if (currentTrajectoryType > 0) {
800 "You may wish to disable trajectory production too:"
801 "\n \"/tracking/storeTrajectory 0\""
802 "\nbut don't forget to re-enable with"
804 "\n \"/tracking/storeTrajectory " << currentTrajectoryType
805 <<
"\"\n and maybe \"/vis/viewer/rebuild\""
812 std::size_t nSystems = fAvailableGraphicsSystems.size ();
815 G4warn <<
"G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
816 "\n graphics system available!"
817 "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
818 "\n when you compiled/built the visualization code?"
819 "\n 2) Did you instantiate your own Visualization Manager and forget"
820 "\n to implement RegisterGraphicsSystems correctly?"
821 "\n 3) You can register your own graphics system, e.g.,"
822 "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
823 "\n after instantiating your vis manager and before"
824 "\n visManager->Initialize()."
828 return fAvailableGraphicsSystems;
834 fAvailableGraphicsSystems.push_back (pSystem);
836 G4cout <<
"G4VisManager::RegisterGraphicsSystem: "
837 << pSystem -> GetName ();
838 if (pSystem -> GetNickname () !=
"") {
839 G4cout <<
" (" << pSystem -> GetNickname () <<
")";
846 G4warn <<
"G4VisManager::RegisterGraphicsSystem: null pointer!"
857 assert (0 != fpTrajDrawModelMgr);
866 G4warn<<
"G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model."<<
G4endl;
867 G4warn<<
"See commands in /vis/modeling/trajectories/ for other options."<<
G4endl;
871 model = fpTrajDrawModelMgr->Current();
879 fpTrajDrawModelMgr->Register(model);
885 fpTrajDrawModelMgr->Register(factory);
890 fpTrajFilterMgr->Register(model);
896 fpTrajFilterMgr->Register(factory);
901 fpHitFilterMgr->Register(model);
907 fpHitFilterMgr->Register(factory);
912 fpDigiFilterMgr->Register(model);
918 fpDigiFilterMgr->Register(factory);
923 fpTrajDrawModelMgr->SetCurrent(model);
930 fDrawGroupNestingDepth++;
931 if (fDrawGroupNestingDepth > 1) {
933 (
"G4VisManager::BeginDraw",
935 "Nesting detected. It is illegal to nest Begin/EndDraw."
939 if (IsValidView ()) {
940 ClearTransientStoreIfMarked();
941 fpSceneHandler -> BeginPrimitives (objectTransform);
950 fDrawGroupNestingDepth--;
951 if (fDrawGroupNestingDepth != 0) {
952 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
955 if (IsValidView ()) {
956 fpSceneHandler -> EndPrimitives ();
958 fIsDrawGroup =
false;
965 fDrawGroupNestingDepth++;
966 if (fDrawGroupNestingDepth > 1) {
968 (
"G4VisManager::BeginDraw2D",
970 "Nesting detected. It is illegal to nest Begin/EndDraw2D."
974 if (IsValidView ()) {
975 ClearTransientStoreIfMarked();
976 fpSceneHandler -> BeginPrimitives2D (objectTransform);
985 fDrawGroupNestingDepth--;
986 if (fDrawGroupNestingDepth != 0) {
987 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
990 if (IsValidView ()) {
991 fpSceneHandler -> EndPrimitives2D ();
993 fIsDrawGroup =
false;
996template <
class T>
void G4VisManager::DrawT
997(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
1003 (
"G4VSceneHandler::DrawT",
1005 "Different transform detected in Begin/EndDraw group.");
1007 fpSceneHandler -> AddPrimitive (graphics_primitive);
1009 if (IsValidView ()) {
1010 ClearTransientStoreIfMarked();
1011 fpSceneHandler -> BeginPrimitives (objectTransform);
1012 fpSceneHandler -> AddPrimitive (graphics_primitive);
1013 fpSceneHandler -> EndPrimitives ();
1018template <
class T>
void G4VisManager::DrawT2D
1019(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
1023 if (objectTransform != fpSceneHandler->GetObjectTransformation()) {
1025 (
"G4VSceneHandler::DrawT",
1027 "Different transform detected in Begin/EndDraw2D group.");
1029 fpSceneHandler -> AddPrimitive (graphics_primitive);
1031 if (IsValidView ()) {
1032 ClearTransientStoreIfMarked();
1033 fpSceneHandler -> BeginPrimitives2D (objectTransform);
1034 fpSceneHandler -> AddPrimitive (graphics_primitive);
1035 fpSceneHandler -> EndPrimitives2D ();
1043 DrawT (circle, objectTransform);
1049 DrawT (polyhedron, objectTransform);
1055 DrawT (line, objectTransform);
1061 DrawT (polymarker, objectTransform);
1067 DrawT (square, objectTransform);
1073 DrawT (text, objectTransform);
1079 DrawT2D (circle, objectTransform);
1085 DrawT2D (polyhedron, objectTransform);
1091 DrawT2D (line, objectTransform);
1097 DrawT2D (polymarker, objectTransform);
1103 DrawT2D (square, objectTransform);
1109 DrawT2D (text, objectTransform);
1116 fpSceneHandler -> AddCompound (hit);
1118 if (IsValidView ()) {
1119 ClearTransientStoreIfMarked();
1120 fpSceneHandler -> AddCompound (hit);
1129 fpSceneHandler -> AddCompound (digi);
1131 if (IsValidView ()) {
1132 ClearTransientStoreIfMarked();
1133 fpSceneHandler -> AddCompound (digi);
1155 fpSceneHandler -> SetModel (&trajectoriesModel);
1156 fpSceneHandler -> AddCompound (traj);
1157 fpSceneHandler -> SetModel (0);
1159 if (IsValidView ()) {
1160 ClearTransientStoreIfMarked();
1161 fpSceneHandler -> SetModel (&trajectoriesModel);
1162 fpSceneHandler -> AddCompound (traj);
1163 fpSceneHandler -> SetModel (0);
1175 Draw (*pSol, attribs, objectTransform);
1184 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1186 fpSceneHandler -> PostAddSolid ();
1188 if (IsValidView ()) {
1189 ClearTransientStoreIfMarked();
1190 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1192 fpSceneHandler -> PostAddSolid ();
1215 G4VSolid* pSol = pLV -> GetSolid ();
1216 Draw (*pSol, attribs, objectTransform);
1223 auto modelingParameters = fpSceneHandler->CreateModelingParameters();
1225 const G4bool useFullExtent =
true;
1228 delete modelingParameters;
1233 if (fpGraphicsSystem) {
1236 if (pSceneHandler) {
1237 fAvailableSceneHandlers.push_back (pSceneHandler);
1238 fpSceneHandler = pSceneHandler;
1242 G4warn <<
"ERROR in G4VisManager::CreateSceneHandler during "
1243 << fpGraphicsSystem -> GetName ()
1244 <<
" scene handler creation.\n No action taken."
1249 else PrintInvalidPointers ();
1258 if (!fpSceneHandler) {
1259 PrintInvalidPointers ();
1267 G4warn <<
"ERROR in G4VisManager::CreateViewer: null pointer during "
1268 << fpGraphicsSystem -> GetName ()
1269 <<
" viewer creation.\n No action taken."
1275 if (p -> GetViewId() < 0) {
1277 G4warn <<
"ERROR in G4VisManager::CreateViewer during "
1278 << fpGraphicsSystem -> GetName ()
1279 <<
" viewer instantiation.\n No action taken."
1290 p -> SetViewParameters(initialvp);
1292 if (p -> GetViewId() < 0) {
1294 G4warn <<
"ERROR in G4VisManager::CreateViewer during "
1295 << fpGraphicsSystem -> GetName ()
1296 <<
" viewer initialisation.\n No action taken."
1303 fpSceneHandler -> AddViewerToList (fpViewer);
1306 G4cout <<
"G4VisManager::CreateViewer: new viewer created."
1316 static G4bool warned =
false;
1320 "NOTE: objects with visibility flag set to \"false\""
1321 " will not be drawn!"
1322 "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1323 "\n Also see other \"/vis/viewer/set\" commands."
1330 static G4bool warned =
false;
1334 "WARNING: covered objects in solid mode will not be rendered!"
1335 "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1336 "\n Also see other \"/vis/viewer/set\" commands."
1346 G4cout <<
"G4VisManager::GeometryHasChanged() called." <<
G4endl;
1352 -> GetNavigatorForTracking () -> GetWorldVolume ();
1355 G4warn <<
"WARNING: There is no world volume!" <<
G4endl;
1361 std::size_t iScene, nScenes = sceneList.size ();
1362 for (iScene = 0; iScene < nScenes; ++iScene) {
1363 G4Scene* pScene = sceneList [iScene];
1364 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1365 if (modelList.size ()) {
1368 modelInvalid =
false;
1369 std::vector<G4Scene::Model>::iterator iterModel;
1370 for (iterModel = modelList.begin();
1371 iterModel != modelList.end();
1377 G4warn <<
"WARNING: Model \""
1378 << iterModel->fpModel->GetGlobalDescription ()
1379 <<
"\" is no longer valid - being removed\n from scene \""
1380 << pScene -> GetName ()
1381 <<
"\". You may have to re-establish the scene."
1384 modelList.erase (iterModel);
1388 }
while (modelInvalid);
1390 if (modelList.size () == 0) {
1392 G4warn <<
"WARNING: No run-duration models left in this scene \""
1393 << pScene -> GetName ()
1399 G4warn <<
" Adding current world to \""
1400 << pScene -> GetName ()
1407 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1413 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1419 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1421 G4warn <<
"WARNING: The current scene \""
1422 << fpScene -> GetName ()
1423 <<
"\" has no run duration models."
1424 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1428 if (fpSceneHandler) {
1429 fpSceneHandler->ClearTransientStore();
1430 fpSceneHandler->ClearStore();
1432 fpViewer->NeedKernelVisit();
1433 fpViewer->SetView();
1434 fpViewer->ClearView();
1435 fpViewer->FinishView();
1444 G4cout <<
"G4VisManager::NotifyHandler() called." <<
G4endl;
1447 if (IsValidView()) {
1451 std::size_t iScene, nScenes = sceneList.size ();
1452 for (iScene = 0; iScene < nScenes; ++iScene) {
1453 G4Scene* pScene = sceneList [iScene];
1454 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1456 if (modelList.size ()) {
1459 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1464 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1466 G4warn <<
"WARNING: The current scene \""
1467 << fpScene -> GetName ()
1468 <<
"\" has no run duration models."
1469 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1472 fpSceneHandler->ClearTransientStore();
1473 fpSceneHandler->ClearStore();
1474 fpViewer->NeedKernelVisit();
1475 fpViewer->SetView();
1476 fpViewer->ClearView();
1477 fpViewer->FinishView();
1484 return fpTrajFilterMgr->Accept(trajectory);
1489 return fpHitFilterMgr->Accept(hit);
1494 return fpDigiFilterMgr->Accept(digi);
1512 assert (0 != fpTrajDrawModelMgr);
1516 assert (0 != trajectoryModel);
1518 if (IsValidView()) {
1519 trajectoryModel->
Draw(trajectory, visible);
1527 fRunDurationUserVisActions.push_back(
UserVisAction(name,pVisAction));
1529 fUserVisActionExtents[pVisAction] = extent;
1533 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1539 <<
"Run duration user vis action \"" << name <<
"\" registered"
1548 fEndOfEventUserVisActions.push_back(
UserVisAction(name,pVisAction));
1550 fUserVisActionExtents[pVisAction] = extent;
1554 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1560 <<
"End of event user vis action \"" << name <<
"\" registered"
1569 fEndOfRunUserVisActions.push_back(
UserVisAction(name,pVisAction));
1571 fUserVisActionExtents[pVisAction] = extent;
1575 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1581 <<
"End of run user vis action \"" << name <<
"\" registered"
1587 if (pScene != fpScene) {
1596 fpGraphicsSystem = pSystem;
1598 G4cout <<
"G4VisManager::SetCurrentGraphicsSystem: system now "
1599 << pSystem -> GetName () <<
G4endl;
1604 if (!(fpSceneHandler && fpSceneHandler -> GetGraphicsSystem () == pSystem)) {
1608 for (iSH = nSH - 1; iSH >= 0; iSH--) {
1609 if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem)
break;
1612 fpSceneHandler = sceneHandlerList [iSH];
1614 G4cout <<
" Scene Handler now "
1615 << fpSceneHandler -> GetName () <<
G4endl;
1617 if (fpScene != fpSceneHandler -> GetScene ()) {
1618 fpScene = fpSceneHandler -> GetScene ();
1620 G4cout <<
" Scene now \""
1621 << fpScene -> GetName () <<
"\"" <<
G4endl;
1624 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1625 if (viewerList.size ()) {
1626 fpViewer = viewerList [0];
1628 G4cout <<
" Viewer now " << fpViewer -> GetName () <<
G4endl;
1643 fpSceneHandler = pSceneHandler;
1645 G4cout <<
"G4VisManager::SetCurrentSceneHandler: scene handler now \""
1646 << pSceneHandler -> GetName () <<
"\"" <<
G4endl;
1648 if (fpScene != fpSceneHandler -> GetScene ()) {
1649 fpScene = fpSceneHandler -> GetScene ();
1651 G4cout <<
" Scene now \""
1652 << fpScene -> GetName () <<
"\"" <<
G4endl;
1655 if (fpGraphicsSystem != pSceneHandler -> GetGraphicsSystem ()) {
1656 fpGraphicsSystem = pSceneHandler -> GetGraphicsSystem ();
1658 G4cout <<
" Graphics system now \""
1659 << fpGraphicsSystem -> GetName () <<
"\"" <<
G4endl;
1662 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1663 std::size_t nViewers = viewerList.size ();
1665 std::size_t iViewer;
1666 for (iViewer = 0; iViewer < nViewers; ++iViewer) {
1667 if (fpViewer == viewerList [iViewer])
break;
1669 if (iViewer >= nViewers) {
1670 fpViewer = viewerList [0];
1672 G4cout <<
" Viewer now \"" << fpViewer -> GetName () <<
"\""
1676 if (!IsValidView ()) {
1679 "WARNING: Problem setting scene handler - please report circumstances."
1688 "WARNING: No viewers for this scene handler - please create one."
1696 if (fpViewer ==
nullptr) {
1698 G4cout <<
"G4VisManager::SetCurrentViewer: current viewer pointer zeroed "
1704 G4cout <<
"G4VisManager::SetCurrentViewer: viewer now "
1705 << pViewer -> GetName ()
1708 fpSceneHandler = fpViewer -> GetSceneHandler ();
1709 if (!fpSceneHandler) {
1712 "WARNING: No scene handler for this viewer - please create one."
1720 fpScene = fpSceneHandler -> GetScene ();
1721 fpGraphicsSystem = fpSceneHandler -> GetGraphicsSystem ();
1722 if (!IsValidView ()) {
1725 "WARNING: Problem setting viewer - please report circumstances."
1732(
Verbosity verbosity, std::ostream& out)
const
1734 out <<
"Registered graphics systems are:\n";
1735 if (fAvailableGraphicsSystems.size ()) {
1736 for (
const auto& gs: fAvailableGraphicsSystems) {
1737 const G4String& name = gs->GetName();
1738 const std::vector<G4String>& nicknames = gs->GetNicknames();
1741 out <<
" " << name <<
" (";
1742 for (std::size_t i = 0; i < nicknames.size(); ++i) {
1746 out << nicknames[i];
1756 "You may choose a graphics system (driver) with a parameter of"
1757 "\nthe command \"/vis/open\" or \"/vis/sceneHandler/create\","
1758 "\nor you may omit the driver parameter and choose at run time:"
1759 "\n- by argument in the construction of G4VisExecutive;"
1760 "\n- by environment variable \"G4VIS_DEFAULT_DRIVER\";"
1761 "\n- by entry in \"~/.g4session\";"
1762 "\n- by build flags."
1763 "\n- Note: This feature is not allowed in batch mode."
1764 "\nFor further information see \"examples/basic/B1/exampleB1.cc\""
1765 "\nand \"vis.mac\"."
1768 out <<
" NONE!!! None registered - yet! Mmmmm!" << std::endl;
1772void G4VisManager::PrintAvailableModels (Verbosity verbosity)
const
1777 const std::vector<G4VModelFactory<G4VTrajectoryModel>*>& factoryList =
1781 std::vector<G4VModelFactory<G4VTrajectoryModel>*>::const_iterator i;
1782 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1787 const G4VisListManager<G4VTrajectoryModel>* listManager =
1788 fpTrajDrawModelMgr->ListManager();
1789 const std::map<G4String, G4VTrajectoryModel*>& modelMap =
1793 std::map<G4String, G4VTrajectoryModel*>::const_iterator i;
1794 for (i = modelMap.begin(); i != modelMap.end(); ++i) {
1795 G4cout <<
" " << i->second->Name();
1796 if (i->second == listManager->
Current())
G4cout <<
" (Current)";
1808 const std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>&
1809 factoryList = fpTrajFilterMgr->FactoryList();
1812 std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>::const_iterator i;
1813 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1819 const std::vector<G4VFilter<G4VTrajectory>*>&
1820 filterList = fpTrajFilterMgr->FilterList();
1823 std::vector<G4VFilter<G4VTrajectory>*>::const_iterator i;
1824 for (i = filterList.begin(); i != filterList.end(); ++i) {
1832void G4VisManager::PrintAvailableUserVisActions (Verbosity)
const
1835 "You have successfully registered the following user vis actions."
1837 G4cout <<
"Run Duration User Vis Actions:";
1838 if (fRunDurationUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1841 for (
const auto& fRunDurationUserVisAction : fRunDurationUserVisActions) {
1842 const G4String&
name = fRunDurationUserVisAction.fName;
1847 G4cout <<
"End of Event User Vis Actions:";
1848 if (fEndOfEventUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1851 for (
const auto& fEndOfEventUserVisAction : fEndOfEventUserVisActions) {
1852 const G4String&
name = fEndOfEventUserVisAction.fName;
1857 G4cout <<
"End of Run User Vis Actions:";
1858 if (fEndOfRunUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1861 for (
const auto& fEndOfRunUserVisAction : fEndOfRunUserVisActions) {
1862 const G4String&
name = fEndOfRunUserVisAction.fName;
1868void G4VisManager::PrintAvailableColours (Verbosity)
const {
1870 "Some /vis commands (optionally) take a string to specify colour."
1871 "\nThey are also available in your C++ code, e.g:"
1872 "\n G4Colour niceColour; // Default - white"
1873 "\n G4Colour::GetColour(\"pink\", niceColour);"
1874 "\n logical->SetVisAttributes(niceColour);"
1875 "\nSee G4Colour.hh."
1876 "\nAvailable colours";
1878 G4cout <<
", " << i.first;
1883void G4VisManager::PrintInvalidPointers ()
const {
1885 G4warn <<
"ERROR: G4VisManager::PrintInvalidPointers:";
1886 if (!fpGraphicsSystem) {
1887 G4warn <<
"\n null graphics system pointer.";
1890 G4warn <<
"\n Graphics system is " << fpGraphicsSystem -> GetName ()
1894 "\n Null scene pointer. Use \"/vis/drawVolume\" or"
1895 " \"/vis/scene/create\".";
1896 if (!fpSceneHandler)
1898 "\n Null scene handler pointer. Use \"/vis/open\" or"
1899 " \"/vis/sceneHandler/create\".";
1902 "\n Null viewer pointer. Use \"/vis/viewer/create\".";
1911#ifdef G4MULTITHREADED
1914 if (!pSceneHandler)
return 0;
1916 if (!pScene)
return 0;
1918 if (!pViewer)
return 0;
1935 std::size_t eventQueueSize = mtVisEventQueue.size();
1939 while (eventQueueSize) {
1942 const G4Event*
event = mtVisEventQueue.front();
1957 pVisManager->ClearTransientStoreIfMarked();
1961 ++pVisManager->fNoOfEventsDrawnThisRun;
1965 mtVisEventQueue.pop_front();
1966 pVisManager->EndOfEventCleanup(event);
1967 eventQueueSize = mtVisEventQueue.size();
1972 G4bool runInProgress = mtRunInProgress;
1974 if (!runInProgress) {
1981 std::this_thread::sleep_for(std::chrono::milliseconds(100));
1993void G4VisManager::BeginOfRun ()
1995 if (fIgnoreStateChanges)
return;
2001 isValidViewForRun = fpSceneHandler && IsValidView();
2002 if (!isValidViewForRun)
return;
2007 isFakeRun = (nEventsToBeProcessed == 0);
2008 if (isFakeRun)
return;
2012 isSubEventRunManagerType =
2016 fNKeepForPostProcessingRequests = 0;
2017 fNKeepTheEventRequests = 0;
2018 fEventKeepingSuspended =
false;
2019 fTransientsDrawnThisRun =
false;
2021 fNoOfEventsDrawnThisRun = 0;
2037 mtRunInProgress =
true;
2052void G4VisManager::BeginOfEvent ()
2054 if (fIgnoreStateChanges)
return;
2056 if (!isValidViewForRun)
return;
2057 if (isFakeRun)
return;
2061#ifndef G4MULTITHREADED
2063 fTransientsDrawnThisEvent =
false;
2064 if (fpSceneHandler) fpSceneHandler->SetTransientsDrawnThisEvent(
false);
2095void G4VisManager::EndOfEvent ()
2097 if (fIgnoreStateChanges)
return;
2099 if (!isValidViewForRun)
return;
2100 if (isFakeRun)
return;
2103 if (isSubEventRunManagerType)
return;
2110 if (!currentRun)
return;
2115 if (!currentEvent)
return;
2118 EndOfEventKernel(currentEvent);
2125 if (fIgnoreStateChanges)
return;
2127 if (!isValidViewForRun)
return;
2128 if (isFakeRun)
return;
2131 EndOfEventKernel(event);
2134void G4VisManager::EndOfEventKernel (
const G4Event* currentEvent)
2140 if (fDrawEventOnlyIfToBeKept) {
2148 std::size_t eventQueueSize = mtVisEventQueue.size();
2151 G4bool eventQueueFull =
false;
2152 while (fMaxEventQueueSize > 0 && (
G4int)eventQueueSize >= fMaxEventQueueSize) {
2154 if (fWaitOnEventQueueFull) {
2156 static G4bool warned =
false;
2159 "WARNING: The number of events in the visualisation queue has exceeded"
2161 << fMaxEventQueueSize <<
2162 ".\n If, during a multithreaded run, the simulation gets ahead of the"
2163 "\n visualisation by more than this maximum, the simulation is delayed"
2164 "\n until the vis sub-thread has drawn a few more events and removed them"
2165 "\n from the queue. You may change this maximum number of events with"
2166 "\n \"/vis/multithreading/maxEventQueueSize <N>\", where N is the maximum"
2167 "\n number you wish to allow. N <= 0 means \"unlimited\"."
2168 "\n Alternatively you may choose to discard events for drawing by setting"
2169 "\n \"/vis/multithreading/actionOnEventQueueFull discard\"."
2170 "\n To avoid visualisation altogether: \"/vis/disable\"."
2171 "\n And maybe \"/tracking/storeTrajectories 0\"."
2177 std::this_thread::sleep_for(std::chrono::milliseconds(100));
2181 static G4bool warned =
false;
2184 "WARNING: The number of events in the visualisation queue has exceeded"
2186 << fMaxEventQueueSize <<
2187 ".\n Some events have been discarded for drawing. You may change this"
2188 "\n behaviour with \"/vis/multithreading/actionOnEventQueueFull wait\"."
2189 "\n To avoid visualisation altogether: \"/vis/disable\"."
2190 "\n And maybe \"/tracking/storeTrajectories 0\"."
2195 eventQueueFull =
true;
2200 eventQueueSize = mtVisEventQueue.size();
2204 if (!eventQueueFull) {
2206 if (RequiredToBeKeptForVis(currentEvent->
GetEventID())) {
2208 fNKeepTheEventRequests++;
2216 fNKeepForPostProcessingRequests++;
2219 mtVisEventQueue.push_back(currentEvent);
2236 ClearTransientStoreIfMarked();
2240 fNKeepForPostProcessingRequests++;
2242 if (RequiredToBeKeptForVis(currentEvent->
GetEventID())) {
2244 fNKeepTheEventRequests++;
2248 fpSceneHandler->DrawEvent(currentEvent);
2249 ++fNoOfEventsDrawnThisRun;
2251 EndOfEventCleanup(currentEvent);
2255void G4VisManager::EndOfEventCleanup(
const G4Event* currentEvent)
2257 if (fpScene->GetRefreshAtEndOfEvent()) {
2259 fpSceneHandler->SetMarkForClearingTransientStore(
true);
2264 fpViewer->ShowView();
2270G4bool G4VisManager::RequiredToBeKeptForVis (
G4int eventID)
2273 G4bool requiredToBeKept =
false;
2278 if (fpScene->GetRefreshAtEndOfEvent()) {
2281 if (eventID == nEventsToBeProcessed - 1) {
2282 requiredToBeKept =
true;
2287 G4int maxNumberOfKeptEvents = fpScene->GetMaxNumberOfKeptEvents();
2289 if (maxNumberOfKeptEvents >= 0) {
2291 if (fNKeepTheEventRequests < maxNumberOfKeptEvents) {
2294 requiredToBeKept =
true;
2299 fEventKeepingSuspended =
true;
2300 static G4bool warned =
false;
2304 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended."
2306 if (maxNumberOfKeptEvents > 0) {
2308 "\n The number of events exceeds the maximum, "
2309 << maxNumberOfKeptEvents <<
2310 ", that may be kept by\n the vis manager."
2320 requiredToBeKept =
true;
2325 return requiredToBeKept;
2328void G4VisManager::EndOfRun ()
2330 if (fIgnoreStateChanges)
return;
2332 if (!isValidViewForRun)
return;
2333 if (isFakeRun)
return;
2339 if (!currentRun)
return;
2345 mtRunInProgress =
false;
2349 delete mtVisSubThread;
2350 fpViewer->SwitchToMasterThread();
2355 if (fNoOfEventsDrawnThisRun != noOfEventsRequested) {
2358 <<
"WARNING: Number of events drawn this run, "
2359 << fNoOfEventsDrawnThisRun <<
", is different to number requested, "
2360 << noOfEventsRequested <<
2361 ".\n (This is because you requested \"/vis/multithreading/actionOnEventQueueFull discard\".)"
2370 if (nKeptEvents == 1)
G4warn <<
" event has";
2371 else G4warn <<
" events have";
2372 G4warn <<
" been kept for refreshing and/or reviewing." <<
G4endl;
2373 if (nKeptEvents != fNKeepTheEventRequests) {
2374 if (fNKeepTheEventRequests == 0) {
2375 G4warn <<
"No keep requests were";
2376 }
else if (fNKeepTheEventRequests == 1) {
2377 G4warn <<
"1 keep request was";
2379 G4warn << fNKeepTheEventRequests <<
" keep requests were";
2381 G4warn <<
" made by the vis manager.";
2382 if (fNKeepTheEventRequests == 0) {
2384 "\n The kept events are those you have asked to be kept in your user action(s).";
2387 "\n The same or further events may have been kept by you in your user action(s)."
2388 "\n To turn off event keeping by the vis manager: /vis/drawOnlyToBeKeptEvents"
2389 "\n or use /vis/scene/endOfEventAction <refresh|accumulate> 0";
2394 " \"/vis/reviewKeptEvents\" to review one by one."
2395 "\n To see accumulated, \"/vis/enable\", then \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\"."
2401 "WARNING: G4VisManager::EndOfRun: Automatic event keeping was suspended."
2403 if (fpScene->GetMaxNumberOfKeptEvents() > 0) {
2405 " The number of events in the run exceeded the maximum, "
2406 << fpScene->GetMaxNumberOfKeptEvents() <<
2407 ", that may be\n kept by the vis manager." <<
2408 "\n The number of events kept by the vis manager can be changed with"
2409 "\n \"/vis/scene/endOfEventAction accumulate <N>\", where N is the"
2410 "\n maximum number you wish to allow. N < 0 means \"unlimited\"."
2420 if (fpScene->GetRefreshAtEndOfRun()) {
2421 fpSceneHandler->DrawEndOfRunModels();
2424 if (fpViewer->GetViewParameters().IsAutoRefresh()) {
2425 fpViewer->RefreshView();
2430 fpViewer->ShowView();
2431 fpSceneHandler->SetMarkForClearingTransientStore(
true);
2433 if (fpGraphicsSystem->GetFunctionality() ==
2436 G4warn <<
"\"/vis/viewer/update\" to close file." <<
G4endl;
2441 fEventRefreshing =
false;
2444void G4VisManager::ClearTransientStoreIfMarked(){
2446 if (fpSceneHandler->GetMarkForClearingTransientStore()) {
2447 fpSceneHandler->SetMarkForClearingTransientStore(
false);
2448 fpSceneHandler->ClearTransientStore();
2454 fTransientsDrawnThisEvent = fpSceneHandler->GetTransientsDrawnThisEvent();
2455 fTransientsDrawnThisRun = fpSceneHandler->GetTransientsDrawnThisRun();
2460 fTransientsDrawnThisRun =
false;
2461 fTransientsDrawnThisEvent =
false;
2463 for (i = fAvailableSceneHandlers.begin();
2464 i != fAvailableSceneHandlers.end(); ++i) {
2465 (*i)->SetTransientsDrawnThisEvent(
false);
2466 (*i)->SetTransientsDrawnThisRun(
false);
2471 const G4String& viewerShortName = viewerName.substr(0, viewerName.find (
' '));
2477 std::size_t nHandlers = fAvailableSceneHandlers.size ();
2478 std::size_t iHandler, iViewer;
2481 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2483 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2484 for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2485 viewer = viewerList [iViewer];
2486 if (viewerShortName == viewer -> GetShortName ()) {
2493 if (found)
return viewer;
2501 switch (verbosity) {
2502 case quiet: rs =
"quiet (0)";
break;
2503 case startup: rs =
"startup (1)";
break;
2504 case errors: rs =
"errors (2)";
break;
2505 case warnings: rs =
"warnings (3)";
break;
2507 case parameters: rs =
"parameters (5)";
break;
2508 case all: rs =
"all (6)";
break;
2515 os <<
"Available verbosity options:";
2517 os <<
'\n' << VerbosityGuidanceString;
2527 if (ss[0] ==
'q') verbosity =
quiet;
2528 else if (ss[0] ==
's') verbosity =
startup;
2529 else if (ss[0] ==
'e') verbosity =
errors;
2530 else if (ss[0] ==
'w') verbosity =
warnings;
2532 else if (ss[0] ==
'p') verbosity =
parameters;
2533 else if (ss[0] ==
'a') verbosity =
all;
2537 std::istringstream is(ss);
2540 G4warn <<
"ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2541 << verbosityString <<
"\"\n";
2556 else if (intVerbosity >
all) verbosity =
all;
2557 else verbosity =
Verbosity(intVerbosity);
2573G4bool G4VisManager::IsValidView () {
2577 static G4bool noGSPrinting =
true;
2578 if (!fpGraphicsSystem) {
2582 noGSPrinting =
false;
2585 "WARNING: G4VisManager::IsValidView(): Attempt to draw when no graphics system"
2586 "\n has been instantiated. Use \"/vis/open\" or \"/vis/sceneHandler/create\"."
2587 "\n Alternatively, to avoid this message, suppress instantiation of vis"
2588 "\n manager (G4VisExecutive) and ensure drawing code is executed only if"
2589 "\n G4VVisManager::GetConcreteInstance() is non-zero."
2596 if ((!fpScene) || (!fpSceneHandler) || (!fpViewer)) {
2599 "ERROR: G4VisManager::IsValidView(): Current view is not valid."
2601 PrintInvalidPointers ();
2606 if (fpScene != fpSceneHandler -> GetScene ()) {
2608 G4warn <<
"ERROR: G4VisManager::IsValidView ():";
2609 if (fpSceneHandler -> GetScene ()) {
2611 "\n The current scene \""
2612 << fpScene -> GetName ()
2613 <<
"\" is not handled by"
2614 "\n the current scene handler \""
2615 << fpSceneHandler -> GetName ()
2617 "\n (it currently handles scene \""
2618 << fpSceneHandler -> GetScene () -> GetName ()
2621 "\n (a) attach it to the scene handler with"
2622 "\n /vis/sceneHandler/attach "
2623 << fpScene -> GetName ()
2625 "\n (b) create a new scene handler with "
2626 "\n /vis/sceneHandler/create <graphics-system>,"
2627 "\n in which case it should pick up the the new scene."
2631 G4warn <<
"\n Scene handler \""
2632 << fpSceneHandler -> GetName ()
2633 <<
"\" has null scene pointer."
2634 "\n Attach a scene with /vis/sceneHandler/attach [<scene-name>]"
2641 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
2642 if (viewerList.size () == 0) {
2645 "ERROR: G4VisManager::IsValidView (): the current scene handler\n \""
2646 << fpSceneHandler -> GetName ()
2647 <<
"\" has no viewers. Do /vis/viewer/create."
2654 if (fpScene -> IsEmpty ()) {
2656 G4bool successful = fpScene -> AddWorldIfEmpty (warn);
2657 if (!successful || fpScene -> IsEmpty ()) {
2659 G4warn <<
"ERROR: G4VisManager::IsValidView ():";
2661 "\n Attempt at some drawing operation when scene is empty."
2662 "\n Maybe the geometry has not yet been defined."
2663 " Try /run/initialize."
2664 "\n Or use \"/vis/scene/add/extent\"."
2673 "WARNING: G4VisManager: the scene was empty, \"world\" has been"
2674 "\n added and the scene handlers notified.";
2686 G4warn<<
"G4VisManager: No model factories registered with G4VisManager."<<
G4endl;
2687 G4warn<<
"G4VisManager::RegisterModelFactories() should be overridden in derived"<<
G4endl;
2688 G4warn<<
"class. See G4VisExecutive for an example."<<
G4endl;
2695#ifdef G4MULTITHREADED
2702 fIgnoreStateChanges = val;
G4TemplateAutoLock< G4Mutex > G4AutoLock
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)
G4VModelFactory< G4VFilter< G4VHit > > G4HitFilterFactory
G4VModelFactory< G4VTrajectoryModel > G4TrajDrawModelFactory
G4VModelFactory< G4VFilter< G4VTrajectory > > G4TrajFilterFactory
G4VModelFactory< G4VFilter< G4VDigi > > G4DigiFilterFactory
G4GLOB_DLL std::ostream G4cout
static void InitialiseColourMap()
static const std::map< G4String, G4Colour > & GetMap()
const G4Event * GetConstCurrentEvent()
static G4EventManager * GetEventManager()
void KeepTheEvent(G4bool vl=true) const
void PostProcessingFinished() const
G4bool KeepTheEventFlag() const
void KeepForPostProcessing() const
static pool_type * GetPool()
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
G4VSolid * GetSolid() const
G4Navigator is a class for use by the tracking management, able to obtain/calculate dynamic tracking ...
void SetWorldVolume(G4VPhysicalVolume *pWorld)
void DescribeYourselfTo(G4VGraphicsScene &)
static G4RunManager * GetMasterRunManager()
static G4RunManagerKernel * GetMasterRunManagerKernel()
static G4RunManagerKernel * GetRunManagerKernel()
G4TrackingManager * GetTrackingManager() const
G4int GetNumberOfEventsToBeProcessed() const
static G4RunManager * GetRunManager()
RMType GetRunManagerType() const
const G4Run * GetCurrentRun() const
G4int GetNumberOfKeptEvents() const
G4bool AddRunDurationModel(G4VModel *, G4bool warn=false)
const G4String & GetName() 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(const G4String &aPrefix)
static G4UImanager * GetUIpointer()
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4LogicalVolume * GetLogicalVolume() const
void SetTransientsDrawnThisRun(G4bool)
void DrawEvent(const G4Event *)
G4Scene * GetScene() const
void SetTransientsDrawnThisEvent(G4bool)
const G4Transform3D & GetObjectTransformation() const
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const =0
virtual void Draw(const G4VTrajectory &trajectory, const G4bool &visible=true) const =0
virtual void DoneWithMasterThread()
virtual void MovingToMasterThread()
virtual void SwitchToVisSubThread()
virtual void MovingToVisSubThread()
virtual void DoneWithVisSubThread()
static void SetVisManager(G4VisManager *pVisManager)
static G4VVisManager * GetConcreteInstance()
static void SetConcreteInstance(G4VVisManager *)
void SetXGeometryString(const G4String &)
G4bool IsCullingInvisible() const
G4bool IsCullingCovered() const
G4double GetExtentRadius() const
const std::map< G4String, T * > & Map() const
const T * Current() const
void SelectTrajectoryModel(const G4String &model)
void RegisterRunDurationUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())
G4String fDefaultXGeometryStringBasis
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
void SetCurrentGraphicsSystem(G4VGraphicsSystem *)
void Draw2D(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
void PrintAvailableGraphicsSystems(Verbosity, std::ostream &=G4cout) const
virtual void RegisterGraphicsSystems()=0
void BeginDraw2D(const G4Transform3D &objectTransformation=G4Transform3D())
void CreateSceneHandler(const G4String &name="")
void SetCurrentSceneHandler(G4VSceneHandler *)
friend class G4VisCommandList
const G4VTrajectoryModel * CurrentTrajDrawModel() const
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())
G4String ViewerShortName(const G4String &viewerName) const
G4String fDefaultGraphicsSystemBasis
void RegisterModel(G4VTrajectoryModel *model)
void RegisterMessenger(G4UImessenger *messenger)
void SetCurrentViewer(G4VViewer *)
G4String fDefaultXGeometryString
static void PrintAvailableVerbosity(std::ostream &os)
void RegisterModelFactory(G4TrajDrawModelFactory *factory)
G4bool FilterHit(const G4VHit &)
G4VViewer * GetCurrentViewer() const
G4bool RegisterGraphicsSystem(G4VGraphicsSystem *)
static G4ThreadFunReturnType G4VisSubThread(G4ThreadFunArgType)
virtual void RegisterModelFactories()
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
void RegisterMessengers()
void ResetTransientsDrawnFlags()
G4bool FilterTrajectory(const G4VTrajectory &)
G4String fDefaultGraphicsSystemName
virtual void SetUpForAThread()
void SetVerboseLevel(G4int)
void IgnoreStateChanges(G4bool)
friend class G4VisStateDependent
G4VisManager(const G4String &verbosityString="warnings")
void DrawGeometry(G4VPhysicalVolume *, const G4Transform3D &t=G4Transform3D())
static Verbosity GetVerbosityValue(const G4String &)
static G4VisManager * GetInstance()
void GeometryHasChanged()
const G4GraphicsSystemList & GetAvailableGraphicsSystems()
void RegisterEndOfRunUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())
virtual void EventReadyForVis(const G4Event *)
friend class G4VSceneHandler
void BeginDraw(const G4Transform3D &objectTransformation=G4Transform3D())
void CreateViewer(const G4String &name="", const G4String &XGeometry="")
void DispatchToModel(const G4VTrajectory &)
G4VViewer * GetViewer(const G4String &viewerName) const
const std::vector< Factory * > & FactoryList() const
const char * name(G4int ptype)
G4String strip_copy(G4String str, char ch=' ')
Return copy of string with leading and trailing characters removed.
G4String to_lower_copy(G4String str)
Return lowercased copy of string.
G4bool IsMultithreadedApplication()
void G4ConsumeParameters(_Args &&...)