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 - \"default\", \"dots\" or \"surfaces\".");
392 fpCommandSpecialMeshRenderingOption->
SetParameterName (
"option",omitable =
true);
393 fpCommandSpecialMeshRenderingOption->
SetCandidates(
"default 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);
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;
1213 if (G4StrUtil::icompare(choice,
"off") == 0 ||
1215 if (G4StrUtil::icompare(choice,
"on") == 0 ||
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 ==
"dots") {
1281 else if(newValue ==
"surfaces") {
1286 G4cout <<
"Special mesh rendering option set to \""
1292 else if (command == fpCommandSpecialMeshVolumes) {
1293 std::vector<G4ModelingParameters::PVNameCopyNo> requestedMeshes;
1294 if (newValue.empty()) {
1298 G4String::size_type iBegin, iEnd;
1299 iBegin = newValue.find_first_not_of(
' ');
1300 while (iBegin != G4String::npos) {
1301 iEnd = newValue.find_first_of(
' ',iBegin);
1302 if (iEnd == G4String::npos) {
1303 iEnd = newValue.length();
1305 G4String name(newValue.substr(iBegin,iEnd-iBegin));
1306 iBegin = newValue.find_first_not_of(
' ',iEnd);
1307 if (iBegin == G4String::npos) {
1310 "WARNING: G4VisCommandsViewerSet::SetNewValue: /vis/viewer/set/specialMeshVolumes"
1311 "\n A pair not found. (There should be an even number of parameters.)"
1312 "\n Command ignored."
1317 iEnd = newValue.find_first_of(
' ',iBegin);
1318 if (iEnd == G4String::npos) {
1319 iEnd = newValue.length();
1322 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
1323 if (!(iss >> copyNo)) {
1326 "WARNING: G4VisCommandsViewerSet::SetNewValue: /vis/viewer/set/specialMeshVolumes"
1327 "\n Error reading copy number - it was not numeric?"
1328 "\n Command ignored."
1334 iBegin = newValue.find_first_not_of(
' ',iEnd);
1341 "Special mesh list empty, which means \"all meshes\"."
1344 G4cout <<
"Selected special mesh volumes are:";
1346 G4cout <<
"\n " << pvNameCopyNo.GetName();
1347 if (pvNameCopyNo.GetCopyNo() >= 0)
G4cout <<
':' << pvNameCopyNo.GetCopyNo();
1354 else if (command == fpCommandStyle) {
1356 const size_t iPos0 = 0;
1357 if (newValue[iPos0] ==
'w') {
1358 switch (existingStyle) {
1374 else if (newValue[iPos0] ==
's') {
1375 switch (existingStyle) {
1391 else if (newValue[iPos0] ==
'c') {
1392 switch (existingStyle) {
1411 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised."
1412 " Looking for 'w' or 's' or 'c' first character." <<
G4endl;
1417 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1423 else if (command == fpCommandTargetPoint) {
1430 G4cout <<
"Target point set to "
1433 <<
"\n\"Current Target Point\" set to "
1436 <<
"\n\"Standard Target Point\" is "
1438 (standardTargetPoint)
1443 else if (command == fpCommandUpThetaPhi) {
1446 G4double x = std::sin (theta) * std::cos (phi);
1447 G4double y = std::sin (theta) * std::sin (phi);
1457 else if (command == fpCommandUpVector) {
1465 else if (command == fpCommandViewpointThetaPhi) {
1468 G4double x = std::sin (theta) * std::cos (phi);
1469 G4double y = std::sin (theta) * std::sin (phi);
1474 G4cout <<
"Viewpoint direction set to "
1477 G4cout <<
"Lightpoint direction set to "
1484 else if (command == fpCommandViewpointVector) {
1486 if (viewpointVector.
mag2() <= 0.) {
1488 G4warn <<
"ERROR: Null viewpoint vector. No action taken." <<
G4endl;
1491 fViewpointVector = viewpointVector.
unit();
1494 G4cout <<
"Viewpoint direction set to "
1497 G4cout <<
"Lightpoint direction set to "
1504 else if (command == fpCommandTimeWindowDisplayHeadTime)
1507 G4double screenX, screenY, screenSize, red, green, blue;
1508 std::istringstream iss(newValue);
1509 iss >> display >> screenX >> screenY
1510 >> screenSize >> red >> green >> blue;
1519 G4cout <<
"Display head time flag set: "
1525 else if (command == fpCommandTimeWindowDisplayLightFront)
1527 G4String display, originX, originY, originZ, unitS, originT, unitT;
1529 std::istringstream iss(newValue);
1531 >> originX >> originY >> originZ >> unitS
1533 >> red >> green >> blue;
1547 G4cout <<
"Display light front flag set: "
1553 else if (command == fpCommandTimeWindowEndTime)
1555 G4String end_time_string, end_time_unit,
1556 time_range_string, time_range_unit;
1557 std::istringstream iss(newValue);
1558 iss >> end_time_string >> end_time_unit
1559 >> time_range_string >> time_range_unit;
1562 (
G4String(end_time_string +
' ' + end_time_unit)));
1564 (
G4String(time_range_string +
' ' + time_range_unit));
1565 if (timeRange > 0.) {
1571 <<
"Time window start time: " << vp.
GetStartTime()/ns <<
" ns"
1572 <<
", time window end time: " << vp.
GetEndTime()/ns <<
" ns";
1573 if (timeRange > 0.) {
1574 G4cout <<
"\n (time range: " << timeRange/ns <<
" ns)";
1580 else if (command == fpCommandTimeWindowFadeFactor) {
1588 else if (command == fpCommandTimeWindowStartTime)
1590 G4String start_time_string, start_time_unit,
1591 time_range_string, time_range_unit;
1592 std::istringstream iss(newValue);
1593 iss >> start_time_string >> start_time_unit
1594 >> time_range_string >> time_range_unit;
1597 (
G4String(start_time_string +
' ' + start_time_unit)));
1599 (
G4String(time_range_string +
' ' + time_range_unit));
1600 if (timeRange > 0.) {
1606 <<
"Time window start time: " << vp.
GetStartTime()/ns <<
" ns"
1607 <<
", time window end time: " << vp.
GetEndTime()/ns <<
" ns";
1608 if (timeRange > 0.) {
1609 G4cout <<
"\n (time range: " << timeRange/ns <<
" ns)";
1618 "ERROR: G4VisCommandsViewerSet::SetNewValue: unrecognised command."