59 (
"Copies view parameters.");
61 (
"Copies ALL view parameters (except the autoRefresh status) from"
62 "\nfrom-viewer to current viewer. You may need \"/vis/viewer/rebuild\".");
64 (
"Note: to copy only the camera-specific parameters use"
65 "\n\"/vis/viewer/copyfrom\".");
69 (
"/vis/viewer/set/autoRefresh",
this);
70 fpCommandAutoRefresh->
SetGuidance(
"Sets auto-refresh.");
72 (
"If true, view is automatically refreshed after a change of"
73 "\nview parameters.");
78 (
"/vis/viewer/set/auxiliaryEdge",
this);
79 fpCommandAuxEdge->
SetGuidance(
"Sets visibility of auxiliary edges");
81 (
"Auxiliary edges, i.e., those that are part of a curved surface,"
82 "\nsometimes called soft edges, become visible/invisible.");
87 (
"/vis/viewer/set/background",
this);
89 (
"Set background colour and transparency (default black and opaque).");
91 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
92 parameter -> SetDefaultValue (
"0.");
93 fpCommandBackground -> SetParameter (parameter);
95 parameter -> SetDefaultValue (0.);
96 fpCommandBackground -> SetParameter (parameter);
98 parameter -> SetDefaultValue (0.);
99 fpCommandBackground -> SetParameter (parameter);
100 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
101 parameter -> SetDefaultValue (1.);
102 fpCommandBackground -> SetParameter (parameter);
104 fpCommandCulling =
new G4UIcommand(
"/vis/viewer/set/culling",
this);
105 fpCommandCulling->
SetGuidance (
"Set culling options.");
107 (
"\"global\": enables/disables all other culling options.");
109 (
"\"coveredDaughters\": culls, i.e., eliminates, volumes that would not"
110 "\nbe seen because covered by ancestor volumes in surface drawing mode,"
111 "\nand then only if the ancestors are visible and opaque, and then only"
112 "\nif no sections or cutaways are in operation. Intended solely to"
113 "\nimprove the speed of rendering visible volumes.");
115 (
"\"invisible\": culls objects with the invisible attribute set.");
117 (
"\"density\": culls volumes with density lower than threshold. Useful"
118 "\nfor eliminating \"container volumes\" with no physical correspondence,"
119 "\nwhose material is usually air. If this is selected, provide threshold"
120 "\ndensity and unit (e.g., g/cm3, mg/cm3 or kg/m3)."
122 parameter =
new G4UIparameter(
"culling-option",
's',omitable =
false);
124 (
"global coveredDaughters invisible density");
129 parameter =
new G4UIparameter(
"density-threshold",
'd',omitable =
true);
138 fpCommandCutawayMode =
141 (
"Sets cutaway mode - add (union) or multiply (intersection).");
143 fpCommandCutawayMode->
SetCandidates (
"add union multiply intersection");
147 (
"/vis/viewer/set/defaultColour",
this);
149 (
"Set defaultColour colour and transparency (default white and opaque).");
151 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
152 parameter -> SetDefaultValue (
"1.");
153 fpCommandDefaultColour -> SetParameter (parameter);
154 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
155 parameter -> SetDefaultValue (1.);
156 fpCommandDefaultColour -> SetParameter (parameter);
157 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
158 parameter -> SetDefaultValue (1.);
159 fpCommandDefaultColour -> SetParameter (parameter);
160 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
161 parameter -> SetDefaultValue (1.);
162 fpCommandDefaultColour -> SetParameter (parameter);
165 (
"/vis/viewer/set/defaultTextColour",
this);
167 (
"Set defaultTextColour colour and transparency (default blue and opaque).");
169 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
170 parameter -> SetDefaultValue (
"0.");
171 fpCommandDefaultTextColour -> SetParameter (parameter);
172 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
173 parameter -> SetDefaultValue (0.);
174 fpCommandDefaultTextColour -> SetParameter (parameter);
175 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
176 parameter -> SetDefaultValue (1.);
177 fpCommandDefaultTextColour -> SetParameter (parameter);
178 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
179 parameter -> SetDefaultValue (1.);
180 fpCommandDefaultTextColour -> SetParameter (parameter);
184 (
"Edges become visible/invisible in surface mode.");
189 (
"/vis/viewer/set/explodeFactor",
this);
191 (
"Moves top-level drawn volumes by this factor from this centre.");
192 parameter =
new G4UIparameter(
"explodeFactor",
'd', omitable=
true);
198 parameter->
SetGuidance (
"Coordinate of explode centre.");
202 parameter->
SetGuidance (
"Coordinate of explode centre.");
206 parameter->
SetGuidance (
"Coordinate of explode centre.");
210 parameter->
SetGuidance (
"Unit of explode centre.");
214 (
"/vis/viewer/set/globalLineWidthScale",
this);
216 (
"Multiplies line widths by this factor.");
217 fpCommandGlobalLineWidthScale->
218 SetParameterName(
"scale-factor", omitable=
true);
222 (
"/vis/viewer/set/globalMarkerScale",
this);
224 (
"Multiplies marker sizes by this factor.");
225 fpCommandGlobalMarkerScale->
226 SetParameterName(
"scale-factor", omitable=
true);
229 fpCommandHiddenEdge =
232 (
"Edges become hidden/seen in wireframe or surface mode.");
236 fpCommandHiddenMarker =
239 (
"If true, closer objects hide markers. Otherwise, markers always show.");
244 (
"/vis/viewer/set/lightsMove",
this);
246 (
"Lights move with camera or with object");
249 (
"cam camera with-camera obj object with-object");
252 (
"/vis/viewer/set/lightsThetaPhi",
this);
254 (
"Set direction from target to lights.");
255 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
256 parameter -> SetDefaultValue(60.);
257 fpCommandLightsThetaPhi -> SetParameter (parameter);
259 parameter -> SetDefaultValue(45.);
260 fpCommandLightsThetaPhi -> SetParameter (parameter);
261 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
262 parameter -> SetDefaultValue (
"deg");
263 fpCommandLightsThetaPhi -> SetParameter (parameter);
266 (
"/vis/viewer/set/lightsVector",
this);
268 (
"Set direction from target to lights.");
270 parameter -> SetDefaultValue (1);
271 fpCommandLightsVector -> SetParameter (parameter);
273 parameter -> SetDefaultValue (1);
274 fpCommandLightsVector -> SetParameter (parameter);
276 parameter -> SetDefaultValue (1);
277 fpCommandLightsVector -> SetParameter (parameter);
280 (
"/vis/viewer/set/lineSegmentsPerCircle",
this);
282 (
"Set number of sides per circle for polygon/polyhedron drawing.");
284 (
"Refers to graphical representation of objects with curved lines/surfaces.");
289 (
"/vis/viewer/set/lineWidth",
this);
291 (
"Use \"/vis/viewer/set/globalLineWidthScale\" instead."
292 "\nFor trajectories use \"/vis/modeling/trajectories/*/default/setLineWidth\"."
293 "\nFor volumes use \"/vis/geometry/set/lineWidth\".");
296 (
"/vis/viewer/set/numberOfCloudPoints",
this);
298 (
"Set number of points to be used for cloud representation of volumes.");
303 (
"/vis/viewer/set/picking",
this);
304 fpCommandPicking->
SetGuidance(
"Sets picking, if available.");
306 (
"If true, view is set up for picking, if available.");
308 (
"You may need to issue \"/vis/viewer/update\".");
310 (
"For required actions, watch for instructions for viewer.");
314 fpCommandProjection =
new G4UIcommand(
"/vis/viewer/set/projection",
this);
316 (
"Set projection style - o[rthogonal] or p[erspective]."
317 "\nIf p[erspective], also set field half angle.");
318 parameter =
new G4UIparameter(
"projection",
's',omitable =
true);
322 parameter =
new G4UIparameter(
"field-half-angle",
'd',omitable =
true);
332 (
"/vis/viewer/set/rotationStyle",
this);
334 (
"Set style of rotation - constrainUpDirection or freeRotation.");
336 (
"constrainUpDirection: conventional HEP view.");
338 (
"freeRotation: Google-like rotation, using mouse-grab.");
340 fpCommandRotationStyle->
SetCandidates(
"constrainUpDirection freeRotation");
342 fpCommandSectionPlane =
new G4UIcommand(
"/vis/viewer/set/sectionPlane",
this);
343 fpCommandSectionPlane -> SetGuidance
344 (
"Set plane for drawing section (DCUT).");
345 fpCommandSectionPlane -> SetGuidance
346 (
"E.g., for a y-z plane at x = 1 cm:"
347 "\n\"/vis/viewer/set/sectionPlane on 1 0 0 cm 1 0 0\"."
348 "\nTo turn off: /vis/viewer/set/sectionPlane off");
350 parameter -> SetDefaultValue (
"on");
353 parameter -> SetDefaultValue (0);
354 parameter -> SetGuidance (
"Coordinate of point on the plane.");
357 parameter -> SetDefaultValue (0);
358 parameter -> SetGuidance (
"Coordinate of point on the plane.");
361 parameter -> SetDefaultValue (0);
362 parameter -> SetGuidance (
"Coordinate of point on the plane.");
365 parameter -> SetDefaultValue (
"m");
366 parameter -> SetGuidance (
"Unit of point on the plane.");
369 parameter -> SetDefaultValue (1);
370 parameter -> SetGuidance (
"Component of plane normal.");
373 parameter -> SetDefaultValue (0);
374 parameter -> SetGuidance (
"Component of plane normal.");
377 parameter -> SetDefaultValue (0);
378 parameter -> SetGuidance (
"Component of plane normal.");
382 (
"/vis/viewer/set/specialMeshRendering",
this);
383 fpCommandSpecialMeshRendering -> SetGuidance
384 (
"Request special rendering of volumes (meshes) that use G4VParameterisation.");
389 (
"/vis/viewer/set/specialMeshRenderingOption",
this);
391 (
"Set special mesh rendering option - \"dots\" or \"surfaces\".");
392 fpCommandSpecialMeshRenderingOption->
SetParameterName (
"option",omitable =
true);
393 fpCommandSpecialMeshRenderingOption->
SetCandidates(
"dots surfaces");
397 (
"/vis/viewer/set/specialMeshVolumes",
this);
398 fpCommandSpecialMeshVolumes -> SetGuidance
399 (
"Specify the volumes for special rendering. No arguments resets the list"
400 "\nand is interpreted to mean \"all found meshes\".");
402 (
"Please provide a list of space-separated physical volume names and copy"
403 "\nnumber pairs. Negative copy number means \"all volumes of that name\".");
404 parameter =
new G4UIparameter(
"volumes",
's',omitable =
true);
406 (
"List of physical volume names and copy number pairs");
411 (
"Set style of drawing - w[ireframe] or s[urface] or c[loud].");
413 (
"(Hidden line drawing is controlled by \"/vis/viewer/set/hiddenEdge\".)");
415 fpCommandStyle->
SetCandidates(
"w wireframe s surface c cloud");
418 (
"/vis/viewer/set/targetPoint",
this);
420 (
"Set target point.");
422 (
"This sets the \"Current Target Point\" relative to the \"Standard");
424 (
"Target Point\" so that the actual target point is as requested.");
426 (
"(See G4ViewParameters.hh for an explanation of target points.)");
431 (
"/vis/viewer/set/upThetaPhi",
this);
432 fpCommandUpThetaPhi -> SetGuidance (
"Set up vector.");
433 fpCommandUpThetaPhi -> SetGuidance
434 (
"Viewer will attempt always to show this direction upwards.");
435 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
436 parameter -> SetDefaultValue (90.);
437 fpCommandUpThetaPhi -> SetParameter (parameter);
439 parameter -> SetDefaultValue (90.);
440 fpCommandUpThetaPhi -> SetParameter (parameter);
441 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
442 parameter -> SetDefaultValue (
"deg");
443 fpCommandUpThetaPhi -> SetParameter (parameter);
446 (
"/vis/viewer/set/upVector",
this);
447 fpCommandUpVector -> SetGuidance (
"Set up vector.");
448 fpCommandUpVector -> SetGuidance
449 (
"Viewer will attempt always to show this direction upwards.");
451 parameter -> SetDefaultValue (0.);
452 fpCommandUpVector -> SetParameter (parameter);
454 parameter -> SetDefaultValue (1.);
455 fpCommandUpVector -> SetParameter (parameter);
457 parameter -> SetDefaultValue (0.);
458 fpCommandUpVector -> SetParameter (parameter);
461 (
"/vis/viewer/set/viewpointThetaPhi",
this);
462 fpCommandViewpointThetaPhi -> SetGuidance
463 (
"Set direction from target to camera.");
464 fpCommandViewpointThetaPhi -> SetGuidance
465 (
"Also changes lightpoint direction if lights are set to move with camera.");
466 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
467 parameter -> SetDefaultValue (60.);
468 fpCommandViewpointThetaPhi -> SetParameter (parameter);
470 parameter -> SetDefaultValue (45.);
471 fpCommandViewpointThetaPhi -> SetParameter (parameter);
472 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
473 parameter -> SetDefaultValue (
"deg");
474 fpCommandViewpointThetaPhi -> SetParameter (parameter);
477 (
"/vis/viewer/set/viewpointVector",
this);
478 fpCommandViewpointVector -> SetGuidance
479 (
"Set direction from target to camera.");
480 fpCommandViewpointVector -> SetGuidance
481 (
"Also changes lightpoint direction if lights are set to move with camera.");
483 parameter -> SetDefaultValue (1.);
484 fpCommandViewpointVector -> SetParameter (parameter);
486 parameter -> SetDefaultValue (1.);
487 fpCommandViewpointVector -> SetParameter (parameter);
489 parameter -> SetDefaultValue (1.);
490 fpCommandViewpointVector -> SetParameter (parameter);
492 fpTimeWindowDirectory =
new G4UIdirectory (
"/vis/viewer/set/timeWindow/");
493 fpTimeWindowDirectory -> SetGuidance (
"Set time window parameters of current viewer.");
495 "For these commands use"
496 "\n /vis/scene/add/trajectories rich"
497 "\n /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns"
499 "\n /vis/viewer/set/timeWindow/displayLightFront true 0 0 -50 cm -0.5 ns"
500 "\n /vis/viewer/set/timeWindow/displayHeadTime true"
501 "\n /vis/viewer/set/timeWindow/fadeFactor 1"
502 "\n /run/beamOn # or several until you get a good event or events"
503 "\n /vis/viewer/set/timeWindow/startTime 0 ns 1 ns"
504 "\n /vis/viewer/save"
505 "\n /vis/viewer/set/timeWindow/startTime 1 ns 1 ns"
506 "\nthen zoom, pan etc to a view of interest and"
507 "\n /vis/viewer/save"
508 "\nthen repeat with next start time, another view and a save, then try"
509 "\n /vis/viewer/interpolate";
511 fpCommandTimeWindowDisplayHeadTime =
512 new G4UIcommand(
"/vis/viewer/set/timeWindow/displayHeadTime",
this);
514 (
"Display head time of range in 2D text.");
515 fpCommandTimeWindowDisplayHeadTime->
SetGuidance(timeWindowGuidance);
516 parameter =
new G4UIparameter (
"displayHeadTime",
'b', omitable =
false);
518 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
519 parameter =
new G4UIparameter (
"screenX",
'd', omitable =
true);
523 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
524 parameter =
new G4UIparameter (
"screenY",
'd', omitable =
true);
528 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
529 parameter =
new G4UIparameter (
"screenSize",
'd', omitable =
true);
531 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
535 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
536 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
539 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
540 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
543 fpCommandTimeWindowDisplayHeadTime->
SetParameter(parameter);
545 fpCommandTimeWindowDisplayLightFront =
546 new G4UIcommand(
"/vis/viewer/set/timeWindow/displayLightFront",
this);
548 (
"Display the light front at head time.");
550 (
"Tip: The trajectories can appear of jump ahead of the light front"
551 "\nbecause their time range overlaps the viewer's time range. To"
552 "\naverage out this discrete time effect, advance the light front by"
553 "\nhalf the trajectories interval. E.g., if the trajectory time slice"
554 "\ninterval is 0.01 ns:"
555 "\n /vis/viewer/set/timeWindow/displayLightFront true -90 0 0 mm -0.005 ns"
556 "\nTo prevent them beating the light front at all:"
557 "\n /vis/viewer/set/timeWindow/displayLightFront true -90 0 0 mm -0.01 ns");
558 fpCommandTimeWindowDisplayLightFront->
SetGuidance(timeWindowGuidance);
559 parameter =
new G4UIparameter (
"displayLightFront",
'b', omitable =
true);
561 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
562 parameter =
new G4UIparameter (
"originX",
'd', omitable =
true);
564 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
565 parameter =
new G4UIparameter (
"originY",
'd', omitable =
true);
567 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
568 parameter =
new G4UIparameter (
"originZ",
'd', omitable =
true);
570 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
571 parameter =
new G4UIparameter (
"space_unit",
's', omitable =
true);
573 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
574 parameter =
new G4UIparameter (
"originT",
'd', omitable =
true);
576 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
577 parameter =
new G4UIparameter (
"time_unit",
's', omitable =
true);
579 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
583 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
584 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
587 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
588 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
591 fpCommandTimeWindowDisplayLightFront->
SetParameter(parameter);
593 fpCommandTimeWindowEndTime =
594 new G4UIcommand(
"/vis/viewer/set/timeWindow/endTime",
this);
595 fpCommandTimeWindowEndTime->
SetGuidance(
"Set end and range of track time.");
596 fpCommandTimeWindowEndTime->
SetGuidance(timeWindowGuidance);
597 parameter =
new G4UIparameter (
"end-time",
'd', omitable =
false);
600 parameter =
new G4UIparameter (
"end-time-unit",
's', omitable =
false);
603 parameter =
new G4UIparameter (
"time-range",
'd', omitable =
true);
606 parameter =
new G4UIparameter (
"time-range-unit",
's', omitable =
true);
610 fpCommandTimeWindowFadeFactor =
613 (
"0: no fade; 1: maximum fade with time window.");
614 fpCommandTimeWindowFadeFactor->
SetGuidance(timeWindowGuidance);
615 fpCommandTimeWindowFadeFactor->
SetParameterName(
"fade_factor", omitable =
false);
616 fpCommandTimeWindowFadeFactor->
SetRange(
"fade_factor>=0.&&fade_factor<=1.");
619 fpCommandTimeWindowStartTime =
620 new G4UIcommand(
"/vis/viewer/set/timeWindow/startTime",
this);
621 fpCommandTimeWindowStartTime->
SetGuidance(
"Set start and range of track time.");
622 fpCommandTimeWindowStartTime->
SetGuidance(timeWindowGuidance);
623 parameter =
new G4UIparameter (
"start-time",
'd', omitable =
false);
626 parameter =
new G4UIparameter (
"start-time-unit",
's', omitable =
false);
629 parameter =
new G4UIparameter (
"time-range",
'd', omitable =
true);
632 parameter =
new G4UIparameter (
"time-range-unit",
's', omitable =
true);
638 delete fpCommandTimeWindowStartTime;
639 delete fpCommandTimeWindowFadeFactor;
640 delete fpCommandTimeWindowEndTime;
641 delete fpCommandTimeWindowDisplayLightFront;
642 delete fpCommandTimeWindowDisplayHeadTime;
643 delete fpTimeWindowDirectory;
644 delete fpCommandViewpointVector;
645 delete fpCommandViewpointThetaPhi;
646 delete fpCommandUpVector;
647 delete fpCommandUpThetaPhi;
648 delete fpCommandTargetPoint;
649 delete fpCommandStyle;
650 delete fpCommandSpecialMeshVolumes;
651 delete fpCommandSpecialMeshRenderingOption;
652 delete fpCommandSpecialMeshRendering;
653 delete fpCommandSectionPlane;
654 delete fpCommandRotationStyle;
655 delete fpCommandProjection;
656 delete fpCommandPicking;
657 delete fpCommandNumberOfCloudPoints;
658 delete fpCommandLineWidth;
659 delete fpCommandLineSegments;
660 delete fpCommandLightsVector;
661 delete fpCommandLightsThetaPhi;
662 delete fpCommandLightsMove;
663 delete fpCommandHiddenMarker;
664 delete fpCommandHiddenEdge;
665 delete fpCommandGlobalMarkerScale;
666 delete fpCommandGlobalLineWidthScale;
667 delete fpCommandExplodeFactor;
668 delete fpCommandEdge;
669 delete fpCommandDefaultTextColour;
670 delete fpCommandDefaultColour;
671 delete fpCommandCutawayMode;
672 delete fpCommandCulling;
673 delete fpCommandBackground;
674 delete fpCommandAuxEdge;
675 delete fpCommandAutoRefresh;
689 if (!currentViewer) {
692 "ERROR: G4VisCommandsViewerSet::SetNewValue: no current viewer."
700 if (command == fpCommandAll) {
705 "ERROR: G4VisCommandsViewerSet::SetNewValue: all:"
706 "\n unrecognised from-viewer."
711 if (fromViewer == currentViewer) {
714 "WARNING: G4VisCommandsViewerSet::SetNewValue: all:"
715 "\n from-viewer and current viewer are identical."
727 const std::vector<G4ModelingParameters::VisAttributesModifier>*
730 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator i;
731 for (i = privateVAMs->begin(); i != privateVAMs->end(); ++i) {
736 G4cout <<
"View parameters of viewer \"" << currentViewer->
GetName()
737 <<
"\"\n set to those of viewer \"" << fromViewer->
GetName()
742 G4warn <<
"You may need \"/vis/viewer/rebuild\"."
747 else if (command == fpCommandAutoRefresh) {
755 << currentViewer->
GetName() <<
" is NOT auto-refesh by default"
756 <<
"\n so cannot be set to auto-refresh."
765 G4cout <<
"be automatically refreshed after a change of view parameters."
774 else if (command == fpCommandAuxEdge) {
777 G4cout <<
"Auxiliary edges will ";
783 else if (command == fpCommandBackground) {
786 std::istringstream iss(newValue);
787 iss >> redOrString >> green >> blue >> opacity;
792 G4cout <<
"Background colour "
799 else if (command == fpCommandCulling) {
800 G4String cullingOption, stringFlag, unit;
802 std::istringstream is (newValue);
803 is >> cullingOption >> stringFlag >> density >> unit;
805 if (cullingOption ==
"global") {
809 "G4VisCommandsViewerSet::SetNewValue: culling: global culling flag"
811 ".\n Does not change specific culling flags."
815 else if (cullingOption ==
"coveredDaughters") {
819 "G4VisCommandsViewerSet::SetNewValue: culling: culling covered"
820 "\n daughters flag set to "
822 ". Daughters covered by opaque mothers"
823 "\n will be culled, i.e., not drawn, if this flag is true."
824 "\n Note: this is only effective in surface drawing style,"
825 "\n and then only if the volumes are visible and opaque, and then"
826 "\n only if no sections or cutaways are in operation."
830 else if (cullingOption ==
"invisible") {
834 "G4VisCommandsViewerSet::SetNewValue: culling: culling invisible"
837 ". Volumes marked invisible will be culled,"
838 "\n i.e., not drawn, if this flag is true."
842 else if (cullingOption ==
"density") {
844 "G4VisCommandsViewerSet::SetNewValue: culling: culling by density";
851 density *= valueOfUnit;
865 <<
". Volumes with density less than "
867 <<
"\n will be culled, i.e., not drawn, if this flag is true."
874 "ERROR: G4VisCommandsViewerSet::SetNewValue: culling:"
875 "\n option not recognised."
881 else if (command == fpCommandCutawayMode) {
882 if (newValue ==
"add" || newValue ==
"union")
884 if (newValue ==
"multiply" || newValue ==
"intersection")
888 G4cout <<
"Cutaway mode set to ";
892 G4cout <<
"cutawayIntersection";
897 else if (command == fpCommandDefaultColour) {
900 std::istringstream iss(newValue);
901 iss >> redOrString >> green >> blue >> opacity;
908 G4cout <<
"Default colour "
915 else if (command == fpCommandDefaultTextColour) {
918 std::istringstream iss(newValue);
919 iss >> redOrString >> green >> blue >> opacity;
926 G4cout <<
"Default colour "
933 else if (command == fpCommandEdge) {
936 switch (existingStyle) {
951 switch (existingStyle) {
966 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
972 else if (command == fpCommandExplodeFactor) {
975 std::istringstream is (newValue);
976 is >> explodeFactor >> x >> y >> z >> unitString;
987 else if (command == fpCommandGlobalLineWidthScale) {
992 G4cout <<
"Global Line Width Scale changed to "
997 else if (command == fpCommandGlobalMarkerScale) {
1002 G4cout <<
"Global Marker Scale changed to "
1007 else if (command == fpCommandHiddenEdge) {
1010 switch (existingStyle) {
1026 switch (existingStyle) {
1042 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1048 else if (command == fpCommandHiddenMarker) {
1053 G4cout <<
"Markers will ";
1059 else if (command == fpCommandLightsMove) {
1060 if (newValue.find(
"cam") != G4String::npos)
1062 else if(newValue.find(
"obj") != G4String::npos)
1066 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised."
1067 " Looking for \"cam\" or \"obj\" in string." <<
G4endl;
1071 G4cout <<
"Lights move with ";
1073 G4cout <<
"camera (object appears to rotate).";
1074 else G4cout <<
"object (the viewer appears to be moving).";
1079 else if (command == fpCommandLightsThetaPhi) {
1082 G4double x = std::sin (theta) * std::cos (phi);
1083 G4double y = std::sin (theta) * std::sin (phi);
1088 G4cout <<
"Lights direction set to "
1094 else if (command == fpCommandLightsVector) {
1098 G4cout <<
"Lights direction set to "
1103 else if (command == fpCommandLineWidth) {
1110 else if (command == fpCommandLineSegments) {
1115 "Number of line segments per circle in polygon approximation is "
1120 else if (command == fpCommandNumberOfCloudPoints) {
1125 "Number of points to be used in cloud representation of volumes is "
1130 else if (command == fpCommandPicking) {
1135 else G4cout <<
"inhibited.";
1139 G4warn <<
"You may need to issue \"/vis/viewer/update\"."
1144 else if (command == fpCommandProjection) {
1146 const size_t iPos0 = 0;
1147 if (newValue[iPos0] ==
'o') {
1148 fieldHalfAngle = 0.;
1150 else if (newValue[iPos0] ==
'p') {
1153 std::istringstream is (newValue);
1154 is >> dummy >> fieldHalfAngle >> unit;
1156 if (fieldHalfAngle > 89.5 * deg || fieldHalfAngle <= 0.0) {
1159 "ERROR: Field half angle should be 0 < angle <= 89.5 degrees.";
1167 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised."
1168 " Looking for 'o' or 'p' first character." <<
G4endl;
1174 G4cout <<
"Projection style of viewer \"" << currentViewer->
GetName()
1176 if (fieldHalfAngle == 0.) {
1180 G4cout <<
"perspective\n with half angle " << fieldHalfAngle / deg
1187 else if (command == fpCommandRotationStyle) {
1189 if (newValue ==
"constrainUpDirection")
1191 else if (newValue ==
"freeRotation")
1195 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised." <<
G4endl;
1201 G4cout <<
"Rotation style of viewer \"" << currentViewer->
GetName()
1207 else if (command == fpCommandSectionPlane) {
1209 G4double x, y, z, nx, ny, nz, F = 1.;
1210 std::istringstream is (newValue);
1211 is >> choice >> x >> y >> z >> unit >> nx >> ny >> nz;
1212 G4int iSelector = -1;
1217 if (iSelector < 0) {
1219 G4warn <<
"Choice not recognised (on/true or off/false)." <<
G4endl;
1224 switch (iSelector) {
1230 x *= F; y *= F; z *= F;
1231 if (nx == 0. && ny == 0. && nz == 0.) {
1245 G4cout <<
"Section drawing is: ";
1248 G4cout <<
".\nSection plane is now: "
1254 else if (command == fpCommandSpecialMeshRendering) {
1257 G4cout <<
"Special mesh rendering";
1259 G4cout <<
" requested. Current option is \""
1264 G4cout <<
"selected volumes:";
1266 G4cout <<
"\n " << pvNameCopyNo.GetName();
1267 if (pvNameCopyNo.GetCopyNo() >= 0)
G4cout <<
':' << pvNameCopyNo.GetCopyNo();
1276 else if (command == fpCommandSpecialMeshRenderingOption) {
1278 if (newValue ==
"surfaces") {
1283 G4cout <<
"Special mesh rendering option set to \""
1289 else if (command == fpCommandSpecialMeshVolumes) {
1290 std::vector<G4ModelingParameters::PVNameCopyNo> requestedMeshes;
1291 if (newValue.empty()) {
1295 G4String::size_type iBegin, iEnd;
1296 iBegin = newValue.find_first_not_of(
' ');
1297 while (iBegin != G4String::npos) {
1298 iEnd = newValue.find_first_of(
' ',iBegin);
1299 if (iEnd == G4String::npos) {
1300 iEnd = newValue.length();
1302 G4String name(newValue.substr(iBegin,iEnd-iBegin));
1303 iBegin = newValue.find_first_not_of(
' ',iEnd);
1304 if (iBegin == G4String::npos) {
1307 "WARNING: G4VisCommandsViewerSet::SetNewValue: /vis/viewer/set/specialMeshVolumes"
1308 "\n A pair not found. (There should be an even number of parameters.)"
1309 "\n Command ignored."
1314 iEnd = newValue.find_first_of(
' ',iBegin);
1315 if (iEnd == G4String::npos) {
1316 iEnd = newValue.length();
1319 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
1320 if (!(iss >> copyNo)) {
1323 "WARNING: G4VisCommandsViewerSet::SetNewValue: /vis/viewer/set/specialMeshVolumes"
1324 "\n Error reading copy number - it was not numeric?"
1325 "\n Command ignored."
1331 iBegin = newValue.find_first_not_of(
' ',iEnd);
1338 "Special mesh list empty, which means \"all meshes\"."
1341 G4cout <<
"Selected special mesh volumes are:";
1343 G4cout <<
"\n " << pvNameCopyNo.GetName();
1344 if (pvNameCopyNo.GetCopyNo() >= 0)
G4cout <<
':' << pvNameCopyNo.GetCopyNo();
1351 else if (command == fpCommandStyle) {
1353 const size_t iPos0 = 0;
1354 if (newValue[iPos0] ==
'w') {
1355 switch (existingStyle) {
1371 else if (newValue[iPos0] ==
's') {
1372 switch (existingStyle) {
1388 else if (newValue[iPos0] ==
'c') {
1389 switch (existingStyle) {
1408 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised."
1409 " Looking for 'w' or 's' or 'c' first character." <<
G4endl;
1414 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1420 else if (command == fpCommandTargetPoint) {
1427 G4cout <<
"Target point set to "
1430 <<
"\n\"Current Target Point\" set to "
1433 <<
"\n\"Standard Target Point\" is "
1435 (standardTargetPoint)
1440 else if (command == fpCommandUpThetaPhi) {
1443 G4double x = std::sin (theta) * std::cos (phi);
1444 G4double y = std::sin (theta) * std::sin (phi);
1454 else if (command == fpCommandUpVector) {
1462 else if (command == fpCommandViewpointThetaPhi) {
1465 G4double x = std::sin (theta) * std::cos (phi);
1466 G4double y = std::sin (theta) * std::sin (phi);
1471 G4cout <<
"Viewpoint direction set to "
1474 G4cout <<
"Lightpoint direction set to "
1481 else if (command == fpCommandViewpointVector) {
1483 if (viewpointVector.
mag2() <= 0.) {
1485 G4warn <<
"ERROR: Null viewpoint vector. No action taken." <<
G4endl;
1488 fViewpointVector = viewpointVector.
unit();
1491 G4cout <<
"Viewpoint direction set to "
1494 G4cout <<
"Lightpoint direction set to "
1501 else if (command == fpCommandTimeWindowDisplayHeadTime)
1504 G4double screenX, screenY, screenSize, red, green, blue;
1505 std::istringstream iss(newValue);
1506 iss >> display >> screenX >> screenY
1507 >> screenSize >> red >> green >> blue;
1516 G4cout <<
"Display head time flag set: "
1522 else if (command == fpCommandTimeWindowDisplayLightFront)
1524 G4String display, originX, originY, originZ, unitS, originT, unitT;
1526 std::istringstream iss(newValue);
1528 >> originX >> originY >> originZ >> unitS
1530 >> red >> green >> blue;
1544 G4cout <<
"Display light front flag set: "
1550 else if (command == fpCommandTimeWindowEndTime)
1552 G4String end_time_string, end_time_unit,
1553 time_range_string, time_range_unit;
1554 std::istringstream iss(newValue);
1555 iss >> end_time_string >> end_time_unit
1556 >> time_range_string >> time_range_unit;
1559 (
G4String(end_time_string +
' ' + end_time_unit)));
1561 (
G4String(time_range_string +
' ' + time_range_unit));
1562 if (timeRange > 0.) {
1569 <<
", time window end time: " << vp.
GetEndTime()/
ns <<
" ns";
1570 if (timeRange > 0.) {
1571 G4cout <<
"\n (time range: " << timeRange/
ns <<
" ns)";
1577 else if (command == fpCommandTimeWindowFadeFactor) {
1585 else if (command == fpCommandTimeWindowStartTime)
1587 G4String start_time_string, start_time_unit,
1588 time_range_string, time_range_unit;
1589 std::istringstream iss(newValue);
1590 iss >> start_time_string >> start_time_unit
1591 >> time_range_string >> time_range_unit;
1594 (
G4String(start_time_string +
' ' + start_time_unit)));
1596 (
G4String(time_range_string +
' ' + time_range_unit));
1597 if (timeRange > 0.) {
1604 <<
", time window end time: " << vp.
GetEndTime()/
ns <<
" ns";
1605 if (timeRange > 0.) {
1606 G4cout <<
"\n (time range: " << timeRange/
ns <<
" ns)";
1615 "ERROR: G4VisCommandsViewerSet::SetNewValue: unrecognised command."
HepGeom::Normal3D< G4double > G4Normal3D
HepGeom::Plane3D< G4double > G4Plane3D
HepGeom::Point3D< G4double > G4Point3D
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
const G4Point3D & GetStandardTargetPoint() const
G4String ConvertToStringWithBestUnit(const 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)
const G4String & GetGuidanceLine(G4int i) const
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)
G4bool IsSpecialMeshRendering() const
CutawayMode GetCutawayMode() const
G4double GetExplodeFactor() const
void SetSpecialMeshRenderingOption(SMROption)
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 SetSpecialMeshVolumes(const std::vector< G4ModelingParameters::PVNameCopyNo > &)
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
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() 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)
void SetSpecialMeshRendering(G4bool)
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
SMROption GetSpecialMeshRenderingOption() 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
G4int icompare(std::string_view lhs, std::string_view rhs)
Case insensitive comparison of two strings.