102, fDefaultGraphicsSystemName(
"OGL")
103, fDefaultXGeometryString (
"600x600-0+0")
104, fDefaultGraphicsSystemBasis (
"G4VisManager initialisation")
105, fDefaultXGeometryStringBasis(
"G4VisManager initialisation")
106, fInitialised (false)
107, fpGraphicsSystem (0)
111, fpStateDependent (0)
112, fEventRefreshing (false)
113, fTransientsDrawnThisRun (false)
114, fTransientsDrawnThisEvent (false)
115, fNoOfEventsDrawnThisRun (0)
117, fEventKeepingSuspended (false)
118, fDrawEventOnlyIfToBeKept (false)
119, fpRequestedEvent (0)
120, fReviewingKeptEvents (false)
121, fAbortReviewKeptEvents (false)
122, fReviewingPlots (false)
123, fAbortReviewPlots (false)
124, fIsDrawGroup (false)
125, fDrawGroupNestingDepth (0)
126, fIgnoreStateChanges (false)
127#ifdef G4MULTITHREADED
128, fMaxEventQueueSize (100)
129, fWaitOnEventQueueFull (true)
139 (
"Simple graded message scheme - digit or string (1st character defines):");
141 (
" 0) quiet, // Nothing is printed.");
143 (
" 1) startup, // Startup and endup messages are printed...");
145 (
" 2) errors, // ...and errors...");
147 (
" 3) warnings, // ...and warnings...");
149 (
" 4) confirmations, // ...and confirming messages...");
151 (
" 5) parameters, // ...and parameters of scenes and views...");
153 (
" 6) all // ...and everything available.");
157 (
"G4VisManager::G4VisManager",
159 "Attempt to Construct more than one VisManager");
171 <<
"Visualization Manager instantiating with verbosity \""
201 G4bool propagateToWorkers;
202 auto directory =
new G4UIdirectory (
"/vis/",propagateToWorkers=
false);
203 directory -> SetGuidance (
"Visualization commands.");
206 fDirectoryList.push_back (directory);
222 for (i = 0; i < fSceneList.size (); ++i) {
223 delete fSceneList[i];
225 for (i = 0; i < fAvailableSceneHandlers.size (); ++i) {
226 if (fAvailableSceneHandlers[i] != NULL) {
227 delete fAvailableSceneHandlers[i];
230 for (i = 0; i < fAvailableGraphicsSystems.size (); ++i) {
231 if (fAvailableGraphicsSystems[i]) {
232 delete fAvailableGraphicsSystems[i];
237 G4cout <<
"Visualization Manager deleting..." <<
G4endl;
239 for (i = 0; i < fMessengerList.size (); ++i) {
240 delete fMessengerList[i];
242 for (i = 0; i < fDirectoryList.size (); ++i) {
243 delete fDirectoryList[i];
246 delete fpDigiFilterMgr;
247 delete fpHitFilterMgr;
248 delete fpTrajFilterMgr;
249 delete fpTrajDrawModelMgr;
256 (
"G4VisManager::GetInstance",
265 G4warn <<
"WARNING: G4VisManager::Initialise: already initialised."
271 G4cout <<
"Visualization Manager initialising..." <<
G4endl;
276 "\nYou have instantiated your own Visualization Manager, inheriting"
277 "\n G4VisManager and implementing RegisterGraphicsSystems(), in which"
278 "\n you should, normally, instantiate drivers which do not need"
279 "\n external packages or libraries, and, optionally, drivers under"
280 "\n control of environment variables."
281 "\n Also you should implement RegisterModelFactories()."
282 "\n See visualization/management/include/G4VisExecutive.hh/icc, for example."
283 "\n In your main() you will have something like:"
284 "\n G4VisManager* visManager = new G4VisExecutive;"
285 "\n visManager -> SetVerboseLevel (Verbose);"
286 "\n visManager -> Initialize ();"
287 "\n (Don't forget to delete visManager;)"
300 "\nYou have successfully registered the following graphics systems."
310 directory -> SetGuidance (
"Modeling commands.");
311 fDirectoryList.push_back (directory);
312 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/");
313 directory -> SetGuidance (
"Trajectory model commands.");
314 fDirectoryList.push_back (directory);
315 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/create/");
316 directory -> SetGuidance (
"Create trajectory models and messengers.");
317 fDirectoryList.push_back (directory);
321 directory -> SetGuidance (
"Filtering commands.");
322 fDirectoryList.push_back (directory);
323 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/");
324 directory -> SetGuidance (
"Trajectory filtering commands.");
325 fDirectoryList.push_back (directory);
326 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/create/");
327 directory -> SetGuidance (
"Create trajectory filters and messengers.");
328 fDirectoryList.push_back (directory);
330 directory -> SetGuidance (
"Hit filtering commands.");
331 fDirectoryList.push_back (directory);
332 directory =
new G4UIdirectory (
"/vis/filtering/hits/create/");
333 directory -> SetGuidance (
"Create hit filters and messengers.");
334 fDirectoryList.push_back (directory);
336 directory -> SetGuidance (
"Digi filtering commands.");
337 fDirectoryList.push_back (directory);
338 directory =
new G4UIdirectory (
"/vis/filtering/digi/create/");
339 directory -> SetGuidance (
"Create digi filters and messengers.");
340 fDirectoryList.push_back (directory);
352 "\nYou have successfully registered the following model factories."
363 InitialiseG4ColourMap();
367 "Some /vis commands (optionally) take a string to specify colour."
368 "\n\"/vis/list\" to see available colours."
375void G4VisManager::InitialiseG4ColourMap()
const
384#define TOOLS_COLORS_STAT(name,r,g,b) \
385G4Colour::AddToMap(#name, G4Colour(r,g,b));
466#undef TOOLS_COLORS_STAT
477 directory -> SetGuidance(
"Operations on vis attributes of Geant4 geometry.");
478 fDirectoryList.push_back (directory);
483 directory -> SetGuidance(
"Set vis attributes of Geant4 geometry.");
484 fDirectoryList.push_back (directory);
496#ifdef G4MULTITHREADED
498 directory -> SetGuidance(
"Commands unique to multithreading mode.");
499 fDirectoryList.push_back (directory);
505 directory -> SetGuidance
506 (
"Set quantities for use in future commands where appropriate.");
507 fDirectoryList.push_back (directory);
519 directory -> SetGuidance (
"Operations on Geant4 scenes.");
520 fDirectoryList.push_back (directory);
532 directory -> SetGuidance (
"Add model to current scene.");
533 fDirectoryList.push_back (directory);
573 directory -> SetGuidance (
"Operations on Geant4 scene handlers.");
574 fDirectoryList.push_back (directory);
581 directory -> SetGuidance (
"Operations on touchables.");
582 fDirectoryList.push_back (directory);
586 directory -> SetGuidance (
"Set vis attributes of current touchable.");
587 fDirectoryList.push_back (directory);
591 directory -> SetGuidance (
"Operations on Geant4 viewers.");
592 fDirectoryList.push_back (directory);
620 directory -> SetGuidance(
"Set default values for future viewers.");
621 fDirectoryList.push_back (directory);
626 directory -> SetGuidance (
"Set view parameters of current viewer.");
627 fDirectoryList.push_back (directory);
652 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->
Placement()));
654 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->
Placement()));
658 (fpTrajFilterMgr, fpTrajFilterMgr->
Placement()));
660 (fpTrajFilterMgr, fpTrajFilterMgr->
Placement()));
664 (fpHitFilterMgr, fpHitFilterMgr->
Placement()));
666 (fpHitFilterMgr, fpHitFilterMgr->
Placement()));
670 (fpDigiFilterMgr, fpDigiFilterMgr->
Placement()));
672 (fpDigiFilterMgr, fpDigiFilterMgr->
Placement()));
675#include <tools/histo/h1d>
676#include <tools/histo/h2d>
680 std::size_t fNumberOfPlots = 0;
681 std::size_t fTotalEntries = 0;
683 template <
typename HT>
684 PlotResults ResultsOfHnPlots(
const G4String& plotType) {
685 PlotResults plotResults;
687 auto keepControlVerbose = ui->GetVerboseLevel();
688 ui->SetVerboseLevel(0);
689 auto status = ui->ApplyCommand(
"/analysis/" + plotType +
"/getVector");
690 ui->SetVerboseLevel(keepControlVerbose);
692 G4String hexString = ui->GetCurrentValues(
G4String(
"/analysis/" + plotType +
"/getVector"));
693 if(hexString.size()) {
694 void* ptr; std::istringstream is(hexString); is >> ptr;
695 auto vectorOfPlots = (
const std::vector<HT*>*)ptr;
696 for (std::size_t i = 0; i < vectorOfPlots->size(); ++i) {
697 auto plot = (*vectorOfPlots)[i];
698 if (plot ==
nullptr)
continue;
699 ++plotResults.fNumberOfPlots;
700 plotResults.fTotalEntries += plot->entries();
706 void PrintListOfPlots() {
707 std::size_t numberOfPlots = 0;
708 std::size_t numberOfEntries = 0;
709 PlotResults h1results = ResultsOfHnPlots<tools::histo::h1d>(
"h1");
710 numberOfPlots += h1results.fNumberOfPlots;
711 numberOfEntries += h1results.fTotalEntries;
712 PlotResults h2results = ResultsOfHnPlots<tools::histo::h2d>(
"h2");
713 numberOfPlots += h2results.fNumberOfPlots;
714 numberOfEntries += h2results.fTotalEntries;
715 if (numberOfPlots > 0) {
716 G4warn <<
"There are histograms that can be viewed with visualization:";
717 if (h1results.fNumberOfPlots > 0) {
718 G4warn <<
"\n " << h1results.fNumberOfPlots <<
" h1 histograms(s)";
720 if (h2results.fNumberOfPlots > 0) {
721 G4warn <<
"\n " << h2results.fNumberOfPlots <<
" h2 histograms(s)";
724 <<
"\n List them with \"/analysis/list\"."
725 <<
"\n View them immediately with \"/vis/plot\" or \"/vis/reviewPlots\"."
727 if (numberOfEntries == 0) {
729 " But...there are no entries. To make your histograms available for"
730 "\n plotting in this UI session, use CloseFile(false) in your"
731 "\n EndOfRunAction and Reset() in your BeginOfRunAction."
739 if (IsValidView ()) {
742 G4cout <<
"G4VisManager::Enable: visualization enabled." <<
G4endl;
745 std::size_t nKeptEvents = 0;
749 if (nKeptEvents == 1) {isare =
"is"; plural =
"";}
751 "There " << isare <<
' ' << nKeptEvents <<
" kept event" << plural <<
'.'
753 if (nKeptEvents > 0) {
755 " \"/vis/reviewKeptEvents\" to review one by one."
756 "\n To see accumulated, \"/vis/enable\", then \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\"."
765 "G4VisManager::Enable: WARNING: visualization remains disabled for"
766 "\n above reasons. Rectifying with valid vis commands will"
767 "\n automatically enable."
777 "G4VisManager::Disable: visualization disabled."
778 "\n The pointer returned by GetConcreteInstance will be zero."
779 "\n Note that it will become enabled after some valid vis commands."
783 G4int currentTrajectoryType =
785 if (currentTrajectoryType > 0) {
787 "You may wish to disable trajectory production too:"
788 "\n \"/tracking/storeTrajectory 0\""
789 "\nbut don't forget to re-enable with"
791 "\n \"/tracking/storeTrajectory " << currentTrajectoryType
792 <<
"\"\n and maybe \"/vis/viewer/rebuild\""
799 std::size_t nSystems = fAvailableGraphicsSystems.size ();
802 G4warn <<
"G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
803 "\n graphics system available!"
804 "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
805 "\n when you compiled/built the visualization code?"
806 "\n 2) Did you instantiate your own Visualization Manager and forget"
807 "\n to implement RegisterGraphicsSystems correctly?"
808 "\n 3) You can register your own graphics system, e.g.,"
809 "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
810 "\n after instantiating your vis manager and before"
811 "\n visManager->Initialize()."
815 return fAvailableGraphicsSystems;
821 fAvailableGraphicsSystems.push_back (pSystem);
823 G4cout <<
"G4VisManager::RegisterGraphicsSystem: "
824 << pSystem -> GetName ();
825 if (pSystem -> GetNickname () !=
"") {
826 G4cout <<
" (" << pSystem -> GetNickname () <<
")";
833 G4warn <<
"G4VisManager::RegisterGraphicsSystem: null pointer!"
844 assert (0 != fpTrajDrawModelMgr);
853 G4warn<<
"G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model."<<
G4endl;
854 G4warn<<
"See commands in /vis/modeling/trajectories/ for other options."<<
G4endl;
858 model = fpTrajDrawModelMgr->
Current();
866 fpTrajDrawModelMgr->
Register(model);
872 fpTrajDrawModelMgr->
Register(factory);
915#ifdef G4MULTITHREADED
918 fDrawGroupNestingDepth++;
919 if (fDrawGroupNestingDepth > 1) {
921 (
"G4VisManager::BeginDraw",
923 "Nesting detected. It is illegal to nest Begin/EndDraw."
927 if (IsValidView ()) {
928 ClearTransientStoreIfMarked();
929 fpSceneHandler -> BeginPrimitives (objectTransform);
936#ifdef G4MULTITHREADED
939 fDrawGroupNestingDepth--;
940 if (fDrawGroupNestingDepth != 0) {
941 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
944 if (IsValidView ()) {
945 fpSceneHandler -> EndPrimitives ();
947 fIsDrawGroup =
false;
952#ifdef G4MULTITHREADED
955 fDrawGroupNestingDepth++;
956 if (fDrawGroupNestingDepth > 1) {
958 (
"G4VisManager::BeginDraw2D",
960 "Nesting detected. It is illegal to nest Begin/EndDraw2D."
964 if (IsValidView ()) {
965 ClearTransientStoreIfMarked();
966 fpSceneHandler -> BeginPrimitives2D (objectTransform);
973#ifdef G4MULTITHREADED
976 fDrawGroupNestingDepth--;
977 if (fDrawGroupNestingDepth != 0) {
978 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
981 if (IsValidView ()) {
982 fpSceneHandler -> EndPrimitives2D ();
984 fIsDrawGroup =
false;
987template <
class T>
void G4VisManager::DrawT
988(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
989#ifdef G4MULTITHREADED
995 (
"G4VSceneHandler::DrawT",
997 "Different transform detected in Begin/EndDraw group.");
999 fpSceneHandler -> AddPrimitive (graphics_primitive);
1001 if (IsValidView ()) {
1002 ClearTransientStoreIfMarked();
1003 fpSceneHandler -> BeginPrimitives (objectTransform);
1004 fpSceneHandler -> AddPrimitive (graphics_primitive);
1005 fpSceneHandler -> EndPrimitives ();
1010template <
class T>
void G4VisManager::DrawT2D
1011(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
1012#ifdef G4MULTITHREADED
1018 (
"G4VSceneHandler::DrawT",
1020 "Different transform detected in Begin/EndDraw2D group.");
1022 fpSceneHandler -> AddPrimitive (graphics_primitive);
1024 if (IsValidView ()) {
1025 ClearTransientStoreIfMarked();
1026 fpSceneHandler -> BeginPrimitives2D (objectTransform);
1027 fpSceneHandler -> AddPrimitive (graphics_primitive);
1028 fpSceneHandler -> EndPrimitives2D ();
1036 DrawT (circle, objectTransform);
1042 DrawT (polyhedron, objectTransform);
1048 DrawT (line, objectTransform);
1054 DrawT (polymarker, objectTransform);
1060 DrawT (square, objectTransform);
1066 DrawT (text, objectTransform);
1072 DrawT2D (circle, objectTransform);
1078 DrawT2D (polyhedron, objectTransform);
1084 DrawT2D (line, objectTransform);
1090 DrawT2D (polymarker, objectTransform);
1096 DrawT2D (square, objectTransform);
1102 DrawT2D (text, objectTransform);
1106#ifdef G4MULTITHREADED
1110 fpSceneHandler -> AddCompound (hit);
1112 if (IsValidView ()) {
1113 ClearTransientStoreIfMarked();
1114 fpSceneHandler -> AddCompound (hit);
1120#ifdef G4MULTITHREADED
1124 fpSceneHandler -> AddCompound (digi);
1126 if (IsValidView ()) {
1127 ClearTransientStoreIfMarked();
1128 fpSceneHandler -> AddCompound (digi);
1134#ifdef G4MULTITHREADED
1151 fpSceneHandler -> SetModel (&trajectoriesModel);
1152 fpSceneHandler -> AddCompound (traj);
1153 fpSceneHandler -> SetModel (0);
1155 if (IsValidView ()) {
1156 ClearTransientStoreIfMarked();
1157 fpSceneHandler -> SetModel (&trajectoriesModel);
1158 fpSceneHandler -> AddCompound (traj);
1159 fpSceneHandler -> SetModel (0);
1167#ifdef G4MULTITHREADED
1172 Draw (*pSol, attribs, objectTransform);
1178#ifdef G4MULTITHREADED
1182 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1184 fpSceneHandler -> PostAddSolid ();
1186 if (IsValidView ()) {
1187 ClearTransientStoreIfMarked();
1188 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1190 fpSceneHandler -> PostAddSolid ();
1198#ifdef G4MULTITHREADED
1214 G4VSolid* pSol = pLV -> GetSolid ();
1215 Draw (*pSol, attribs, objectTransform);
1224 const G4bool useFullExtent =
true;
1227 delete modelingParameters;
1232 if (fpGraphicsSystem) {
1235 if (pSceneHandler) {
1236 fAvailableSceneHandlers.push_back (pSceneHandler);
1237 fpSceneHandler = pSceneHandler;
1241 G4warn <<
"ERROR in G4VisManager::CreateSceneHandler during "
1242 << fpGraphicsSystem -> GetName ()
1243 <<
" scene handler creation.\n No action taken."
1248 else PrintInvalidPointers ();
1257 if (!fpSceneHandler) {
1258 PrintInvalidPointers ();
1266 G4warn <<
"ERROR in G4VisManager::CreateViewer: null pointer during "
1267 << fpGraphicsSystem -> GetName ()
1268 <<
" viewer creation.\n No action taken."
1274 if (p -> GetViewId() < 0) {
1276 G4warn <<
"ERROR in G4VisManager::CreateViewer during "
1277 << fpGraphicsSystem -> GetName ()
1278 <<
" viewer instantiation.\n No action taken."
1289 p -> SetViewParameters(initialvp);
1291 if (p -> GetViewId() < 0) {
1293 G4warn <<
"ERROR in G4VisManager::CreateViewer during "
1294 << fpGraphicsSystem -> GetName ()
1295 <<
" viewer initialisation.\n No action taken."
1302 fpSceneHandler -> AddViewerToList (fpViewer);
1305 G4cout <<
"G4VisManager::CreateViewer: new viewer created."
1315 static G4bool warned =
false;
1319 "NOTE: objects with visibility flag set to \"false\""
1320 " will not be drawn!"
1321 "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1322 "\n Also see other \"/vis/viewer/set\" commands."
1329 static G4bool warned =
false;
1333 "WARNING: covered objects in solid mode will not be rendered!"
1334 "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1335 "\n Also see other \"/vis/viewer/set\" commands."
1345 G4cout <<
"G4VisManager::GeometryHasChanged() called." <<
G4endl;
1351 -> GetNavigatorForTracking () -> GetWorldVolume ();
1354 G4warn <<
"WARNING: There is no world volume!" <<
G4endl;
1360 std::size_t iScene, nScenes = sceneList.size ();
1361 for (iScene = 0; iScene < nScenes; ++iScene) {
1362 G4Scene* pScene = sceneList [iScene];
1363 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1364 if (modelList.size ()) {
1367 modelInvalid =
false;
1368 std::vector<G4Scene::Model>::iterator iterModel;
1369 for (iterModel = modelList.begin();
1370 iterModel != modelList.end();
1376 G4warn <<
"WARNING: Model \""
1377 << iterModel->fpModel->GetGlobalDescription ()
1379 "\" is no longer valid - being removed\n from scene \""
1380 << pScene -> GetName () <<
"\""
1383 modelList.erase (iterModel);
1387 }
while (modelInvalid);
1389 if (modelList.size () == 0) {
1391 G4warn <<
"WARNING: No run-duration models left in this scene \""
1392 << pScene -> GetName ()
1398 G4warn <<
" Adding current world to \""
1399 << pScene -> GetName ()
1406 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1412 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1418 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1420 G4warn <<
"WARNING: The current scene \""
1421 << fpScene -> GetName ()
1422 <<
"\" has no run duration models."
1423 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1427 if (fpSceneHandler) {
1443 G4cout <<
"G4VisManager::NotifyHandler() called." <<
G4endl;
1446 if (IsValidView()) {
1450 std::size_t iScene, nScenes = sceneList.size ();
1451 for (iScene = 0; iScene < nScenes; ++iScene) {
1452 G4Scene* pScene = sceneList [iScene];
1453 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1455 if (modelList.size ()) {
1458 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1463 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1465 G4warn <<
"WARNING: The current scene \""
1466 << fpScene -> GetName ()
1467 <<
"\" has no run duration models."
1468 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1483 return fpTrajFilterMgr->
Accept(trajectory);
1488 return fpHitFilterMgr->
Accept(hit);
1493 return fpDigiFilterMgr->
Accept(digi);
1511 assert (0 != fpTrajDrawModelMgr);
1515 assert (0 != trajectoryModel);
1517 if (IsValidView()) {
1518 trajectoryModel->
Draw(trajectory, visible);
1526 fRunDurationUserVisActions.push_back(
UserVisAction(name,pVisAction));
1528 fUserVisActionExtents[pVisAction] = extent;
1532 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1538 <<
"Run duration user vis action \"" << name <<
"\" registered"
1547 fEndOfEventUserVisActions.push_back(
UserVisAction(name,pVisAction));
1549 fUserVisActionExtents[pVisAction] = extent;
1553 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1559 <<
"End of event user vis action \"" << name <<
"\" registered"
1568 fEndOfRunUserVisActions.push_back(
UserVisAction(name,pVisAction));
1570 fUserVisActionExtents[pVisAction] = extent;
1574 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1580 <<
"End of run user vis action \"" << name <<
"\" registered"
1586 if (pScene != fpScene) {
1595 fpGraphicsSystem = pSystem;
1597 G4cout <<
"G4VisManager::SetCurrentGraphicsSystem: system now "
1598 << pSystem -> GetName () <<
G4endl;
1603 if (!(fpSceneHandler && fpSceneHandler -> GetGraphicsSystem () == pSystem)) {
1607 for (iSH = nSH - 1; iSH >= 0; iSH--) {
1608 if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem)
break;
1611 fpSceneHandler = sceneHandlerList [iSH];
1613 G4cout <<
" Scene Handler now "
1614 << fpSceneHandler -> GetName () <<
G4endl;
1616 if (fpScene != fpSceneHandler -> GetScene ()) {
1617 fpScene = fpSceneHandler -> GetScene ();
1619 G4cout <<
" Scene now \""
1620 << fpScene -> GetName () <<
"\"" <<
G4endl;
1623 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1624 if (viewerList.size ()) {
1625 fpViewer = viewerList [0];
1627 G4cout <<
" Viewer now " << fpViewer -> GetName () <<
G4endl;
1642 fpSceneHandler = pSceneHandler;
1644 G4cout <<
"G4VisManager::SetCurrentSceneHandler: scene handler now \""
1645 << pSceneHandler -> GetName () <<
"\"" <<
G4endl;
1647 if (fpScene != fpSceneHandler -> GetScene ()) {
1648 fpScene = fpSceneHandler -> GetScene ();
1650 G4cout <<
" Scene now \""
1651 << fpScene -> GetName () <<
"\"" <<
G4endl;
1654 if (fpGraphicsSystem != pSceneHandler -> GetGraphicsSystem ()) {
1655 fpGraphicsSystem = pSceneHandler -> GetGraphicsSystem ();
1657 G4cout <<
" Graphics system now \""
1658 << fpGraphicsSystem -> GetName () <<
"\"" <<
G4endl;
1661 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1662 std::size_t nViewers = viewerList.size ();
1664 std::size_t iViewer;
1665 for (iViewer = 0; iViewer < nViewers; ++iViewer) {
1666 if (fpViewer == viewerList [iViewer])
break;
1668 if (iViewer >= nViewers) {
1669 fpViewer = viewerList [0];
1671 G4cout <<
" Viewer now \"" << fpViewer -> GetName () <<
"\""
1675 if (!IsValidView ()) {
1678 "WARNING: Problem setting scene handler - please report circumstances."
1687 "WARNING: No viewers for this scene handler - please create one."
1695 if (fpViewer ==
nullptr) {
1697 G4cout <<
"G4VisManager::SetCurrentViewer: current viewer pointer zeroed "
1703 G4cout <<
"G4VisManager::SetCurrentViewer: viewer now "
1704 << pViewer -> GetName ()
1707 fpSceneHandler = fpViewer -> GetSceneHandler ();
1708 if (!fpSceneHandler) {
1711 "WARNING: No scene handler for this viewer - please create one."
1719 fpScene = fpSceneHandler -> GetScene ();
1720 fpGraphicsSystem = fpSceneHandler -> GetGraphicsSystem ();
1721 if (!IsValidView ()) {
1724 "WARNING: Problem setting viewer - please report circumstances."
1731(
Verbosity verbosity, std::ostream& out)
const
1733 out <<
"Registered graphics systems are:\n";
1734 if (fAvailableGraphicsSystems.size ()) {
1735 for (
const auto& gs: fAvailableGraphicsSystems) {
1736 const G4String& name = gs->GetName();
1737 const std::vector<G4String>& nicknames = gs->GetNicknames();
1740 out <<
" " << name <<
" (";
1741 for (std::size_t i = 0; i < nicknames.size(); ++i) {
1745 out << nicknames[i];
1758 <<
"\nNote: Parameters specified on the command line will override these defaults."
1759 <<
"\n Use \"vis/open\" without parameters to get these defaults."
1762 out <<
" NONE!!! None registered - yet! Mmmmm!" <<
G4endl;
1766void G4VisManager::PrintAvailableModels (Verbosity verbosity)
const
1771 const std::vector<G4VModelFactory<G4VTrajectoryModel>*>& factoryList =
1775 std::vector<G4VModelFactory<G4VTrajectoryModel>*>::const_iterator i;
1776 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1783 const std::map<G4String, G4VTrajectoryModel*>& modelMap =
1787 std::map<G4String, G4VTrajectoryModel*>::const_iterator i;
1788 for (i = modelMap.begin(); i != modelMap.end(); ++i) {
1789 G4cout <<
" " << i->second->Name();
1790 if (i->second == listManager->
Current())
G4cout <<
" (Current)";
1802 const std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>&
1806 std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>::const_iterator i;
1807 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1813 const std::vector<G4VFilter<G4VTrajectory>*>&
1817 std::vector<G4VFilter<G4VTrajectory>*>::const_iterator i;
1818 for (i = filterList.begin(); i != filterList.end(); ++i) {
1826void G4VisManager::PrintAvailableUserVisActions (Verbosity)
const
1829 "You have successfully registered the following user vis actions."
1831 G4cout <<
"Run Duration User Vis Actions:";
1832 if (fRunDurationUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1835 for (std::size_t i = 0; i < fRunDurationUserVisActions.size(); ++i) {
1836 const G4String&
name = fRunDurationUserVisActions[i].fName;
1841 G4cout <<
"End of Event User Vis Actions:";
1842 if (fEndOfEventUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1845 for (std::size_t i = 0; i < fEndOfEventUserVisActions.size(); ++i) {
1846 const G4String&
name = fEndOfEventUserVisActions[i].fName;
1851 G4cout <<
"End of Run User Vis Actions:";
1852 if (fEndOfRunUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1855 for (std::size_t i = 0; i < fEndOfRunUserVisActions.size(); ++i) {
1856 const G4String&
name = fEndOfRunUserVisActions[i].fName;
1862void G4VisManager::PrintAvailableColours (Verbosity)
const {
1864 "Some /vis commands (optionally) take a string to specify colour."
1865 "\nAvailable colours:\n ";
1867 for (std::map<G4String, G4Colour>::const_iterator i = map.begin();
1870 if (++i != map.end())
G4cout <<
", ";
1875void G4VisManager::PrintInvalidPointers ()
const {
1877 G4warn <<
"ERROR: G4VisManager::PrintInvalidPointers:";
1878 if (!fpGraphicsSystem) {
1879 G4warn <<
"\n null graphics system pointer.";
1882 G4warn <<
"\n Graphics system is " << fpGraphicsSystem -> GetName ()
1886 "\n Null scene pointer. Use \"/vis/drawVolume\" or"
1887 " \"/vis/scene/create\".";
1888 if (!fpSceneHandler)
1890 "\n Null scene handler pointer. Use \"/vis/open\" or"
1891 " \"/vis/sceneHandler/create\".";
1894 "\n Null viewer pointer. Use \"/vis/viewer/create\".";
1900#ifdef G4MULTITHREADED
1903 G4bool mtRunInProgress =
false;
1904 std::deque<const G4Event*> mtVisEventQueue;
1913 if (!pSceneHandler)
return 0;
1915 if (!pScene)
return 0;
1917 if (!pViewer)
return 0;
1932 pViewer->SwitchToVisSubThread();
1937 std::size_t eventQueueSize = mtVisEventQueue.size();
1941 while (eventQueueSize) {
1944 const G4Event*
event = mtVisEventQueue.front();
1964 pVisManager->ClearTransientStoreIfMarked();
1968 ++pVisManager->fNoOfEventsDrawnThisRun;
1985 mtVisEventQueue.pop_front();
1986 event->PostProcessingFinished();
1987 eventQueueSize = mtVisEventQueue.size();
1993 G4int runInProgress = mtRunInProgress;
1995 if (!runInProgress) {
2002 std::this_thread::sleep_for(std::chrono::milliseconds(100));
2006 pViewer->DoneWithVisSubThread();
2007 pViewer->MovingToMasterThread();
2021void G4VisManager::BeginOfRun ()
2023 if (fIgnoreStateChanges)
return;
2025#ifdef G4MULTITHREADED
2035 if (nEventsToBeProcessed == 0)
return;
2038 fEventKeepingSuspended =
false;
2039 fTransientsDrawnThisRun =
false;
2041 fNoOfEventsDrawnThisRun = 0;
2049#ifdef G4MULTITHREADED
2058 if (fpViewer) fpViewer->DoneWithMasterThread();
2063 mtRunInProgress =
true;
2074 if (fpViewer) fpViewer->MovingToVisSubThread();
2079void G4VisManager::BeginOfEvent ()
2081 if (fIgnoreStateChanges)
return;
2089#ifndef G4MULTITHREADED
2091 fTransientsDrawnThisEvent =
false;
2096void G4VisManager::EndOfEvent ()
2098 if (fIgnoreStateChanges)
return;
2105#ifdef G4MULTITHREADED
2114 G4bool valid = fpSceneHandler && IsValidView();
2120 if (!currentRun)
return;
2125 if (!currentEvent)
return;
2129 if (fDrawEventOnlyIfToBeKept) {
2130 if (!currentEvent->
ToBeKept())
return;
2135#ifdef G4MULTITHREADED
2139 std::size_t eventQueueSize = mtVisEventQueue.size();
2143 G4bool eventQueueFull =
false;
2144 while (fMaxEventQueueSize > 0 && (
G4int)eventQueueSize >= fMaxEventQueueSize) {
2147 if (fWaitOnEventQueueFull) {
2148 static G4bool warned =
false;
2151 "WARNING: The number of events in the visualisation queue has exceeded"
2153 << fMaxEventQueueSize <<
2154 ".\n If, during a multithreaded run, the simulation gets ahead of the"
2155 "\n visualisation by more than this maximum, the simulation is delayed"
2156 "\n until the vis sub-thread has drawn a few more events and removed them"
2157 "\n from the queue. You may change this maximum number of events with"
2158 "\n \"/vis/multithreading/maxEventQueueSize <N>\", where N is the maximum"
2159 "\n number you wish to allow. N <= 0 means \"unlimited\"."
2160 "\n Alternatively you may choose to discard events for drawing by setting"
2161 "\n \"/vis/multithreading/actionOnEventQueueFull discard\"."
2162 "\n To avoid visualisation altogether: \"/vis/disable\"."
2163 "\n And maybe \"/tracking/storeTrajectories 0\"."
2169 std::this_thread::sleep_for(std::chrono::milliseconds(100));
2172 static G4bool warned =
false;
2175 "WARNING: The number of events in the visualisation queue has exceeded"
2177 << fMaxEventQueueSize <<
2178 ".\n Some events have been discarded for drawing. You may change this"
2179 "\n behaviour with \"/vis/multithreading/actionOnEventQueueFull wait\"."
2180 "\n To avoid visualisation altogether: \"/vis/disable\"."
2181 "\n And maybe \"/tracking/storeTrajectories 0\"."
2185 eventQueueFull =
true;
2190 eventQueueSize = mtVisEventQueue.size();
2194 if (!eventQueueFull) {
2200 if (fNKeepRequests == 0) {
2205 mtVisEventQueue.push_back(currentEvent);
2220 G4int nEventsToBeProcessed = 0;
2221 G4int nKeptEvents = 0;
2226 const std::vector<const G4Event*>* events = currentRun->
GetEventVector();
2227 if (events) nKeptEvents = (
G4int)events->size();
2238 ClearTransientStoreIfMarked();
2241 fpSceneHandler->
DrawEvent(currentEvent);
2242 ++fNoOfEventsDrawnThisRun;
2247 if (eventID < nEventsToBeProcessed - 1) {
2254 if (nKeptEvents == 0) {
2272 if (maxNumberOfKeptEvents >= 0 &&
2273 fNKeepRequests >= maxNumberOfKeptEvents) {
2275 fEventKeepingSuspended =
true;
2276 static G4bool warned =
false;
2280 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended."
2282 if (maxNumberOfKeptEvents > 0) {
2284 "\n The number of events exceeds the maximum, "
2285 << maxNumberOfKeptEvents <<
2286 ", that may be kept by\n the vis manager."
2293 }
else if (maxNumberOfKeptEvents != 0) {
2307void G4VisManager::EndOfRun ()
2309 if (fIgnoreStateChanges)
return;
2311#ifdef G4MULTITHREADED
2322 if (nEventsToBeProcessed == 0)
return;
2325 if (!currentRun)
return;
2327#ifdef G4MULTITHREADED
2332 mtRunInProgress =
false;
2336 delete mtVisSubThread;
2337 if (fpViewer) fpViewer->SwitchToMasterThread();
2341#ifdef G4MULTITHREADED
2346 if (fpSceneHandler && IsValidView()) {
2348 if (fNoOfEventsDrawnThisRun != noOfEventsRequested) {
2351 <<
"WARNING: Number of events drawn this run, "
2352 << fNoOfEventsDrawnThisRun <<
", is different to number requested, "
2353 << noOfEventsRequested <<
2354 ".\n (This is because you requested \"/vis/multithreading/actionOnEventQueueFull discard\".)"
2361 G4int nKeptEvents = 0;
2362 const std::vector<const G4Event*>* events = currentRun->
GetEventVector();
2363 if (events) nKeptEvents = (
G4int)events->size();
2366 if (nKeptEvents == 1)
G4warn <<
" event has";
2367 else G4warn <<
" events have";
2368 G4warn <<
" been kept for refreshing and/or reviewing." <<
G4endl;
2369 if (nKeptEvents != fNKeepRequests) {
2371 if (fNKeepRequests == 0) {
2372 G4warn <<
"No keep requests were";
2373 }
else if (fNKeepRequests == 1) {
2374 G4warn <<
"1 keep request was";
2376 G4warn << fNKeepRequests <<
" keep requests were";
2378 G4warn <<
" made by the vis manager.";
2379 if (fNKeepRequests == 0) {
2381 "\n The kept events are those you have asked to be kept in your user action(s).)";
2384 "\n The same or further events may have been kept by you in your user action(s).)";
2389 " \"/vis/reviewKeptEvents\" to review one by one."
2390 "\n To see accumulated, \"/vis/enable\", then \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\"."
2398 "WARNING: G4VisManager::EndOfRun: Automatic event keeping was suspended."
2402 " The number of events in the run exceeded the maximum, "
2404 ", that may be\n kept by the vis manager." <<
2405 "\n The number of events kept by the vis manager can be changed with"
2406 "\n \"/vis/scene/endOfEventAction accumulate <N>\", where N is the"
2407 "\n maximum number you wish to allow. N < 0 means \"unlimited\"."
2415 G4bool valid = fpSceneHandler && IsValidView();
2439 G4warn <<
"\"/vis/viewer/update\" to close file." <<
G4endl;
2445 fEventRefreshing =
false;
2448void G4VisManager::ClearTransientStoreIfMarked(){
2464 fTransientsDrawnThisRun =
false;
2465 fTransientsDrawnThisEvent =
false;
2467 for (i = fAvailableSceneHandlers.begin();
2468 i != fAvailableSceneHandlers.end(); ++i) {
2469 (*i)->SetTransientsDrawnThisEvent(
false);
2470 (*i)->SetTransientsDrawnThisRun(
false);
2475 G4String viewerShortName = viewerName.substr(0, viewerName.find (
' '));
2476 return G4StrUtil::strip_copy(viewerShortName);
2481 std::size_t nHandlers = fAvailableSceneHandlers.size ();
2482 std::size_t iHandler, iViewer;
2485 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2487 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2488 for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2489 viewer = viewerList [iViewer];
2490 if (viewerShortName == viewer -> GetShortName ()) {
2497 if (found)
return viewer;
2505 switch (verbosity) {
2506 case quiet: rs =
"quiet (0)";
break;
2507 case startup: rs =
"startup (1)";
break;
2508 case errors: rs =
"errors (2)";
break;
2509 case warnings: rs =
"warnings (3)";
break;
2511 case parameters: rs =
"parameters (5)";
break;
2512 case all: rs =
"all (6)";
break;
2519 G4String ss = G4StrUtil::to_lower_copy(verbosityString);
2521 if (ss[0] ==
'q') verbosity =
quiet;
2522 else if (ss[0] ==
's') verbosity =
startup;
2523 else if (ss[0] ==
'e') verbosity =
errors;
2524 else if (ss[0] ==
'w') verbosity =
warnings;
2526 else if (ss[0] ==
'p') verbosity =
parameters;
2527 else if (ss[0] ==
'a') verbosity =
all;
2530 std::istringstream is(ss);
2533 G4warn <<
"ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2534 << verbosityString <<
"\"";
2552 else if (intVerbosity >
all) verbosity =
all;
2553 else verbosity =
Verbosity(intVerbosity);
2569G4bool G4VisManager::IsValidView () {
2573 static G4bool noGSPrinting =
true;
2574 if (!fpGraphicsSystem) {
2578 noGSPrinting =
false;
2581 "WARNING: G4VisManager::IsValidView(): Attempt to draw when no graphics system"
2582 "\n has been instantiated. Use \"/vis/open\" or \"/vis/sceneHandler/create\"."
2583 "\n Alternatively, to avoid this message, suppress instantiation of vis"
2584 "\n manager (G4VisExecutive) and ensure drawing code is executed only if"
2585 "\n G4VVisManager::GetConcreteInstance() is non-zero."
2592 if ((!fpScene) || (!fpSceneHandler) || (!fpViewer)) {
2595 "ERROR: G4VisManager::IsValidView(): Current view is not valid."
2597 PrintInvalidPointers ();
2602 if (fpScene != fpSceneHandler -> GetScene ()) {
2604 G4warn <<
"ERROR: G4VisManager::IsValidView ():";
2605 if (fpSceneHandler -> GetScene ()) {
2607 "\n The current scene \""
2608 << fpScene -> GetName ()
2609 <<
"\" is not handled by"
2610 "\n the current scene handler \""
2611 << fpSceneHandler -> GetName ()
2613 "\n (it currently handles scene \""
2614 << fpSceneHandler -> GetScene () -> GetName ()
2617 "\n (a) attach it to the scene handler with"
2618 "\n /vis/sceneHandler/attach "
2619 << fpScene -> GetName ()
2621 "\n (b) create a new scene handler with "
2622 "\n /vis/sceneHandler/create <graphics-system>,"
2623 "\n in which case it should pick up the the new scene."
2627 G4warn <<
"\n Scene handler \""
2628 << fpSceneHandler -> GetName ()
2629 <<
"\" has null scene pointer."
2630 "\n Attach a scene with /vis/sceneHandler/attach [<scene-name>]"
2637 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
2638 if (viewerList.size () == 0) {
2641 "ERROR: G4VisManager::IsValidView (): the current scene handler\n \""
2642 << fpSceneHandler -> GetName ()
2643 <<
"\" has no viewers. Do /vis/viewer/create."
2650 if (fpScene -> IsEmpty ()) {
2652 G4bool successful = fpScene -> AddWorldIfEmpty (warn);
2653 if (!successful || fpScene -> IsEmpty ()) {
2655 G4warn <<
"ERROR: G4VisManager::IsValidView ():";
2657 "\n Attempt at some drawing operation when scene is empty."
2658 "\n Maybe the geometry has not yet been defined."
2659 " Try /run/initialize."
2660 "\n Or use \"/vis/scene/add/extent\"."
2669 "WARNING: G4VisManager: the scene was empty, \"world\" has been"
2670 "\n added and the scene handlers notified.";
2682 G4warn<<
"G4VisManager: No model factories registered with G4VisManager."<<
G4endl;
2683 G4warn<<
"G4VisManager::RegisterModelFactories() should be overridden in derived"<<
G4endl;
2684 G4warn<<
"class. See G4VisExecutive for an example."<<
G4endl;
2688#ifdef G4MULTITHREADED
2689void G4VisManager::SetUpForAThread()
2697 fIgnoreStateChanges = val;
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 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
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()
const G4Run * GetCurrentRun() const
std::vector< const G4Event * > * GetEventVector() const
G4bool AddRunDurationModel(G4VModel *, G4bool warn=false)
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(const G4String &aPrefix)
static G4UImanager * GetUIpointer()
Functionality GetFunctionality() const
G4LogicalVolume * GetLogicalVolume() const
virtual void ClearTransientStore()
G4bool GetTransientsDrawnThisEvent() const
void SetTransientsDrawnThisRun(G4bool)
void DrawEvent(const G4Event *)
G4ModelingParameters * CreateModelingParameters()
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
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 *)
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
void RegisterModelFactory(G4TrajDrawModelFactory *factory)
G4bool FilterHit(const G4VHit &)
G4VViewer * GetCurrentViewer() const
G4bool RegisterGraphicsSystem(G4VGraphicsSystem *)
virtual void RegisterModelFactories()
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
void RegisterMessengers()
void ResetTransientsDrawnFlags()
G4bool FilterTrajectory(const G4VTrajectory &)
G4String fDefaultGraphicsSystemName
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())
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 List * ListManager() const
const Model * Current() const
void SetCurrent(const G4String &)
const std::vector< Factory * > & FactoryList() const
G4String Placement() const
const char * name(G4int ptype)
G4bool IsMultithreadedApplication()