56 (
"Copies view parameters.");
58 (
"Copies ALL view parameters (except the autoRefresh status) from"
59 "\nfrom-viewer to current viewer. You may need \"/vis/viewer/rebuild\".");
61 (
"Note: to copy only the camera-specific parameters use"
62 "\n\"/vis/viewer/copyfrom\".");
66 (
"/vis/viewer/set/autoRefresh",
this);
67 fpCommandAutoRefresh->
SetGuidance(
"Sets auto-refresh.");
69 (
"If true, view is automatically refreshed after a change of"
70 "\nview parameters.");
75 (
"/vis/viewer/set/auxiliaryEdge",
this);
76 fpCommandAuxEdge->
SetGuidance(
"Sets visibility of auxiliary edges");
78 (
"Auxiliary edges, i.e., those that are part of a curved surface,"
79 "\nsometimes called soft edges, become visible/invisible.");
84 (
"/vis/viewer/set/background",
this);
86 (
"Set background colour and transparency (default black and opaque).");
88 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
89 parameter -> SetDefaultValue (
"0.");
90 fpCommandBackground -> SetParameter (parameter);
92 parameter -> SetDefaultValue (0.);
93 fpCommandBackground -> SetParameter (parameter);
95 parameter -> SetDefaultValue (0.);
96 fpCommandBackground -> SetParameter (parameter);
97 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
98 parameter -> SetDefaultValue (1.);
99 fpCommandBackground -> SetParameter (parameter);
101 fpCommandCulling =
new G4UIcommand(
"/vis/viewer/set/culling",
this);
102 fpCommandCulling->
SetGuidance (
"Set culling options.");
104 (
"\"global\": enables/disables all other culling options.");
106 (
"\"coveredDaughters\": culls, i.e., eliminates, volumes that would not"
107 "\nbe seen because covered by ancestor volumes in surface drawing mode,"
108 "\nand then only if the ancestors are visible and opaque, and then only"
109 "\nif no sections or cutaways are in operation. Intended solely to"
110 "\nimprove the speed of rendering visible volumes.");
112 (
"\"invisible\": culls objects with the invisible attribute set.");
114 (
"\"density\": culls volumes with density lower than threshold. Useful"
115 "\nfor eliminating \"container volumes\" with no physical correspondence,"
116 "\nwhose material is usually air. If this is selected, provide threshold"
117 "\ndensity and unit (e.g., g/cm3, mg/cm3 or kg/m3)."
119 parameter =
new G4UIparameter(
"culling-option",
's',omitable =
false);
121 (
"global coveredDaughters invisible density");
126 parameter =
new G4UIparameter(
"density-threshold",
'd',omitable =
true);
135 fpCommandCutawayMode =
138 (
"Sets cutaway mode - add (union) or multiply (intersection).");
140 fpCommandCutawayMode->
SetCandidates (
"add union multiply intersection");
144 (
"/vis/viewer/set/defaultColour",
this);
146 (
"Set defaultColour colour and transparency (default white and opaque).");
148 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
149 parameter -> SetDefaultValue (
"1.");
150 fpCommandDefaultColour -> SetParameter (parameter);
151 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
152 parameter -> SetDefaultValue (1.);
153 fpCommandDefaultColour -> SetParameter (parameter);
154 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
155 parameter -> SetDefaultValue (1.);
156 fpCommandDefaultColour -> SetParameter (parameter);
157 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
158 parameter -> SetDefaultValue (1.);
159 fpCommandDefaultColour -> SetParameter (parameter);
162 (
"/vis/viewer/set/defaultTextColour",
this);
164 (
"Set defaultTextColour colour and transparency (default blue and opaque).");
166 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
167 parameter -> SetDefaultValue (
"0.");
168 fpCommandDefaultTextColour -> SetParameter (parameter);
169 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
170 parameter -> SetDefaultValue (0.);
171 fpCommandDefaultTextColour -> SetParameter (parameter);
172 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
173 parameter -> SetDefaultValue (1.);
174 fpCommandDefaultTextColour -> SetParameter (parameter);
175 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
176 parameter -> SetDefaultValue (1.);
177 fpCommandDefaultTextColour -> SetParameter (parameter);
181 (
"Edges become visible/invisible in surface mode.");
186 (
"/vis/viewer/set/explodeFactor",
this);
188 (
"Moves top-level drawn volumes by this factor from this centre.");
189 parameter =
new G4UIparameter(
"explodeFactor",
'd', omitable=
true);
195 parameter->
SetGuidance (
"Coordinate of explode centre.");
199 parameter->
SetGuidance (
"Coordinate of explode centre.");
203 parameter->
SetGuidance (
"Coordinate of explode centre.");
207 parameter->
SetGuidance (
"Unit of explode centre.");
211 (
"/vis/viewer/set/globalLineWidthScale",
this);
213 (
"Multiplies line widths by this factor.");
214 fpCommandGlobalLineWidthScale->
215 SetParameterName(
"scale-factor", omitable=
true);
219 (
"/vis/viewer/set/globalMarkerScale",
this);
221 (
"Multiplies marker sizes by this factor.");
222 fpCommandGlobalMarkerScale->
223 SetParameterName(
"scale-factor", omitable=
true);
226 fpCommandHiddenEdge =
229 (
"Edges become hidden/seen in wireframe or surface mode.");
233 fpCommandHiddenMarker =
236 (
"If true, closer objects hide markers. Otherwise, markers always show.");
241 (
"/vis/viewer/set/lightsMove",
this);
243 (
"Lights move with camera or with object");
246 (
"cam camera with-camera obj object with-object");
249 (
"/vis/viewer/set/lightsThetaPhi",
this);
251 (
"Set direction from target to lights.");
252 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
253 parameter -> SetDefaultValue(60.);
254 fpCommandLightsThetaPhi -> SetParameter (parameter);
256 parameter -> SetDefaultValue(45.);
257 fpCommandLightsThetaPhi -> SetParameter (parameter);
258 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
259 parameter -> SetDefaultValue (
"deg");
260 fpCommandLightsThetaPhi -> SetParameter (parameter);
263 (
"/vis/viewer/set/lightsVector",
this);
265 (
"Set direction from target to lights.");
267 parameter -> SetDefaultValue (1);
268 fpCommandLightsVector -> SetParameter (parameter);
270 parameter -> SetDefaultValue (1);
271 fpCommandLightsVector -> SetParameter (parameter);
273 parameter -> SetDefaultValue (1);
274 fpCommandLightsVector -> SetParameter (parameter);
277 (
"/vis/viewer/set/lineSegmentsPerCircle",
this);
279 (
"Set number of sides per circle for polygon/polyhedron drawing.");
281 (
"Refers to graphical representation of objects with curved lines/surfaces.");
286 (
"/vis/viewer/set/numberOfCloudPoints",
this);
288 (
"Set number of points to be used for cloud representation of volumes.");
293 (
"/vis/viewer/set/picking",
this);
294 fpCommandPicking->
SetGuidance(
"Sets picking, if available.");
296 (
"If true, view is set up for picking, if available.");
298 (
"You may need to issue \"/vis/viewer/update\".");
300 (
"For required actions, watch for instructions for viewer.");
304 fpCommandProjection =
new G4UIcommand(
"/vis/viewer/set/projection",
this);
306 (
"Set projection style - o[rthogonal] or p[erspective]."
307 "\nIf p[erspective], also set field half angle.");
308 parameter =
new G4UIparameter(
"projection",
's',omitable =
true);
312 parameter =
new G4UIparameter(
"field-half-angle",
'd',omitable =
true);
322 (
"/vis/viewer/set/rotationStyle",
this);
324 (
"Set style of rotation - constrainUpDirection or freeRotation.");
326 (
"constrainUpDirection: conventional HEP view.");
328 (
"freeRotation: Google-like rotation, using mouse-grab.");
330 fpCommandRotationStyle->
SetCandidates(
"constrainUpDirection freeRotation");
332 fpCommandSectionPlane =
new G4UIcommand(
"/vis/viewer/set/sectionPlane",
this);
333 fpCommandSectionPlane -> SetGuidance
334 (
"Set plane for drawing section (DCUT).");
335 fpCommandSectionPlane -> SetGuidance
336 (
"E.g., for a y-z plane at x = 1 cm:"
337 "\n\"/vis/viewer/set/sectionPlane on 1 0 0 cm 1 0 0\"."
338 "\nTo turn off: /vis/viewer/set/sectionPlane off");
340 parameter -> SetDefaultValue (
"on");
343 parameter -> SetDefaultValue (0);
344 parameter -> SetGuidance (
"Coordinate of point on the plane.");
347 parameter -> SetDefaultValue (0);
348 parameter -> SetGuidance (
"Coordinate of point on the plane.");
351 parameter -> SetDefaultValue (0);
352 parameter -> SetGuidance (
"Coordinate of point on the plane.");
355 parameter -> SetDefaultValue (
"m");
356 parameter -> SetGuidance (
"Unit of point on the plane.");
359 parameter -> SetDefaultValue (1);
360 parameter -> SetGuidance (
"Component of plane normal.");
363 parameter -> SetDefaultValue (0);
364 parameter -> SetGuidance (
"Component of plane normal.");
367 parameter -> SetDefaultValue (0);
368 parameter -> SetGuidance (
"Component of plane normal.");
373 (
"Set style of drawing - w[ireframe] or s[urface] or c[loud].");
375 (
"(Hidden line drawing is controlled by \"/vis/viewer/set/hiddenEdge\".)");
377 fpCommandStyle->
SetCandidates(
"w wireframe s surface c cloud");
380 (
"/vis/viewer/set/targetPoint",
this);
382 (
"Set target point.");
384 (
"This sets the \"Current Target Point\" relative to the \"Standard");
386 (
"Target Point\" so that the actual target point is as requested.");
388 (
"(See G4ViewParameters.hh for an explanation of target points.)");
393 (
"/vis/viewer/set/upThetaPhi",
this);
394 fpCommandUpThetaPhi -> SetGuidance (
"Set up vector.");
395 fpCommandUpThetaPhi -> SetGuidance
396 (
"Viewer will attempt always to show this direction upwards.");
397 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
398 parameter -> SetDefaultValue (90.);
399 fpCommandUpThetaPhi -> SetParameter (parameter);
401 parameter -> SetDefaultValue (90.);
402 fpCommandUpThetaPhi -> SetParameter (parameter);
403 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
404 parameter -> SetDefaultValue (
"deg");
405 fpCommandUpThetaPhi -> SetParameter (parameter);
408 (
"/vis/viewer/set/upVector",
this);
409 fpCommandUpVector -> SetGuidance (
"Set up vector.");
410 fpCommandUpVector -> SetGuidance
411 (
"Viewer will attempt always to show this direction upwards.");
413 parameter -> SetDefaultValue (0.);
414 fpCommandUpVector -> SetParameter (parameter);
416 parameter -> SetDefaultValue (1.);
417 fpCommandUpVector -> SetParameter (parameter);
419 parameter -> SetDefaultValue (0.);
420 fpCommandUpVector -> SetParameter (parameter);
423 (
"/vis/viewer/set/viewpointThetaPhi",
this);
424 fpCommandViewpointThetaPhi -> SetGuidance
425 (
"Set direction from target to camera.");
426 fpCommandViewpointThetaPhi -> SetGuidance
427 (
"Also changes lightpoint direction if lights are set to move with camera.");
428 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
429 parameter -> SetDefaultValue (60.);
430 fpCommandViewpointThetaPhi -> SetParameter (parameter);
432 parameter -> SetDefaultValue (45.);
433 fpCommandViewpointThetaPhi -> SetParameter (parameter);
434 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
435 parameter -> SetDefaultValue (
"deg");
436 fpCommandViewpointThetaPhi -> SetParameter (parameter);
439 (
"/vis/viewer/set/viewpointVector",
this);
440 fpCommandViewpointVector -> SetGuidance
441 (
"Set direction from target to camera.");
442 fpCommandViewpointVector -> SetGuidance
443 (
"Also changes lightpoint direction if lights are set to move with camera.");
445 parameter -> SetDefaultValue (1.);
446 fpCommandViewpointVector -> SetParameter (parameter);
448 parameter -> SetDefaultValue (1.);
449 fpCommandViewpointVector -> SetParameter (parameter);
451 parameter -> SetDefaultValue (1.);
452 fpCommandViewpointVector -> SetParameter (parameter);
454 fpTimeWindowDirectory =
new G4UIdirectory (
"/vis/viewer/set/timeWindow/");
455 fpTimeWindowDirectory -> SetGuidance (
"Set time window parameters of current viewer.");
457 "For these commands use"
458 "\n /vis/scene/add/trajectories rich"
459 "\n /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns"
461 "\n /vis/viewer/set/timeWindow/displayLightFront true 0 0 -50 cm -0.5 ns"
462 "\n /vis/viewer/set/timeWindow/displayHeadTime true"
463 "\n /vis/viewer/set/timeWindow/fadeFactor 1"
464 "\n /run/beamOn # or several until you get a good event or events"
465 "\n /vis/viewer/set/timeWindow/startTime 0 ns 1 ns"
466 "\n /vis/viewer/save"
467 "\n /vis/viewer/set/timeWindow/startTime 1 ns 1 ns"
468 "\nthen zoom, pan etc to a view of interest and"
469 "\n /vis/viewer/save"
470 "\nthen repeat with next start time, another view and a save, then try"
471 "\n /vis/viewer/interpolate";
473 fpCommandTimeWindowDisplayHeadTime =
474 new G4UIcommand(
"/vis/viewer/set/timeWindow/displayHeadTime",
this);
476 (
"Display head time of range in 2D text.");
477 fpCommandTimeWindowDisplayHeadTime->
SetGuidance(timeWindowGuidance);
478 parameter =
new G4UIparameter (
"displayHeadTime",
'b', omitable =
false);
480 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
481 parameter =
new G4UIparameter (
"screenX",
'd', omitable =
true);
485 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
486 parameter =
new G4UIparameter (
"screenY",
'd', omitable =
true);
490 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
491 parameter =
new G4UIparameter (
"screenSize",
'd', omitable =
true);
493 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
497 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
498 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
501 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
502 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
505 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
507 fpCommandTimeWindowDisplayLightFront =
508 new G4UIcommand(
"/vis/viewer/set/timeWindow/displayLightFront",
this);
510 (
"Display the light front at head time.");
512 (
"Tip: The trajectories can appear of jump ahead of the light front"
513 "\nbecause their time range overlaps the viewer's time range. To"
514 "\naverage out this discrete time effect, advance the light front by"
515 "\nhalf the trajectories interval. E.g., if the trajectory time slice"
516 "\ninterval is 0.01 ns:"
517 "\n /vis/viewer/set/timeWindow/displayLightFront true -90 0 0 mm -0.005 ns"
518 "\nTo prevent them beating the light front at all:"
519 "\n /vis/viewer/set/timeWindow/displayLightFront true -90 0 0 mm -0.01 ns");
520 fpCommandTimeWindowDisplayLightFront->
SetGuidance(timeWindowGuidance);
521 parameter =
new G4UIparameter (
"displayLightFront",
'b', omitable =
true);
523 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
524 parameter =
new G4UIparameter (
"originX",
'd', omitable =
true);
526 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
527 parameter =
new G4UIparameter (
"originY",
'd', omitable =
true);
529 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
530 parameter =
new G4UIparameter (
"originZ",
'd', omitable =
true);
532 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
533 parameter =
new G4UIparameter (
"space_unit",
's', omitable =
true);
535 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
536 parameter =
new G4UIparameter (
"originT",
'd', omitable =
true);
538 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
539 parameter =
new G4UIparameter (
"time_unit",
's', omitable =
true);
541 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
545 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
546 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
549 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
550 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
553 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
555 fpCommandTimeWindowEndTime =
556 new G4UIcommand(
"/vis/viewer/set/timeWindow/endTime",
this);
557 fpCommandTimeWindowEndTime->
SetGuidance(
"Set end and range of track time.");
558 fpCommandTimeWindowEndTime->
SetGuidance(timeWindowGuidance);
559 parameter =
new G4UIparameter (
"end-time",
'd', omitable =
false);
562 parameter =
new G4UIparameter (
"end-time-unit",
's', omitable =
false);
565 parameter =
new G4UIparameter (
"time-range",
'd', omitable =
true);
568 parameter =
new G4UIparameter (
"time-range-unit",
's', omitable =
true);
572 fpCommandTimeWindowFadeFactor =
575 (
"0: no fade; 1: maximum fade with time window.");
576 fpCommandTimeWindowFadeFactor->
SetGuidance(timeWindowGuidance);
577 fpCommandTimeWindowFadeFactor->
SetParameterName(
"fade_factor", omitable =
false);
578 fpCommandTimeWindowFadeFactor->
SetRange(
"fade_factor>=0.&&fade_factor<=1.");
581 fpCommandTimeWindowStartTime =
582 new G4UIcommand(
"/vis/viewer/set/timeWindow/startTime",
this);
583 fpCommandTimeWindowStartTime->
SetGuidance(
"Set start and range of track time.");
584 fpCommandTimeWindowStartTime->
SetGuidance(timeWindowGuidance);
585 parameter =
new G4UIparameter (
"start-time",
'd', omitable =
false);
588 parameter =
new G4UIparameter (
"start-time-unit",
's', omitable =
false);
591 parameter =
new G4UIparameter (
"time-range",
'd', omitable =
true);
594 parameter =
new G4UIparameter (
"time-range-unit",
's', omitable =
true);
600 delete fpCommandTimeWindowStartTime;
601 delete fpCommandTimeWindowFadeFactor;
602 delete fpCommandTimeWindowEndTime;
603 delete fpCommandTimeWindowDisplayLightFront;
604 delete fpCommandTimeWindowDisplayHeadTime;
605 delete fpTimeWindowDirectory;
606 delete fpCommandViewpointVector;
607 delete fpCommandViewpointThetaPhi;
608 delete fpCommandUpVector;
609 delete fpCommandUpThetaPhi;
610 delete fpCommandTargetPoint;
611 delete fpCommandStyle;
612 delete fpCommandSectionPlane;
613 delete fpCommandRotationStyle;
614 delete fpCommandProjection;
615 delete fpCommandPicking;
616 delete fpCommandNumberOfCloudPoints;
617 delete fpCommandLineSegments;
618 delete fpCommandLightsVector;
619 delete fpCommandLightsThetaPhi;
620 delete fpCommandLightsMove;
621 delete fpCommandHiddenMarker;
622 delete fpCommandHiddenEdge;
623 delete fpCommandGlobalMarkerScale;
624 delete fpCommandGlobalLineWidthScale;
625 delete fpCommandExplodeFactor;
626 delete fpCommandEdge;
627 delete fpCommandDefaultTextColour;
628 delete fpCommandDefaultColour;
629 delete fpCommandCutawayMode;
630 delete fpCommandCulling;
631 delete fpCommandBackground;
632 delete fpCommandAuxEdge;
633 delete fpCommandAutoRefresh;
647 if (!currentViewer) {
650 "ERROR: G4VisCommandsViewerSet::SetNewValue: no current viewer."
658 if (command == fpCommandAll) {
663 "ERROR: G4VisCommandsViewerSet::SetNewValue: all:"
664 "\n unrecognised from-viewer."
669 if (fromViewer == currentViewer) {
672 "WARNING: G4VisCommandsViewerSet::SetNewValue: all:"
673 "\n from-viewer and current viewer are identical."
679 G4bool currentAutoRefresh =
684 const std::vector<G4ModelingParameters::VisAttributesModifier>*
687 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator i;
688 for (i = privateVAMs->begin(); i != privateVAMs->end(); ++i) {
693 G4cout <<
"View parameters of viewer \"" << currentViewer->
GetName()
694 <<
"\"\n set to those of viewer \"" << fromViewer->
GetName()
699 G4cout <<
"You may need \"/vis/viewer/rebuild\"."
704 else if (command == fpCommandAutoRefresh) {
712 << currentViewer->
GetName() <<
" is NOT auto-refesh by default"
713 <<
"\n so cannot be set to auto-refresh."
722 G4cout <<
"be automatically refreshed after a change of view parameters."
731 else if (command == fpCommandAuxEdge) {
734 G4cout <<
"Auxiliary edges will ";
740 else if (command == fpCommandBackground) {
743 std::istringstream iss(newValue);
744 iss >> redOrString >> green >> blue >> opacity;
749 G4cout <<
"Background colour "
756 else if (command == fpCommandCulling) {
757 G4String cullingOption, stringFlag, unit;
759 std::istringstream is (newValue);
760 is >> cullingOption >> stringFlag >> density >> unit;
762 if (cullingOption ==
"global") {
766 "G4VisCommandsViewerSet::SetNewValue: culling: global culling flag"
768 ".\n Does not change specific culling flags."
772 else if (cullingOption ==
"coveredDaughters") {
776 "G4VisCommandsViewerSet::SetNewValue: culling: culling covered"
777 "\n daughters flag set to "
779 ". Daughters covered by opaque mothers"
780 "\n will be culled, i.e., not drawn, if this flag is true."
781 "\n Note: this is only effective in surface drawing style,"
782 "\n and then only if the volumes are visible and opaque, and then"
783 "\n only if no sections or cutaways are in operation."
787 else if (cullingOption ==
"invisible") {
791 "G4VisCommandsViewerSet::SetNewValue: culling: culling invisible"
794 ". Volumes marked invisible will be culled,"
795 "\n i.e., not drawn, if this flag is true."
799 else if (cullingOption ==
"density") {
801 "G4VisCommandsViewerSet::SetNewValue: culling: culling by density";
808 density *= valueOfUnit;
822 <<
". Volumes with density less than "
824 <<
"\n will be culled, i.e., not drawn, if this flag is true."
831 "ERROR: G4VisCommandsViewerSet::SetNewValue: culling:"
832 "\n option not recognised."
838 else if (command == fpCommandCutawayMode) {
839 if (newValue ==
"add" || newValue ==
"union")
841 if (newValue ==
"multiply" || newValue ==
"intersection")
845 G4cout <<
"Cutaway mode set to ";
849 G4cout <<
"cutawayIntersection";
854 else if (command == fpCommandDefaultColour) {
857 std::istringstream iss(newValue);
858 iss >> redOrString >> green >> blue >> opacity;
865 G4cout <<
"Default colour "
872 else if (command == fpCommandDefaultTextColour) {
875 std::istringstream iss(newValue);
876 iss >> redOrString >> green >> blue >> opacity;
883 G4cout <<
"Default colour "
890 else if (command == fpCommandEdge) {
893 switch (existingStyle) {
908 switch (existingStyle) {
923 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
929 else if (command == fpCommandExplodeFactor) {
932 std::istringstream is (newValue);
933 is >> explodeFactor >> x >> y >> z >> unitString;
944 else if (command == fpCommandGlobalLineWidthScale) {
949 G4cout <<
"Global Line Width Scale changed to "
954 else if (command == fpCommandGlobalMarkerScale) {
959 G4cout <<
"Global Marker Scale changed to "
964 else if (command == fpCommandHiddenEdge) {
967 switch (existingStyle) {
983 switch (existingStyle) {
999 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1005 else if (command == fpCommandHiddenMarker) {
1010 G4cout <<
"Markers will ";
1016 else if (command == fpCommandLightsMove) {
1017 if (newValue.find(
"cam") != G4String::npos)
1019 else if(newValue.find(
"obj") != G4String::npos)
1023 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised."
1024 " Looking for \"cam\" or \"obj\" in string." <<
G4endl;
1028 G4cout <<
"Lights move with ";
1030 G4cout <<
"camera (object appears to rotate).";
1031 else G4cout <<
"object (the viewer appears to be moving).";
1036 else if (command == fpCommandLightsThetaPhi) {
1039 G4double x = std::sin (theta) * std::cos (phi);
1040 G4double y = std::sin (theta) * std::sin (phi);
1045 G4cout <<
"Lights direction set to "
1051 else if (command == fpCommandLightsVector) {
1055 G4cout <<
"Lights direction set to "
1060 else if (command == fpCommandLineSegments) {
1065 "Number of line segments per circle in polygon approximation is "
1070 else if (command == fpCommandNumberOfCloudPoints) {
1075 "Number of points to be used in cloud representation of volumes is "
1080 else if (command == fpCommandPicking) {
1085 else G4cout <<
"inhibited.";
1089 G4cout <<
"You may need to issue \"/vis/viewer/update\"."
1094 else if (command == fpCommandProjection) {
1096 const size_t iPos0 = 0;
1097 if (newValue[iPos0] ==
'o') {
1098 fieldHalfAngle = 0.;
1100 else if (newValue[iPos0] ==
'p') {
1103 std::istringstream is (newValue);
1104 is >> dummy >> fieldHalfAngle >> unit;
1106 if (fieldHalfAngle > 89.5 * deg || fieldHalfAngle <= 0.0) {
1109 "ERROR: Field half angle should be 0 < angle <= 89.5 degrees.";
1117 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised."
1118 " Looking for 'o' or 'p' first character." <<
G4endl;
1124 G4cout <<
"Projection style of viewer \"" << currentViewer->
GetName()
1126 if (fieldHalfAngle == 0.) {
1130 G4cout <<
"perspective\n with half angle " << fieldHalfAngle / deg
1137 else if (command == fpCommandSectionPlane) {
1139 G4double x, y, z, nx, ny, nz, F = 1.;
1140 std::istringstream is (newValue);
1141 is >> choice >> x >> y >> z >> unit >> nx >> ny >> nz;
1142 G4int iSelector = -1;
1147 if (iSelector < 0) {
1149 G4cout <<
"Choice not recognised (on/true or off/false)." <<
G4endl;
1154 switch (iSelector) {
1160 x *= F; y *= F; z *= F;
1161 if (nx == 0. && ny == 0. && nz == 0.) {
1174 G4cout <<
"Section drawing is: ";
1177 G4cout <<
".\nSection plane is now: "
1183 else if (command == fpCommandRotationStyle) {
1185 if (newValue ==
"constrainUpDirection")
1187 else if (newValue ==
"freeRotation")
1191 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised." <<
G4endl;
1197 G4cout <<
"Rotation style of viewer \"" << currentViewer->
GetName()
1203 else if (command == fpCommandStyle) {
1205 const size_t iPos0 = 0;
1206 if (newValue[iPos0] ==
'w') {
1207 switch (existingStyle) {
1223 else if (newValue[iPos0] ==
's') {
1224 switch (existingStyle) {
1240 else if (newValue[iPos0] ==
'c') {
1241 switch (existingStyle) {
1260 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised."
1261 " Looking for 'w' or 's' or 'c' first character." <<
G4endl;
1266 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1272 else if (command == fpCommandTargetPoint) {
1279 G4cout <<
"Target point set to "
1282 <<
"\n\"Current Target Point\" set to "
1285 <<
"\n\"Standard Target Point\" is "
1287 (standardTargetPoint)
1292 else if (command == fpCommandUpThetaPhi) {
1295 G4double x = std::sin (theta) * std::cos (phi);
1296 G4double y = std::sin (theta) * std::sin (phi);
1306 else if (command == fpCommandUpVector) {
1314 else if (command == fpCommandViewpointThetaPhi) {
1317 G4double x = std::sin (theta) * std::cos (phi);
1318 G4double y = std::sin (theta) * std::sin (phi);
1323 G4cout <<
"Viewpoint direction set to "
1326 G4cout <<
"Lightpoint direction set to "
1333 else if (command == fpCommandViewpointVector) {
1335 if (viewpointVector.
mag2() <= 0.) {
1337 G4cerr <<
"ERROR: Null viewpoint vector. No action taken." <<
G4endl;
1340 fViewpointVector = viewpointVector.
unit();
1343 G4cout <<
"Viewpoint direction set to "
1346 G4cout <<
"Lightpoint direction set to "
1353 else if (command == fpCommandTimeWindowDisplayHeadTime)
1356 G4double screenX, screenY, screenSize, red, green, blue;
1357 std::istringstream iss(newValue);
1358 iss >> display >> screenX >> screenY
1359 >> screenSize >> red >> green >> blue;
1368 G4cout <<
"Display head time flag set: "
1374 else if (command == fpCommandTimeWindowDisplayLightFront)
1376 G4String display, originX, originY, originZ, unitS, originT, unitT;
1378 std::istringstream iss(newValue);
1380 >> originX >> originY >> originZ >> unitS
1382 >> red >> green >> blue;
1396 G4cout <<
"Display light front flag set: "
1402 else if (command == fpCommandTimeWindowEndTime)
1404 G4String end_time_string, end_time_unit,
1405 time_range_string, time_range_unit;
1406 std::istringstream iss(newValue);
1407 iss >> end_time_string >> end_time_unit
1408 >> time_range_string >> time_range_unit;
1411 (
G4String(end_time_string +
' ' + end_time_unit)));
1413 (
G4String(time_range_string +
' ' + time_range_unit));
1414 if (timeRange > 0.) {
1421 <<
", time window end time: " << vp.
GetEndTime()/
ns <<
" ns";
1422 if (timeRange > 0.) {
1423 G4cout <<
"\n (time range: " << timeRange/
ns <<
" ns)";
1429 else if (command == fpCommandTimeWindowFadeFactor) {
1437 else if (command == fpCommandTimeWindowStartTime)
1439 G4String start_time_string, start_time_unit,
1440 time_range_string, time_range_unit;
1441 std::istringstream iss(newValue);
1442 iss >> start_time_string >> start_time_unit
1443 >> time_range_string >> time_range_unit;
1446 (
G4String(start_time_string +
' ' + start_time_unit)));
1448 (
G4String(time_range_string +
' ' + time_range_unit));
1449 if (timeRange > 0.) {
1456 <<
", time window end time: " << vp.
GetEndTime()/
ns <<
" ns";
1457 if (timeRange > 0.) {
1458 G4cout <<
"\n (time range: " << timeRange/
ns <<
" ns)";
1467 "ERROR: G4VisCommandsViewerSet::SetNewValue: unrecognised command."
HepGeom::Normal3D< G4double > G4Normal3D
HepGeom::Plane3D< G4double > G4Plane3D
HepGeom::Point3D< G4double > G4Point3D
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
const G4Point3D & GetStandardTargetPoint() const
G4int compareTo(const char *, caseCompare mode=exact) const
G4String ConvertToStringWithBestUnit(G4ThreeVector vec)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4double GetNewDoubleValue(const char *paramString)
void SetDefaultValue(G4double defVal)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
static G4ThreeVector ConvertTo3Vector(const char *st)
static G4double ValueOf(const char *unitName)
static G4String ConvertToString(G4bool boolVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4int ConvertToInt(const char *st)
static G4bool ConvertToBool(const char *st)
void SetRange(const char *rs)
static G4double ConvertToDouble(const char *st)
static G4double ConvertToDimensionedDouble(const char *st)
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
G4Scene * GetScene() const
const G4String & GetName() const
const G4ViewParameters & GetViewParameters() const
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers() const
const G4ViewParameters & GetDefaultViewParameters() const
void SetViewParameters(const G4ViewParameters &vp)
G4VSceneHandler * GetSceneHandler() const
void ConvertToColour(G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
static G4VisManager * fpVisManager
static G4bool ConvertToDoublePair(const G4String ¶mString, G4double &xval, G4double &yval)
void SetViewParameters(G4VViewer *viewer, const G4ViewParameters &viewParams)
const G4String & ConvertToColourGuidance()
G4bool ProvideValueOfUnit(const G4String &where, const G4String &unit, const G4String &category, G4double &value)
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
G4int SetNumberOfCloudPoints(G4int)
G4int SetNoOfSides(G4int nSides)
void SetViewAndLights(const G4Vector3D &viewpointDirection)
void SetAutoRefresh(G4bool)
void SetBackgroundColour(const G4Colour &)
void SetGlobalMarkerScale(G4double globalMarkerScale)
void SetExplodeCentre(const G4Point3D &explodeCentre)
void SetDisplayLightFrontY(G4double)
CutawayMode GetCutawayMode() const
G4double GetExplodeFactor() const
G4bool IsMarkerNotHidden() const
void SetDisplayHeadTimeBlue(G4double)
void SetVisibleDensity(G4double visibleDensity)
G4double GetGlobalLineWidthScale() const
void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier &)
G4Vector3D & GetActualLightpointDirection()
void SetCurrentTargetPoint(const G4Point3D ¤tTargetPoint)
void SetDisplayLightFrontT(G4double)
void SetDrawingStyle(G4ViewParameters::DrawingStyle style)
const G4Colour & GetBackgroundColour() const
const G4Vector3D & GetLightpointDirection() const
void SetDisplayHeadTimeX(G4double)
void SetDefaultVisAttributes(const G4VisAttributes &)
void SetFieldHalfAngle(G4double fieldHalfAngle)
void SetCullingCovered(G4bool)
const G4Vector3D & GetViewpointDirection() const
void SetExplodeFactor(G4double explodeFactor)
void SetGlobalLineWidthScale(G4double globalLineWidthScale)
const G4Point3D & GetCurrentTargetPoint() const
void SetStartTime(G4double)
void SetDisplayLightFrontBlue(G4double)
void SetDisplayHeadTime(G4bool)
const G4VisAttributes * GetDefaultTextVisAttributes() const
void SetDisplayHeadTimeY(G4double)
void SetDensityCulling(G4bool)
void SetDisplayLightFrontZ(G4double)
G4double GetStartTime() const
void SetDisplayLightFront(G4bool)
void SetDisplayLightFrontRed(G4double)
const G4Vector3D & GetUpVector() const
void SetDisplayHeadTimeSize(G4double)
void SetMarkerNotHidden()
void SetDisplayHeadTimeRed(G4double)
G4double GetEndTime() const
G4double GetFadeFactor() const
G4double GetGlobalMarkerScale() const
const G4VisAttributes * GetDefaultVisAttributes() const
void SetCullingInvisible(G4bool)
void SetUpVector(const G4Vector3D &upVector)
void SetEndTime(G4double)
void SetFadeFactor(G4double)
RotationStyle GetRotationStyle() const
void SetCutawayMode(CutawayMode)
G4bool IsDensityCulling() const
void SetDefaultTextVisAttributes(const G4VisAttributes &)
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
void SetDisplayLightFrontX(G4double)
void SetLightsMoveWithCamera(G4bool moves)
void SetDisplayHeadTimeGreen(G4double)
void SetRotationStyle(RotationStyle)
G4bool IsAutoRefresh() const
G4double GetVisibleDensity() const
G4bool GetLightsMoveWithCamera() const
void SetSectionPlane(const G4Plane3D §ionPlane)
void SetAuxEdgeVisible(G4bool)
void SetDisplayLightFrontGreen(G4double)
const G4Point3D & GetExplodeCentre() const
const G4Plane3D & GetSectionPlane() const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const
void SetColour(const G4Colour &)
const G4Colour & GetColour() const
static constexpr G4double fVeryLongTime
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandsViewerSet()
G4VViewer * GetCurrentViewer() const
static Verbosity GetVerbosity()
G4VViewer * GetViewer(const G4String &viewerName) const