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.");
172 fpCommand -> SetParameter (parameter);
174 fpCommand -> SetParameter (parameter);
176 fpCommand -> SetParameter (parameter);
178 fpCommand -> SetParameter (parameter);
197 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
203 std::istringstream is(newValue);
204 is >> x1 >> y1 >> x2 >> y2;
206 Arrow2D* arrow2D =
new Arrow2D
213 const G4String& currentSceneName = pScene -> GetName ();
214 G4bool successful = pScene -> AddRunDurationModel (model, warn);
217 G4cout <<
"A 2D arrow has been added to scene \""
218 << currentSceneName <<
"\"."
227G4VisCommandSceneAddArrow2D::Arrow2D::Arrow2D
231 fWidth(width), fColour(colour)
233 fShaftPolyline.push_back(
G4Point3D(x1,y1,0));
234 fShaftPolyline.push_back(
G4Point3D(x2,y2,0));
236 G4Vector3D arrowPointLeftDirection(arrowDirection);
237 arrowPointLeftDirection.rotateZ(150.*deg);
238 G4Vector3D arrowPointRightDirection(arrowDirection);
239 arrowPointRightDirection.rotateZ(-150.*deg);
240 fHeadPolyline.push_back(
G4Point3D(x2,y2,0)+0.04*arrowPointLeftDirection);
241 fHeadPolyline.push_back(
G4Point3D(x2,y2,0));
242 fHeadPolyline.push_back(
G4Point3D(x2,y2,0)+0.04*arrowPointRightDirection);
246 fShaftPolyline.SetVisAttributes(va);
247 fHeadPolyline.SetVisAttributes(va);
250void G4VisCommandSceneAddArrow2D::Arrow2D::operator()
253 sceneHandler.BeginPrimitives2D();
254 sceneHandler.AddPrimitive(fShaftPolyline);
255 sceneHandler.AddPrimitive(fHeadPolyline);
256 sceneHandler.EndPrimitives2D();
263 fpCommand =
new G4UIcommand (
"/vis/scene/add/axes",
this);
264 fpCommand -> SetGuidance (
"Add axes.");
265 fpCommand -> SetGuidance
266 (
"Draws axes at (x0, y0, z0) of given length and colour.");
267 fpCommand -> SetGuidance
268 (
"If \"colour-string\" is \"auto\", x, y and z will be red, green and blue"
269 "\n respectively. Otherwise it can be one of the pre-defined text-specified"
270 "\n colours - see information printed by the vis manager at start-up or"
271 "\n use \"/vis/list\".");
272 fpCommand -> SetGuidance
273 (
"If \"length\" is negative, it is set to about 25% of scene extent.");
274 fpCommand -> SetGuidance
275 (
"If \"showtext\" is false, annotations are suppressed.");
286 parameter =
new G4UIparameter (
"length",
'd', omitable =
true);
289 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
292 parameter =
new G4UIparameter (
"colour-string",
's', omitable =
true);
295 parameter =
new G4UIparameter (
"showtext",
'b', omitable =
true);
316 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
323 <<
"ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"."
330 G4String unitString, colourString, showTextString;
332 std::istringstream is (newValue);
333 is >> x0 >> y0 >> z0 >> length >> unitString
334 >> colourString >> showTextString;
339 x0 *= unit; y0 *= unit; z0 *= unit;
343 const G4double intLog10Length = std::floor(std::log10(lengthMax));
344 length = std::pow(10,intLog10Length);
345 if (5.*length < lengthMax) length *= 5.;
346 else if (2.*length < lengthMax) length *= 2.;
355 if (arrowWidth > length/30.) arrowWidth = length/30.;
358 (x0, y0, z0, length, arrowWidth, colourString, newValue,
361 G4bool successful = pScene -> AddRunDurationModel (model, warn);
362 const G4String& currentSceneName = pScene -> GetName ();
366 <<
"have been added to scene \"" << currentSceneName <<
"\"."
379 fpCommand =
new G4UIcommand (
"/vis/scene/add/date",
this);
380 fpCommand -> SetGuidance (
"Adds date to current scene.");
381 fpCommand -> SetGuidance
382 (
"If \"date\"is omitted, the current date and time is drawn."
383 "\nOtherwise, the string, including the rest of the line, is drawn.");
385 parameter =
new G4UIparameter (
"size",
'i', omitable =
true);
386 parameter -> SetGuidance (
"Screen size of text in pixels.");
387 parameter -> SetDefaultValue (18);
388 fpCommand -> SetParameter (parameter);
389 parameter =
new G4UIparameter (
"x-position",
'd', omitable =
true);
390 parameter -> SetGuidance (
"x screen position in range -1 < x < 1.");
391 parameter -> SetDefaultValue (0.95);
392 fpCommand -> SetParameter (parameter);
393 parameter =
new G4UIparameter (
"y-position",
'd', omitable =
true);
394 parameter -> SetGuidance (
"y screen position in range -1 < y < 1.");
395 parameter -> SetDefaultValue (0.9);
396 fpCommand -> SetParameter (parameter);
397 parameter =
new G4UIparameter (
"layout",
's', omitable =
true);
398 parameter -> SetGuidance (
"Layout, i.e., adjustment: left|centre|right.");
399 parameter -> SetDefaultValue (
"right");
400 fpCommand -> SetParameter (parameter);
401 parameter =
new G4UIparameter (
"date",
's', omitable =
true);
402 parameter -> SetDefaultValue (
"-");
403 fpCommand -> SetParameter (parameter);
422 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
430 std::istringstream is(newValue);
431 is >> size >> x >> y >> layoutString >> dateString;
433 const size_t NREMAINDER = 100;
434 char remainder[NREMAINDER];
436 is.getline(remainder, NREMAINDER);
437 dateString += remainder;
443 Date* date =
new Date(
fpVisManager, size, x, y, layout, dateString);
449 const G4String& currentSceneName = pScene -> GetName ();
450 G4bool successful = pScene -> AddRunDurationModel (model, warn);
453 G4cout <<
"Date has been added to scene \""
454 << currentSceneName <<
"\"."
463void G4VisCommandSceneAddDate::Date::operator()
468 time = fTimer.GetClockTime();
473 std::string::size_type i = time.rfind(
'\n');
474 if (i != std::string::npos) time.erase(i);
476 text.SetScreenSize(fSize);
477 text.SetLayout(fLayout);
479 text.SetVisAttributes(textAtts);
480 sceneHandler.BeginPrimitives2D();
481 sceneHandler.AddPrimitive(text);
482 sceneHandler.EndPrimitives2D();
489 fpCommand -> SetGuidance (
"Adds digis to current scene.");
490 fpCommand -> SetGuidance
491 (
"Digis are drawn at end of event when the scene in which"
492 "\nthey are added is current.");
511 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
517 const G4String& currentSceneName = pScene -> GetName ();
518 G4bool successful = pScene -> AddEndOfEventModel (model, warn);
521 G4cout <<
"Digis, if any, will be drawn at end of run in scene \""
522 << currentSceneName <<
"\"."
535 fpCommand =
new G4UIcommand (
"/vis/scene/add/electricField",
this);
536 fpCommand -> SetGuidance
537 (
"Adds electric field representation to current scene.");
538 fpCommand -> SetGuidance
539 (
"The first parameter is no. of data points per half extent. So, possibly, at"
540 "\nmaximum, the number of data points sampled is (2*n+1)^3, which can grow"
541 "\nlarge--be warned!"
542 "\nThe default value is 10, i.e., a 21x21x21 array, i.e., 9,261 sampling points."
543 "\nThat may swamp your view, but usually, a field is limited to a small part of"
544 "\nthe extent, so it's not a problem. But if it is, here are some of the things"
546 "\n- reduce the number of data points per half extent (first parameter);"
547 "\n- specify \"lightArrow\" (second parameter);"
548 "\n- restrict the region sampled with \"/vis/set/extentForField\";"
549 "\n- restrict the drawing to a specific volume with"
550 "\n \"/vis/set/volumeForField\" or \"/vis/touchable/volumeForField\"."
551 "\nNote: you might have to deactivate existing field models with"
552 "\n \"/vis/scene/activateModel Field false\" and re-issue"
553 "\n \"/vis/scene/add/...Field\" command again.");
554 fpCommand -> SetGuidance
555 (
"In the arrow representation, the length of the arrow is proportional"
556 "\nto the magnitude of the field and the colour is mapped onto the range"
557 "\nas a fraction of the maximum magnitude: 0->0.5->1 is red->green->blue.");
559 parameter =
new G4UIparameter (
"nDataPointsPerHalfExtent",
'i', omitable =
true);
560 parameter -> SetDefaultValue (10);
561 fpCommand -> SetParameter (parameter);
562 parameter =
new G4UIparameter (
"representation",
's', omitable =
true);
563 parameter -> SetParameterCandidates(
"fullArrow lightArrow");
564 parameter -> SetDefaultValue (
"fullArrow");
565 fpCommand -> SetParameter (parameter);
585 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
590 G4int nDataPointsPerHalfExtent;
592 std::istringstream iss(newValue);
593 iss >> nDataPointsPerHalfExtent >> representation;
596 if (representation ==
"lightArrow") {
601 (nDataPointsPerHalfExtent,modelRepresentation,
605 const G4String& currentSceneName = pScene -> GetName ();
606 G4bool successful = pScene -> AddRunDurationModel (model, warn);
610 <<
"Electric field, if any, will be drawn in scene \""
613 << nDataPointsPerHalfExtent
614 <<
" data points per half extent and with representation \""
629 fpCommand =
new G4UIcommand (
"/vis/scene/add/eventID",
this);
630 fpCommand -> SetGuidance (
"Adds eventID to current scene.");
631 fpCommand -> SetGuidance
632 (
"Run and event numbers are drawn at end of event or run when"
633 "\n the scene in which they are added is current.");
635 parameter =
new G4UIparameter (
"size",
'i', omitable =
true);
636 parameter -> SetGuidance (
"Screen size of text in pixels.");
637 parameter -> SetDefaultValue (18);
638 fpCommand -> SetParameter (parameter);
639 parameter =
new G4UIparameter (
"x-position",
'd', omitable =
true);
640 parameter -> SetGuidance (
"x screen position in range -1 < x < 1.");
641 parameter -> SetDefaultValue (-0.95);
642 fpCommand -> SetParameter (parameter);
643 parameter =
new G4UIparameter (
"y-position",
'd', omitable =
true);
644 parameter -> SetGuidance (
"y screen position in range -1 < y < 1.");
645 parameter -> SetDefaultValue (0.9);
646 fpCommand -> SetParameter (parameter);
647 parameter =
new G4UIparameter (
"layout",
's', omitable =
true);
648 parameter -> SetGuidance (
"Layout, i.e., adjustment: left|centre|right.");
649 parameter -> SetDefaultValue (
"left");
650 fpCommand -> SetParameter (parameter);
669 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
677 std::istringstream is(newValue);
678 is >> size >> x >> y >> layoutString;
687 =
new EventID(forEndOfEvent,
fpVisManager, size, x, y, layout);
690 eoeModel->
SetType(
"EoEEventID");
693 G4bool successfulEoE = pScene -> AddEndOfEventModel (eoeModel, warn);
697 =
new EventID(forEndOfRun,
fpVisManager, size, x, y, layout);
700 eorModel->
SetType(
"EoREventID");
703 G4bool successfulEoR = pScene -> AddEndOfRunModel (eorModel, warn);
705 if (successfulEoE && successfulEoR) {
707 const G4String& currentSceneName = pScene -> GetName ();
708 G4cout <<
"EventID has been added to scene \""
709 << currentSceneName <<
"\"."
718void G4VisCommandSceneAddEventID::EventID::operator()
726 if (!currentRun)
return;
730 std::ostringstream oss;
735 if (!fpVisManager->GetReviewingKeptEvents())
return;
736 const G4Event* currentEvent = mp->GetEvent();
737 if (!currentEvent)
return;
739 oss <<
"Run " << currentRunID <<
" Event " << eventID;
745 if (fpVisManager->GetReviewingKeptEvents())
return;
748 size_t nKeptEvents = events? events->size(): 0;
749 oss <<
"Run " << currentRunID <<
" (" << nEvents <<
" event";
750 if (nEvents != 1) oss <<
's';
751 oss <<
", " << nKeptEvents <<
" kept)";
759 text.SetScreenSize(fSize);
760 text.SetLayout(fLayout);
762 text.SetVisAttributes(textAtts);
763 sceneHandler.BeginPrimitives2D();
764 sceneHandler.AddPrimitive(text);
765 sceneHandler.EndPrimitives2D();
771 fpCommand =
new G4UIcommand(
"/vis/scene/add/extent",
this);
772 fpCommand -> SetGuidance
773 (
"Adds a dummy model with given extent to the current scene."
774 "\nRequires the limits: xmin, xmax, ymin, ymax, zmin, zmax unit."
775 "\nThis can be used to provide an extent to the scene even if"
776 "\nno other models with extent are available. For example,"
777 "\neven if there is no geometry. In that case, for example:"
779 "\n /vis/scene/create"
780 "\n /vis/scene/add/extent -300 300 -300 300 -300 300 cm"
781 "\n /vis/sceneHandler/attach");
784 parameter =
new G4UIparameter (
"xmin",
'd', omitable =
true);
785 parameter -> SetDefaultValue (0.);
786 fpCommand -> SetParameter (parameter);
787 parameter =
new G4UIparameter (
"xmax",
'd', omitable =
true);
788 parameter -> SetDefaultValue (0.);
789 fpCommand -> SetParameter (parameter);
790 parameter =
new G4UIparameter (
"ymin",
'd', omitable =
true);
791 parameter -> SetDefaultValue (0.);
792 fpCommand -> SetParameter (parameter);
793 parameter =
new G4UIparameter (
"ymax",
'd', omitable =
true);
794 parameter -> SetDefaultValue (0.);
795 fpCommand -> SetParameter (parameter);
796 parameter =
new G4UIparameter (
"zmin",
'd', omitable =
true);
797 parameter -> SetDefaultValue (0.);
798 fpCommand -> SetParameter (parameter);
799 parameter =
new G4UIparameter (
"zmax",
'd', omitable =
true);
800 parameter -> SetDefaultValue (0.);
801 fpCommand -> SetParameter (parameter);
802 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
803 parameter -> SetDefaultValue (
"m");
804 fpCommand -> SetParameter (parameter);
823 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
828 G4double xmin, xmax, ymin, ymax, zmin, zmax;
830 std::istringstream is(newValue);
831 is >> xmin >> xmax >> ymin >> ymax >> zmin >> zmax >> unitString;
833 xmin *= unit; xmax *= unit;
834 ymin *= unit; ymax *= unit;
835 zmin *= unit; zmax *= unit;
837 G4VisExtent visExtent(xmin, xmax, ymin, ymax, zmin, zmax);
838 Extent* extent =
new Extent(xmin, xmax, ymin, ymax, zmin, zmax);
845 const G4String& currentSceneName = pScene -> GetName ();
846 G4bool successful = pScene -> AddRunDurationModel (model, warn);
849 G4cout <<
"A benign model with extent "
851 <<
" has been added to scene \""
852 << currentSceneName <<
"\"."
861G4VisCommandSceneAddExtent::Extent::Extent
865fExtent(xmin,xmax,ymin,ymax,zmin,zmax)
868void G4VisCommandSceneAddExtent::Extent::operator()
875 fpCommand =
new G4UIcommand(
"/vis/scene/add/frame",
this);
876 fpCommand -> SetGuidance (
"Add frame to current scene.");
879 parameter =
new G4UIparameter (
"size",
'd', omitable =
true);
880 parameter -> SetGuidance (
"Size of frame. 1 = full window.");
881 parameter -> SetParameterRange (
"size > 0 && size <=1");
882 parameter -> SetDefaultValue (0.97);
883 fpCommand -> SetParameter (parameter);
902 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
908 std::istringstream is(newValue);
917 const G4String& currentSceneName = pScene -> GetName ();
918 G4bool successful = pScene -> AddRunDurationModel (model, warn);
921 G4cout <<
"Frame has been added to scene \""
922 << currentSceneName <<
"\"."
931void G4VisCommandSceneAddFrame::Frame::operator()
935 frame.push_back(
G4Point3D( fSize, fSize, 0.));
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.));
944 sceneHandler.BeginPrimitives2D();
945 sceneHandler.AddPrimitive(frame);
946 sceneHandler.EndPrimitives2D();
954 fpCommand =
new G4UIcommand (
"/vis/scene/add/gps",
this);
955 fpCommand -> SetGuidance
956 (
"A representation of the source(s) of the General Particle Source"
957 "\nwill be added to current scene and drawn, if applicable.");
959 fpCommand->
SetGuidance(
"Default: red and transparent.");
960 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
961 parameter -> SetDefaultValue (
"1.");
962 fpCommand -> SetParameter (parameter);
963 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
964 parameter -> SetDefaultValue (0.);
965 fpCommand -> SetParameter (parameter);
966 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
967 parameter -> SetDefaultValue (0.);
968 fpCommand -> SetParameter (parameter);
969 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
970 parameter -> SetDefaultValue (0.3);
971 fpCommand -> SetParameter (parameter);
990 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
997 std::istringstream iss(newValue);
998 iss >> redOrString >> green >> blue >> opacity;
1003 const G4String& currentSceneName = pScene -> GetName ();
1004 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1008 "A representation of the source(s) of the General Particle Source will be drawn"
1009 "\n in colour " << colour <<
" for scene \""
1010 << currentSceneName <<
"\" if applicable."
1023 fpCommand -> SetGuidance (
"Adds hits to current scene.");
1024 fpCommand -> SetGuidance
1025 (
"Hits are drawn at end of event when the scene in which"
1026 "\nthey are added is current.");
1045 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1051 const G4String& currentSceneName = pScene -> GetName ();
1052 G4bool successful = pScene -> AddEndOfEventModel (model, warn);
1055 G4cout <<
"Hits, if any, will be drawn at end of run in scene \""
1056 << currentSceneName <<
"\"."
1068 fpCommand =
new G4UIcommand(
"/vis/scene/add/line",
this);
1069 fpCommand -> SetGuidance (
"Adds line to current scene.");
1072 parameter =
new G4UIparameter (
"x1",
'd', omitable =
false);
1073 fpCommand -> SetParameter (parameter);
1074 parameter =
new G4UIparameter (
"y1",
'd', omitable =
false);
1075 fpCommand -> SetParameter (parameter);
1076 parameter =
new G4UIparameter (
"z1",
'd', omitable =
false);
1077 fpCommand -> SetParameter (parameter);
1078 parameter =
new G4UIparameter (
"x2",
'd', omitable =
false);
1079 fpCommand -> SetParameter (parameter);
1080 parameter =
new G4UIparameter (
"y2",
'd', omitable =
false);
1081 fpCommand -> SetParameter (parameter);
1082 parameter =
new G4UIparameter (
"z2",
'd', omitable =
false);
1083 fpCommand -> SetParameter (parameter);
1084 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1105 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1112 std::istringstream is(newValue);
1113 is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2 >> unitString;
1115 x1 *= unit; y1 *= unit; z1 *= unit;
1116 x2 *= unit; y2 *= unit; z2 *= unit;
1118 Line* line =
new Line(x1, y1, z1, x2, y2, z2,
1125 const G4String& currentSceneName = pScene -> GetName ();
1126 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1129 G4cout <<
"Line has been added to scene \""
1130 << currentSceneName <<
"\"."
1139G4VisCommandSceneAddLine::Line::Line
1143 fWidth(width), fColour(colour)
1145 fPolyline.push_back(
G4Point3D(x1,y1,z1));
1146 fPolyline.push_back(
G4Point3D(x2,y2,z2));
1150 fPolyline.SetVisAttributes(va);
1153void G4VisCommandSceneAddLine::Line::operator()
1156 sceneHandler.BeginPrimitives();
1157 sceneHandler.AddPrimitive(fPolyline);
1158 sceneHandler.EndPrimitives();
1164 fpCommand =
new G4UIcommand(
"/vis/scene/add/line2D",
this);
1165 fpCommand -> SetGuidance (
"Adds 2D line to current scene.");
1168 parameter =
new G4UIparameter (
"x1",
'd', omitable =
false);
1169 fpCommand -> SetParameter (parameter);
1170 parameter =
new G4UIparameter (
"y1",
'd', omitable =
false);
1171 fpCommand -> SetParameter (parameter);
1172 parameter =
new G4UIparameter (
"x2",
'd', omitable =
false);
1173 fpCommand -> SetParameter (parameter);
1174 parameter =
new G4UIparameter (
"y2",
'd', omitable =
false);
1175 fpCommand -> SetParameter (parameter);
1194 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1200 std::istringstream is(newValue);
1201 is >> x1 >> y1 >> x2 >> y2;
1203 Line2D* line2D =
new Line2D
1210 const G4String& currentSceneName = pScene -> GetName ();
1211 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1214 G4cout <<
"A 2D line has been added to scene \""
1215 << currentSceneName <<
"\"."
1224G4VisCommandSceneAddLine2D::Line2D::Line2D
1228 fWidth(width), fColour(colour)
1230 fPolyline.push_back(
G4Point3D(x1,y1,0));
1231 fPolyline.push_back(
G4Point3D(x2,y2,0));
1235 fPolyline.SetVisAttributes(va);
1238void G4VisCommandSceneAddLine2D::Line2D::operator()
1241 sceneHandler.BeginPrimitives2D();
1242 sceneHandler.AddPrimitive(fPolyline);
1243 sceneHandler.EndPrimitives2D();
1250 fpCommand =
new G4UIcommand (
"/vis/scene/add/localAxes",
this);
1251 fpCommand -> SetGuidance
1252 (
"Adds local axes to physical volume(s).");
1254 parameter =
new G4UIparameter (
"physical-volume-name",
's', omitable =
false);
1255 fpCommand -> SetParameter (parameter);
1256 parameter =
new G4UIparameter (
"copy-no",
'i', omitable =
true);
1257 parameter -> SetGuidance (
"If negative, matches any copy no.");
1258 parameter -> SetDefaultValue (-1);
1259 fpCommand -> SetParameter (parameter);
1267 return "world 0 -1";
1279 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1286 std::istringstream is (newValue);
1287 is >> name >> copyNo;
1289 std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
1294 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
1296 size_t nWorlds = transportationManager->
GetNoWorlds();
1297 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
1306 (&searchModel, name, copyNo);
1308 for (
const auto& findings: searchScene.
GetFindings()) {
1309 findingsVector.push_back(findings);
1314 for (
const auto& findings: findingsVector) {
1317 const auto& extent = findings.fpFoundPV->GetLogicalVolume()->GetSolid()->GetExtent();
1318 const auto& transform = findings.fFoundObjectTransformation;
1320 const G4double lengthMax = extent.GetExtentRadius()/2.;
1321 const G4double intLog10LengthMax = std::floor(std::log10(lengthMax));
1322 G4double length = std::pow(10,intLog10LengthMax);
1323 if (5.*length < lengthMax) length *= 5.;
1324 else if (2.*length < lengthMax) length *= 2.;
1326 const auto& axesModel =
new G4AxesModel(0.,0.,0.,length,transform);
1327 axesModel->SetGlobalTag(
"LocalAxesModel");
1328 std::ostringstream oss; oss
1329 <<
"Local Axes for " << findings.fpFoundPV->GetName()
1330 <<
':' << findings.fFoundPVCopyNo <<
':' <<
id++;
1331 axesModel->SetGlobalDescription(oss.str());
1336 G4cout <<
"\"" << findings.fpFoundPV->GetName()
1337 <<
"\", copy no. " << findings.fFoundPVCopyNo
1338 <<
",\n found in searched volume \""
1339 << findings.fpSearchPV->GetName()
1340 <<
"\" at depth " << findings.fFoundDepth
1341 <<
",\n base path: \"" << findings.fFoundBasePVPath
1342 <<
"\".\n Local axes have been added to scene \""
1343 << pScene->
GetName() <<
"\".";
1345 G4cout <<
" With extent " << extent
1346 <<
"\n at " << transform.getRotation()
1347 <<
" " << transform.getTranslation();
1356 if (findingsVector.empty()) {
1358 G4warn <<
"ERROR: Volume \"" << name <<
"\"";
1360 G4warn <<
", copy no. " << copyNo <<
",";
1375 fpCommand =
new G4UIcommand (
"/vis/scene/add/logicalVolume",
this);
1376 fpCommand -> SetGuidance (
"Adds a logical volume to the current scene,");
1377 fpCommand -> SetGuidance
1378 (
"Shows boolean components (if any), voxels (if any), readout geometry"
1379 "\n (if any), local axes and overlaps (if any), under control of the"
1380 "\n appropriate flag."
1381 "\n Note: voxels are not constructed until start of run -"
1382 "\n \"/run/beamOn\". (For voxels without a run, \"/run/beamOn 0\".)");
1384 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
false);
1385 fpCommand -> SetParameter (parameter);
1386 parameter =
new G4UIparameter (
"depth-of-descent",
'i', omitable =
true);
1387 parameter -> SetGuidance (
"Depth of descent of geometry hierarchy.");
1388 parameter -> SetDefaultValue (1);
1389 fpCommand -> SetParameter (parameter);
1390 parameter =
new G4UIparameter (
"booleans-flag",
'b', omitable =
true);
1391 parameter -> SetDefaultValue (
true);
1392 fpCommand -> SetParameter (parameter);
1393 parameter =
new G4UIparameter (
"voxels-flag",
'b', omitable =
true);
1394 parameter -> SetDefaultValue (
true);
1395 fpCommand -> SetParameter (parameter);
1396 parameter =
new G4UIparameter (
"readout-flag",
'b', omitable =
true);
1397 parameter -> SetDefaultValue (
true);
1398 fpCommand -> SetParameter (parameter);
1399 parameter =
new G4UIparameter (
"axes-flag",
'b', omitable =
true);
1400 parameter -> SetDefaultValue (
true);
1401 parameter -> SetGuidance (
"Set \"false\" to suppress axes.");
1402 fpCommand -> SetParameter (parameter);
1403 parameter =
new G4UIparameter(
"check-overlap-flag",
'b', omitable =
true);
1405 parameter -> SetGuidance (
"Set \"false\" to suppress overlap check.");
1426 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1432 G4int requestedDepthOfDescent;
1433 G4String booleansString, voxelsString, readoutString, axesString;
1435 std::istringstream is (newValue);
1436 is >> name >> requestedDepthOfDescent
1437 >> booleansString >> voxelsString >> readoutString >> axesString
1448 if (pLV ==
nullptr)
return;
1450 const std::vector<G4Scene::Model>& rdModelList =
1451 pScene -> GetRunDurationModelList();
1452 std::vector<G4Scene::Model>::const_iterator i;
1453 for (i = rdModelList.begin(); i != rdModelList.end(); ++i) {
1454 if (i->fpModel->GetGlobalDescription().find(
"Volume") != std::string::npos)
break;
1456 if (i != rdModelList.end()) {
1458 G4warn <<
"There is already a volume, \""
1459 << i->fpModel->GetGlobalDescription()
1460 <<
"\",\n in the run-duration model list of scene \""
1461 << pScene -> GetName()
1462 <<
"\".\n Your logical volume must be the only volume in the scene."
1463 <<
"\n Create a new scene and try again:"
1464 <<
"\n /vis/specify " << name
1466 <<
"\n /vis/scene/create"
1467 <<
"\n /vis/scene/add/logicalVolume " << name
1468 <<
"\n /vis/sceneHandler/attach"
1469 <<
"\n (and also, if necessary, /vis/viewer/flush)"
1476 (pLV, requestedDepthOfDescent, booleans, voxels, readout, checkOverlaps);
1477 const G4String& currentSceneName = pScene -> GetName ();
1478 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1482 G4bool axesSuccessful =
false;
1485 const G4double axisLengthMax = radius / 2.;
1486 const G4double intLog10Length = std::floor(std::log10(axisLengthMax));
1487 G4double axisLength = std::pow(10,intLog10Length);
1488 if (5.*axisLength < axisLengthMax) axisLength *= 5.;
1489 else if (2.*axisLength < axisLengthMax) axisLength *= 2.;
1490 const G4double axisWidth = axisLength / 20.;
1492 axesSuccessful = pScene -> AddRunDurationModel (axesModel, warn);
1503 G4cout <<
"Logical volume \"" << pLV -> GetName ()
1504 <<
"\" with requested depth of descent "
1505 << requestedDepthOfDescent
1507 if (!booleans)
G4cout <<
"out";
1508 G4cout <<
" boolean components, with";
1509 if (!voxels)
G4cout <<
"out";
1510 G4cout <<
" voxels,\n with";
1511 if (!readout)
G4cout <<
"out";
1512 G4cout <<
" readout geometry and with";
1513 if (!checkOverlaps)
G4cout <<
"out";
1514 G4cout <<
" overlap checking"
1515 <<
"\n has been added to scene \"" << currentSceneName <<
"\".";
1517 if (axesSuccessful) {
1519 "\n Axes have also been added at the origin of local cooordinates.";
1522 "\n Axes have not been added for some reason possibly stated above.";
1541 fpCommand =
new G4UIcommand (
"/vis/scene/add/logo",
this);
1542 fpCommand -> SetGuidance (
"Adds a G4 logo to the current scene.");
1543 fpCommand -> SetGuidance
1544 (
"If \"unit\" is \"auto\", height is roughly one tenth of scene extent.");
1545 fpCommand -> SetGuidance
1546 (
"\"direction\" is that of outward-facing normal to front face of logo."
1547 "\nIf \"direction\" is \"auto\", logo faces the user in the current viewer.");
1548 fpCommand -> SetGuidance
1549 (
"\nIf \"placement\" is \"auto\", logo is placed at bottom right of screen"
1550 "\n when viewed from logo direction.");
1552 parameter =
new G4UIparameter (
"height",
'd', omitable =
true);
1555 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1558 parameter =
new G4UIparameter (
"direction",
's', omitable =
true);
1562 parameter =
new G4UIparameter (
"red",
'd', omitable =
true);
1565 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
1568 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
1571 parameter =
new G4UIparameter (
"placement",
's', omitable =
true);
1572 parameter -> SetParameterCandidates(
"auto manual");
1575 parameter =
new G4UIparameter (
"xmid",
'd', omitable =
true);
1578 parameter =
new G4UIparameter (
"ymid",
'd', omitable =
true);
1581 parameter =
new G4UIparameter (
"zmid",
'd', omitable =
true);
1584 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
1605 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1612 <<
"ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"."
1623 "ERROR: G4VisCommandSceneAddLogo::SetNewValue: no viewer."
1624 "\n Auto direction needs a viewer."
1630 G4double userHeight, red, green, blue, xmid, ymid, zmid;
1631 G4String userHeightUnit, direction, placement, positionUnit;
1632 std::istringstream is (newValue);
1633 is >> userHeight >> userHeightUnit >> direction
1634 >> red >> green >> blue
1636 >> xmid >> ymid >> zmid >> positionUnit;
1640 if (userHeightUnit ==
"auto") {
1647 xmid *= unit; ymid *= unit; zmid *= unit;
1649 Direction logoDirection = X;
1650 if (direction ==
"auto") {
1654 if (vp.
x() > vp.
y() && vp.
x() > vp.
z()) logoDirection = X;
1655 else if (vp.
x() < vp.
y() && vp.
x() < vp.
z()) logoDirection = minusX;
1656 else if (vp.
y() > vp.
x() && vp.
y() > vp.
z()) logoDirection = Y;
1657 else if (vp.
y() < vp.
x() && vp.
y() < vp.
z()) logoDirection = minusY;
1658 else if (vp.
z() > vp.
x() && vp.
z() > vp.
y()) logoDirection = Z;
1659 else if (vp.
z() < vp.
x() && vp.
z() < vp.
y()) logoDirection = minusZ;
1661 else if (direction[0] ==
'x') logoDirection = X;
1662 else if (direction[0] ==
'y') logoDirection = Y;
1663 else if (direction[0] ==
'z') logoDirection = Z;
1664 else if (direction[0] ==
'-') {
1665 if (direction[1] ==
'x') logoDirection = minusX;
1666 else if (direction[1] ==
'y') logoDirection = minusY;
1667 else if (direction[1] ==
'z') logoDirection = minusZ;
1670 G4warn <<
"ERROR: Unrecogniseed direction: \""
1671 << direction <<
"\"." <<
G4endl;
1676 G4bool autoPlacing =
false;
if (placement ==
"auto") autoPlacing =
true;
1693 "WARNING: Existing scene does not yet have any extent."
1694 "\n Maybe you have not yet added any geometrical object."
1700 const G4double halfHeight(height / 2.);
1702 const G4double freeHeightFraction (1. + 2. * comfort);
1706 switch (logoDirection) {
1709 if (freeHeightFraction * (xmax - xmin) < height) room =
false;
1713 if (freeHeightFraction * (ymax - ymin) < height) room =
false;
1717 if (freeHeightFraction * (zmax - zmin) < height) room =
false;
1724 "WARNING: Not enough room in existing scene. Maybe logo is too large."
1731 "WARNING: The logo you have asked for is bigger than the existing"
1732 "\n scene. Maybe you have added it too soon. It is recommended that"
1733 "\n you add the logo last so that it can be correctly auto-positioned"
1734 "\n so as not to be obscured by any existing object and so that the"
1735 "\n view parameters can be correctly recalculated."
1740 G4double sxmid(xmid), symid(ymid), szmid(zmid);
1744 const G4double xComfort = comfort * (xmax - xmin);
1745 const G4double yComfort = comfort * (ymax - ymin);
1746 const G4double zComfort = comfort * (zmax - zmin);
1747 switch (logoDirection) {
1749 sxmid = xmax + halfHeight + xComfort;
1750 symid = ymin - yComfort;
1751 szmid = zmin - zComfort;
1754 sxmid = xmin - halfHeight - xComfort;
1755 symid = ymin - yComfort;
1756 szmid = zmax + zComfort;
1759 sxmid = xmin - xComfort;
1760 symid = ymax + halfHeight + yComfort;
1761 szmid = zmin - zComfort;
1764 sxmid = xmax + xComfort;
1765 symid = ymin - halfHeight - yComfort;
1766 szmid = zmin - zComfort;
1769 sxmid = xmax + xComfort;
1770 symid = ymin - yComfort;
1771 szmid = zmax + halfHeight + zComfort;
1774 sxmid = xmin - xComfort;
1775 symid = ymin - yComfort;
1776 szmid = zmin - halfHeight - zComfort;
1782 switch (logoDirection) {
1807 G4Logo* logo =
new G4Logo(height,visAtts,transform);
1819 const G4String& currentSceneName = pScene -> GetName ();
1820 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1823 G4cout <<
"G4 Logo of height " << userHeight <<
' ' << userHeightUnit
1824 <<
", " << direction <<
"-direction, added to scene \""
1825 << currentSceneName <<
"\"";
1827 G4cout <<
"\n with extent " << extent
1839G4VisCommandSceneAddLogo::G4Logo::G4Logo
1854 const G4double xb = -h2, yb = f2 + w;
1855 const G4double dx = xt - xb, dy = yt - yb;
1856 const G4double angle = std::atan2(dy,dx);
1859 const G4double d = std::sqrt(dx * dx + dy * dy);
1862 const G4double x8 = ((-ss * d - dx * (yt - y8)) / dy) + xt;
1864 G4double x9 = ((-(ss - w) * d - dx * (yt - y8)) / dy) + xt;
1866 const G4double xtr = ss - f1, ytr = -ss - f2 -w;
1867 x9 += xtr; y9 += ytr;
1881 G4Tubs tG(
"tG",ri,ro,d2,0.15*pi,1.85*pi);
1882 G4Box bG(
"bG",w2,ro2,d2);
1884 fpG = logoG.CreatePolyhedron();
1885 fpG->SetVisAttributes(visAtts);
1887 fpG->Transform(transform);
1890 G4Box b1(
"b1",h2,h2,d2);
1891 G4Box bS(
"bS",ss,ss,d2+e);
1892 G4Box bS2(
"bS2",ss,ss,d2+2.*e);
1901 fp4 = logo4.CreatePolyhedron();
1910 fp4->SetVisAttributes(visAtts);
1912 fp4->Transform(transform);
1915G4VisCommandSceneAddLogo::G4Logo::~G4Logo() {
1920void G4VisCommandSceneAddLogo::G4Logo::operator()
1922 sceneHandler.BeginPrimitives();
1923 sceneHandler.AddPrimitive(*fpG);
1924 sceneHandler.AddPrimitive(*fp4);
1925 sceneHandler.EndPrimitives();
1932 fpCommand =
new G4UIcommand (
"/vis/scene/add/logo2D",
this);
1933 fpCommand -> SetGuidance (
"Adds 2D logo to current scene.");
1935 parameter =
new G4UIparameter (
"size",
'i', omitable =
true);
1936 parameter -> SetGuidance (
"Screen size of text in pixels.");
1937 parameter -> SetDefaultValue (48);
1938 fpCommand -> SetParameter (parameter);
1939 parameter =
new G4UIparameter (
"x-position",
'd', omitable =
true);
1940 parameter -> SetGuidance (
"x screen position in range -1 < x < 1.");
1941 parameter -> SetDefaultValue (-0.9);
1942 fpCommand -> SetParameter (parameter);
1943 parameter =
new G4UIparameter (
"y-position",
'd', omitable =
true);
1944 parameter -> SetGuidance (
"y screen position in range -1 < y < 1.");
1945 parameter -> SetDefaultValue (-0.9);
1946 fpCommand -> SetParameter (parameter);
1947 parameter =
new G4UIparameter (
"layout",
's', omitable =
true);
1948 parameter -> SetGuidance (
"Layout, i.e., adjustment: left|centre|right.");
1949 parameter -> SetDefaultValue (
"left");
1950 fpCommand -> SetParameter (parameter);
1969 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
1977 std::istringstream is(newValue);
1978 is >> size >> x >> y >> layoutString;
1984 Logo2D* logo2D =
new Logo2D(
fpVisManager, size, x, y, layout);
1990 const G4String& currentSceneName = pScene -> GetName ();
1991 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1994 G4cout <<
"2D logo has been added to scene \""
1995 << currentSceneName <<
"\"."
2004void G4VisCommandSceneAddLogo2D::Logo2D::operator()
2008 text.SetScreenSize(fSize);
2009 text.SetLayout(fLayout);
2011 text.SetVisAttributes(textAtts);
2012 sceneHandler.BeginPrimitives2D();
2013 sceneHandler.AddPrimitive(text);
2014 sceneHandler.EndPrimitives2D();
2020 fpCommand =
new G4UIcommand (
"/vis/scene/add/magneticField",
this);
2021 fpCommand -> SetGuidance
2022 (
"Adds magnetic field representation to current scene.");
2048 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2053 G4int nDataPointsPerHalfScene;
2055 std::istringstream iss(newValue);
2056 iss >> nDataPointsPerHalfScene >> representation;
2059 if (representation ==
"lightArrow") {
2064 (nDataPointsPerHalfScene,modelRepresentation,
2068 const G4String& currentSceneName = pScene -> GetName ();
2069 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2073 <<
"Magnetic field, if any, will be drawn in scene \""
2076 << nDataPointsPerHalfScene
2077 <<
" data points per half extent and with representation \""
2093 fpCommand -> SetGuidance
2094 (
"Adds Primitive Scorer Hits (PSHits) to current scene.");
2095 fpCommand -> SetGuidance
2096 (
"PSHits are drawn at end of run when the scene in which"
2097 "\nthey are added is current.");
2098 fpCommand -> SetGuidance
2099 (
"Optional parameter specifies name of scoring map. By default all"
2100 "\nscoring maps registered with the G4ScoringManager are drawn.");
2101 fpCommand -> SetParameterName (
"mapname", omitable =
true);
2102 fpCommand -> SetDefaultValue (
"all");
2122 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2128 const G4String& currentSceneName = pScene -> GetName ();
2129 G4bool successful = pScene -> AddEndOfRunModel (model, warn);
2132 if (newValue ==
"all") {
2133 G4cout <<
"All Primitive Scorer hits";
2135 G4cout <<
"Hits of Primitive Scorer \"" << newValue <<
'"';
2137 G4cout <<
" will be drawn at end of run in scene \""
2138 << currentSceneName <<
"\"."
2151 fpCommand =
new G4UIcommand (
"/vis/scene/add/scale",
this);
2152 fpCommand -> SetGuidance
2153 (
"Adds an annotated scale line to the current scene.");
2154 fpCommand -> SetGuidance
2155 (
"If \"unit\" is \"auto\", length is roughly one tenth of the scene extent.");
2156 fpCommand -> SetGuidance
2157 (
"If \"direction\" is \"auto\", scale is roughly in the plane of the current view.");
2158 fpCommand -> SetGuidance
2159 (
"If \"placement\" is \"auto\", scale is placed at bottom left of current view."
2160 "\n Otherwise placed at (xmid,ymid,zmid).");
2161 fpCommand -> SetGuidance
2162 (
"An annotated line in the specified direction with tick marks at the"
2163 "\nend. If autoPlacing is true it is required to be centred at the"
2164 "\nfront, right, bottom corner of the world space, comfortably outside"
2165 "\nthe existing bounding box/sphere so that existing objects do not"
2166 "\nobscure it. Otherwise it is required to be drawn with mid-point at"
2167 "\n(xmid, ymid, zmid)."
2169 "\nThe auto placing algorithm is (approx):"
2170 "\n x = xmin + (1 + comfort) * (xmax - xmin);"
2171 "\n y = ymin - comfort * (ymax - ymin);"
2172 "\n z = zmin + (1 + comfort) * (zmax - zmin);"
2173 "\n if direction == x then (x - length,y,z) to (x,y,z);"
2174 "\n if direction == y then (x,y,z) to (x,y + length,z);"
2175 "\n if direction == z then (x,y,z - length) to (x,y,z);"
2178 parameter =
new G4UIparameter (
"length",
'd', omitable =
true);
2181 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
2184 parameter =
new G4UIparameter (
"direction",
's', omitable =
true);
2188 parameter =
new G4UIparameter (
"red",
'd', omitable =
true);
2191 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
2194 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
2197 parameter =
new G4UIparameter (
"placement",
's', omitable =
true);
2198 parameter -> SetParameterCandidates(
"auto manual");
2201 parameter =
new G4UIparameter (
"xmid",
'd', omitable =
true);
2204 parameter =
new G4UIparameter (
"ymid",
'd', omitable =
true);
2207 parameter =
new G4UIparameter (
"zmid",
'd', omitable =
true);
2210 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
2231 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2238 <<
"ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"."
2245 G4double userLength, red, green, blue, xmid, ymid, zmid;
2246 G4String userLengthUnit, direction, placement, positionUnit;
2247 std::istringstream is (newValue);
2248 is >> userLength >> userLengthUnit >> direction
2249 >> red >> green >> blue
2251 >> xmid >> ymid >> zmid >> positionUnit;
2255 if (userLengthUnit ==
"auto") {
2257 const G4double intLog10Length = std::floor(std::log10(lengthMax));
2258 length = std::pow(10,intLog10Length);
2259 if (5.*length < lengthMax) length *= 5.;
2260 else if (2.*length < lengthMax) length *= 2.;
2267 xmid *= unit; ymid *= unit; zmid *= unit;
2269 Scale::Direction scaleDirection (Scale::x);
2270 if (direction[0] ==
'y') scaleDirection = Scale::y;
2271 if (direction[0] ==
'z') scaleDirection = Scale::z;
2277 "ERROR: G4VisCommandSceneAddScale::SetNewValue: no viewer."
2278 "\n Auto direction needs a viewer."
2289 if (direction ==
"auto") {
2290 if (std::abs(vp.
x()) > std::abs(vp.
y()) &&
2291 std::abs(vp.
x()) > std::abs(vp.
z())) {
2292 if (std::abs(up.
y()) > std::abs(up.
z())) scaleDirection = Scale::z;
2293 else scaleDirection = Scale::y;
2295 else if (std::abs(vp.
y()) > std::abs(vp.
x()) &&
2296 std::abs(vp.
y()) > std::abs(vp.
z())) {
2297 if (std::abs(up.
x()) > std::abs(up.
z())) scaleDirection = Scale::z;
2298 else scaleDirection = Scale::x;
2300 else if (std::abs(vp.
z()) > std::abs(vp.
x()) &&
2301 std::abs(vp.
z()) > std::abs(vp.
y())) {
2302 if (std::abs(up.
y()) > std::abs(up.
x())) scaleDirection = Scale::x;
2303 else scaleDirection = Scale::y;
2307 G4bool autoPlacing =
false;
if (placement ==
"auto") autoPlacing =
true;
2311 const G4double halfLength(length / 2.);
2313 const G4double freeLengthFraction (1. + 2. * comfort);
2328 "WARNING: Existing scene does not yet have any extent."
2329 "\n Maybe you have not yet added any geometrical object."
2336 switch (scaleDirection) {
2338 if (freeLengthFraction * (xmax - xmin) < length) room =
false;
2341 if (freeLengthFraction * (ymax - ymin) < length) room =
false;
2344 if (freeLengthFraction * (zmax - zmin) < length) room =
false;
2351 "WARNING: Not enough room in existing scene. Maybe scale is too long."
2358 "WARNING: The scale you have asked for is bigger than the existing"
2359 "\n scene. Maybe you have added it too soon. It is recommended that"
2360 "\n you add the scale last so that it can be correctly auto-positioned"
2361 "\n so as not to be obscured by any existing object and so that the"
2362 "\n view parameters can be correctly recalculated."
2390 G4double sxmid(xmid), symid(ymid), szmid(zmid);
2394 const G4double xComfort = comfort * (xmax - xmin);
2395 const G4double yComfort = comfort * (ymax - ymin);
2396 const G4double zComfort = comfort * (zmax - zmin);
2397 switch (scaleDirection) {
2400 sxmid = xmax + xComfort;
2401 symid = ymin - yComfort;
2402 szmid = zmin - zComfort;
2404 sxmid = xmin - xComfort;
2405 symid = ymin - yComfort;
2406 szmid = zmax + zComfort;
2411 sxmid = xmin - xComfort;
2412 symid = ymax + yComfort;
2413 szmid = zmin - zComfort;
2415 sxmid = xmax + xComfort;
2416 symid = ymin - yComfort;
2417 szmid = zmin - zComfort;
2422 sxmid = xmax + xComfort;
2423 symid = ymin - yComfort;
2424 szmid = zmax + zComfort;
2426 sxmid = xmin - xComfort;
2427 symid = ymin - yComfort;
2428 szmid = zmax + zComfort;
2438 switch (scaleDirection) {
2449 scaleExtent = scaleExtent.
Transform(transform);
2452 if (direction ==
"auto") {
2453 switch (scaleDirection) {
2467 Scale* scale =
new Scale
2468 (visAttr, length, transform,
2476 const G4String& currentSceneName = pScene -> GetName ();
2477 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2480 G4cout <<
"Scale of " << annotation
2481 <<
" added to scene \"" << currentSceneName <<
"\".";
2483 G4cout <<
"\n with extent " << scaleExtent
2495G4VisCommandSceneAddScale::Scale::Scale
2503 const G4double halfLength(length / 2.);
2504 const G4double tickLength(length / 20.);
2508 fScaleLine.SetVisAttributes(&fVisAtts);
2509 fTick11.SetVisAttributes(&fVisAtts);
2510 fTick12.SetVisAttributes(&fVisAtts);
2511 fTick21.SetVisAttributes(&fVisAtts);
2512 fTick22.SetVisAttributes(&fVisAtts);
2518 fScaleLine.push_back(r1);
2519 fScaleLine.push_back(r2);
2522 fTick11.push_back(r1 + ticky);
2523 fTick11.push_back(r1 - ticky);
2524 fTick12.push_back(r1 + tickz);
2525 fTick12.push_back(r1 - tickz);
2526 fTick21.push_back(r2 + ticky);
2527 fTick21.push_back(r2 - ticky);
2528 fTick22.push_back(r2 + tickz);
2529 fTick22.push_back(r2 - tickz);
2531 fScaleLine.transform(transform);
2532 fTick11.transform(transform);
2533 fTick12.transform(transform);
2534 fTick21.transform(transform);
2535 fTick22.transform(transform);
2537 G4Point3D textPosition(0., tickLength, 0.);
2538 textPosition.transform(transform);
2539 fText =
G4Text(annotation,textPosition);
2540 fText.SetVisAttributes(annotationColour);
2541 fText.SetScreenSize(annotationSize);
2544void G4VisCommandSceneAddScale::Scale::operator()
2548 sceneHandler.BeginPrimitives();
2549 sceneHandler.AddPrimitive(fScaleLine);
2550 sceneHandler.AddPrimitive(fTick11);
2551 sceneHandler.AddPrimitive(fTick12);
2552 sceneHandler.AddPrimitive(fTick21);
2553 sceneHandler.AddPrimitive(fTick22);
2554 sceneHandler.AddPrimitive(fText);
2555 sceneHandler.EndPrimitives();
2562 fpCommand =
new G4UIcommand (
"/vis/scene/add/text",
this);
2563 fpCommand -> SetGuidance (
"Adds text to current scene.");
2564 fpCommand -> SetGuidance
2565 (
"Use \"/vis/set/textColour\" to set colour.");
2566 fpCommand -> SetGuidance
2567 (
"Use \"/vis/set/textLayout\" to set layout:");
2578 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
2581 parameter =
new G4UIparameter (
"font_size",
'd', omitable =
true);
2585 parameter =
new G4UIparameter (
"x_offset",
'd', omitable =
true);
2589 parameter =
new G4UIparameter (
"y_offset",
'd', omitable =
true);
2593 parameter =
new G4UIparameter (
"text",
's', omitable =
true);
2594 parameter->
SetGuidance (
"The rest of the line is text.");
2615 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2631 x *= unit; y *= unit; z *= unit;
2640 const G4String& currentSceneName = pScene -> GetName ();
2641 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2644 G4cout <<
"Text \"" << text
2645 <<
"\" has been added to scene \"" << currentSceneName <<
"\"."
2659 fpCommand =
new G4UIcommand (
"/vis/scene/add/text2D",
this);
2660 fpCommand -> SetGuidance (
"Adds 2D text to current scene.");
2661 fpCommand -> SetGuidance
2662 (
"Use \"/vis/set/textColour\" to set colour.");
2663 fpCommand -> SetGuidance
2664 (
"Use \"/vis/set/textLayout\" to set layout:");
2672 parameter =
new G4UIparameter (
"font_size",
'd', omitable =
true);
2676 parameter =
new G4UIparameter (
"x_offset",
'd', omitable =
true);
2680 parameter =
new G4UIparameter (
"y_offset",
'd', omitable =
true);
2684 parameter =
new G4UIparameter (
"text",
's', omitable =
true);
2685 parameter->
SetGuidance (
"The rest of the line is text.");
2706 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2725 G4Text2D* g4text2D =
new G4Text2D(g4text);
2731 const G4String& currentSceneName = pScene -> GetName ();
2732 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2735 G4cout <<
"2D text \"" << text
2736 <<
"\" has been added to scene \"" << currentSceneName <<
"\"."
2745G4VisCommandSceneAddText2D::G4Text2D::G4Text2D(
const G4Text& text):
2749void G4VisCommandSceneAddText2D::G4Text2D::operator()
2751 sceneHandler.BeginPrimitives2D();
2752 sceneHandler.AddPrimitive(fText);
2753 sceneHandler.EndPrimitives2D();
2762 (
"/vis/scene/add/trajectories",
this);
2763 fpCommand -> SetGuidance
2764 (
"Adds trajectories to current scene.");
2765 fpCommand -> SetGuidance
2766 (
"Causes trajectories, if any, to be drawn at the end of processing an"
2767 "\nevent. Switches on trajectory storing and sets the"
2768 "\ndefault trajectory type.");
2769 fpCommand -> SetGuidance
2770 (
"The command line parameter list determines the default trajectory type."
2771 "\nIf it contains the string \"smooth\", auxiliary inter-step points will"
2772 "\nbe inserted to improve the smoothness of the drawing of a curved"
2774 "\nIf it contains the string \"rich\", significant extra information will"
2775 "\nbe stored in the trajectory (G4RichTrajectory) amenable to modeling"
2776 "\nand filtering with \"/vis/modeling/trajectories/create/drawByAttribute\""
2777 "\nand \"/vis/filtering/trajectories/create/attributeFilter\" commands."
2778 "\nIt may contain both strings in any order.");
2779 fpCommand -> SetGuidance
2780 (
"\nTo switch off trajectory storing: \"/tracking/storeTrajectory 0\"."
2781 "\nSee also \"/vis/scene/endOfEventAction\".");
2782 fpCommand -> SetGuidance
2783 (
"Note: This only sets the default. Independently of the result of this"
2784 "\ncommand, a user may instantiate a trajectory that overrides this default"
2785 "\nin PreUserTrackingAction.");
2786 fpCommand -> SetParameterName (
"default-trajectory-type", omitable =
true);
2787 fpCommand -> SetDefaultValue (
"");
2807 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2811 const G4String& currentSceneName = pScene -> GetName ();
2815 if (newValue.find(
"smooth") != std::string::npos) smooth =
true;
2816 if (newValue.find(
"rich") != std::string::npos) rich =
true;
2817 if (newValue.size() && !(rich || smooth)) {
2819 G4warn <<
"ERROR: Unrecognised parameter \"" << newValue <<
"\""
2820 "\n No action taken."
2828 if (smooth && rich) {
2829 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 4");
2830 defaultTrajectoryType =
"G4RichTrajectory configured for smooth steps";
2831 }
else if (smooth) {
2832 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 2");
2833 defaultTrajectoryType =
"G4SmoothTrajectory";
2835 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 3");
2836 defaultTrajectoryType =
"G4RichTrajectory";
2838 UImanager->
ApplyCommand(
"/tracking/storeTrajectory 1");
2839 defaultTrajectoryType =
"G4Trajectory";
2844 "Attributes available for modeling and filtering with"
2845 "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2846 "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2852 }
else if (smooth) {
2862 auto eoeModel = eoeList.begin();
2863 for (; eoeModel != eoeList.end(); ++eoeModel) {
2864 const auto* actualModel = eoeModel->fpModel;
2867 if (eoeModel == eoeList.end()) {
2870 pScene -> AddEndOfEventModel (model, warn);
2876 G4cout <<
"Default trajectory type " << defaultTrajectoryType
2877 <<
"\n will be used to store trajectories for scene \""
2878 << currentSceneName <<
"\"."
2884 "WARNING: Trajectory storing has been requested. This action may be"
2885 "\n reversed with \"/tracking/storeTrajectory 0\"."
2897 fpCommand -> SetGuidance
2898 (
"Add named Vis User Action to current scene.");
2899 fpCommand -> SetGuidance
2900 (
"Attempts to match search string to name of action - use unique sub-string.");
2901 fpCommand -> SetGuidance
2902 (
"(Use /vis/list to see names of registered actions.)");
2903 fpCommand -> SetGuidance
2904 (
"If name == \"all\" (default), all actions are added.");
2905 fpCommand -> SetParameterName(
"action-name", omitable =
true);
2906 fpCommand -> SetDefaultValue(
"all");
2925 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
2932 const std::vector<G4VisManager::UserVisAction>& runDurationUserVisActions =
2934 for (
size_t i = 0; i < runDurationUserVisActions.size(); i++) {
2935 const G4String& name = runDurationUserVisActions[i].fName;
2936 G4VUserVisAction* visAction = runDurationUserVisActions[i].fpUserVisAction;
2937 if (newValue ==
"all" || name.find(newValue) != std::string::npos) {
2939 AddVisAction(name,visAction,pScene,runDuration,verbosity);
2943 const std::vector<G4VisManager::UserVisAction>& endOfEventUserVisActions =
2945 for (
size_t i = 0; i < endOfEventUserVisActions.size(); i++) {
2946 const G4String& name = endOfEventUserVisActions[i].fName;
2948 if (newValue ==
"all" || name.find(newValue) != std::string::npos) {
2950 AddVisAction(name,visAction,pScene,endOfEvent,verbosity);
2954 const std::vector<G4VisManager::UserVisAction>& endOfRunUserVisActions =
2956 for (
size_t i = 0; i < endOfRunUserVisActions.size(); i++) {
2957 const G4String& name = endOfRunUserVisActions[i].fName;
2959 if (newValue ==
"all" || name.find(newValue) != std::string::npos) {
2961 AddVisAction(name,visAction,pScene,endOfRun,verbosity);
2967 G4warn <<
"WARNING: No User Vis Action registered." <<
G4endl;
2975void G4VisCommandSceneAddUserAction::AddVisAction
2979 G4VisCommandSceneAddUserAction::ActionType type,
2984 const std::map<G4VUserVisAction*,G4VisExtent>& visExtentMap =
2987 std::map<G4VUserVisAction*,G4VisExtent>::const_iterator i =
2988 visExtentMap.find(visAction);
2989 if (i != visExtentMap.end()) extent = i->second;
2993 <<
"WARNING: User Vis Action \"" << name <<
"\" extent is null."
2999 model->
SetType(
"User Vis Action");
3003 G4bool successful =
false;;
3006 successful = pScene -> AddRunDurationModel (model, warn);
3009 successful = pScene -> AddEndOfEventModel (model, warn);
3012 successful = pScene -> AddEndOfRunModel (model, warn);
3017 const G4String& currentSceneName = pScene -> GetName ();
3018 G4cout <<
"User Vis Action added to scene \""
3019 << currentSceneName <<
"\"";
3021 G4cout <<
"\n with extent " << extent;
3033 fpCommand =
new G4UIcommand (
"/vis/scene/add/volume",
this);
3034 fpCommand -> SetGuidance
3035 (
"Adds a physical volume to current scene, with optional clipping volume.");
3036 fpCommand -> SetGuidance
3037 (
"If physical-volume-name is \"world\" (the default), the top of the"
3038 "\nmain geometry tree (material world) is added. If \"worlds\", the"
3039 "\ntops of all worlds - material world and parallel worlds, if any - are"
3040 "\nadded. Otherwise a search of all worlds is made.");
3041 fpCommand -> SetGuidance
3042 (
"In the last case the names of all volumes in all worlds are matched"
3043 "\nagainst physical-volume-name. If this is of the form \"/regexp/\","
3044 "\nwhere regexp is a regular expression (see C++ regex), the match uses"
3045 "\nthe usual rules of regular expression matching. Otherwise an exact"
3046 "\nmatch is required."
3047 "\nFor example, \"/Shap/\" adds \"Shape1\" and \"Shape2\".");
3048 fpCommand -> SetGuidance
3049 (
"It may help to see a textual representation of the geometry hierarchy of"
3050 "\nthe worlds. Try \"/vis/drawTree [worlds]\" or one of the driver/browser"
3051 "\ncombinations that have the required functionality, e.g., HepRepFile.");
3052 fpCommand -> SetGuidance
3053 (
"If clip-volume-type is specified, the subsequent parameters are used to"
3054 "\nto define a clipping volume. For example,"
3055 "\n\"/vis/scene/add/volume ! ! ! -box km 0 1 0 1 0 1\" will draw the world"
3056 "\nwith the positive octant cut away. (If the Boolean Processor issues"
3057 "\nwarnings try replacing 0 by 0.000000001 or something.)");
3058 fpCommand -> SetGuidance
3059 (
"If clip-volume-type is prepended with '-', the clip-volume is subtracted"
3060 "\n(cutaway). (This is the default if there is no prepended character.)"
3061 "\nIf '*' is prepended, the intersection of the physical-volume and the"
3062 "\nclip-volume is made. (You can make a section through the detector with"
3063 "\na thin box, for example).");
3064 fpCommand -> SetGuidance
3065 (
"For \"box\", the parameters are xmin,xmax,ymin,ymax,zmin,zmax."
3066 "\nOnly \"box\" is programmed at present.");
3068 parameter =
new G4UIparameter (
"physical-volume-name",
's', omitable =
true);
3069 parameter -> SetDefaultValue (
"world");
3070 fpCommand -> SetParameter (parameter);
3071 parameter =
new G4UIparameter (
"copy-no",
'i', omitable =
true);
3072 parameter -> SetGuidance (
"If negative, matches any copy no.");
3073 parameter -> SetDefaultValue (-1);
3074 fpCommand -> SetParameter (parameter);
3075 parameter =
new G4UIparameter (
"depth-of-descent",
'i', omitable =
true);
3076 parameter -> SetGuidance
3077 (
"Depth of descent of geometry hierarchy. Default = unlimited depth.");
3079 fpCommand -> SetParameter (parameter);
3080 parameter =
new G4UIparameter (
"clip-volume-type",
's', omitable =
true);
3081 parameter -> SetParameterCandidates(
"none box -box *box");
3082 parameter -> SetDefaultValue (
"none");
3083 parameter -> SetGuidance(
"[-|*]type. See general guidance.");
3084 fpCommand -> SetParameter (parameter);
3085 parameter =
new G4UIparameter (
"parameter-unit",
's', omitable =
true);
3086 parameter -> SetDefaultValue (
"m");
3087 fpCommand -> SetParameter (parameter);
3088 parameter =
new G4UIparameter (
"parameter-1",
'd', omitable =
true);
3089 parameter -> SetDefaultValue (0.);
3090 fpCommand -> SetParameter (parameter);
3091 parameter =
new G4UIparameter (
"parameter-2",
'd', omitable =
true);
3092 parameter -> SetDefaultValue (0.);
3093 fpCommand -> SetParameter (parameter);
3094 parameter =
new G4UIparameter (
"parameter-3",
'd', omitable =
true);
3095 parameter -> SetDefaultValue (0.);
3096 fpCommand -> SetParameter (parameter);
3097 parameter =
new G4UIparameter (
"parameter-4",
'd', omitable =
true);
3098 parameter -> SetDefaultValue (0.);
3099 fpCommand -> SetParameter (parameter);
3100 parameter =
new G4UIparameter (
"parameter-5",
'd', omitable =
true);
3101 parameter -> SetDefaultValue (0.);
3102 fpCommand -> SetParameter (parameter);
3103 parameter =
new G4UIparameter (
"parameter-6",
'd', omitable =
true);
3104 parameter -> SetDefaultValue (0.);
3105 fpCommand -> SetParameter (parameter);
3113 return "world 0 -1";
3125 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
3130 G4String name, clipVolumeType, parameterUnit;
3131 G4int copyNo, requestedDepthOfDescent;
3132 G4double param1, param2, param3, param4, param5, param6;
3133 std::istringstream is (newValue);
3134 is >> name >> copyNo >> requestedDepthOfDescent
3135 >> clipVolumeType >> parameterUnit
3136 >> param1 >> param2 >> param3 >> param4 >> param5 >> param6;
3139 if (clipVolumeType[
size_t(0)] ==
'-') {
3140 clipVolumeType = clipVolumeType.substr(1);
3141 }
else if (clipVolumeType[
size_t(0)] ==
'*') {
3143 clipVolumeType = clipVolumeType.substr(1);
3146 param1 *= unit; param2 *= unit; param3 *= unit;
3147 param4 *= unit; param5 *= unit; param6 *= unit;
3150 if (clipVolumeType ==
"box") {
3151 const G4double dX = (param2 - param1) / 2.;
3152 const G4double dY = (param4 - param3) / 2.;
3153 const G4double dZ = (param6 - param5) / 2.;
3154 const G4double x0 = (param2 + param1) / 2.;
3155 const G4double y0 = (param4 + param3) / 2.;
3156 const G4double z0 = (param6 + param5) / 2.;
3158 (
"_displaced_clipping_box",
3159 new G4Box(
"_clipping_box",dX,dY,dZ),
3166 size_t nWorlds = transportationManager->
GetNoWorlds();
3169 static G4bool warned =
false;
3170 if (!warned && name !=
"worlds") {
3172 "WARNING: Parallel worlds in operation. To visualise, specify"
3173 "\n \"worlds\" or the parallel world volume or sub-volume name"
3174 "\n and control visibility with /vis/geometry."
3176 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3178 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3179 G4warn <<
" World " << i <<
": " << (*iterWorld)->GetName()
3193 "ERROR: G4VisCommandSceneAddVolume::SetNewValue:"
3194 "\n No world. Maybe the geometry has not yet been defined."
3195 "\n Try \"/run/initialize\""
3201 std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
3213 G4bool useFullExtent =
false;
3221 if (name ==
"world") {
3223 findingsVector.push_back
3226 }
else if (name ==
"worlds") {
3231 "WARNING: G4VisCommandSceneAddVolume::SetNewValue:"
3232 "\n Parallel worlds requested but none exist."
3233 "\n Just adding material world."
3237 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3239 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3240 findingsVector.push_back
3242 (*iterWorld,*iterWorld));
3252 useFullExtent =
true;
3254 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3256 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3260 requestedDepthOfDescent,
3266 for (
const auto& findings: searchScene.
GetFindings()) {
3267 findingsVector.push_back(findings);
3272 for (
const auto& findings: findingsVector) {
3274 findings.fpFoundPV->SetCopyNo(findings.fFoundPVCopyNo);
3276 (findings.fpFoundPV,
3277 requestedDepthOfDescent,
3278 findings.fFoundObjectTransformation,
3281 findings.fFoundBasePVPath);
3282 if (clippingSolid) {
3286 if (!foundPVModel->
Validate(warn))
return;
3291 G4cout <<
"\"" << findings.fpFoundPV->GetName()
3292 <<
"\", copy no. " << findings.fFoundPVCopyNo
3293 <<
",\n found in searched volume \""
3294 << findings.fpSearchPV->GetName()
3295 <<
"\" at depth " << findings.fFoundDepth
3296 <<
",\n base path: \"" << findings.fFoundBasePVPath
3297 <<
"\",\n with a requested depth of further descent of ";
3298 if (requestedDepthOfDescent < 0) {
3299 G4cout <<
"<0 (unlimited)";
3302 G4cout << requestedDepthOfDescent;
3304 G4cout <<
",\n has been added to scene \"" << pScene->
GetName() <<
"\"."
3312 if (findingsVector.empty()) {
3314 G4warn <<
"ERROR: Volume \"" << name <<
"\"";
3316 G4warn <<
", copy no. " << copyNo <<
",";
3331 fpCommand =
new G4UIcommand(
"/vis/scene/add/plotter",
this);
3332 fpCommand -> SetGuidance (
"Add a plotter to current scene.");
3351 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
3359 const G4String& currentSceneName = pScene -> GetName ();
3360 G4bool successful = pScene -> AddEndOfRunModel(model, warn);
3365 <<
"\" 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()
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4RunManager * GetMasterRunManager()
const G4Run * GetCurrentRun() const
G4int GetNumberOfEventToBeProcessed() const
const std::vector< const G4Event * > * GetEventVector() const
G4bool AddRunDurationModel(G4VModel *, G4bool warn=false)
const G4VisExtent & GetExtent() const
const G4String & GetName() const
const std::vector< Model > & GetEndOfEventModelList() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
void SetOffset(double dx, double dy)
const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
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)
void SetScreenSize(G4double)
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