102, fInitialised (false)
103, fpGraphicsSystem (0)
107, fpStateDependent (0)
108, fEventRefreshing (false)
109, fTransientsDrawnThisRun (false)
110, fTransientsDrawnThisEvent (false)
111, fNoOfEventsDrawnThisRun (0)
113, fEventKeepingSuspended (false)
114, fDrawEventOnlyIfToBeKept (false)
115, fpRequestedEvent (0)
116, fReviewingKeptEvents (false)
117, fAbortReviewKeptEvents (false)
118, fReviewingPlots (false)
119, fAbortReviewPlots (false)
120, fIsDrawGroup (false)
121, fDrawGroupNestingDepth (0)
122, fIgnoreStateChanges (false)
123#ifdef G4MULTITHREADED
124, fMaxEventQueueSize (100)
125, fWaitOnEventQueueFull (true)
135 (
"Simple graded message scheme - digit or string (1st character defines):");
137 (
" 0) quiet, // Nothing is printed.");
139 (
" 1) startup, // Startup and endup messages are printed...");
141 (
" 2) errors, // ...and errors...");
143 (
" 3) warnings, // ...and warnings...");
145 (
" 4) confirmations, // ...and confirming messages...");
147 (
" 5) parameters, // ...and parameters of scenes and views...");
149 (
" 6) all // ...and everything available.");
153 (
"G4VisManager::G4VisManager",
155 "Attempt to Construct more than one VisManager");
167 <<
"Visualization Manager instantiating with verbosity \""
197 G4bool propagateToWorkers;
198 auto directory =
new G4UIdirectory (
"/vis/",propagateToWorkers=
false);
199 directory -> SetGuidance (
"Visualization commands.");
202 fDirectoryList.push_back (directory);
218 for (i = 0; i < fSceneList.size (); ++i) {
219 delete fSceneList[i];
221 for (i = 0; i < fAvailableSceneHandlers.size (); ++i) {
222 if (fAvailableSceneHandlers[i] != NULL) {
223 delete fAvailableSceneHandlers[i];
226 for (i = 0; i < fAvailableGraphicsSystems.size (); ++i) {
227 if (fAvailableGraphicsSystems[i]) {
228 delete fAvailableGraphicsSystems[i];
233 G4cout <<
"Visualization Manager deleting..." <<
G4endl;
235 for (i = 0; i < fMessengerList.size (); ++i) {
236 delete fMessengerList[i];
238 for (i = 0; i < fDirectoryList.size (); ++i) {
239 delete fDirectoryList[i];
242 delete fpDigiFilterMgr;
243 delete fpHitFilterMgr;
244 delete fpTrajFilterMgr;
245 delete fpTrajDrawModelMgr;
252 (
"G4VisManager::GetInstance",
260 if (fInitialised && fVerbosity >=
warnings) {
261 G4warn <<
"WARNING: G4VisManager::Initialise: already initialised."
267 G4cout <<
"Visualization Manager initialising..." <<
G4endl;
272 "\nYou have instantiated your own Visualization Manager, inheriting"
273 "\n G4VisManager and implementing RegisterGraphicsSystems(), in which"
274 "\n you should, normally, instantiate drivers which do not need"
275 "\n external packages or libraries, and, optionally, drivers under"
276 "\n control of environment variables."
277 "\n Also you should implement RegisterModelFactories()."
278 "\n See visualization/management/include/G4VisExecutive.hh/icc, for example."
279 "\n In your main() you will have something like:"
280 "\n G4VisManager* visManager = new G4VisExecutive;"
281 "\n visManager -> SetVerboseLevel (Verbose);"
282 "\n visManager -> Initialize ();"
283 "\n (Don't forget to delete visManager;)"
296 "\nYou have successfully registered the following graphics systems."
306 directory -> SetGuidance (
"Modeling commands.");
307 fDirectoryList.push_back (directory);
308 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/");
309 directory -> SetGuidance (
"Trajectory model commands.");
310 fDirectoryList.push_back (directory);
311 directory =
new G4UIdirectory (
"/vis/modeling/trajectories/create/");
312 directory -> SetGuidance (
"Create trajectory models and messengers.");
313 fDirectoryList.push_back (directory);
317 directory -> SetGuidance (
"Filtering commands.");
318 fDirectoryList.push_back (directory);
319 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/");
320 directory -> SetGuidance (
"Trajectory filtering commands.");
321 fDirectoryList.push_back (directory);
322 directory =
new G4UIdirectory (
"/vis/filtering/trajectories/create/");
323 directory -> SetGuidance (
"Create trajectory filters and messengers.");
324 fDirectoryList.push_back (directory);
326 directory -> SetGuidance (
"Hit filtering commands.");
327 fDirectoryList.push_back (directory);
328 directory =
new G4UIdirectory (
"/vis/filtering/hits/create/");
329 directory -> SetGuidance (
"Create hit filters and messengers.");
330 fDirectoryList.push_back (directory);
332 directory -> SetGuidance (
"Digi filtering commands.");
333 fDirectoryList.push_back (directory);
334 directory =
new G4UIdirectory (
"/vis/filtering/digi/create/");
335 directory -> SetGuidance (
"Create digi filters and messengers.");
336 fDirectoryList.push_back (directory);
348 "\nYou have successfully registered the following model factories."
350 PrintAvailableModels (fVerbosity);
355 PrintAvailableUserVisActions (fVerbosity);
359 InitialiseG4ColourMap();
363 "Some /vis commands (optionally) take a string to specify colour."
364 "\n\"/vis/list\" to see available colours."
371void G4VisManager::InitialiseG4ColourMap()
const
380#define TOOLS_COLORS_STAT(name,r,g,b) \
381G4Colour::AddToMap(#name, G4Colour(r,g,b));
462#undef TOOLS_COLORS_STAT
473 directory -> SetGuidance(
"Operations on vis attributes of Geant4 geometry.");
474 fDirectoryList.push_back (directory);
479 directory -> SetGuidance(
"Set vis attributes of Geant4 geometry.");
480 fDirectoryList.push_back (directory);
492#ifdef G4MULTITHREADED
494 directory -> SetGuidance(
"Commands unique to multithreading mode.");
495 fDirectoryList.push_back (directory);
501 directory -> SetGuidance
502 (
"Set quantities for use in future commands where appropriate.");
503 fDirectoryList.push_back (directory);
515 directory -> SetGuidance (
"Operations on Geant4 scenes.");
516 fDirectoryList.push_back (directory);
528 directory -> SetGuidance (
"Add model to current scene.");
529 fDirectoryList.push_back (directory);
569 directory -> SetGuidance (
"Operations on Geant4 scene handlers.");
570 fDirectoryList.push_back (directory);
577 directory -> SetGuidance (
"Operations on touchables.");
578 fDirectoryList.push_back (directory);
582 directory -> SetGuidance (
"Set vis attributes of current touchable.");
583 fDirectoryList.push_back (directory);
587 directory -> SetGuidance (
"Operations on Geant4 viewers.");
588 fDirectoryList.push_back (directory);
616 directory -> SetGuidance(
"Set default values for future viewers.");
617 fDirectoryList.push_back (directory);
622 directory -> SetGuidance (
"Set view parameters of current viewer.");
623 fDirectoryList.push_back (directory);
648 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->
Placement()));
650 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->
Placement()));
654 (fpTrajFilterMgr, fpTrajFilterMgr->
Placement()));
656 (fpTrajFilterMgr, fpTrajFilterMgr->
Placement()));
660 (fpHitFilterMgr, fpHitFilterMgr->
Placement()));
662 (fpHitFilterMgr, fpHitFilterMgr->
Placement()));
666 (fpDigiFilterMgr, fpDigiFilterMgr->
Placement()));
668 (fpDigiFilterMgr, fpDigiFilterMgr->
Placement()));
671#include <tools/histo/h1d>
672#include <tools/histo/h2d>
675 template <
typename HT>
678 G4bool thereArePlots =
false;
679 auto keepControlVerbose = ui->GetVerboseLevel();
680 ui->SetVerboseLevel(0);
681 auto status = ui->ApplyCommand(
"/analysis/" + plotType +
"/getVector");
682 ui->SetVerboseLevel(keepControlVerbose);
684 G4String hexString = ui->GetCurrentValues(
G4String(
"/analysis/" + plotType +
"/getVector"));
685 if(hexString.size()) {
687 std::istringstream is(hexString);
689 auto _v = (
const std::vector<HT*>*)ptr;
690 auto _n = _v->size();
692 thereArePlots =
true;
694 if (_n == 1) {isare =
"is"; plural =
"";}
696 "There " << isare <<
' ' << _n <<
' ' << plotType <<
" histogram" << plural
699 for (std::size_t i = 0; i < _n; ++i) {
700 const auto& _h = (*_v)[i];
703 <<
" with " << std::setw(6) << _h->entries() <<
" entries: "
704 << _h->get_title() <<
G4endl;
710 return thereArePlots;
712 void PrintListOfPlots() {
713 G4bool thereArePlots =
false;
714 if (PrintListOfHnPlots<tools::histo::h1d>(
"h1")) thereArePlots =
true;
715 if (PrintListOfHnPlots<tools::histo::h2d>(
"h2")) thereArePlots =
true;
718 "List them with \"/analysis/list\"."
719 "\nView them with \"/vis/plot\" or \"/vis/reviewPlots\"."
726 if (IsValidView ()) {
729 G4cout <<
"G4VisManager::Enable: visualization enabled." <<
G4endl;
732 std::size_t nKeptEvents = 0;
736 if (nKeptEvents == 1) {isare =
"is"; plural =
"";}
738 "There " << isare <<
' ' << nKeptEvents <<
" kept event" << plural <<
'.'
740 if (nKeptEvents > 0) {
742 " \"/vis/reviewKeptEvents\" to review one by one."
743 "\n To see accumulated, \"/vis/enable\", then \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\"."
752 "G4VisManager::Enable: WARNING: visualization remains disabled for"
753 "\n above reasons. Rectifying with valid vis commands will"
754 "\n automatically enable."
764 "G4VisManager::Disable: visualization disabled."
765 "\n The pointer returned by GetConcreteInstance will be zero."
766 "\n Note that it will become enabled after some valid vis commands."
770 G4int currentTrajectoryType =
772 if (currentTrajectoryType > 0) {
774 "You may wish to disable trajectory production too:"
775 "\n \"/tracking/storeTrajectory 0\""
776 "\nbut don't forget to re-enable with"
778 "\n \"/tracking/storeTrajectory " << currentTrajectoryType
779 <<
"\"\n and maybe \"/vis/viewer/rebuild\""
786 std::size_t nSystems = fAvailableGraphicsSystems.size ();
789 G4warn <<
"G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
790 "\n graphics system available!"
791 "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
792 "\n when you compiled/built the visualization code?"
793 "\n 2) Did you instantiate your own Visualization Manager and forget"
794 "\n to implement RegisterGraphicsSystems correctly?"
795 "\n 3) You can register your own graphics system, e.g.,"
796 "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
797 "\n after instantiating your vis manager and before"
798 "\n visManager->Initialize()."
802 return fAvailableGraphicsSystems;
808 fAvailableGraphicsSystems.push_back (pSystem);
810 G4cout <<
"G4VisManager::RegisterGraphicsSystem: "
811 << pSystem -> GetName ();
812 if (pSystem -> GetNickname () !=
"") {
813 G4cout <<
" (" << pSystem -> GetNickname () <<
")";
819 if (fVerbosity >=
errors) {
820 G4warn <<
"G4VisManager::RegisterGraphicsSystem: null pointer!"
831 assert (0 != fpTrajDrawModelMgr);
840 G4warn<<
"G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model."<<
G4endl;
841 G4warn<<
"See commands in /vis/modeling/trajectories/ for other options."<<
G4endl;
845 model = fpTrajDrawModelMgr->
Current();
853 fpTrajDrawModelMgr->
Register(model);
859 fpTrajDrawModelMgr->
Register(factory);
902#ifdef G4MULTITHREADED
905 fDrawGroupNestingDepth++;
906 if (fDrawGroupNestingDepth > 1) {
908 (
"G4VisManager::BeginDraw",
910 "Nesting detected. It is illegal to nest Begin/EndDraw."
914 if (IsValidView ()) {
915 ClearTransientStoreIfMarked();
916 fpSceneHandler -> BeginPrimitives (objectTransform);
923#ifdef G4MULTITHREADED
926 fDrawGroupNestingDepth--;
927 if (fDrawGroupNestingDepth != 0) {
928 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
931 if (IsValidView ()) {
932 fpSceneHandler -> EndPrimitives ();
934 fIsDrawGroup =
false;
939#ifdef G4MULTITHREADED
942 fDrawGroupNestingDepth++;
943 if (fDrawGroupNestingDepth > 1) {
945 (
"G4VisManager::BeginDraw2D",
947 "Nesting detected. It is illegal to nest Begin/EndDraw2D."
951 if (IsValidView ()) {
952 ClearTransientStoreIfMarked();
953 fpSceneHandler -> BeginPrimitives2D (objectTransform);
960#ifdef G4MULTITHREADED
963 fDrawGroupNestingDepth--;
964 if (fDrawGroupNestingDepth != 0) {
965 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
968 if (IsValidView ()) {
969 fpSceneHandler -> EndPrimitives2D ();
971 fIsDrawGroup =
false;
974template <
class T>
void G4VisManager::DrawT
975(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
976#ifdef G4MULTITHREADED
982 (
"G4VSceneHandler::DrawT",
984 "Different transform detected in Begin/EndDraw group.");
986 fpSceneHandler -> AddPrimitive (graphics_primitive);
988 if (IsValidView ()) {
989 ClearTransientStoreIfMarked();
990 fpSceneHandler -> BeginPrimitives (objectTransform);
991 fpSceneHandler -> AddPrimitive (graphics_primitive);
992 fpSceneHandler -> EndPrimitives ();
997template <
class T>
void G4VisManager::DrawT2D
998(
const T& graphics_primitive,
const G4Transform3D& objectTransform) {
999#ifdef G4MULTITHREADED
1005 (
"G4VSceneHandler::DrawT",
1007 "Different transform detected in Begin/EndDraw2D group.");
1009 fpSceneHandler -> AddPrimitive (graphics_primitive);
1011 if (IsValidView ()) {
1012 ClearTransientStoreIfMarked();
1013 fpSceneHandler -> BeginPrimitives2D (objectTransform);
1014 fpSceneHandler -> AddPrimitive (graphics_primitive);
1015 fpSceneHandler -> EndPrimitives2D ();
1023 DrawT (circle, objectTransform);
1029 DrawT (polyhedron, objectTransform);
1035 DrawT (line, objectTransform);
1041 DrawT (polymarker, objectTransform);
1047 DrawT (square, objectTransform);
1053 DrawT (text, objectTransform);
1059 DrawT2D (circle, objectTransform);
1065 DrawT2D (polyhedron, objectTransform);
1071 DrawT2D (line, objectTransform);
1077 DrawT2D (polymarker, objectTransform);
1083 DrawT2D (square, objectTransform);
1089 DrawT2D (text, objectTransform);
1093#ifdef G4MULTITHREADED
1097 fpSceneHandler -> AddCompound (hit);
1099 if (IsValidView ()) {
1100 ClearTransientStoreIfMarked();
1101 fpSceneHandler -> AddCompound (hit);
1107#ifdef G4MULTITHREADED
1111 fpSceneHandler -> AddCompound (digi);
1113 if (IsValidView ()) {
1114 ClearTransientStoreIfMarked();
1115 fpSceneHandler -> AddCompound (digi);
1121#ifdef G4MULTITHREADED
1138 fpSceneHandler -> SetModel (&trajectoriesModel);
1139 fpSceneHandler -> AddCompound (traj);
1140 fpSceneHandler -> SetModel (0);
1142 if (IsValidView ()) {
1143 ClearTransientStoreIfMarked();
1144 fpSceneHandler -> SetModel (&trajectoriesModel);
1145 fpSceneHandler -> AddCompound (traj);
1146 fpSceneHandler -> SetModel (0);
1154#ifdef G4MULTITHREADED
1159 Draw (*pSol, attribs, objectTransform);
1165#ifdef G4MULTITHREADED
1169 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1171 fpSceneHandler -> PostAddSolid ();
1173 if (IsValidView ()) {
1174 ClearTransientStoreIfMarked();
1175 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1177 fpSceneHandler -> PostAddSolid ();
1185#ifdef G4MULTITHREADED
1201 G4VSolid* pSol = pLV -> GetSolid ();
1202 Draw (*pSol, attribs, objectTransform);
1211 const G4bool useFullExtent =
true;
1214 delete modelingParameters;
1219 if (fpGraphicsSystem) {
1222 if (pSceneHandler) {
1223 fAvailableSceneHandlers.push_back (pSceneHandler);
1224 fpSceneHandler = pSceneHandler;
1227 if (fVerbosity >=
errors) {
1228 G4warn <<
"ERROR in G4VisManager::CreateSceneHandler during "
1229 << fpGraphicsSystem -> GetName ()
1230 <<
" scene handler creation.\n No action taken."
1235 else PrintInvalidPointers ();
1244 if (!fpSceneHandler) {
1245 PrintInvalidPointers ();
1252 if (fVerbosity >=
errors) {
1253 G4warn <<
"ERROR in G4VisManager::CreateViewer: null pointer during "
1254 << fpGraphicsSystem -> GetName ()
1255 <<
" viewer creation.\n No action taken."
1261 if (p -> GetViewId() < 0) {
1262 if (fVerbosity >=
errors) {
1263 G4warn <<
"ERROR in G4VisManager::CreateViewer during "
1264 << fpGraphicsSystem -> GetName ()
1265 <<
" viewer instantiation.\n No action taken."
1276 p -> SetViewParameters(initialvp);
1278 if (p -> GetViewId() < 0) {
1279 if (fVerbosity >=
errors) {
1280 G4warn <<
"ERROR in G4VisManager::CreateViewer during "
1281 << fpGraphicsSystem -> GetName ()
1282 <<
" viewer initialisation.\n No action taken."
1289 fpSceneHandler -> AddViewerToList (fpViewer);
1292 G4cout <<
"G4VisManager::CreateViewer: new viewer created."
1302 static G4bool warned =
false;
1306 "NOTE: objects with visibility flag set to \"false\""
1307 " will not be drawn!"
1308 "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1309 "\n Also see other \"/vis/viewer/set\" commands."
1316 static G4bool warned =
false;
1320 "WARNING: covered objects in solid mode will not be rendered!"
1321 "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1322 "\n Also see other \"/vis/viewer/set\" commands."
1332 G4cout <<
"G4VisManager::GeometryHasChanged() called." <<
G4endl;
1338 -> GetNavigatorForTracking () -> GetWorldVolume ();
1341 G4warn <<
"WARNING: There is no world volume!" <<
G4endl;
1347 std::size_t iScene, nScenes = sceneList.size ();
1348 for (iScene = 0; iScene < nScenes; ++iScene) {
1349 G4Scene* pScene = sceneList [iScene];
1350 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1351 if (modelList.size ()) {
1354 modelInvalid =
false;
1355 std::vector<G4Scene::Model>::iterator iterModel;
1356 for (iterModel = modelList.begin();
1357 iterModel != modelList.end();
1359 modelInvalid = !(iterModel->fpModel->Validate(fVerbosity>=
warnings));
1363 G4warn <<
"WARNING: Model \""
1364 << iterModel->fpModel->GetGlobalDescription ()
1366 "\" is no longer valid - being removed\n from scene \""
1367 << pScene -> GetName () <<
"\""
1370 modelList.erase (iterModel);
1374 }
while (modelInvalid);
1376 if (modelList.size () == 0) {
1378 G4warn <<
"WARNING: No run-duration models left in this scene \""
1379 << pScene -> GetName ()
1385 G4warn <<
" Adding current world to \""
1386 << pScene -> GetName ()
1393 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1399 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1405 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1407 G4warn <<
"WARNING: The current scene \""
1408 << fpScene -> GetName ()
1409 <<
"\" has no run duration models."
1410 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1414 if (fpSceneHandler) {
1430 G4cout <<
"G4VisManager::NotifyHandler() called." <<
G4endl;
1433 if (IsValidView()) {
1437 std::size_t iScene, nScenes = sceneList.size ();
1438 for (iScene = 0; iScene < nScenes; ++iScene) {
1439 G4Scene* pScene = sceneList [iScene];
1440 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1442 if (modelList.size ()) {
1445 ApplyCommand (
G4String(
"/vis/scene/notifyHandlers " + pScene->
GetName()));
1450 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1452 G4warn <<
"WARNING: The current scene \""
1453 << fpScene -> GetName ()
1454 <<
"\" has no run duration models."
1455 <<
"\n Use \"/vis/scene/add/volume\" or create a new scene."
1470 return fpTrajFilterMgr->
Accept(trajectory);
1475 return fpHitFilterMgr->
Accept(hit);
1480 return fpDigiFilterMgr->
Accept(digi);
1498 assert (0 != fpTrajDrawModelMgr);
1502 assert (0 != trajectoryModel);
1504 if (IsValidView()) {
1505 trajectoryModel->
Draw(trajectory, visible);
1513 fRunDurationUserVisActions.push_back(
UserVisAction(name,pVisAction));
1515 fUserVisActionExtents[pVisAction] = extent;
1519 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1525 <<
"Run duration user vis action \"" << name <<
"\" registered"
1534 fEndOfEventUserVisActions.push_back(
UserVisAction(name,pVisAction));
1536 fUserVisActionExtents[pVisAction] = extent;
1540 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1546 <<
"End of event user vis action \"" << name <<
"\" registered"
1555 fEndOfRunUserVisActions.push_back(
UserVisAction(name,pVisAction));
1557 fUserVisActionExtents[pVisAction] = extent;
1561 "WARNING: No extent set for user vis action \"" << name <<
"\"."
1567 <<
"End of run user vis action \"" << name <<
"\" registered"
1573 if (pScene != fpScene) {
1582 fpGraphicsSystem = pSystem;
1584 G4cout <<
"G4VisManager::SetCurrentGraphicsSystem: system now "
1585 << pSystem -> GetName () <<
G4endl;
1590 if (!(fpSceneHandler && fpSceneHandler -> GetGraphicsSystem () == pSystem)) {
1594 for (iSH = nSH - 1; iSH >= 0; iSH--) {
1595 if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem)
break;
1598 fpSceneHandler = sceneHandlerList [iSH];
1600 G4cout <<
" Scene Handler now "
1601 << fpSceneHandler -> GetName () <<
G4endl;
1603 if (fpScene != fpSceneHandler -> GetScene ()) {
1604 fpScene = fpSceneHandler -> GetScene ();
1606 G4cout <<
" Scene now \""
1607 << fpScene -> GetName () <<
"\"" <<
G4endl;
1610 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1611 if (viewerList.size ()) {
1612 fpViewer = viewerList [0];
1614 G4cout <<
" Viewer now " << fpViewer -> GetName () <<
G4endl;
1629 fpSceneHandler = pSceneHandler;
1631 G4cout <<
"G4VisManager::SetCurrentSceneHandler: scene handler now \""
1632 << pSceneHandler -> GetName () <<
"\"" <<
G4endl;
1634 if (fpScene != fpSceneHandler -> GetScene ()) {
1635 fpScene = fpSceneHandler -> GetScene ();
1637 G4cout <<
" Scene now \""
1638 << fpScene -> GetName () <<
"\"" <<
G4endl;
1641 if (fpGraphicsSystem != pSceneHandler -> GetGraphicsSystem ()) {
1642 fpGraphicsSystem = pSceneHandler -> GetGraphicsSystem ();
1644 G4cout <<
" Graphics system now \""
1645 << fpGraphicsSystem -> GetName () <<
"\"" <<
G4endl;
1648 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1649 std::size_t nViewers = viewerList.size ();
1651 std::size_t iViewer;
1652 for (iViewer = 0; iViewer < nViewers; ++iViewer) {
1653 if (fpViewer == viewerList [iViewer])
break;
1655 if (iViewer >= nViewers) {
1656 fpViewer = viewerList [0];
1658 G4cout <<
" Viewer now \"" << fpViewer -> GetName () <<
"\""
1662 if (!IsValidView ()) {
1665 "WARNING: Problem setting scene handler - please report circumstances."
1674 "WARNING: No viewers for this scene handler - please create one."
1682 if (fpViewer ==
nullptr) {
1684 G4cout <<
"G4VisManager::SetCurrentViewer: current viewer pointer zeroed "
1690 G4cout <<
"G4VisManager::SetCurrentViewer: viewer now "
1691 << pViewer -> GetName ()
1694 fpSceneHandler = fpViewer -> GetSceneHandler ();
1695 if (!fpSceneHandler) {
1698 "WARNING: No scene handler for this viewer - please create one."
1706 fpScene = fpSceneHandler -> GetScene ();
1707 fpGraphicsSystem = fpSceneHandler -> GetGraphicsSystem ();
1708 if (!IsValidView ()) {
1711 "WARNING: Problem setting viewer - please report circumstances."
1718(
Verbosity verbosity, std::ostream& out)
const
1720 out <<
"Registered graphics systems are:\n";
1721 if (fAvailableGraphicsSystems.size ()) {
1722 for (
const auto& gs: fAvailableGraphicsSystems) {
1723 const G4String& name = gs->GetName();
1724 const std::vector<G4String>& nicknames = gs->GetNicknames();
1727 out <<
" " << name <<
" (";
1728 for (std::size_t i = 0; i < nicknames.size(); ++i) {
1732 out << nicknames[i];
1742 out <<
" NONE!!! None registered - yet! Mmmmm!" <<
G4endl;
1746void G4VisManager::PrintAvailableModels (Verbosity verbosity)
const
1751 const std::vector<G4VModelFactory<G4VTrajectoryModel>*>& factoryList =
1755 std::vector<G4VModelFactory<G4VTrajectoryModel>*>::const_iterator i;
1756 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1763 const std::map<G4String, G4VTrajectoryModel*>& modelMap =
1767 std::map<G4String, G4VTrajectoryModel*>::const_iterator i;
1768 for (i = modelMap.begin(); i != modelMap.end(); ++i) {
1769 G4cout <<
" " << i->second->Name();
1770 if (i->second == listManager->
Current())
G4cout <<
" (Current)";
1782 const std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>&
1786 std::vector<G4VModelFactory<G4VFilter<G4VTrajectory> >*>::const_iterator i;
1787 for (i = factoryList.begin(); i != factoryList.end(); ++i) {
1793 const std::vector<G4VFilter<G4VTrajectory>*>&
1797 std::vector<G4VFilter<G4VTrajectory>*>::const_iterator i;
1798 for (i = filterList.begin(); i != filterList.end(); ++i) {
1806void G4VisManager::PrintAvailableUserVisActions (Verbosity)
const
1809 "You have successfully registered the following user vis actions."
1811 G4cout <<
"Run Duration User Vis Actions:";
1812 if (fRunDurationUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1815 for (std::size_t i = 0; i < fRunDurationUserVisActions.size(); ++i) {
1816 const G4String&
name = fRunDurationUserVisActions[i].fName;
1821 G4cout <<
"End of Event User Vis Actions:";
1822 if (fEndOfEventUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1825 for (std::size_t i = 0; i < fEndOfEventUserVisActions.size(); ++i) {
1826 const G4String&
name = fEndOfEventUserVisActions[i].fName;
1831 G4cout <<
"End of Run User Vis Actions:";
1832 if (fEndOfRunUserVisActions.empty())
G4cout <<
" none" <<
G4endl;
1835 for (std::size_t i = 0; i < fEndOfRunUserVisActions.size(); ++i) {
1836 const G4String&
name = fEndOfRunUserVisActions[i].fName;
1842void G4VisManager::PrintAvailableColours (Verbosity)
const {
1844 "Some /vis commands (optionally) take a string to specify colour."
1845 "\nAvailable colours:\n ";
1847 for (std::map<G4String, G4Colour>::const_iterator i = map.begin();
1850 if (++i != map.end())
G4cout <<
", ";
1855void G4VisManager::PrintInvalidPointers ()
const {
1856 if (fVerbosity >=
errors) {
1857 G4warn <<
"ERROR: G4VisManager::PrintInvalidPointers:";
1858 if (!fpGraphicsSystem) {
1859 G4warn <<
"\n null graphics system pointer.";
1862 G4warn <<
"\n Graphics system is " << fpGraphicsSystem -> GetName ()
1866 "\n Null scene pointer. Use \"/vis/drawVolume\" or"
1867 " \"/vis/scene/create\".";
1868 if (!fpSceneHandler)
1870 "\n Null scene handler pointer. Use \"/vis/open\" or"
1871 " \"/vis/sceneHandler/create\".";
1874 "\n Null viewer pointer. Use \"/vis/viewer/create\".";
1880#ifdef G4MULTITHREADED
1883 G4bool mtRunInProgress =
false;
1884 std::deque<const G4Event*> mtVisEventQueue;
1893 if (!pSceneHandler)
return 0;
1895 if (!pScene)
return 0;
1897 if (!pViewer)
return 0;
1912 pViewer->SwitchToVisSubThread();
1917 std::size_t eventQueueSize = mtVisEventQueue.size();
1921 while (eventQueueSize) {
1924 const G4Event*
event = mtVisEventQueue.front();
1944 pVisManager->ClearTransientStoreIfMarked();
1948 ++pVisManager->fNoOfEventsDrawnThisRun;
1965 mtVisEventQueue.pop_front();
1966 event->PostProcessingFinished();
1967 eventQueueSize = mtVisEventQueue.size();
1973 G4int runInProgress = mtRunInProgress;
1975 if (!runInProgress) {
1982 std::this_thread::sleep_for(std::chrono::milliseconds(100));
1986 pViewer->DoneWithVisSubThread();
1987 pViewer->MovingToMasterThread();
2001void G4VisManager::BeginOfRun ()
2003 if (fIgnoreStateChanges)
return;
2005#ifdef G4MULTITHREADED
2015 if (nEventsToBeProcessed == 0)
return;
2018 fEventKeepingSuspended =
false;
2019 fTransientsDrawnThisRun =
false;
2021 fNoOfEventsDrawnThisRun = 0;
2029#ifdef G4MULTITHREADED
2038 if (fpViewer) fpViewer->DoneWithMasterThread();
2043 mtRunInProgress =
true;
2054 if (fpViewer) fpViewer->MovingToVisSubThread();
2059void G4VisManager::BeginOfEvent ()
2061 if (fIgnoreStateChanges)
return;
2069#ifndef G4MULTITHREADED
2071 fTransientsDrawnThisEvent =
false;
2076void G4VisManager::EndOfEvent ()
2078 if (fIgnoreStateChanges)
return;
2085#ifdef G4MULTITHREADED
2094 G4bool valid = fpSceneHandler && IsValidView();
2100 if (!currentRun)
return;
2105 if (!currentEvent)
return;
2109 if (fDrawEventOnlyIfToBeKept) {
2110 if (!currentEvent->
ToBeKept())
return;
2115#ifdef G4MULTITHREADED
2119 std::size_t eventQueueSize = mtVisEventQueue.size();
2123 G4bool eventQueueFull =
false;
2124 while (fMaxEventQueueSize > 0 && (
G4int)eventQueueSize >= fMaxEventQueueSize) {
2127 if (fWaitOnEventQueueFull) {
2128 static G4bool warned =
false;
2131 "WARNING: The number of events in the visualisation queue has exceeded"
2133 << fMaxEventQueueSize <<
2134 ".\n If, during a multithreaded run, the simulation gets ahead of the"
2135 "\n visualisation by more than this maximum, the simulation is delayed"
2136 "\n until the vis sub-thread has drawn a few more events and removed them"
2137 "\n from the queue. You may change this maximum number of events with"
2138 "\n \"/vis/multithreading/maxEventQueueSize <N>\", where N is the maximum"
2139 "\n number you wish to allow. N <= 0 means \"unlimited\"."
2140 "\n Alternatively you may choose to discard events for drawing by setting"
2141 "\n \"/vis/multithreading/actionOnEventQueueFull discard\"."
2142 "\n To avoid visualisation altogether: \"/vis/disable\"."
2143 "\n And maybe \"/tracking/storeTrajectories 0\"."
2149 std::this_thread::sleep_for(std::chrono::milliseconds(100));
2152 static G4bool warned =
false;
2155 "WARNING: The number of events in the visualisation queue has exceeded"
2157 << fMaxEventQueueSize <<
2158 ".\n Some events have been discarded for drawing. You may change this"
2159 "\n behaviour with \"/vis/multithreading/actionOnEventQueueFull wait\"."
2160 "\n To avoid visualisation altogether: \"/vis/disable\"."
2161 "\n And maybe \"/tracking/storeTrajectories 0\"."
2165 eventQueueFull =
true;
2170 eventQueueSize = mtVisEventQueue.size();
2174 if (!eventQueueFull) {
2180 if (fNKeepRequests == 0) {
2185 mtVisEventQueue.push_back(currentEvent);
2200 G4int nEventsToBeProcessed = 0;
2201 G4int nKeptEvents = 0;
2206 const std::vector<const G4Event*>* events = currentRun->
GetEventVector();
2207 if (events) nKeptEvents = (
G4int)events->size();
2218 ClearTransientStoreIfMarked();
2221 fpSceneHandler->
DrawEvent(currentEvent);
2222 ++fNoOfEventsDrawnThisRun;
2227 if (eventID < nEventsToBeProcessed - 1) {
2234 if (nKeptEvents == 0) {
2252 if (maxNumberOfKeptEvents >= 0 &&
2253 fNKeepRequests >= maxNumberOfKeptEvents) {
2255 fEventKeepingSuspended =
true;
2256 static G4bool warned =
false;
2260 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended."
2262 if (maxNumberOfKeptEvents > 0) {
2264 "\n The number of events exceeds the maximum, "
2265 << maxNumberOfKeptEvents <<
2266 ", that may be kept by\n the vis manager."
2273 }
else if (maxNumberOfKeptEvents != 0) {
2287void G4VisManager::EndOfRun ()
2289 if (fIgnoreStateChanges)
return;
2291#ifdef G4MULTITHREADED
2302 if (nEventsToBeProcessed == 0)
return;
2305 if (!currentRun)
return;
2307#ifdef G4MULTITHREADED
2312 mtRunInProgress =
false;
2316 delete mtVisSubThread;
2317 if (fpViewer) fpViewer->SwitchToMasterThread();
2321#ifdef G4MULTITHREADED
2326 if (fpSceneHandler && IsValidView()) {
2328 if (fNoOfEventsDrawnThisRun != noOfEventsRequested) {
2329 if (!fWaitOnEventQueueFull && fVerbosity >=
warnings) {
2331 <<
"WARNING: Number of events drawn this run, "
2332 << fNoOfEventsDrawnThisRun <<
", is different to number requested, "
2333 << noOfEventsRequested <<
2334 ".\n (This is because you requested \"/vis/multithreading/actionOnEventQueueFull discard\".)"
2341 G4int nKeptEvents = 0;
2342 const std::vector<const G4Event*>* events = currentRun->
GetEventVector();
2343 if (events) nKeptEvents = (
G4int)events->size();
2344 if (fVerbosity >=
warnings && nKeptEvents > 0) {
2346 if (nKeptEvents == 1)
G4warn <<
" event has";
2347 else G4warn <<
" events have";
2348 G4warn <<
" been kept for refreshing and/or reviewing." <<
G4endl;
2349 if (nKeptEvents != fNKeepRequests) {
2351 if (fNKeepRequests == 0) {
2352 G4warn <<
"No keep requests were";
2353 }
else if (fNKeepRequests == 1) {
2354 G4warn <<
"1 keep request was";
2356 G4warn << fNKeepRequests <<
" keep requests were";
2358 G4warn <<
" made by the vis manager.";
2359 if (fNKeepRequests == 0) {
2361 "\n The kept events are those you have asked to be kept in your user action(s).)";
2364 "\n The same or further events may have been kept by you in your user action(s).)";
2369 " \"/vis/reviewKeptEvents\" to review one by one."
2370 "\n To see accumulated, \"/vis/enable\", then \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\"."
2374 if (fVerbosity >=
warnings) PrintListOfPlots();
2376 if (fEventKeepingSuspended && fVerbosity >=
warnings) {
2378 "WARNING: G4VisManager::EndOfRun: Automatic event keeping was suspended."
2382 "\n The number of events in the run exceeded the maximum, "
2384 ", that may be\n kept by the vis manager." <<
2385 "\n The number of events kept by the vis manager can be changed with"
2386 "\n \"/vis/scene/endOfEventAction accumulate <N>\", where N is the"
2387 "\n maximum number you wish to allow. N < 0 means \"unlimited\"."
2395 G4bool valid = fpSceneHandler && IsValidView();
2419 G4warn <<
"\"/vis/viewer/update\" to close file." <<
G4endl;
2425 fEventRefreshing =
false;
2428void G4VisManager::ClearTransientStoreIfMarked(){
2444 fTransientsDrawnThisRun =
false;
2445 fTransientsDrawnThisEvent =
false;
2447 for (i = fAvailableSceneHandlers.begin();
2448 i != fAvailableSceneHandlers.end(); ++i) {
2449 (*i)->SetTransientsDrawnThisEvent(
false);
2450 (*i)->SetTransientsDrawnThisRun(
false);
2455 G4String viewerShortName = viewerName.substr(0, viewerName.find (
' '));
2461 std::size_t nHandlers = fAvailableSceneHandlers.size ();
2462 std::size_t iHandler, iViewer;
2465 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2467 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2468 for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2469 viewer = viewerList [iViewer];
2470 if (viewerShortName == viewer -> GetShortName ()) {
2477 if (found)
return viewer;
2485 switch (verbosity) {
2486 case quiet: rs =
"quiet (0)";
break;
2487 case startup: rs =
"startup (1)";
break;
2488 case errors: rs =
"errors (2)";
break;
2489 case warnings: rs =
"warnings (3)";
break;
2491 case parameters: rs =
"parameters (5)";
break;
2492 case all: rs =
"all (6)";
break;
2501 if (ss[0] ==
'q') verbosity =
quiet;
2502 else if (ss[0] ==
's') verbosity =
startup;
2503 else if (ss[0] ==
'e') verbosity =
errors;
2504 else if (ss[0] ==
'w') verbosity =
warnings;
2506 else if (ss[0] ==
'p') verbosity =
parameters;
2507 else if (ss[0] ==
'a') verbosity =
all;
2510 std::istringstream is(ss);
2513 G4warn <<
"ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2514 << verbosityString <<
"\"";
2532 else if (intVerbosity >
all) verbosity =
all;
2533 else verbosity =
Verbosity(intVerbosity);
2549G4bool G4VisManager::IsValidView () {
2553 static G4bool noGSPrinting =
true;
2554 if (!fpGraphicsSystem) {
2558 noGSPrinting =
false;
2561 "WARNING: G4VisManager::IsValidView(): Attempt to draw when no graphics system"
2562 "\n has been instantiated. Use \"/vis/open\" or \"/vis/sceneHandler/create\"."
2563 "\n Alternatively, to avoid this message, suppress instantiation of vis"
2564 "\n manager (G4VisExecutive) and ensure drawing code is executed only if"
2565 "\n G4VVisManager::GetConcreteInstance() is non-zero."
2572 if ((!fpScene) || (!fpSceneHandler) || (!fpViewer)) {
2573 if (fVerbosity >=
errors) {
2575 "ERROR: G4VisManager::IsValidView(): Current view is not valid."
2577 PrintInvalidPointers ();
2582 if (fpScene != fpSceneHandler -> GetScene ()) {
2583 if (fVerbosity >=
errors) {
2584 G4warn <<
"ERROR: G4VisManager::IsValidView ():";
2585 if (fpSceneHandler -> GetScene ()) {
2587 "\n The current scene \""
2588 << fpScene -> GetName ()
2589 <<
"\" is not handled by"
2590 "\n the current scene handler \""
2591 << fpSceneHandler -> GetName ()
2593 "\n (it currently handles scene \""
2594 << fpSceneHandler -> GetScene () -> GetName ()
2597 "\n (a) attach it to the scene handler with"
2598 "\n /vis/sceneHandler/attach "
2599 << fpScene -> GetName ()
2601 "\n (b) create a new scene handler with "
2602 "\n /vis/sceneHandler/create <graphics-system>,"
2603 "\n in which case it should pick up the the new scene."
2607 G4warn <<
"\n Scene handler \""
2608 << fpSceneHandler -> GetName ()
2609 <<
"\" has null scene pointer."
2610 "\n Attach a scene with /vis/sceneHandler/attach [<scene-name>]"
2617 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
2618 if (viewerList.size () == 0) {
2619 if (fVerbosity >=
errors) {
2621 "ERROR: G4VisManager::IsValidView (): the current scene handler\n \""
2622 << fpSceneHandler -> GetName ()
2623 <<
"\" has no viewers. Do /vis/viewer/create."
2630 if (fpScene -> IsEmpty ()) {
2632 G4bool successful = fpScene -> AddWorldIfEmpty (warn);
2633 if (!successful || fpScene -> IsEmpty ()) {
2634 if (fVerbosity >=
errors) {
2635 G4warn <<
"ERROR: G4VisManager::IsValidView ():";
2637 "\n Attempt at some drawing operation when scene is empty."
2638 "\n Maybe the geometry has not yet been defined."
2639 " Try /run/initialize."
2640 "\n Or use \"/vis/scene/add/extent\"."
2649 "WARNING: G4VisManager: the scene was empty, \"world\" has been"
2650 "\n added and the scene handlers notified.";
2662 G4warn<<
"G4VisManager: No model factories registered with G4VisManager."<<
G4endl;
2663 G4warn<<
"G4VisManager::RegisterModelFactories() should be overridden in derived"<<
G4endl;
2664 G4warn<<
"class. See G4VisExecutive for an example."<<
G4endl;
2668#ifdef G4MULTITHREADED
2669void G4VisManager::SetUpForAThread()
2677 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
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())
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
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
void RegisterModel(G4VTrajectoryModel *model)
void RegisterMessenger(G4UImessenger *messenger)
void SetCurrentViewer(G4VViewer *)
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 &)
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)
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()