90 fpCommand =
new G4UIcommand(
"/vis/scene/add/arrow",
this);
91 fpCommand -> SetGuidance (
"Adds arrow to current scene.");
95 fpCommand -> SetParameter (parameter);
97 fpCommand -> SetParameter (parameter);
99 fpCommand -> SetParameter (parameter);
101 fpCommand -> SetParameter (parameter);
103 fpCommand -> SetParameter (parameter);
105 fpCommand -> SetParameter (parameter);
106 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
127 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
134 std::istringstream is(newValue);
135 is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2 >> unitString;
137 x1 *= unit; y1 *= unit; z1 *= unit;
138 x2 *= unit; y2 *= unit; z2 *= unit;
146 (x1, y1, z1, x2, y2, z2,
150 const G4String& currentSceneName = pScene -> GetName ();
151 G4bool successful = pScene -> AddRunDurationModel (model, warn);
154 G4cout <<
"Arrow has been added to scene \""
155 << currentSceneName <<
"\"."
167 fpCommand =
new G4UIcommand(
"/vis/scene/add/arrow2D",
this);
168 fpCommand -> SetGuidance (
"Adds 2D arrow to current scene.");
169 fpCommand -> SetGuidance (
"x,y in range [-1,1]");
173 fpCommand -> SetParameter (parameter);
175 fpCommand -> SetParameter (parameter);
177 fpCommand -> SetParameter (parameter);
179 fpCommand -> SetParameter (parameter);
198 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
204 std::istringstream is(newValue);
205 is >> x1 >> y1 >> x2 >> y2;
207 Arrow2D* arrow2D =
new Arrow2D
214 const G4String& currentSceneName = pScene -> GetName ();
215 G4bool successful = pScene -> AddRunDurationModel (model, warn);
218 G4cout <<
"A 2D arrow has been added to scene \""
219 << currentSceneName <<
"\"."
228G4VisCommandSceneAddArrow2D::Arrow2D::Arrow2D
232 fWidth(width), fColour(colour)
234 fShaftPolyline.push_back(
G4Point3D(x1,y1,0));
235 fShaftPolyline.push_back(
G4Point3D(x2,y2,0));
237 G4Vector3D arrowPointLeftDirection(arrowDirection);
238 arrowPointLeftDirection.rotateZ(150.*deg);
239 G4Vector3D arrowPointRightDirection(arrowDirection);
240 arrowPointRightDirection.rotateZ(-150.*deg);
241 fHeadPolyline.push_back(
G4Point3D(x2,y2,0)+0.04*arrowPointLeftDirection);
242 fHeadPolyline.push_back(
G4Point3D(x2,y2,0));
243 fHeadPolyline.push_back(
G4Point3D(x2,y2,0)+0.04*arrowPointRightDirection);
247 fShaftPolyline.SetVisAttributes(va);
248 fHeadPolyline.SetVisAttributes(va);
251void G4VisCommandSceneAddArrow2D::Arrow2D::operator()
254 sceneHandler.BeginPrimitives2D();
255 sceneHandler.AddPrimitive(fShaftPolyline);
256 sceneHandler.AddPrimitive(fHeadPolyline);
257 sceneHandler.EndPrimitives2D();
264 fpCommand =
new G4UIcommand (
"/vis/scene/add/axes",
this);
265 fpCommand -> SetGuidance (
"Add axes.");
266 fpCommand -> SetGuidance
267 (
"Draws axes at (x0, y0, z0) of given length and colour.");
268 fpCommand -> SetGuidance
269 (
"If \"colour-string\" is \"auto\", x, y and z will be red, green and blue"
270 "\n respectively. Otherwise it can be one of the pre-defined text-specified"
271 "\n colours - see information printed by the vis manager at start-up or"
272 "\n use \"/vis/list\".");
273 fpCommand -> SetGuidance
274 (
"If \"length\" is negative, it is set to about 25% of scene extent.");
275 fpCommand -> SetGuidance
276 (
"If \"showtext\" is false, annotations are suppressed.");
287 parameter =
new G4UIparameter (
"length",
'd', omitable =
true);
290 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
293 parameter =
new G4UIparameter (
"colour-string",
's', omitable =
true);
296 parameter =
new G4UIparameter (
"showtext",
'b', omitable =
true);
317 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
324 <<
"ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"."
331 G4String unitString, colourString, showTextString;
333 std::istringstream is (newValue);
334 is >> x0 >> y0 >> z0 >> length >> unitString
335 >> colourString >> showTextString;
340 x0 *= unit; y0 *= unit; z0 *= unit;
344 const G4double intLog10Length = std::floor(std::log10(lengthMax));
345 length = std::pow(10,intLog10Length);
346 if (5.*length < lengthMax) length *= 5.;
347 else if (2.*length < lengthMax) length *= 2.;
356 if (arrowWidth > length/30.) arrowWidth = length/30.;
359 (x0, y0, z0, length, arrowWidth, colourString, newValue,
362 G4bool successful = pScene -> AddRunDurationModel (model, warn);
363 const G4String& currentSceneName = pScene -> GetName ();
367 <<
"have been added to scene \"" << currentSceneName <<
"\"."
380 fpCommand =
new G4UIcommand (
"/vis/scene/add/date",
this);
381 fpCommand -> SetGuidance (
"Adds date to current scene.");
382 fpCommand -> SetGuidance
383 (
"If \"date\"is omitted, the current date and time is drawn."
384 "\nOtherwise, the string, including the rest of the line, is drawn.");
386 parameter =
new G4UIparameter (
"size",
'i', omitable =
true);
387 parameter -> SetGuidance (
"Screen size of text in pixels.");
388 parameter -> SetDefaultValue (18);
389 fpCommand -> SetParameter (parameter);
390 parameter =
new G4UIparameter (
"x-position",
'd', omitable =
true);
391 parameter -> SetGuidance (
"x screen position in range -1 < x < 1.");
392 parameter -> SetDefaultValue (0.95);
393 fpCommand -> SetParameter (parameter);
394 parameter =
new G4UIparameter (
"y-position",
'd', omitable =
true);
395 parameter -> SetGuidance (
"y screen position in range -1 < y < 1.");
396 parameter -> SetDefaultValue (0.9);
397 fpCommand -> SetParameter (parameter);
398 parameter =
new G4UIparameter (
"layout",
's', omitable =
true);
399 parameter -> SetGuidance (
"Layout, i.e., adjustment: left|centre|right.");
400 parameter -> SetDefaultValue (
"right");
401 fpCommand -> SetParameter (parameter);
402 parameter =
new G4UIparameter (
"date",
's', omitable =
true);
403 parameter -> SetDefaultValue (
"-");
404 fpCommand -> SetParameter (parameter);
423 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
431 std::istringstream is(newValue);
432 is >> size >> x >> y >> layoutString >> dateString;
434 const size_t NREMAINDER = 100;
435 char remainder[NREMAINDER];
437 is.getline(remainder, NREMAINDER);
438 dateString += remainder;
444 Date* date =
new Date(
fpVisManager, size, x, y, layout, dateString);
450 const G4String& currentSceneName = pScene -> GetName ();
451 G4bool successful = pScene -> AddRunDurationModel (model, warn);
454 G4cout <<
"Date has been added to scene \""
455 << currentSceneName <<
"\"."
464void G4VisCommandSceneAddDate::Date::operator()
469 time = fTimer.GetClockTime();
474 std::string::size_type i = time.rfind(
'\n');
475 if (i != std::string::npos) time.erase(i);
477 text.SetScreenSize(fSize);
478 text.SetLayout(fLayout);
480 text.SetVisAttributes(textAtts);
481 sceneHandler.BeginPrimitives2D();
482 sceneHandler.AddPrimitive(text);
483 sceneHandler.EndPrimitives2D();
490 fpCommand -> SetGuidance (
"Adds digis to current scene.");
491 fpCommand -> SetGuidance
492 (
"Digis are drawn at end of event when the scene in which"
493 "\nthey are added is current.");
512 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
518 const G4String& currentSceneName = pScene -> GetName ();
519 G4bool successful = pScene -> AddEndOfEventModel (model, warn);
522 G4cout <<
"Digis, if any, will be drawn at end of run in scene \""
523 << currentSceneName <<
"\"."
536 fpCommand =
new G4UIcommand (
"/vis/scene/add/electricField",
this);
537 fpCommand -> SetGuidance
538 (
"Adds electric field representation to current scene.");
539 fpCommand -> SetGuidance
540 (
"The first parameter is no. of data points per half extent. So, possibly, at"
541 "\nmaximum, the number of data points sampled is (2*n+1)^3, which can grow"
542 "\nlarge--be warned!"
543 "\nThe default value is 10, i.e., a 21x21x21 array, i.e., 9,261 sampling points."
544 "\nThat may swamp your view, but usually, a field is limited to a small part of"
545 "\nthe extent, so it's not a problem. But if it is, here are some of the things"
547 "\n- reduce the number of data points per half extent (first parameter);"
548 "\n- specify \"lightArrow\" (second parameter);"
549 "\n- restrict the region sampled with \"/vis/set/extentForField\";"
550 "\n- restrict the drawing to a specific volume with"
551 "\n \"/vis/set/volumeForField\" or \"/vis/touchable/volumeForField\"."
552 "\nNote: you might have to deactivate existing field models with"
553 "\n \"/vis/scene/activateModel Field false\" and re-issue"
554 "\n \"/vis/scene/add/...Field\" command again.");
555 fpCommand -> SetGuidance
556 (
"In the arrow representation, the length of the arrow is proportional"
557 "\nto the magnitude of the field and the colour is mapped onto the range"
558 "\nas a fraction of the maximum magnitude: 0->0.5->1 is red->green->blue.");
560 parameter =
new G4UIparameter (
"nDataPointsPerHalfExtent",
'i', omitable =
true);
561 parameter -> SetDefaultValue (10);
562 fpCommand -> SetParameter (parameter);
563 parameter =
new G4UIparameter (
"representation",
's', omitable =
true);
564 parameter -> SetParameterCandidates(
"fullArrow lightArrow");
565 parameter -> SetDefaultValue (
"fullArrow");
566 fpCommand -> SetParameter (parameter);
586 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
591 G4int nDataPointsPerHalfExtent;
593 std::istringstream iss(newValue);
594 iss >> nDataPointsPerHalfExtent >> representation;
597 if (representation ==
"lightArrow") {
602 (nDataPointsPerHalfExtent,modelRepresentation,
606 const G4String& currentSceneName = pScene -> GetName ();
607 G4bool successful = pScene -> AddRunDurationModel (model, warn);
611 <<
"Electric field, if any, will be drawn in scene \""
614 << nDataPointsPerHalfExtent
615 <<
" data points per half extent and with representation \""
630 fpCommand =
new G4UIcommand (
"/vis/scene/add/eventID",
this);
631 fpCommand -> SetGuidance (
"Adds eventID to current scene.");
632 fpCommand -> SetGuidance
633 (
"Run and event numbers are drawn at end of event or run when"
634 "\n the scene in which they are added is current.");
636 parameter =
new G4UIparameter (
"size",
'i', omitable =
true);
637 parameter -> SetGuidance (
"Screen size of text in pixels.");
638 parameter -> SetDefaultValue (18);
639 fpCommand -> SetParameter (parameter);
640 parameter =
new G4UIparameter (
"x-position",
'd', omitable =
true);
641 parameter -> SetGuidance (
"x screen position in range -1 < x < 1.");
642 parameter -> SetDefaultValue (-0.95);
643 fpCommand -> SetParameter (parameter);
644 parameter =
new G4UIparameter (
"y-position",
'd', omitable =
true);
645 parameter -> SetGuidance (
"y screen position in range -1 < y < 1.");
646 parameter -> SetDefaultValue (0.9);
647 fpCommand -> SetParameter (parameter);
648 parameter =
new G4UIparameter (
"layout",
's', omitable =
true);
649 parameter -> SetGuidance (
"Layout, i.e., adjustment: left|centre|right.");
650 parameter -> SetDefaultValue (
"left");
651 fpCommand -> SetParameter (parameter);
670 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
678 std::istringstream is(newValue);
679 is >> size >> x >> y >> layoutString;
688 =
new EventID(forEndOfEvent,
fpVisManager, size, x, y, layout);
691 eoeModel->
SetType(
"EoEEventID");
694 G4bool successfulEoE = pScene -> AddEndOfEventModel (eoeModel, warn);
698 =
new EventID(forEndOfRun,
fpVisManager, size, x, y, layout);
701 eorModel->
SetType(
"EoREventID");
704 G4bool successfulEoR = pScene -> AddEndOfRunModel (eorModel, warn);
706 if (successfulEoE && successfulEoR) {
708 const G4String& currentSceneName = pScene -> GetName ();
709 G4cout <<
"EventID has been added to scene \""
710 << currentSceneName <<
"\"."
719void G4VisCommandSceneAddEventID::EventID::operator()
727 if (!currentRun)
return;
731 std::ostringstream oss;
736 if (!fpVisManager->GetReviewingKeptEvents())
return;
737 const G4Event* currentEvent = mp->GetEvent();
738 if (!currentEvent)
return;
740 oss <<
"Run " << currentRunID <<
" Event " << eventID;
746 if (fpVisManager->GetReviewingKeptEvents())
return;
749 size_t nKeptEvents = events? events->size(): 0;
750 oss <<
"Run " << currentRunID <<
" (" << nEvents <<
" event";
751 if (nEvents != 1) oss <<
's';
752 oss <<
", " << nKeptEvents <<
" kept)";
760 text.SetScreenSize(fSize);
761 text.SetLayout(fLayout);
763 text.SetVisAttributes(textAtts);
764 sceneHandler.BeginPrimitives2D();
765 sceneHandler.AddPrimitive(text);
766 sceneHandler.EndPrimitives2D();
772 fpCommand =
new G4UIcommand(
"/vis/scene/add/extent",
this);
773 fpCommand -> SetGuidance
774 (
"Adds a dummy model with given extent to the current scene."
775 "\nRequires the limits: xmin, xmax, ymin, ymax, zmin, zmax unit."
776 "\nThis can be used to provide an extent to the scene even if"
777 "\nno other models with extent are available. For example,"
778 "\neven if there is no geometry. In that case, for example:"
780 "\n /vis/scene/create"
781 "\n /vis/scene/add/extent -300 300 -300 300 -300 300 cm"
782 "\n /vis/sceneHandler/attach");
785 parameter =
new G4UIparameter (
"xmin",
'd', omitable =
true);
786 parameter -> SetDefaultValue (0.);
787 fpCommand -> SetParameter (parameter);
788 parameter =
new G4UIparameter (
"xmax",
'd', omitable =
true);
789 parameter -> SetDefaultValue (0.);
790 fpCommand -> SetParameter (parameter);
791 parameter =
new G4UIparameter (
"ymin",
'd', omitable =
true);
792 parameter -> SetDefaultValue (0.);
793 fpCommand -> SetParameter (parameter);
794 parameter =
new G4UIparameter (
"ymax",
'd', omitable =
true);
795 parameter -> SetDefaultValue (0.);
796 fpCommand -> SetParameter (parameter);
797 parameter =
new G4UIparameter (
"zmin",
'd', omitable =
true);
798 parameter -> SetDefaultValue (0.);
799 fpCommand -> SetParameter (parameter);
800 parameter =
new G4UIparameter (
"zmax",
'd', omitable =
true);
801 parameter -> SetDefaultValue (0.);
802 fpCommand -> SetParameter (parameter);
803 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
804 parameter -> SetDefaultValue (
"m");
805 fpCommand -> SetParameter (parameter);
824 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
829 G4double xmin, xmax, ymin, ymax, zmin, zmax;
831 std::istringstream is(newValue);
832 is >> xmin >> xmax >> ymin >> ymax >> zmin >> zmax >> unitString;
834 xmin *= unit; xmax *= unit;
835 ymin *= unit; ymax *= unit;
836 zmin *= unit; zmax *= unit;
838 G4VisExtent visExtent(xmin, xmax, ymin, ymax, zmin, zmax);
839 Extent* extent =
new Extent(xmin, xmax, ymin, ymax, zmin, zmax);
846 const G4String& currentSceneName = pScene -> GetName ();
847 G4bool successful = pScene -> AddRunDurationModel (model, warn);
850 G4cout <<
"A benign model with extent "
852 <<
" has been added to scene \""
853 << currentSceneName <<
"\"."
862G4VisCommandSceneAddExtent::Extent::Extent
866fExtent(xmin,xmax,ymin,ymax,zmin,zmax)
869void G4VisCommandSceneAddExtent::Extent::operator()
876 fpCommand =
new G4UIcommand(
"/vis/scene/add/frame",
this);
877 fpCommand -> SetGuidance (
"Add frame to current scene.");
880 parameter =
new G4UIparameter (
"size",
'd', omitable =
true);
881 parameter -> SetGuidance (
"Size of frame. 1 = full window.");
882 parameter -> SetParameterRange (
"size > 0 && size <=1");
883 parameter -> SetDefaultValue (0.97);
884 fpCommand -> SetParameter (parameter);
903 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
909 std::istringstream is(newValue);
918 const G4String& currentSceneName = pScene -> GetName ();
919 G4bool successful = pScene -> AddRunDurationModel (model, warn);
922 G4cout <<
"Frame has been added to scene \""
923 << currentSceneName <<
"\"."
932void G4VisCommandSceneAddFrame::Frame::operator()
936 frame.push_back(
G4Point3D( fSize, fSize, 0.));
937 frame.push_back(
G4Point3D(-fSize, fSize, 0.));
938 frame.push_back(
G4Point3D(-fSize, -fSize, 0.));
939 frame.push_back(
G4Point3D( fSize, -fSize, 0.));
940 frame.push_back(
G4Point3D( fSize, fSize, 0.));
945 sceneHandler.BeginPrimitives2D();
946 sceneHandler.AddPrimitive(frame);
947 sceneHandler.EndPrimitives2D();
955 fpCommand =
new G4UIcommand (
"/vis/scene/add/gps",
this);
956 fpCommand -> SetGuidance
957 (
"A representation of the source(s) of the General Particle Source"
958 "\nwill be added to current scene and drawn, if applicable.");
960 fpCommand->
SetGuidance(
"Default: red and transparent.");
961 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
962 parameter -> SetDefaultValue (
"1.");
963 fpCommand -> SetParameter (parameter);
964 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
965 parameter -> SetDefaultValue (0.);
966 fpCommand -> SetParameter (parameter);
967 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
968 parameter -> SetDefaultValue (0.);
969 fpCommand -> SetParameter (parameter);
970 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
971 parameter -> SetDefaultValue (0.3);
972 fpCommand -> SetParameter (parameter);
991 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
998 std::istringstream iss(newValue);
999 iss >> redOrString >> green >> blue >> opacity;
1004 const G4String& currentSceneName = pScene -> GetName ();
1005 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1009 "A representation of the source(s) of the General Particle Source will be drawn"
1010 "\n in colour " << colour <<
" for scene \""
1011 << currentSceneName <<
"\" if applicable."
1024 fpCommand -> SetGuidance (
"Adds hits to current scene.");
1025 fpCommand -> SetGuidance
1026 (
"Hits are drawn at end of event when the scene in which"
1027 "\nthey are added is current.");
1046 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1052 const G4String& currentSceneName = pScene -> GetName ();
1053 G4bool successful = pScene -> AddEndOfEventModel (model, warn);
1056 G4cout <<
"Hits, if any, will be drawn at end of run in scene \""
1057 << currentSceneName <<
"\"."
1069 fpCommand =
new G4UIcommand(
"/vis/scene/add/line",
this);
1070 fpCommand -> SetGuidance (
"Adds line to current scene.");
1073 parameter =
new G4UIparameter (
"x1",
'd', omitable =
false);
1074 fpCommand -> SetParameter (parameter);
1075 parameter =
new G4UIparameter (
"y1",
'd', omitable =
false);
1076 fpCommand -> SetParameter (parameter);
1077 parameter =
new G4UIparameter (
"z1",
'd', omitable =
false);
1078 fpCommand -> SetParameter (parameter);
1079 parameter =
new G4UIparameter (
"x2",
'd', omitable =
false);
1080 fpCommand -> SetParameter (parameter);
1081 parameter =
new G4UIparameter (
"y2",
'd', omitable =
false);
1082 fpCommand -> SetParameter (parameter);
1083 parameter =
new G4UIparameter (
"z2",
'd', omitable =
false);
1084 fpCommand -> SetParameter (parameter);
1085 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1106 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1113 std::istringstream is(newValue);
1114 is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2 >> unitString;
1116 x1 *= unit; y1 *= unit; z1 *= unit;
1117 x2 *= unit; y2 *= unit; z2 *= unit;
1119 Line* line =
new Line(x1, y1, z1, x2, y2, z2,
1126 const G4String& currentSceneName = pScene -> GetName ();
1127 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1130 G4cout <<
"Line has been added to scene \""
1131 << currentSceneName <<
"\"."
1140G4VisCommandSceneAddLine::Line::Line
1144 fWidth(width), fColour(colour)
1146 fPolyline.push_back(
G4Point3D(x1,y1,z1));
1147 fPolyline.push_back(
G4Point3D(x2,y2,z2));
1151 fPolyline.SetVisAttributes(va);
1154void G4VisCommandSceneAddLine::Line::operator()
1157 sceneHandler.BeginPrimitives();
1158 sceneHandler.AddPrimitive(fPolyline);
1159 sceneHandler.EndPrimitives();
1165 fpCommand =
new G4UIcommand(
"/vis/scene/add/line2D",
this);
1166 fpCommand -> SetGuidance (
"Adds 2D line to current scene.");
1167 fpCommand -> SetGuidance (
"x,y in range [-1,1]");
1170 parameter =
new G4UIparameter (
"x1",
'd', omitable =
false);
1171 fpCommand -> SetParameter (parameter);
1172 parameter =
new G4UIparameter (
"y1",
'd', omitable =
false);
1173 fpCommand -> SetParameter (parameter);
1174 parameter =
new G4UIparameter (
"x2",
'd', omitable =
false);
1175 fpCommand -> SetParameter (parameter);
1176 parameter =
new G4UIparameter (
"y2",
'd', omitable =
false);
1177 fpCommand -> SetParameter (parameter);
1196 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1202 std::istringstream is(newValue);
1203 is >> x1 >> y1 >> x2 >> y2;
1205 Line2D* line2D =
new Line2D
1212 const G4String& currentSceneName = pScene -> GetName ();
1213 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1216 G4cout <<
"A 2D line has been added to scene \""
1217 << currentSceneName <<
"\"."
1226G4VisCommandSceneAddLine2D::Line2D::Line2D
1230 fWidth(width), fColour(colour)
1232 fPolyline.push_back(
G4Point3D(x1,y1,0));
1233 fPolyline.push_back(
G4Point3D(x2,y2,0));
1237 fPolyline.SetVisAttributes(va);
1240void G4VisCommandSceneAddLine2D::Line2D::operator()
1243 sceneHandler.BeginPrimitives2D();
1244 sceneHandler.AddPrimitive(fPolyline);
1245 sceneHandler.EndPrimitives2D();
1252 fpCommand =
new G4UIcommand (
"/vis/scene/add/localAxes",
this);
1253 fpCommand -> SetGuidance
1254 (
"Adds local axes to physical volume(s).");
1256 parameter =
new G4UIparameter (
"physical-volume-name",
's', omitable =
false);
1257 fpCommand -> SetParameter (parameter);
1258 parameter =
new G4UIparameter (
"copy-no",
'i', omitable =
true);
1259 parameter -> SetGuidance (
"If negative, matches any copy no.");
1260 parameter -> SetDefaultValue (-1);
1261 fpCommand -> SetParameter (parameter);
1269 return "world 0 -1";
1281 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1288 std::istringstream is (newValue);
1289 is >> name >> copyNo;
1291 std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
1296 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
1298 size_t nWorlds = transportationManager->
GetNoWorlds();
1299 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
1308 (&searchModel, name, copyNo);
1310 for (
const auto& findings: searchScene.
GetFindings()) {
1311 findingsVector.push_back(findings);
1316 for (
const auto& findings: findingsVector) {
1319 const auto& extent = findings.fpFoundPV->GetLogicalVolume()->GetSolid()->GetExtent();
1320 const auto& transform = findings.fFoundObjectTransformation;
1322 const G4double lengthMax = extent.GetExtentRadius()/2.;
1323 const G4double intLog10LengthMax = std::floor(std::log10(lengthMax));
1324 G4double length = std::pow(10,intLog10LengthMax);
1325 if (5.*length < lengthMax) length *= 5.;
1326 else if (2.*length < lengthMax) length *= 2.;
1328 const auto& axesModel =
new G4AxesModel(0.,0.,0.,length,transform);
1329 axesModel->SetGlobalTag(
"LocalAxesModel");
1330 std::ostringstream oss; oss
1331 <<
"Local Axes for " << findings.fpFoundPV->GetName()
1332 <<
':' << findings.fFoundPVCopyNo <<
':' <<
id++;
1333 axesModel->SetGlobalDescription(oss.str());
1338 G4cout <<
"\"" << findings.fpFoundPV->GetName()
1339 <<
"\", copy no. " << findings.fFoundPVCopyNo
1340 <<
",\n found in searched volume \""
1341 << findings.fpSearchPV->GetName()
1342 <<
"\" at depth " << findings.fFoundDepth
1343 <<
",\n base path: \"" << findings.fFoundBasePVPath
1344 <<
"\".\n Local axes have been added to scene \""
1345 << pScene->
GetName() <<
"\".";
1347 G4cout <<
" With extent " << extent
1348 <<
"\n at " << transform.getRotation()
1349 <<
" " << transform.getTranslation();
1358 if (findingsVector.empty()) {
1360 G4warn <<
"ERROR: Volume \"" << name <<
"\"";
1362 G4warn <<
", copy no. " << copyNo <<
",";
1377 fpCommand =
new G4UIcommand (
"/vis/scene/add/logicalVolume",
this);
1378 fpCommand -> SetGuidance (
"Adds a logical volume to the current scene,");
1379 fpCommand -> SetGuidance
1380 (
"Shows boolean components (if any), voxels (if any), readout geometry"
1381 "\n (if any), local axes and overlaps (if any), under control of the"
1382 "\n appropriate flag."
1383 "\n Note: voxels are not constructed until start of run -"
1384 "\n \"/run/beamOn\". (For voxels without a run, \"/run/beamOn 0\".)");
1386 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
false);
1387 fpCommand -> SetParameter (parameter);
1388 parameter =
new G4UIparameter (
"depth-of-descent",
'i', omitable =
true);
1389 parameter -> SetGuidance (
"Depth of descent of geometry hierarchy.");
1390 parameter -> SetDefaultValue (1);
1391 fpCommand -> SetParameter (parameter);
1392 parameter =
new G4UIparameter (
"booleans-flag",
'b', omitable =
true);
1393 parameter -> SetDefaultValue (
true);
1394 fpCommand -> SetParameter (parameter);
1395 parameter =
new G4UIparameter (
"voxels-flag",
'b', omitable =
true);
1396 parameter -> SetDefaultValue (
true);
1397 fpCommand -> SetParameter (parameter);
1398 parameter =
new G4UIparameter (
"readout-flag",
'b', omitable =
true);
1399 parameter -> SetDefaultValue (
true);
1400 fpCommand -> SetParameter (parameter);
1401 parameter =
new G4UIparameter (
"axes-flag",
'b', omitable =
true);
1402 parameter -> SetDefaultValue (
true);
1403 parameter -> SetGuidance (
"Set \"false\" to suppress axes.");
1404 fpCommand -> SetParameter (parameter);
1405 parameter =
new G4UIparameter(
"check-overlap-flag",
'b', omitable =
true);
1407 parameter -> SetGuidance (
"Set \"false\" to suppress overlap check.");
1428 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1434 G4int requestedDepthOfDescent;
1435 G4String booleansString, voxelsString, readoutString, axesString;
1437 std::istringstream is (newValue);
1438 is >> name >> requestedDepthOfDescent
1439 >> booleansString >> voxelsString >> readoutString >> axesString
1450 if (pLV ==
nullptr)
return;
1452 const std::vector<G4Scene::Model>& rdModelList =
1453 pScene -> GetRunDurationModelList();
1454 std::vector<G4Scene::Model>::const_iterator i;
1455 for (i = rdModelList.begin(); i != rdModelList.end(); ++i) {
1456 if (i->fpModel->GetGlobalDescription().find(
"Volume") != std::string::npos)
break;
1458 if (i != rdModelList.end()) {
1460 G4warn <<
"There is already a volume, \""
1461 << i->fpModel->GetGlobalDescription()
1462 <<
"\",\n in the run-duration model list of scene \""
1463 << pScene -> GetName()
1464 <<
"\".\n Your logical volume must be the only volume in the scene."
1465 <<
"\n Create a new scene and try again:"
1466 <<
"\n /vis/specify " << name
1468 <<
"\n /vis/scene/create"
1469 <<
"\n /vis/scene/add/logicalVolume " << name
1470 <<
"\n /vis/sceneHandler/attach"
1471 <<
"\n (and also, if necessary, /vis/viewer/flush)"
1478 (pLV, requestedDepthOfDescent, booleans, voxels, readout, checkOverlaps);
1479 const G4String& currentSceneName = pScene -> GetName ();
1480 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1484 G4bool axesSuccessful =
false;
1487 const G4double axisLengthMax = radius / 2.;
1488 const G4double intLog10Length = std::floor(std::log10(axisLengthMax));
1489 G4double axisLength = std::pow(10,intLog10Length);
1490 if (5.*axisLength < axisLengthMax) axisLength *= 5.;
1491 else if (2.*axisLength < axisLengthMax) axisLength *= 2.;
1492 const G4double axisWidth = axisLength / 20.;
1494 axesSuccessful = pScene -> AddRunDurationModel (axesModel, warn);
1505 G4cout <<
"Logical volume \"" << pLV -> GetName ()
1506 <<
"\" with requested depth of descent "
1507 << requestedDepthOfDescent
1509 if (!booleans)
G4cout <<
"out";
1510 G4cout <<
" boolean components, with";
1511 if (!voxels)
G4cout <<
"out";
1512 G4cout <<
" voxels,\n with";
1513 if (!readout)
G4cout <<
"out";
1514 G4cout <<
" readout geometry and with";
1515 if (!checkOverlaps)
G4cout <<
"out";
1516 G4cout <<
" overlap checking"
1517 <<
"\n has been added to scene \"" << currentSceneName <<
"\".";
1519 if (axesSuccessful) {
1521 "\n Axes have also been added at the origin of local cooordinates.";
1524 "\n Axes have not been added for some reason possibly stated above.";
1543 fpCommand =
new G4UIcommand (
"/vis/scene/add/logo",
this);
1544 fpCommand -> SetGuidance (
"Adds a G4 logo to the current scene.");
1545 fpCommand -> SetGuidance
1546 (
"If \"unit\" is \"auto\", height is roughly one tenth of scene extent.");
1547 fpCommand -> SetGuidance
1548 (
"\"direction\" is that of outward-facing normal to front face of logo."
1549 "\nIf \"direction\" is \"auto\", logo faces the user in the current viewer.");
1550 fpCommand -> SetGuidance
1551 (
"\nIf \"placement\" is \"auto\", logo is placed at bottom right of screen"
1552 "\n when viewed from logo direction.");
1554 parameter =
new G4UIparameter (
"height",
'd', omitable =
true);
1557 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1560 parameter =
new G4UIparameter (
"direction",
's', omitable =
true);
1564 parameter =
new G4UIparameter (
"red",
'd', omitable =
true);
1567 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
1570 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
1573 parameter =
new G4UIparameter (
"placement",
's', omitable =
true);
1574 parameter -> SetParameterCandidates(
"auto manual");
1577 parameter =
new G4UIparameter (
"xmid",
'd', omitable =
true);
1580 parameter =
new G4UIparameter (
"ymid",
'd', omitable =
true);
1583 parameter =
new G4UIparameter (
"zmid",
'd', omitable =
true);
1586 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1607 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1614 <<
"ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"."
1625 "ERROR: G4VisCommandSceneAddLogo::SetNewValue: no viewer."
1626 "\n Auto direction needs a viewer."
1632 G4double userHeight, red, green, blue, xmid, ymid, zmid;
1633 G4String userHeightUnit, direction, placement, positionUnit;
1634 std::istringstream is (newValue);
1635 is >> userHeight >> userHeightUnit >> direction
1636 >> red >> green >> blue
1638 >> xmid >> ymid >> zmid >> positionUnit;
1642 if (userHeightUnit ==
"auto") {
1649 xmid *= unit; ymid *= unit; zmid *= unit;
1651 Direction logoDirection = X;
1652 if (direction ==
"auto") {
1656 if (vp.
x() > vp.
y() && vp.
x() > vp.
z()) logoDirection = X;
1657 else if (vp.
x() < vp.
y() && vp.
x() < vp.
z()) logoDirection = minusX;
1658 else if (vp.
y() > vp.
x() && vp.
y() > vp.
z()) logoDirection = Y;
1659 else if (vp.
y() < vp.
x() && vp.
y() < vp.
z()) logoDirection = minusY;
1660 else if (vp.
z() > vp.
x() && vp.
z() > vp.
y()) logoDirection = Z;
1661 else if (vp.
z() < vp.
x() && vp.
z() < vp.
y()) logoDirection = minusZ;
1663 else if (direction[0] ==
'x') logoDirection = X;
1664 else if (direction[0] ==
'y') logoDirection = Y;
1665 else if (direction[0] ==
'z') logoDirection = Z;
1666 else if (direction[0] ==
'-') {
1667 if (direction[1] ==
'x') logoDirection = minusX;
1668 else if (direction[1] ==
'y') logoDirection = minusY;
1669 else if (direction[1] ==
'z') logoDirection = minusZ;
1672 G4warn <<
"ERROR: Unrecogniseed direction: \""
1673 << direction <<
"\"." <<
G4endl;
1678 G4bool autoPlacing =
false;
if (placement ==
"auto") autoPlacing =
true;
1695 "WARNING: Existing scene does not yet have any extent."
1696 "\n Maybe you have not yet added any geometrical object."
1702 const G4double halfHeight(height / 2.);
1704 const G4double freeHeightFraction (1. + 2. * comfort);
1708 switch (logoDirection) {
1711 if (freeHeightFraction * (xmax - xmin) < height) room =
false;
1715 if (freeHeightFraction * (ymax - ymin) < height) room =
false;
1719 if (freeHeightFraction * (zmax - zmin) < height) room =
false;
1726 "WARNING: Not enough room in existing scene. Maybe logo is too large."
1733 "WARNING: The logo you have asked for is bigger than the existing"
1734 "\n scene. Maybe you have added it too soon. It is recommended that"
1735 "\n you add the logo last so that it can be correctly auto-positioned"
1736 "\n so as not to be obscured by any existing object and so that the"
1737 "\n view parameters can be correctly recalculated."
1742 G4double sxmid(xmid), symid(ymid), szmid(zmid);
1746 const G4double xComfort = comfort * (xmax - xmin);
1747 const G4double yComfort = comfort * (ymax - ymin);
1748 const G4double zComfort = comfort * (zmax - zmin);
1749 switch (logoDirection) {
1751 sxmid = xmax + halfHeight + xComfort;
1752 symid = ymin - yComfort;
1753 szmid = zmin - zComfort;
1756 sxmid = xmin - halfHeight - xComfort;
1757 symid = ymin - yComfort;
1758 szmid = zmax + zComfort;
1761 sxmid = xmin - xComfort;
1762 symid = ymax + halfHeight + yComfort;
1763 szmid = zmin - zComfort;
1766 sxmid = xmax + xComfort;
1767 symid = ymin - halfHeight - yComfort;
1768 szmid = zmin - zComfort;
1771 sxmid = xmax + xComfort;
1772 symid = ymin - yComfort;
1773 szmid = zmax + halfHeight + zComfort;
1776 sxmid = xmin - xComfort;
1777 symid = ymin - yComfort;
1778 szmid = zmin - halfHeight - zComfort;
1784 switch (logoDirection) {
1809 G4Logo* logo =
new G4Logo(height,visAtts,transform);
1821 const G4String& currentSceneName = pScene -> GetName ();
1822 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1825 G4cout <<
"G4 Logo of height " << userHeight <<
' ' << userHeightUnit
1826 <<
", " << direction <<
"-direction, added to scene \""
1827 << currentSceneName <<
"\"";
1829 G4cout <<
"\n with extent " << extent
1841G4VisCommandSceneAddLogo::G4Logo::G4Logo
1856 const G4double xb = -h2, yb = f2 + w;
1857 const G4double dx = xt - xb, dy = yt - yb;
1858 const G4double angle = std::atan2(dy,dx);
1861 const G4double d = std::sqrt(dx * dx + dy * dy);
1864 const G4double x8 = ((-ss * d - dx * (yt - y8)) / dy) + xt;
1866 G4double x9 = ((-(ss - w) * d - dx * (yt - y8)) / dy) + xt;
1868 const G4double xtr = ss - f1, ytr = -ss - f2 -w;
1869 x9 += xtr; y9 += ytr;
1883 G4Tubs tG(
"tG",ri,ro,d2,0.15*pi,1.85*pi);
1884 G4Box bG(
"bG",w2,ro2,d2);
1886 fpG = logoG.CreatePolyhedron();
1892 G4Box b1(
"b1",h2,h2,d2);
1893 G4Box bS(
"bS",ss,ss,d2+e);
1894 G4Box bS2(
"bS2",ss,ss,d2+2.*e);
1903 fp4 = logo4.CreatePolyhedron();
1917G4VisCommandSceneAddLogo::G4Logo::~G4Logo() {
1922void G4VisCommandSceneAddLogo::G4Logo::operator()
1924 sceneHandler.BeginPrimitives();
1925 sceneHandler.AddPrimitive(*fpG);
1926 sceneHandler.AddPrimitive(*fp4);
1927 sceneHandler.EndPrimitives();
1934 fpCommand =
new G4UIcommand (
"/vis/scene/add/logo2D",
this);
1935 fpCommand -> SetGuidance (
"Adds 2D logo to current scene.");
1937 parameter =
new G4UIparameter (
"size",
'i', omitable =
true);
1938 parameter -> SetGuidance (
"Screen size of text in pixels.");
1939 parameter -> SetDefaultValue (48);
1940 fpCommand -> SetParameter (parameter);
1941 parameter =
new G4UIparameter (
"x-position",
'd', omitable =
true);
1942 parameter -> SetGuidance (
"x screen position in range -1 < x < 1.");
1943 parameter -> SetDefaultValue (-0.9);
1944 fpCommand -> SetParameter (parameter);
1945 parameter =
new G4UIparameter (
"y-position",
'd', omitable =
true);
1946 parameter -> SetGuidance (
"y screen position in range -1 < y < 1.");
1947 parameter -> SetDefaultValue (-0.9);
1948 fpCommand -> SetParameter (parameter);
1949 parameter =
new G4UIparameter (
"layout",
's', omitable =
true);
1950 parameter -> SetGuidance (
"Layout, i.e., adjustment: left|centre|right.");
1951 parameter -> SetDefaultValue (
"left");
1952 fpCommand -> SetParameter (parameter);
1971 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1979 std::istringstream is(newValue);
1980 is >> size >> x >> y >> layoutString;
1986 Logo2D* logo2D =
new Logo2D(
fpVisManager, size, x, y, layout);
1992 const G4String& currentSceneName = pScene -> GetName ();
1993 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1996 G4cout <<
"2D logo has been added to scene \""
1997 << currentSceneName <<
"\"."
2006void G4VisCommandSceneAddLogo2D::Logo2D::operator()
2010 text.SetScreenSize(fSize);
2011 text.SetLayout(fLayout);
2013 text.SetVisAttributes(textAtts);
2014 sceneHandler.BeginPrimitives2D();
2015 sceneHandler.AddPrimitive(text);
2016 sceneHandler.EndPrimitives2D();
2022 fpCommand =
new G4UIcommand (
"/vis/scene/add/magneticField",
this);
2023 fpCommand -> SetGuidance
2024 (
"Adds magnetic field representation to current scene.");
2050 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2055 G4int nDataPointsPerHalfScene;
2057 std::istringstream iss(newValue);
2058 iss >> nDataPointsPerHalfScene >> representation;
2061 if (representation ==
"lightArrow") {
2066 (nDataPointsPerHalfScene,modelRepresentation,
2070 const G4String& currentSceneName = pScene -> GetName ();
2071 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2075 <<
"Magnetic field, if any, will be drawn in scene \""
2078 << nDataPointsPerHalfScene
2079 <<
" data points per half extent and with representation \""
2095 fpCommand -> SetGuidance
2096 (
"Adds Primitive Scorer Hits (PSHits) to current scene.");
2097 fpCommand -> SetGuidance
2098 (
"PSHits are drawn at end of run when the scene in which"
2099 "\nthey are added is current.");
2100 fpCommand -> SetGuidance
2101 (
"Optional parameter specifies name of scoring map. By default all"
2102 "\nscoring maps registered with the G4ScoringManager are drawn.");
2103 fpCommand -> SetParameterName (
"mapname", omitable =
true);
2104 fpCommand -> SetDefaultValue (
"all");
2124 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2130 const G4String& currentSceneName = pScene -> GetName ();
2131 G4bool successful = pScene -> AddEndOfRunModel (model, warn);
2134 if (newValue ==
"all") {
2135 G4cout <<
"All Primitive Scorer hits";
2137 G4cout <<
"Hits of Primitive Scorer \"" << newValue <<
'"';
2139 G4cout <<
" will be drawn at end of run in scene \""
2140 << currentSceneName <<
"\"."
2153 fpCommand =
new G4UIcommand (
"/vis/scene/add/scale",
this);
2154 fpCommand -> SetGuidance
2155 (
"Adds an annotated scale line to the current scene.");
2156 fpCommand -> SetGuidance
2157 (
"If \"unit\" is \"auto\", length is roughly one tenth of the scene extent.");
2158 fpCommand -> SetGuidance
2159 (
"If \"direction\" is \"auto\", scale is roughly in the plane of the current view.");
2160 fpCommand -> SetGuidance
2161 (
"If \"placement\" is \"auto\", scale is placed at bottom left of current view."
2162 "\n Otherwise placed at (xmid,ymid,zmid).");
2163 fpCommand -> SetGuidance
2164 (
"An annotated line in the specified direction with tick marks at the"
2165 "\nend. If autoPlacing is true it is required to be centred at the"
2166 "\nfront, right, bottom corner of the world space, comfortably outside"
2167 "\nthe existing bounding box/sphere so that existing objects do not"
2168 "\nobscure it. Otherwise it is required to be drawn with mid-point at"
2169 "\n(xmid, ymid, zmid)."
2171 "\nThe auto placing algorithm is (approx):"
2172 "\n x = xmin + (1 + comfort) * (xmax - xmin);"
2173 "\n y = ymin - comfort * (ymax - ymin);"
2174 "\n z = zmin + (1 + comfort) * (zmax - zmin);"
2175 "\n if direction == x then (x - length,y,z) to (x,y,z);"
2176 "\n if direction == y then (x,y,z) to (x,y + length,z);"
2177 "\n if direction == z then (x,y,z - length) to (x,y,z);"
2180 parameter =
new G4UIparameter (
"length",
'd', omitable =
true);
2183 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
2186 parameter =
new G4UIparameter (
"direction",
's', omitable =
true);
2190 parameter =
new G4UIparameter (
"red",
'd', omitable =
true);
2193 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
2196 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
2199 parameter =
new G4UIparameter (
"placement",
's', omitable =
true);
2200 parameter -> SetParameterCandidates(
"auto manual");
2203 parameter =
new G4UIparameter (
"xmid",
'd', omitable =
true);
2206 parameter =
new G4UIparameter (
"ymid",
'd', omitable =
true);
2209 parameter =
new G4UIparameter (
"zmid",
'd', omitable =
true);
2212 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
2233 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2240 <<
"ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"."
2247 G4double userLength, red, green, blue, xmid, ymid, zmid;
2248 G4String userLengthUnit, direction, placement, positionUnit;
2249 std::istringstream is (newValue);
2250 is >> userLength >> userLengthUnit >> direction
2251 >> red >> green >> blue
2253 >> xmid >> ymid >> zmid >> positionUnit;
2257 if (userLengthUnit ==
"auto") {
2259 const G4double intLog10Length = std::floor(std::log10(lengthMax));
2260 length = std::pow(10,intLog10Length);
2261 if (5.*length < lengthMax) length *= 5.;
2262 else if (2.*length < lengthMax) length *= 2.;
2269 xmid *= unit; ymid *= unit; zmid *= unit;
2271 Scale::Direction scaleDirection (Scale::x);
2272 if (direction[0] ==
'y') scaleDirection = Scale::y;
2273 if (direction[0] ==
'z') scaleDirection = Scale::z;
2279 "ERROR: G4VisCommandSceneAddScale::SetNewValue: no viewer."
2280 "\n Auto direction needs a viewer."
2291 if (direction ==
"auto") {
2292 if (std::abs(vp.
x()) > std::abs(vp.
y()) &&
2293 std::abs(vp.
x()) > std::abs(vp.
z())) {
2294 if (std::abs(up.
y()) > std::abs(up.
z())) scaleDirection = Scale::z;
2295 else scaleDirection = Scale::y;
2297 else if (std::abs(vp.
y()) > std::abs(vp.
x()) &&
2298 std::abs(vp.
y()) > std::abs(vp.
z())) {
2299 if (std::abs(up.
x()) > std::abs(up.
z())) scaleDirection = Scale::z;
2300 else scaleDirection = Scale::x;
2302 else if (std::abs(vp.
z()) > std::abs(vp.
x()) &&
2303 std::abs(vp.
z()) > std::abs(vp.
y())) {
2304 if (std::abs(up.
y()) > std::abs(up.
x())) scaleDirection = Scale::x;
2305 else scaleDirection = Scale::y;
2309 G4bool autoPlacing =
false;
if (placement ==
"auto") autoPlacing =
true;
2313 const G4double halfLength(length / 2.);
2315 const G4double freeLengthFraction (1. + 2. * comfort);
2330 "WARNING: Existing scene does not yet have any extent."
2331 "\n Maybe you have not yet added any geometrical object."
2338 switch (scaleDirection) {
2340 if (freeLengthFraction * (xmax - xmin) < length) room =
false;
2343 if (freeLengthFraction * (ymax - ymin) < length) room =
false;
2346 if (freeLengthFraction * (zmax - zmin) < length) room =
false;
2353 "WARNING: Not enough room in existing scene. Maybe scale is too long."
2360 "WARNING: The scale you have asked for is bigger than the existing"
2361 "\n scene. Maybe you have added it too soon. It is recommended that"
2362 "\n you add the scale last so that it can be correctly auto-positioned"
2363 "\n so as not to be obscured by any existing object and so that the"
2364 "\n view parameters can be correctly recalculated."
2392 G4double sxmid(xmid), symid(ymid), szmid(zmid);
2396 const G4double xComfort = comfort * (xmax - xmin);
2397 const G4double yComfort = comfort * (ymax - ymin);
2398 const G4double zComfort = comfort * (zmax - zmin);
2399 switch (scaleDirection) {
2402 sxmid = xmax + xComfort;
2403 symid = ymin - yComfort;
2404 szmid = zmin - zComfort;
2406 sxmid = xmin - xComfort;
2407 symid = ymin - yComfort;
2408 szmid = zmax + zComfort;
2413 sxmid = xmin - xComfort;
2414 symid = ymax + yComfort;
2415 szmid = zmin - zComfort;
2417 sxmid = xmax + xComfort;
2418 symid = ymin - yComfort;
2419 szmid = zmin - zComfort;
2424 sxmid = xmax + xComfort;
2425 symid = ymin - yComfort;
2426 szmid = zmax + zComfort;
2428 sxmid = xmin - xComfort;
2429 symid = ymin - yComfort;
2430 szmid = zmax + zComfort;
2440 switch (scaleDirection) {
2451 scaleExtent = scaleExtent.
Transform(transform);
2454 if (direction ==
"auto") {
2455 switch (scaleDirection) {
2469 Scale* scale =
new Scale
2470 (visAttr, length, transform,
2478 const G4String& currentSceneName = pScene -> GetName ();
2479 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2482 G4cout <<
"Scale of " << annotation
2483 <<
" added to scene \"" << currentSceneName <<
"\".";
2485 G4cout <<
"\n with extent " << scaleExtent
2497G4VisCommandSceneAddScale::Scale::Scale
2505 const G4double halfLength(length / 2.);
2506 const G4double tickLength(length / 20.);
2510 fScaleLine.SetVisAttributes(&fVisAtts);
2511 fTick11.SetVisAttributes(&fVisAtts);
2512 fTick12.SetVisAttributes(&fVisAtts);
2513 fTick21.SetVisAttributes(&fVisAtts);
2514 fTick22.SetVisAttributes(&fVisAtts);
2520 fScaleLine.push_back(r1);
2521 fScaleLine.push_back(r2);
2524 fTick11.push_back(r1 + ticky);
2525 fTick11.push_back(r1 - ticky);
2526 fTick12.push_back(r1 + tickz);
2527 fTick12.push_back(r1 - tickz);
2528 fTick21.push_back(r2 + ticky);
2529 fTick21.push_back(r2 - ticky);
2530 fTick22.push_back(r2 + tickz);
2531 fTick22.push_back(r2 - tickz);
2533 fScaleLine.transform(transform);
2534 fTick11.transform(transform);
2535 fTick12.transform(transform);
2536 fTick21.transform(transform);
2537 fTick22.transform(transform);
2539 G4Point3D textPosition(0., tickLength, 0.);
2540 textPosition.transform(transform);
2541 fText =
G4Text(annotation,textPosition);
2542 fText.SetVisAttributes(annotationColour);
2543 fText.SetScreenSize(annotationSize);
2546void G4VisCommandSceneAddScale::Scale::operator()
2550 sceneHandler.BeginPrimitives();
2551 sceneHandler.AddPrimitive(fScaleLine);
2552 sceneHandler.AddPrimitive(fTick11);
2553 sceneHandler.AddPrimitive(fTick12);
2554 sceneHandler.AddPrimitive(fTick21);
2555 sceneHandler.AddPrimitive(fTick22);
2556 sceneHandler.AddPrimitive(fText);
2557 sceneHandler.EndPrimitives();
2564 fpCommand =
new G4UIcommand (
"/vis/scene/add/text",
this);
2565 fpCommand -> SetGuidance (
"Adds text to current scene.");
2566 fpCommand -> SetGuidance
2567 (
"Use \"/vis/set/textColour\" to set colour.");
2568 fpCommand -> SetGuidance
2569 (
"Use \"/vis/set/textLayout\" to set layout:");
2580 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
2583 parameter =
new G4UIparameter (
"font_size",
'd', omitable =
true);
2587 parameter =
new G4UIparameter (
"x_offset",
'd', omitable =
true);
2591 parameter =
new G4UIparameter (
"y_offset",
'd', omitable =
true);
2595 parameter =
new G4UIparameter (
"text",
's', omitable =
true);
2596 parameter->
SetGuidance (
"The rest of the line is text.");
2617 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2633 x *= unit; y *= unit; z *= unit;
2642 const G4String& currentSceneName = pScene -> GetName ();
2643 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2646 G4cout <<
"Text \"" << text
2647 <<
"\" has been added to scene \"" << currentSceneName <<
"\"."
2661 fpCommand =
new G4UIcommand (
"/vis/scene/add/text2D",
this);
2662 fpCommand -> SetGuidance (
"Adds 2D text to current scene.");
2663 fpCommand -> SetGuidance (
"x,y in range [-1,1]");
2664 fpCommand -> SetGuidance
2665 (
"Use \"/vis/set/textColour\" to set colour.");
2666 fpCommand -> SetGuidance
2667 (
"Use \"/vis/set/textLayout\" to set layout:");
2675 parameter =
new G4UIparameter (
"font_size",
'd', omitable =
true);
2679 parameter =
new G4UIparameter (
"x_offset",
'd', omitable =
true);
2683 parameter =
new G4UIparameter (
"y_offset",
'd', omitable =
true);
2687 parameter =
new G4UIparameter (
"text",
's', omitable =
true);
2688 parameter->
SetGuidance (
"The rest of the line is text.");
2709 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2728 G4Text2D* g4text2D =
new G4Text2D(g4text);
2733 std::ostringstream oss;
2734 oss <<
"Text2D: \"" << g4text.
GetText()
2739 const G4String& currentSceneName = pScene -> GetName ();
2740 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2743 G4cout <<
"2D text \"" << text
2744 <<
"\" has been added to scene \"" << currentSceneName <<
"\"."
2753G4VisCommandSceneAddText2D::G4Text2D::G4Text2D(
const G4Text& text):
2757void G4VisCommandSceneAddText2D::G4Text2D::operator()
2759 sceneHandler.BeginPrimitives2D();
2760 sceneHandler.AddPrimitive(fText);
2761 sceneHandler.EndPrimitives2D();
2770 (
"/vis/scene/add/trajectories",
this);
2771 fpCommand -> SetGuidance
2772 (
"Adds trajectories to current scene.");
2773 fpCommand -> SetGuidance
2774 (
"Causes trajectories, if any, to be drawn at the end of processing an"
2775 "\nevent. Switches on trajectory storing and sets the"
2776 "\ndefault trajectory type.");
2777 fpCommand -> SetGuidance
2778 (
"The command line parameter list determines the default trajectory type."
2779 "\nIf it contains the string \"smooth\", auxiliary inter-step points will"
2780 "\nbe inserted to improve the smoothness of the drawing of a curved"
2782 "\nIf it contains the string \"rich\", significant extra information will"
2783 "\nbe stored in the trajectory (G4RichTrajectory) amenable to modeling"
2784 "\nand filtering with \"/vis/modeling/trajectories/create/drawByAttribute\""
2785 "\nand \"/vis/filtering/trajectories/create/attributeFilter\" commands."
2786 "\nIt may contain both strings in any order.");
2787 fpCommand -> SetGuidance
2788 (
"\nTo switch off trajectory storing: \"/tracking/storeTrajectory 0\"."
2789 "\nSee also \"/vis/scene/endOfEventAction\".");
2790 fpCommand -> SetGuidance
2791 (
"Note: This only sets the default. Independently of the result of this"
2792 "\ncommand, a user may instantiate a trajectory that overrides this default"
2793 "\nin PreUserTrackingAction.");
2794 fpCommand -> SetParameterName (
"default-trajectory-type", omitable =
true);
2795 fpCommand -> SetDefaultValue (
"");
2815 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2819 const G4String& currentSceneName = pScene -> GetName ();
2823 if (newValue.find(
"smooth") != std::string::npos) smooth =
true;
2824 if (newValue.find(
"rich") != std::string::npos) rich =
true;
2825 if (newValue.size() && !(rich || smooth)) {
2827 G4warn <<
"ERROR: Unrecognised parameter \"" << newValue <<
"\""
2828 "\n No action taken."
2836 if (smooth && rich) {
2837 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 4");
2838 defaultTrajectoryType =
"G4RichTrajectory configured for smooth steps";
2839 }
else if (smooth) {
2840 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 2");
2841 defaultTrajectoryType =
"G4SmoothTrajectory";
2843 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 3");
2844 defaultTrajectoryType =
"G4RichTrajectory";
2846 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 1");
2847 defaultTrajectoryType =
"G4Trajectory";
2852 "Attributes available for modeling and filtering with"
2853 "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2854 "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2860 }
else if (smooth) {
2870 auto eoeModel = eoeList.begin();
2871 for (; eoeModel != eoeList.end(); ++eoeModel) {
2872 const auto* actualModel = eoeModel->fpModel;
2875 if (eoeModel == eoeList.end()) {
2878 pScene -> AddEndOfEventModel (model, warn);
2884 G4cout <<
"Default trajectory type " << defaultTrajectoryType
2885 <<
"\n will be used to store trajectories for scene \""
2886 << currentSceneName <<
"\"."
2892 "WARNING: Trajectory storing has been requested. This action may be"
2893 "\n reversed with \"/tracking/storeTrajectory 0\"."
2905 fpCommand -> SetGuidance
2906 (
"Add named Vis User Action to current scene.");
2907 fpCommand -> SetGuidance
2908 (
"Attempts to match search string to name of action - use unique sub-string.");
2909 fpCommand -> SetGuidance
2910 (
"(Use /vis/list to see names of registered actions.)");
2911 fpCommand -> SetGuidance
2912 (
"If name == \"all\" (default), all actions are added.");
2913 fpCommand -> SetParameterName(
"action-name", omitable =
true);
2914 fpCommand -> SetDefaultValue(
"all");
2933 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2940 const std::vector<G4VisManager::UserVisAction>& runDurationUserVisActions =
2942 for (
size_t i = 0; i < runDurationUserVisActions.size(); i++) {
2943 const G4String& name = runDurationUserVisActions[i].fName;
2944 G4VUserVisAction* visAction = runDurationUserVisActions[i].fpUserVisAction;
2945 if (newValue ==
"all" || name.find(newValue) != std::string::npos) {
2947 AddVisAction(name,visAction,pScene,runDuration,verbosity);
2951 const std::vector<G4VisManager::UserVisAction>& endOfEventUserVisActions =
2953 for (
size_t i = 0; i < endOfEventUserVisActions.size(); i++) {
2954 const G4String& name = endOfEventUserVisActions[i].fName;
2956 if (newValue ==
"all" || name.find(newValue) != std::string::npos) {
2958 AddVisAction(name,visAction,pScene,endOfEvent,verbosity);
2962 const std::vector<G4VisManager::UserVisAction>& endOfRunUserVisActions =
2964 for (
size_t i = 0; i < endOfRunUserVisActions.size(); i++) {
2965 const G4String& name = endOfRunUserVisActions[i].fName;
2967 if (newValue ==
"all" || name.find(newValue) != std::string::npos) {
2969 AddVisAction(name,visAction,pScene,endOfRun,verbosity);
2975 G4warn <<
"WARNING: No User Vis Action registered." <<
G4endl;
2983void G4VisCommandSceneAddUserAction::AddVisAction
2987 G4VisCommandSceneAddUserAction::ActionType type,
2992 const std::map<G4VUserVisAction*,G4VisExtent>& visExtentMap =
2995 std::map<G4VUserVisAction*,G4VisExtent>::const_iterator i =
2996 visExtentMap.find(visAction);
2997 if (i != visExtentMap.end()) extent = i->second;
3001 <<
"WARNING: User Vis Action \"" << name <<
"\" extent is null."
3007 model->
SetType(
"User Vis Action");
3011 G4bool successful =
false;;
3014 successful = pScene -> AddRunDurationModel (model, warn);
3017 successful = pScene -> AddEndOfEventModel (model, warn);
3020 successful = pScene -> AddEndOfRunModel (model, warn);
3025 const G4String& currentSceneName = pScene -> GetName ();
3026 G4cout <<
"User Vis Action added to scene \""
3027 << currentSceneName <<
"\"";
3029 G4cout <<
"\n with extent " << extent;
3041 fpCommand =
new G4UIcommand (
"/vis/scene/add/volume",
this);
3042 fpCommand -> SetGuidance
3043 (
"Adds a physical volume to current scene, with optional clipping volume.");
3044 fpCommand -> SetGuidance
3045 (
"If physical-volume-name is \"world\" (the default), the top of the"
3046 "\nmain geometry tree (material world) is added. If \"worlds\", the"
3047 "\ntops of all worlds - material world and parallel worlds, if any - are"
3048 "\nadded. Otherwise a search of all worlds is made.");
3049 fpCommand -> SetGuidance
3050 (
"In the last case the names of all volumes in all worlds are matched"
3051 "\nagainst physical-volume-name. If this is of the form \"/regexp/\","
3052 "\nwhere regexp is a regular expression (see C++ regex), the match uses"
3053 "\nthe usual rules of regular expression matching. Otherwise an exact"
3054 "\nmatch is required."
3055 "\nFor example, \"/Shap/\" adds \"Shape1\" and \"Shape2\".");
3056 fpCommand -> SetGuidance
3057 (
"It may help to see a textual representation of the geometry hierarchy of"
3058 "\nthe worlds. Try \"/vis/drawTree [worlds]\" or one of the driver/browser"
3059 "\ncombinations that have the required functionality, e.g., HepRepFile.");
3060 fpCommand -> SetGuidance
3061 (
"If clip-volume-type is specified, the subsequent parameters are used to"
3062 "\nto define a clipping volume. For example,"
3063 "\n\"/vis/scene/add/volume ! ! ! -box km 0 1 0 1 0 1\" will draw the world"
3064 "\nwith the positive octant cut away. (If the Boolean Processor issues"
3065 "\nwarnings try replacing 0 by 0.000000001 or something.)");
3066 fpCommand -> SetGuidance
3067 (
"If clip-volume-type is prepended with '-', the clip-volume is subtracted"
3068 "\n(cutaway). (This is the default if there is no prepended character.)"
3069 "\nIf '*' is prepended, the intersection of the physical-volume and the"
3070 "\nclip-volume is made. (You can make a section through the detector with"
3071 "\na thin box, for example).");
3072 fpCommand -> SetGuidance
3073 (
"For \"box\", the parameters are xmin,xmax,ymin,ymax,zmin,zmax."
3074 "\nOnly \"box\" is programmed at present.");
3076 parameter =
new G4UIparameter (
"physical-volume-name",
's', omitable =
true);
3077 parameter -> SetDefaultValue (
"world");
3078 fpCommand -> SetParameter (parameter);
3079 parameter =
new G4UIparameter (
"copy-no",
'i', omitable =
true);
3080 parameter -> SetGuidance (
"If negative, matches any copy no.");
3081 parameter -> SetDefaultValue (-1);
3082 fpCommand -> SetParameter (parameter);
3083 parameter =
new G4UIparameter (
"depth-of-descent",
'i', omitable =
true);
3084 parameter -> SetGuidance
3085 (
"Depth of descent of geometry hierarchy. Default = unlimited depth.");
3087 fpCommand -> SetParameter (parameter);
3088 parameter =
new G4UIparameter (
"clip-volume-type",
's', omitable =
true);
3089 parameter -> SetParameterCandidates(
"none box -box *box");
3090 parameter -> SetDefaultValue (
"none");
3091 parameter -> SetGuidance(
"[-|*]type. See general guidance.");
3092 fpCommand -> SetParameter (parameter);
3093 parameter =
new G4UIparameter (
"parameter-unit",
's', omitable =
true);
3094 parameter -> SetDefaultValue (
"m");
3095 fpCommand -> SetParameter (parameter);
3096 parameter =
new G4UIparameter (
"parameter-1",
'd', omitable =
true);
3097 parameter -> SetDefaultValue (0.);
3098 fpCommand -> SetParameter (parameter);
3099 parameter =
new G4UIparameter (
"parameter-2",
'd', omitable =
true);
3100 parameter -> SetDefaultValue (0.);
3101 fpCommand -> SetParameter (parameter);
3102 parameter =
new G4UIparameter (
"parameter-3",
'd', omitable =
true);
3103 parameter -> SetDefaultValue (0.);
3104 fpCommand -> SetParameter (parameter);
3105 parameter =
new G4UIparameter (
"parameter-4",
'd', omitable =
true);
3106 parameter -> SetDefaultValue (0.);
3107 fpCommand -> SetParameter (parameter);
3108 parameter =
new G4UIparameter (
"parameter-5",
'd', omitable =
true);
3109 parameter -> SetDefaultValue (0.);
3110 fpCommand -> SetParameter (parameter);
3111 parameter =
new G4UIparameter (
"parameter-6",
'd', omitable =
true);
3112 parameter -> SetDefaultValue (0.);
3113 fpCommand -> SetParameter (parameter);
3121 return "world 0 -1";
3133 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
3138 G4String name, clipVolumeType, parameterUnit;
3139 G4int copyNo, requestedDepthOfDescent;
3140 G4double param1, param2, param3, param4, param5, param6;
3141 std::istringstream is (newValue);
3142 is >> name >> copyNo >> requestedDepthOfDescent
3143 >> clipVolumeType >> parameterUnit
3144 >> param1 >> param2 >> param3 >> param4 >> param5 >> param6;
3147 if (clipVolumeType[
size_t(0)] ==
'-') {
3148 clipVolumeType = clipVolumeType.substr(1);
3149 }
else if (clipVolumeType[
size_t(0)] ==
'*') {
3151 clipVolumeType = clipVolumeType.substr(1);
3154 param1 *= unit; param2 *= unit; param3 *= unit;
3155 param4 *= unit; param5 *= unit; param6 *= unit;
3158 if (clipVolumeType ==
"box") {
3159 const G4double dX = (param2 - param1) / 2.;
3160 const G4double dY = (param4 - param3) / 2.;
3161 const G4double dZ = (param6 - param5) / 2.;
3162 const G4double x0 = (param2 + param1) / 2.;
3163 const G4double y0 = (param4 + param3) / 2.;
3164 const G4double z0 = (param6 + param5) / 2.;
3166 (
"_displaced_clipping_box",
3167 new G4Box(
"_clipping_box",dX,dY,dZ),
3174 size_t nWorlds = transportationManager->
GetNoWorlds();
3177 static G4bool warned =
false;
3178 if (!warned && name !=
"worlds") {
3180 "WARNING: Parallel worlds in operation. To visualise, specify"
3181 "\n \"worlds\" or the parallel world volume or sub-volume name"
3182 "\n and control visibility with /vis/geometry."
3184 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3186 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3187 G4warn <<
" World " << i <<
": " << (*iterWorld)->GetName()
3201 "ERROR: G4VisCommandSceneAddVolume::SetNewValue:"
3202 "\n No world. Maybe the geometry has not yet been defined."
3203 "\n Try \"/run/initialize\""
3209 std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
3221 G4bool useFullExtent =
false;
3229 if (name ==
"world") {
3231 findingsVector.push_back
3234 }
else if (name ==
"worlds") {
3239 "WARNING: G4VisCommandSceneAddVolume::SetNewValue:"
3240 "\n Parallel worlds requested but none exist."
3241 "\n Just adding material world."
3245 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3247 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3248 findingsVector.push_back
3250 (*iterWorld,*iterWorld));
3260 useFullExtent =
true;
3262 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3264 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3268 requestedDepthOfDescent,
3274 for (
const auto& findings: searchScene.
GetFindings()) {
3275 findingsVector.push_back(findings);
3280 for (
const auto& findings: findingsVector) {
3282 findings.fpFoundPV->SetCopyNo(findings.fFoundPVCopyNo);
3284 (findings.fpFoundPV,
3285 requestedDepthOfDescent,
3286 findings.fFoundObjectTransformation,
3289 findings.fFoundBasePVPath);
3290 if (clippingSolid) {
3294 if (!foundPVModel->
Validate(warn))
return;
3299 G4cout <<
"\"" << findings.fpFoundPV->GetName()
3300 <<
"\", copy no. " << findings.fFoundPVCopyNo
3301 <<
",\n found in searched volume \""
3302 << findings.fpSearchPV->GetName()
3303 <<
"\" at depth " << findings.fFoundDepth
3304 <<
",\n base path: \"" << findings.fFoundBasePVPath
3305 <<
"\",\n with a requested depth of further descent of ";
3306 if (requestedDepthOfDescent < 0) {
3307 G4cout <<
"<0 (unlimited)";
3310 G4cout << requestedDepthOfDescent;
3312 G4cout <<
",\n has been added to scene \"" << pScene->
GetName() <<
"\"."
3320 if (findingsVector.empty()) {
3322 G4warn <<
"ERROR: Volume \"" << name <<
"\"";
3324 G4warn <<
", copy no. " << copyNo <<
",";
3339 fpCommand =
new G4UIcommand(
"/vis/scene/add/plotter",
this);
3340 fpCommand -> SetGuidance (
"Add a plotter to current scene.");
3359 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
3367 const G4String& currentSceneName = pScene -> GetName ();
3368 G4bool successful = pScene -> AddEndOfRunModel(model, warn);
3373 <<
"\" has been added to scene \"" << currentSceneName <<
"\"."
HepGeom::Point3D< G4double > G4Point3D
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Vector3D< G4double > G4Vector3D
G4GLOB_DLL std::ostream G4cout
HepRotation & rotateZ(double delta)
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true, G4bool reverseSearch=false) const
static G4LogicalVolumeStore * GetInstance()
void SetClippingSolid(G4VSolid *pClippingSolid)
G4bool Validate(G4bool warn)
void SetClippingMode(ClippingMode mode)
void DescribeYourselfTo(G4VGraphicsScene &)
const std::vector< Findings > & GetFindings() const
G4Plotter & GetPlotter(const G4String &a_name)
static G4PlotterManager & GetInstance()
const std::map< G4String, G4AttDef > * GetAttDefs() const override
const std::map< G4String, G4AttDef > * GetAttDefs() const override
static G4RunManager * GetMasterRunManager()
const G4Run * GetCurrentRun() const
std::vector< const G4Event * > * GetEventVector() const
G4int GetNumberOfEventToBeProcessed() const
G4bool AddRunDurationModel(G4VModel *, G4bool warn=false)
const G4VisExtent & GetExtent() const
const G4String & GetName() const
const std::vector< Model > & GetEndOfEventModelList() const
const std::map< G4String, G4AttDef > * GetAttDefs() const override
const std::map< G4String, G4AttDef > * GetAttDefs() const override
G4double GetYOffset() const
G4double GetXOffset() const
void SetOffset(double dx, double dy)
const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::map< G4String, G4AttDef > * GetAttDefs() const override
const std::map< G4String, G4AttDef > * GetAttDefs() const override
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
std::size_t GetNoWorlds() const
G4UIcommand * FindPath(const char *commandPath) const
static G4double ValueOf(const char *unitName)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4bool ConvertToBool(const char *st)
G4UIcommandTree * GetTree() const
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
G4double StoD(const G4String &s)
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
G4double GetScreenSize() const
void SetScreenSize(G4double)
G4Point3D GetPosition() const
void SetType(const G4String &)
void SetGlobalDescription(const G4String &)
virtual G4String GetCurrentDescription() const
void SetGlobalTag(const G4String &)
void SetExtent(const G4VisExtent &)
const G4VisExtent & GetExtent() const
const G4ViewParameters & GetViewParameters() const
static G4double fCurrentTextSize
void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
static G4Colour fCurrentTextColour
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
static std::vector< G4PhysicalVolumesSearchScene::Findings > fCurrrentPVFindingsForField
void ConvertToColour(G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
static G4VisManager * fpVisManager
static G4VisExtent fCurrentExtentForField
const G4String & ConvertToColourGuidance()
void CopyParametersFrom(const G4UIcommand *fromCmd, G4UIcommand *toCmd)
static G4int fCurrentArrow3DLineSegmentsPerCircle
static G4Text::Layout fCurrentTextLayout
static G4double fCurrentLineWidth
static G4Colour fCurrentColour
void CopyGuidanceFrom(const G4UIcommand *fromCmd, G4UIcommand *toCmd, G4int startLine=0)
const G4Vector3D & GetViewpointDirection() const
const G4Vector3D & GetUpVector() const
void SetColour(const G4Colour &)
void SetLineWidth(G4double)
void SetForceSolid(G4bool=true)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddArrow2D()
G4VisCommandSceneAddArrow2D()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddArrow()
virtual ~G4VisCommandSceneAddArrow()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSceneAddAxes()
virtual ~G4VisCommandSceneAddAxes()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddDate()
G4VisCommandSceneAddDate()
G4VisCommandSceneAddDigis()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddDigis()
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddElectricField()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSceneAddElectricField()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddEventID()
virtual ~G4VisCommandSceneAddEventID()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddExtent()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddExtent()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSceneAddFrame()
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddFrame()
virtual ~G4VisCommandSceneAddGPS()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddGPS()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddHits()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddHits()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSceneAddLine2D()
virtual ~G4VisCommandSceneAddLine2D()
G4VisCommandSceneAddLine()
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddLine()
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddLocalAxes()
G4VisCommandSceneAddLocalAxes()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddLogicalVolume()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddLogicalVolume()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSceneAddLogo2D()
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddLogo2D()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddLogo()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddLogo()
virtual ~G4VisCommandSceneAddMagneticField()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddMagneticField()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddPSHits()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddPSHits()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddPlotter()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddPlotter()
virtual ~G4VisCommandSceneAddScale()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSceneAddScale()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddText2D()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddText2D()
virtual ~G4VisCommandSceneAddText()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddText()
G4VisCommandSceneAddTrajectories()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddTrajectories()
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandSceneAddUserAction()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSceneAddUserAction()
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSceneAddVolume()
virtual ~G4VisCommandSceneAddVolume()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4double GetExtentRadius() const
G4VisExtent & Transform(const G4Transform3D &)
G4Scene * GetCurrentScene() const
const std::vector< UserVisAction > & GetRunDurationUserVisActions() const
const std::map< G4VUserVisAction *, G4VisExtent > & GetUserVisActionExtents() const
const std::vector< UserVisAction > & GetEndOfRunUserVisActions() const
G4VViewer * GetCurrentViewer() const
const std::vector< UserVisAction > & GetEndOfEventUserVisActions() const
static Verbosity GetVerbosity()
void SetVisAttributes(const G4VisAttributes *)
BasicVector3D< T > unit() const
HepPolyhedron & Transform(const G4Transform3D &t)