56 RefreshIfRequired(viewer);
63 if (sceneHandler && sceneHandler->
GetScene()) {
69 G4cout <<
"Issue /vis/viewer/refresh or flush to see effect."
80 fpCommand =
new G4UIcommand (
"/vis/viewer/addCutawayPlane",
this);
81 fpCommand -> SetGuidance
82 (
"Add cutaway plane to current viewer.");
85 parameter -> SetDefaultValue (0);
86 parameter -> SetGuidance (
"Coordinate of point on the plane.");
89 parameter -> SetDefaultValue (0);
90 parameter -> SetGuidance (
"Coordinate of point on the plane.");
93 parameter -> SetDefaultValue (0);
94 parameter -> SetGuidance (
"Coordinate of point on the plane.");
97 parameter -> SetDefaultValue (
"m");
98 parameter -> SetGuidance (
"Unit of point on the plane.");
101 parameter -> SetDefaultValue (1);
102 parameter -> SetGuidance (
"Component of plane normal.");
105 parameter -> SetDefaultValue (0);
106 parameter -> SetGuidance (
"Component of plane normal.");
109 parameter -> SetDefaultValue (0);
110 parameter -> SetGuidance (
"Component of plane normal.");
130 "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
138 std::istringstream is (newValue);
139 is >> x >> y >> z >> unit >> nx >> ny >> nz;
141 x *= F; y *= F; z *= F;
146 G4cout <<
"Cutaway planes for viewer \"" << viewer->
GetName() <<
"\" now:";
148 for (
size_t i = 0; i < cutaways.size(); ++i)
149 G4cout <<
"\n " << i <<
": " << cutaways[i];
160 fpCommand =
new G4UIcommand (
"/vis/viewer/changeCutawayPlane",
this);
161 fpCommand -> SetGuidance(
"Change cutaway plane.");
164 parameter -> SetGuidance (
"Index of plane: 0, 1, 2.");
167 parameter -> SetDefaultValue (0);
168 parameter -> SetGuidance (
"Coordinate of point on the plane.");
171 parameter -> SetDefaultValue (0);
172 parameter -> SetGuidance (
"Coordinate of point on the plane.");
175 parameter -> SetDefaultValue (0);
176 parameter -> SetGuidance (
"Coordinate of point on the plane.");
179 parameter -> SetDefaultValue (
"m");
180 parameter -> SetGuidance (
"Unit of point on the plane.");
183 parameter -> SetDefaultValue (1);
184 parameter -> SetGuidance (
"Component of plane normal.");
187 parameter -> SetDefaultValue (0);
188 parameter -> SetGuidance (
"Component of plane normal.");
191 parameter -> SetDefaultValue (0);
192 parameter -> SetGuidance (
"Component of plane normal.");
212 "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
221 std::istringstream is (newValue);
222 is >> index >> x >> y >> z >> unit >> nx >> ny >> nz;
224 x *= F; y *= F; z *= F;
230 G4cout <<
"Cutaway planes for viewer \"" << viewer->
GetName() <<
"\" now:";
232 for (
size_t i = 0; i < cutaways.size(); ++i)
233 G4cout <<
"\n " << i <<
": " << cutaways[i];
243 G4bool omitable, currentAsDefault;
245 fpCommand -> SetGuidance (
"Clears viewer.");
246 fpCommand -> SetGuidance
247 (
"By default, clears current viewer. Specified viewer becomes current."
248 "\n\"/vis/viewer/list\" to see possible viewer names.");
249 fpCommand -> SetParameterName (
"viewer-name",
251 currentAsDefault =
true);
260 return viewer ? viewer -> GetName () :
G4String(
"none");
271 G4cout <<
"ERROR: Viewer \"" << clearName
272 <<
"\" not found - \"/vis/viewer/list\" to see possibilities."
281 G4cout <<
"Viewer \"" << clearName <<
"\" cleared." <<
G4endl;
290 (
"/vis/viewer/clearCutawayPlanes",
this);
291 fpCommand -> SetGuidance (
"Clear cutaway planes of current viewer.");
310 "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
319 G4cout <<
"Cutaway planes for viewer \"" << viewer->
GetName()
320 <<
"\" now cleared." <<
G4endl;
329 G4bool omitable, currentAsDefault;
331 fpCommand -> SetGuidance (
"Clears transients from viewer.");
332 fpCommand -> SetGuidance
333 (
"By default, operates on current viewer. Specified viewer becomes current."
334 "\n\"/vis/viewer/list\" to see possible viewer names.");
335 fpCommand -> SetParameterName (
"viewer-name",
337 currentAsDefault =
true);
346 return viewer ? viewer -> GetName () :
G4String(
"none");
357 G4cout <<
"ERROR: Viewer \"" << clearName
358 <<
"\" not found - \"/vis/viewer/list\" to see possibilities."
369 G4cout <<
"Viewer \"" << clearName <<
"\" cleared of transients."
379 fpCommand =
new G4UIcommand (
"/vis/viewer/clone",
this);
380 fpCommand -> SetGuidance (
"Clones viewer.");
381 fpCommand -> SetGuidance
382 (
"By default, clones current viewer. Clone becomes current."
383 "\nClone name, if not provided, is derived from the original name."
384 "\n\"/vis/viewer/list\" to see possible viewer names.");
386 parameter =
new G4UIparameter (
"original-viewer-name",
's', omitable =
true);
387 parameter -> SetCurrentAsDefault (
true);
388 fpCommand -> SetParameter (parameter);
389 parameter =
new G4UIparameter (
"clone-name",
's', omitable =
true);
390 parameter -> SetDefaultValue (
"none");
391 fpCommand -> SetParameter (parameter);
401 return "\"" + originalName +
"\"";
409 std::istringstream is (newValue);
414 while (is.get(c) && c ==
' '){}
416 while (is.get(c) && c !=
'"') {originalName +=
c;}
420 while (is.get(c) && c !=
' ') {originalName +=
c;}
426 if (!originalViewer) {
428 G4cout <<
"ERROR: Viewer \"" << originalName
429 <<
"\" not found - \"/vis/viewer/list\" to see possibilities."
434 originalName = originalViewer->
GetName();
436 while (is.get(c) && c ==
' '){}
438 while (is.get(c) && c !=
'"') {cloneName +=
c;}
442 while (is.get(c) && c !=
' ') {cloneName +=
c;}
447 G4bool errorWhileNaming =
false;
448 if (cloneName ==
"none") {
451 cloneName = originalName;
452 std::ostringstream oss;
453 oss <<
'-' << subID++;
454 G4String::size_type lastDashPosition, nextSpacePosition;
455 if ((lastDashPosition = cloneName.rfind(
'-')) != G4String::npos &&
456 (nextSpacePosition = cloneName.find(
" ", lastDashPosition)) !=
458 cloneName.insert(nextSpacePosition, oss.str());
460 G4String::size_type spacePosition = cloneName.find(
' ');
461 if (spacePosition != G4String::npos)
462 cloneName.insert(spacePosition, oss.str());
464 errorWhileNaming =
true;
466 }
while (!errorWhileNaming &&
fpVisManager -> GetViewer (cloneName));
469 if (errorWhileNaming) {
471 G4cout <<
"ERROR: While naming clone viewer \"" << cloneName
480 G4cout <<
"ERROR: Putative clone viewer \"" << cloneName
481 <<
"\" already exists."
493 if (keepVerbose >= 2 ||
499 (
G4String(
"/vis/viewer/create ! \"" + cloneName +
"\" " + windowSizeHint));
504 G4cout <<
"Viewer \"" << originalName <<
"\" cloned." <<
G4endl;
505 G4cout <<
"Clone \"" << cloneName <<
"\" now current." <<
G4endl;
514 fpCommand -> SetGuidance
515 (
"Copy the camera-specific parameters from the specified viewer.");
516 fpCommand -> SetGuidance
517 (
"Note: To copy scene modifications - style, etc. - please use"
518 "\n\"/vis/viewer/set/all\"");
519 fpCommand -> SetParameterName (
"from-viewer-name", omitable =
false);
535 if (!currentViewer) {
538 "ERROR: G4VisCommandsViewerCopyViewFrom::SetNewValue: no current viewer."
544 const G4String& fromViewerName = newValue;
548 G4cout <<
"ERROR: Viewer \"" << fromViewerName
549 <<
"\" not found - \"/vis/viewer/list\" to see possibilities."
555 if (fromViewer == currentViewer) {
558 "WARNING: G4VisCommandsViewerSet::SetNewValue:"
559 "\n from-viewer and current viewer are identical."
580 G4cout <<
"Camera parameters of viewer \"" << currentViewer->
GetName()
581 <<
"\"\n set to those of viewer \"" << fromViewer->
GetName()
591 fpCommand =
new G4UIcommand (
"/vis/viewer/create",
this);
592 fpCommand -> SetGuidance
593 (
"Creates a viewer for the specified scene handler.");
594 fpCommand -> SetGuidance
595 (
"Default scene handler is the current scene handler. Invents a name"
596 "\nif not supplied. (Note: the system adds information to the name"
597 "\nfor identification - only the characters up to the first blank are"
598 "\nused for removing, selecting, etc.) This scene handler and viewer"
599 "\nbecome current.");
601 parameter =
new G4UIparameter (
"scene-handler",
's', omitable =
true);
602 parameter -> SetCurrentAsDefault (
true);
603 fpCommand -> SetParameter (parameter);
604 parameter =
new G4UIparameter (
"viewer-name",
's', omitable =
true);
605 parameter -> SetCurrentAsDefault (
true);
606 fpCommand -> SetParameter (parameter);
607 parameter =
new G4UIparameter (
"window-size-hint",
's', omitable =
true);
609 (
"integer (pixels) for square window placed by window manager or"
610 " X-Windows-type geometry string, e.g. 600x600-100+100");
612 fpCommand -> SetParameter (parameter);
619 G4String G4VisCommandViewerCreate::NextName () {
620 std::ostringstream oss;
622 oss <<
"viewer-" << fId <<
" (";
624 oss << sceneHandler -> GetGraphicsSystem () -> GetName ();
627 oss <<
"no_scene_handlers";
637 if (currentSceneHandler) {
638 currentValue = currentSceneHandler -> GetName ();
641 currentValue =
"none";
645 currentValue += NextName ();
648 currentValue +=
" 600";
659 std::istringstream is (newValue);
660 is >> sceneHandlerName;
665 while (is.get(c) && c ==
' '){}
667 while (is.get(c) && c !=
'"') {newName +=
c;}
671 while (is.get(c) && c !=
' ') {newName +=
c;}
677 is >> windowSizeHintString;
681 G4int nHandlers = sceneHandlerList.size ();
682 if (nHandlers <= 0) {
685 "ERROR: G4VisCommandViewerCreate::SetNewValue: no scene handlers."
686 "\n Create a scene handler with \"/vis/sceneHandler/create\""
693 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
694 if (sceneHandlerList [iHandler] -> GetName () == sceneHandlerName)
break;
697 if (iHandler < 0 || iHandler >= nHandlers) {
701 G4cout <<
"G4VisCommandViewerCreate::SetNewValue:"
702 " invalid scene handler specified."
711 if (sceneHandler !=
fpVisManager -> GetCurrentSceneHandler ()) {
720 if (newName == nextName) fId++;
723 for (
G4int ih = 0; ih < nHandlers; ih++) {
725 const G4ViewerList& viewerList = sh -> GetViewerList ();
726 for (
size_t iViewer = 0; iViewer < viewerList.size (); iViewer++) {
727 if (viewerList [iViewer] -> GetShortName () == newShortName ) {
729 G4cout <<
"ERROR: Viewer \"" << newShortName <<
"\" already exists."
741 fpVisManager -> CreateViewer (newName,windowSizeHintString);
744 if (newViewer && newViewer -> GetName () == newName) {
746 G4cout <<
"New viewer \"" << newName <<
"\" created." <<
G4endl;
752 G4cout <<
"ERROR: New viewer doesn\'t match!!! Curious!!" <<
G4endl;
765 G4cout <<
"Issue /vis/viewer/refresh or flush to see effect."
775 fDollyIncrement (0.),
778 G4bool omitable, currentAsDefault;
781 (
"/vis/viewer/dolly",
this);
782 fpCommandDolly -> SetGuidance
783 (
"Incremental dolly.");
784 fpCommandDolly -> SetGuidance
785 (
"Moves the camera incrementally towards target point.");
786 fpCommandDolly -> SetParameterName(
"increment",
788 currentAsDefault=
true);
789 fpCommandDolly -> SetDefaultUnit(
"m");
792 (
"/vis/viewer/dollyTo",
this);
793 fpCommandDollyTo -> SetGuidance
794 (
"Dolly to specific coordinate.");
795 fpCommandDollyTo -> SetGuidance
796 (
"Places the camera towards target point relative to standard camera point.");
797 fpCommandDollyTo -> SetParameterName(
"distance",
799 currentAsDefault=
true);
800 fpCommandDollyTo -> SetDefaultUnit(
"m");
804 delete fpCommandDolly;
805 delete fpCommandDollyTo;
810 if (command == fpCommandDolly) {
813 else if (command == fpCommandDollyTo) {
826 if (!currentViewer) {
829 "ERROR: G4VisCommandsViewerDolly::SetNewValue: no current viewer."
837 if (command == fpCommandDolly) {
841 else if (command == fpCommandDollyTo) {
856 G4bool omitable, currentAsDefault;
858 fpCommand -> SetGuidance
859 (
"Compound command: \"/vis/viewer/refresh\" + \"/vis/viewer/update\".");
860 fpCommand -> SetGuidance
861 (
"Useful for refreshing and initiating post-processing for graphics"
862 "\nsystems which need post-processing. By default, acts on current"
863 "\nviewer. \"/vis/viewer/list\" to see possible viewers. Viewer"
864 "\nbecomes current.");
865 fpCommand -> SetParameterName (
"viewer-name",
867 currentAsDefault =
true);
876 G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
877 return viewer ? viewer -> GetName () :
G4String(
"none");
888 G4cout <<
"ERROR: Viewer \"" << flushName <<
"\"" <<
889 " not found - \"/vis/viewer/list\"\n to see possibilities."
905 G4cout <<
"Viewer \"" << viewer -> GetName () <<
"\""
914 fpCommand =
new G4UIcommand (
"/vis/viewer/list",
this);
915 fpCommand -> SetGuidance (
"Lists viewers(s).");
916 fpCommand -> SetGuidance
917 (
"See \"/vis/verbose\" for definition of verbosity.");
921 parameter -> SetDefaultValue (
"all");
922 fpCommand -> SetParameter (parameter);
925 parameter -> SetDefaultValue (
"warnings");
926 fpCommand -> SetParameter (parameter);
939 std::istringstream is (newValue);
940 is >> name >> verbosityString;
948 currentViewerShortName = currentViewer -> GetShortName ();
951 currentViewerShortName =
"none";
956 G4int nHandlers = sceneHandlerList.size ();
958 G4bool foundCurrent =
false;
959 for (
int iHandler = 0; iHandler < nHandlers; iHandler++) {
961 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
962 G4cout <<
"Scene handler \"" << sceneHandler -> GetName ();
963 const G4Scene* pScene = sceneHandler -> GetScene ();
965 G4cout <<
"\", scene \"" << pScene -> GetName () <<
"\":";
967 G4int nViewers = viewerList.size ();
969 G4cout <<
"\n No viewers for this scene handler." <<
G4endl;
972 for (
int iViewer = 0; iViewer < nViewers; iViewer++) {
973 const G4VViewer* thisViewer = viewerList [iViewer];
974 G4String thisName = thisViewer -> GetName ();
975 G4String thisShortName = thisViewer -> GetShortName ();
977 if (thisShortName != shortName)
continue;
981 if (thisShortName == currentViewerShortName) {
988 G4cout <<
" viewer \"" << thisName <<
"\"";
990 G4cout <<
"\n " << *thisViewer;
998 G4cout <<
"No valid current viewer - please create or select one."
1004 if (name !=
"all") {
1005 G4cout <<
" of name \"" << name <<
"\"";
1014 fPanIncrementRight (0.),
1015 fPanIncrementUp (0.),
1022 (
"/vis/viewer/pan",
this);
1023 fpCommandPan -> SetGuidance
1024 (
"Incremental pan.");
1025 fpCommandPan -> SetGuidance
1026 (
"Moves the camera incrementally right and up by these amounts (as seen"
1027 "\nfrom viewpoint direction).");
1029 parameter =
new G4UIparameter(
"right-increment",
'd', omitable =
true);
1030 parameter -> SetCurrentAsDefault (
true);
1031 fpCommandPan -> SetParameter (parameter);
1032 parameter =
new G4UIparameter(
"up-increment",
'd', omitable =
true);
1033 parameter -> SetCurrentAsDefault (
true);
1034 fpCommandPan -> SetParameter (parameter);
1035 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1036 parameter -> SetDefaultValue (
"m");
1037 fpCommandPan -> SetParameter (parameter);
1040 (
"/vis/viewer/panTo",
this);
1041 fpCommandPanTo -> SetGuidance
1042 (
"Pan to specific coordinate.");
1043 fpCommandPanTo -> SetGuidance
1044 (
"Places the camera in this position right and up relative to standard"
1045 "\ntarget point (as seen from viewpoint direction).");
1046 parameter =
new G4UIparameter(
"right",
'd', omitable =
true);
1047 parameter -> SetCurrentAsDefault (
true);
1048 fpCommandPanTo -> SetParameter (parameter);
1050 parameter -> SetCurrentAsDefault (
true);
1051 fpCommandPanTo -> SetParameter (parameter);
1052 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1053 parameter -> SetDefaultValue (
"m");
1054 fpCommandPanTo -> SetParameter (parameter);
1058 delete fpCommandPan;
1059 delete fpCommandPanTo;
1064 if (command == fpCommandPan) {
1065 currentValue =
ConvertToString(fPanIncrementRight, fPanIncrementUp,
"m");
1067 else if (command == fpCommandPanTo) {
1070 return currentValue;
1080 if (!currentViewer) {
1083 "ERROR: G4VisCommandsViewerPan::SetNewValue: no current viewer."
1091 if (command == fpCommandPan) {
1095 else if (command == fpCommandPanTo) {
1097 vp.
SetPan(fPanToRight, fPanToUp);
1111 G4bool omitable, currentAsDefault;
1113 fpCommand -> SetGuidance (
"Forces rebuild of graphical database.");
1114 fpCommand -> SetGuidance
1115 (
"By default, acts on current viewer. \"/vis/viewer/list\""
1116 "\nto see possible viewers. Viewer becomes current.");
1117 fpCommand -> SetParameterName (
"viewer-name",
1119 currentAsDefault =
true);
1129 return viewer -> GetName ();
1145 G4cout <<
"ERROR: Viewer \"" << rebuildName
1146 <<
"\" not found - \"/vis/viewer/list\" to see possibilities."
1153 if (!sceneHandler) {
1155 G4cout <<
"ERROR: Viewer \"" << viewer->
GetName() <<
"\"" <<
1156 " has no scene handler - report serious bug."
1175 G4bool omitable, currentAsDefault;
1177 fpCommand -> SetGuidance
1178 (
"Refreshes viewer.");
1179 fpCommand -> SetGuidance
1180 (
"By default, acts on current viewer. \"/vis/viewer/list\""
1181 "\nto see possible viewers. Viewer becomes current.");
1182 fpCommand -> SetParameterName (
"viewer-name",
1184 currentAsDefault =
true);
1193 return viewer ? viewer -> GetName () :
G4String(
"none");
1205 G4cout <<
"ERROR: Viewer \"" << refreshName <<
"\"" <<
1206 " not found - \"/vis/viewer/list\"\n to see possibilities."
1213 if (!sceneHandler) {
1215 G4cout <<
"ERROR: Viewer \"" << refreshName <<
"\"" <<
1216 " has no scene handler - report serious bug."
1225 G4cout <<
"NOTE: SceneHandler \"" << sceneHandler->
GetName()
1226 <<
"\", to which viewer \"" << refreshName <<
"\"" <<
1227 "\n is attached, has no scene - \"/vis/scene/create\" and"
1228 " \"/vis/sceneHandler/attach\""
1229 "\n (or use compound command \"/vis/drawVolume\")."
1235 G4bool successful = scene -> AddWorldIfEmpty (warn);
1239 "WARNING: Scene is empty. Perhaps no geometry exists."
1240 "\n Try /run/initialize."
1251 G4cout <<
"Refreshing viewer \"" << viewer -> GetName () <<
"\"..."
1254 viewer -> SetView ();
1255 viewer -> ClearView ();
1256 viewer -> DrawView ();
1258 G4cout <<
"Viewer \"" << viewer -> GetName () <<
"\"" <<
" refreshed."
1259 "\n (You might also need \"/vis/viewer/update\".)" <<
G4endl;
1267 G4bool omitable, currentAsDefault;
1269 fpCommand -> SetGuidance (
"Resets viewer.");
1270 fpCommand -> SetGuidance
1271 (
"By default, acts on current viewer. \"/vis/viewer/list\""
1272 "\nto see possible viewers. Viewer becomes current.");
1273 fpCommand -> SetParameterName (
"viewer-name",
1275 currentAsDefault =
true);
1285 return viewer -> GetName ();
1300 G4cout <<
"ERROR: Viewer \"" << resetName
1301 <<
"\" not found - \"/vis/viewer/list\" to see possibilities."
1316 fpCommand -> SetGuidance
1317 (
"Write commands that define the current view to file.");
1318 fpCommand -> SetParameterName (
"file-name", omitable =
true);
1319 fpCommand -> SetDefaultValue (
"G4cout");
1351 if (!currentViewer) {
1354 "ERROR: G4VisCommandsViewerSave::SetNewValue: no current viewer."
1361 if (!currentScene) {
1364 "ERROR: G4VisCommandsViewerSave::SetNewValue: no current scene."
1371 if (newValue !=
"G4cout") {
1373 std::ifstream ifs(newValue);
1377 "ERROR: G4VisCommandsViewerSave::SetNewValue: File \""
1378 << newValue <<
"\" already exists."
1388 "ERROR: G4VisCommandsViewerSave::SetNewValue: Trouble opening file \""
1389 << newValue <<
"\"."
1399 const std::vector<G4ModelingParameters::VisAttributesModifier>*
1402 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator i;
1403 for (i = privateVAMs->begin(); i != privateVAMs->end(); ++i) {
1409 if (newValue ==
"G4cout") {
1410 WriteCommands(
G4cout,vp,stp);
1412 WriteCommands(ofs,vp,stp);
1417 G4cout <<
"Viewer \"" << currentViewer -> GetName ()
1418 <<
"\"" <<
" saved to ";
1419 if (newValue ==
"G4cout") {
1422 G4cout <<
"file \'" << newValue <<
"\".";
1434 G4bool omitable, currentAsDefault;
1437 (
"/vis/viewer/scale",
this);
1438 fpCommandScale -> SetGuidance (
"Incremental (non-uniform) scaling.");
1439 fpCommandScale -> SetGuidance
1440 (
"Multiplies components of current scaling by components of this factor."
1441 "\n Scales (x,y,z) by corresponding components of the resulting factor.");
1442 fpCommandScale -> SetGuidance
1444 fpCommandScale -> SetParameterName
1445 (
"x-scale-multiplier",
"y-scale-multiplier",
"z-scale-multiplier",
1446 omitable=
true, currentAsDefault=
true);
1449 (
"/vis/viewer/scaleTo",
this);
1450 fpCommandScaleTo -> SetGuidance (
"Absolute (non-uniform) scaling.");
1451 fpCommandScaleTo -> SetGuidance
1452 (
"Scales (x,y,z) by corresponding components of this factor.");
1453 fpCommandScaleTo -> SetParameterName
1454 (
"x-scale-factor",
"y-scale-factor",
"z-scale-factor",
1455 omitable=
true, currentAsDefault=
true);
1459 delete fpCommandScale;
1460 delete fpCommandScaleTo;
1465 if (command == fpCommandScale) {
1468 else if (command == fpCommandScaleTo) {
1471 return currentValue;
1481 if (!currentViewer) {
1484 "ERROR: G4VisCommandsViewerScale::SetNewValue: no current viewer."
1492 if (command == fpCommandScale) {
1496 else if (command == fpCommandScaleTo) {
1513 fpCommand -> SetGuidance (
"Selects viewer.");
1514 fpCommand -> SetGuidance
1515 (
"Specify viewer by name. \"/vis/viewer/list\" to see possible viewers.");
1516 fpCommand -> SetParameterName (
"viewer-name", omitable =
false);
1536 G4cout <<
"ERROR: Viewer \"" << selectName <<
"\"";
1537 G4cout <<
" not found - \"/vis/viewer/list\""
1538 "\n to see possibilities."
1546 G4cout <<
"WARNING: Viewer \"" << viewer -> GetName () <<
"\""
1547 <<
" already selected." <<
G4endl;
1560 G4bool omitable, currentAsDefault;
1562 fpCommand -> SetGuidance
1563 (
"Triggers graphical database post-processing for viewers"
1564 "\nusing that technique.");
1565 fpCommand -> SetGuidance
1566 (
"For such viewers the view only becomes visible with this command."
1567 "\nBy default, acts on current viewer. \"/vis/viewer/list\""
1568 "\nto see possible viewers. Viewer becomes current.");
1569 fpCommand -> SetParameterName (
"viewer-name",
1571 currentAsDefault =
true);
1581 return viewer -> GetName ();
1598 "ERROR: G4VisCommandsViewerUpdate::SetNewValue: no current viewer."
1605 if (!sceneHandler) {
1607 G4cout <<
"ERROR: Viewer \"" << updateName <<
"\"" <<
1608 " has no scene handler - report serious bug."
1617 G4cout <<
"NOTE: SceneHandler \"" << sceneHandler->
GetName()
1618 <<
"\", to which viewer \"" << updateName <<
"\"" <<
1619 "\n is attached, has no scene - \"/vis/scene/create\" and"
1620 " \"/vis/sceneHandler/attach\""
1621 "\n (or use compound command \"/vis/drawVolume\")."
1628 G4cout <<
"Viewer \"" << viewer -> GetName () <<
"\"";
1631 viewer -> ShowView ();
1633 sceneHandler -> SetMarkForClearingTransientStore(
true);
1639 fZoomMultiplier (1.),
1642 G4bool omitable, currentAsDefault;
1645 (
"/vis/viewer/zoom",
this);
1646 fpCommandZoom -> SetGuidance (
"Incremental zoom.");
1647 fpCommandZoom -> SetGuidance
1648 (
"Multiplies current magnification by this factor.");
1649 fpCommandZoom -> SetParameterName(
"multiplier",
1651 currentAsDefault=
true);
1654 (
"/vis/viewer/zoomTo",
this);
1655 fpCommandZoomTo -> SetGuidance (
"Absolute zoom.");
1656 fpCommandZoomTo -> SetGuidance
1657 (
"Magnifies standard magnification by this factor.");
1658 fpCommandZoomTo -> SetParameterName(
"factor",
1660 currentAsDefault=
true);
1664 delete fpCommandZoom;
1665 delete fpCommandZoomTo;
1670 if (command == fpCommandZoom) {
1673 else if (command == fpCommandZoomTo) {
1676 return currentValue;
1686 if (!currentViewer) {
1689 "ERROR: G4VisCommandsViewerZoom::SetNewValue: no current viewer."
1697 if (command == fpCommandZoom) {
1701 else if (command == fpCommandZoomTo) {
const G4String & GetName() const
G4String GetCurrentValue(G4UIcommand *command)
void SetParameter(G4UIparameter *const newParameter)
G4String TouchableCommands() const
G4String GetCurrentValue(G4UIcommand *command)
G4double GetZoomFactor() const
G4VisCommandViewerClone()
void IncrementPan(G4double right, G4double up)
void ClearCutawayPlanes()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandViewerAddCutawayPlane()
void AddCutawayPlane(const G4Plane3D &cutawayPlane)
G4double GetDolly() const
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
void SetPan(G4double right, G4double up)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetScaleFactor(const G4Vector3D &scaleFactor)
CLHEP::Hep3Vector G4ThreeVector
virtual void ClearView()=0
G4VisCommandViewerCopyViewFrom()
G4String strip(G4int strip_Type=trailing, char c=' ')
void UpdateVisManagerScene(const G4String &sceneName="")
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandViewerClearTransients()
virtual ~G4VisCommandViewerChangeCutawayPlane()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandViewerUpdate()
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
void SetUpVector(const G4Vector3D &upVector)
const G4ViewParameters & GetViewParameters() const
virtual ~G4VisCommandViewerClear()
void SetDefaultValue(const char *theDefaultValue)
static G4String ConvertToString(G4bool boolVal)
const G4String & GetName() const
G4String SceneModifyingCommands() const
void SetViewParameters(const G4ViewParameters &vp)
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
virtual ~G4VisCommandViewerFlush()
HepGeom::Point3D< G4double > G4Point3D
const G4Planes & GetCutawayPlanes() const
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
static G4double GetNewDoubleValue(const char *paramString)
G4int GetVerboseLevel() const
const G4String & GetName() const
static Verbosity GetVerbosityValue(const G4String &)
void SetVerboseLevel(G4int val)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetLightsMoveWithCamera(G4bool moves)
G4String GetCurrentValue(G4UIcommand *command)
const G4Point3D & GetCurrentTargetPoint() const
static G4UImanager * GetUIpointer()
G4VisCommandViewerScale()
virtual ~G4VisCommandViewerClearCutawayPlanes()
const G4Vector3D & GetLightpointDirection() const
const G4String & GetXGeometryString() const
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
const G4Vector3D & GetViewpointDirection() const
G4GLOB_DLL std::ostream G4cout
void SetZoomFactor(G4double zoomFactor)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void ChangeCutawayPlane(size_t index, const G4Plane3D &cutawayPlane)
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandViewerSelect()
const G4Point3D & GetStandardTargetPoint() const
virtual ~G4VisCommandViewerRebuild()
void SetNewValue(G4UIcommand *command, G4String newValue)
std::vector< G4Plane3D > G4Planes
static G4double GetNewDoubleValue(const char *paramString)
const std::vector< Model > & GetRunDurationModelList() const
virtual ~G4VisCommandViewerUpdate()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandViewerCreate()
void ResetTransientsDrawnFlags()
void SetCurrentTargetPoint(const G4Point3D ¤tTargetPoint)
void SetDolly(G4double dolly)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandViewerRefresh()
void SetFieldHalfAngle(G4double fieldHalfAngle)
G4VisCommandViewerReset()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4String DrawingStyleCommands() const
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandViewerChangeCutawayPlane()
void RefreshIfRequired(G4VViewer *)
G4Scene * GetScene() const
void MultiplyZoomFactor(G4double zoomFactorMultiplier)
G4VisCommandViewerRebuild()
virtual ~G4VisCommandViewerDolly()
void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier &)
G4VisCommandViewerDolly()
G4VSceneHandler * GetSceneHandler() const
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
const G4Vector3D & GetScaleFactor() const
virtual ~G4VisCommandViewerScale()
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers() const
static G4String ConvertToString(G4double x, G4double y, const char *unitName)
static G4double ValueOf(const char *unitName)
G4VisCommandViewerFlush()
virtual ~G4VisCommandViewerList()
virtual ~G4VisCommandViewerClone()
static Verbosity GetVerbosity()
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VVisCommandViewer()
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandViewerSelect()
G4VisCommandViewerClear()
HepGeom::Plane3D< G4double > G4Plane3D
G4String CameraAndLightingCommands(const G4Point3D standardTargetPoint) const
G4bool GetLightsMoveWithCamera() const
G4VViewer * GetCurrentViewer() const
G4double GetFieldHalfAngle() const
void SetNewValue(G4UIcommand *command, G4String newValue)
void MultiplyScaleFactor(const G4Vector3D &scaleFactorMultiplier)
virtual ~G4VisCommandViewerCopyViewFrom()
virtual void ClearTransientStore()
virtual ~G4VisCommandViewerSave()
G4VisCommandViewerClearTransients()
void SetGuidance(const char *theGuidance)
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
const G4Vector3D & GetUpVector() const
virtual ~G4VisCommandViewerReset()
static void ConvertToDoublePair(const G4String ¶mString, G4double &xval, G4double &yval)
virtual ~G4VisCommandViewerZoom()
G4VisCommandViewerRefresh()
virtual ~G4VisCommandViewerPan()
void SetMarkForClearingTransientStore(G4bool)
G4bool IsAutoRefresh() const
void IncrementDolly(G4double dollyIncrement)
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
G4int ApplyCommand(const char *aCommand)
G4VisCommandViewerClearCutawayPlanes()
G4String GetCurrentValue(G4UIcommand *command)
virtual void FinishView()
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
HepGeom::Normal3D< G4double > G4Normal3D
G4VisCommandViewerCreate()
virtual void DrawView()=0
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
static G4VisManager * fpVisManager
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandViewerAddCutawayPlane()