59 fpCommandAll->SetGuidance
60 (
"Copies view parameters.");
61 fpCommandAll->SetGuidance
62 (
"Copies ALL view parameters (except the autoRefresh status) from"
63 "\nfrom-viewer to current viewer. You may need \"/vis/viewer/rebuild\".");
64 fpCommandAll->SetGuidance
65 (
"Note: to copy only the camera-specific parameters use"
66 "\n\"/vis/viewer/copyfrom\".");
67 fpCommandAll->SetParameterName (
"from-viewer-name",omitable =
false);
70 (
"/vis/viewer/set/autoRefresh",
this);
71 fpCommandAutoRefresh->SetGuidance(
"Sets auto-refresh.");
72 fpCommandAutoRefresh->SetGuidance
73 (
"If true, view is automatically refreshed after a change of"
74 "\nview parameters.");
75 fpCommandAutoRefresh->SetParameterName(
"auto-refresh",omitable =
true);
76 fpCommandAutoRefresh->SetDefaultValue(
true);
79 (
"/vis/viewer/set/auxiliaryEdge",
this);
80 fpCommandAuxEdge->SetGuidance(
"Sets visibility of auxiliary edges");
81 fpCommandAuxEdge->SetGuidance
82 (
"Auxiliary edges, i.e., those that are part of a curved surface,"
83 "\nsometimes called soft edges, become visible/invisible.");
84 fpCommandAuxEdge->SetParameterName(
"edge",omitable =
true);
85 fpCommandAuxEdge->SetDefaultValue(
true);
88 (
"/vis/viewer/set/background",
this);
89 fpCommandBackground->SetGuidance
90 (
"Set background colour and transparency (default black and opaque).");
92 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
93 parameter -> SetDefaultValue (
"0.");
94 fpCommandBackground -> SetParameter (parameter);
96 parameter -> SetDefaultValue (0.);
97 fpCommandBackground -> SetParameter (parameter);
99 parameter -> SetDefaultValue (0.);
100 fpCommandBackground -> SetParameter (parameter);
101 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
102 parameter -> SetDefaultValue (1.);
103 fpCommandBackground -> SetParameter (parameter);
105 fpCommandCulling =
new G4UIcommand(
"/vis/viewer/set/culling",
this);
106 fpCommandCulling->SetGuidance (
"Set culling options.");
107 fpCommandCulling->SetGuidance
108 (
"\"global\": enables/disables all other culling options.");
109 fpCommandCulling->SetGuidance
110 (
"\"coveredDaughters\": culls, i.e., eliminates, volumes that would not"
111 "\nbe seen because covered by ancestor volumes in surface drawing mode,"
112 "\nand then only if the ancestors are visible and opaque, and then only"
113 "\nif no sections or cutaways are in operation. Intended solely to"
114 "\nimprove the speed of rendering visible volumes.");
115 fpCommandCulling->SetGuidance
116 (
"\"invisible\": culls objects with the invisible attribute set.");
117 fpCommandCulling->SetGuidance
118 (
"\"density\": culls volumes with density lower than threshold. Useful"
119 "\nfor eliminating \"container volumes\" with no physical correspondence,"
120 "\nwhose material is usually air. If this is selected, provide threshold"
121 "\ndensity and unit (e.g., g/cm3, mg/cm3 or kg/m3)."
123 parameter =
new G4UIparameter(
"culling-option",
's',omitable =
false);
125 (
"global coveredDaughters invisible density");
126 fpCommandCulling->SetParameter(parameter);
129 fpCommandCulling->SetParameter(parameter);
130 parameter =
new G4UIparameter(
"density-threshold",
'd',omitable =
true);
132 fpCommandCulling->SetParameter(parameter);
137 fpCommandCulling->SetParameter(parameter);
139 fpCommandCutawayMode =
141 fpCommandCutawayMode->SetGuidance
142 (
"Sets cutaway mode - add (union) or multiply (intersection).");
143 fpCommandCutawayMode->SetParameterName (
"cutaway-mode",omitable =
false);
144 fpCommandCutawayMode->SetCandidates (
"add union multiply intersection");
145 fpCommandCutawayMode->SetDefaultValue(
"union");
148 (
"/vis/viewer/set/defaultColour",
this);
149 fpCommandDefaultColour->SetGuidance
150 (
"Set defaultColour colour and transparency (default white and opaque).");
152 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
153 parameter -> SetDefaultValue (
"1.");
154 fpCommandDefaultColour -> SetParameter (parameter);
155 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
156 parameter -> SetDefaultValue (1.);
157 fpCommandDefaultColour -> SetParameter (parameter);
158 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
159 parameter -> SetDefaultValue (1.);
160 fpCommandDefaultColour -> SetParameter (parameter);
161 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
162 parameter -> SetDefaultValue (1.);
163 fpCommandDefaultColour -> SetParameter (parameter);
166 (
"/vis/viewer/set/defaultTextColour",
this);
167 fpCommandDefaultTextColour->SetGuidance
168 (
"Set defaultTextColour colour and transparency (default blue and opaque).");
170 parameter =
new G4UIparameter(
"red_or_string",
's', omitable =
true);
171 parameter -> SetDefaultValue (
"0.");
172 fpCommandDefaultTextColour -> SetParameter (parameter);
173 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
174 parameter -> SetDefaultValue (0.);
175 fpCommandDefaultTextColour -> SetParameter (parameter);
176 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
177 parameter -> SetDefaultValue (1.);
178 fpCommandDefaultTextColour -> SetParameter (parameter);
179 parameter =
new G4UIparameter (
"opacity",
'd', omitable =
true);
180 parameter -> SetDefaultValue (1.);
181 fpCommandDefaultTextColour -> SetParameter (parameter);
184 fpCommandDotsSize->SetGuidance(
"Set dots size.");
185 fpCommandDotsSize->SetParameterName(
"dots-size", omitable=
true);
186 fpCommandDotsSize->SetDefaultValue(1.);
188 fpCommandDotsSmooth =
new G4UIcmdWithABool(
"/vis/viewer/set/dotsSmooth",
this);
189 fpCommandDotsSmooth->SetGuidance(
"True/false to enable/disable smooth dots (if available).");
190 fpCommandDotsSmooth->SetGuidance
191 (
"\"Smooth\" typically means rounded, i.e., dots drawn as filled circles."
192 "\nThe vis system is configured by default to draw smooth dots. This may"
193 "\nbe switched off with \"/vis/viewer/set/dotsSmooth false\" - typically"
194 "\nthis will result in square dots.");
195 fpCommandDotsSmooth->SetParameterName(
"dots-smooth-enabled", omitable =
true);
196 fpCommandDotsSmooth->SetDefaultValue(
true);
199 fpCommandEdge->SetGuidance
200 (
"Edges become visible/invisible in surface mode.");
201 fpCommandEdge->SetParameterName(
"edge",omitable =
true);
202 fpCommandEdge->SetDefaultValue(
true);
205 (
"/vis/viewer/set/explodeFactor",
this);
206 fpCommandExplodeFactor->SetGuidance
207 (
"Moves top-level drawn volumes by this factor from this centre.");
208 parameter =
new G4UIparameter(
"explodeFactor",
'd', omitable=
true);
211 fpCommandExplodeFactor->SetParameter(parameter);
214 parameter->
SetGuidance (
"Coordinate of explode centre.");
215 fpCommandExplodeFactor->SetParameter(parameter);
218 parameter->
SetGuidance (
"Coordinate of explode centre.");
219 fpCommandExplodeFactor->SetParameter(parameter);
222 parameter->
SetGuidance (
"Coordinate of explode centre.");
223 fpCommandExplodeFactor->SetParameter(parameter);
226 parameter->
SetGuidance (
"Unit of explode centre.");
227 fpCommandExplodeFactor->SetParameter(parameter);
230 (
"/vis/viewer/set/globalLineWidthScale",
this);
231 fpCommandGlobalLineWidthScale->SetGuidance
232 (
"Multiplies line widths by this factor.");
233 fpCommandGlobalLineWidthScale->
234 SetParameterName(
"scale-factor", omitable=
true);
235 fpCommandGlobalLineWidthScale->SetDefaultValue(1.);
238 (
"/vis/viewer/set/globalMarkerScale",
this);
239 fpCommandGlobalMarkerScale->SetGuidance
240 (
"Multiplies marker sizes by this factor.");
241 fpCommandGlobalMarkerScale->
242 SetParameterName(
"scale-factor", omitable=
true);
243 fpCommandGlobalMarkerScale->SetDefaultValue(1.);
245 fpCommandHiddenEdge =
247 fpCommandHiddenEdge->SetGuidance
248 (
"Edges become hidden/seen in wireframe or surface mode.");
249 fpCommandHiddenEdge->SetParameterName(
"hidden-edge",omitable =
true);
250 fpCommandHiddenEdge->SetDefaultValue(
true);
252 fpCommandHiddenMarker =
254 fpCommandHiddenMarker->SetGuidance
255 (
"If true, closer objects hide markers. Otherwise, markers always show.");
256 fpCommandHiddenMarker->SetParameterName(
"hidden-marker",omitable =
true);
257 fpCommandHiddenMarker->SetDefaultValue(
true);
260 (
"/vis/viewer/set/lightsMove",
this);
261 fpCommandLightsMove->SetGuidance
262 (
"Lights move with camera or with object");
263 fpCommandLightsMove->SetParameterName(
"lightsMove",omitable =
false);
264 fpCommandLightsMove->SetCandidates
265 (
"cam camera with-camera obj object with-object");
268 (
"/vis/viewer/set/lightsThetaPhi",
this);
269 fpCommandLightsThetaPhi->SetGuidance
270 (
"Set direction from target to lights.");
271 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
272 parameter -> SetDefaultValue(60.);
273 fpCommandLightsThetaPhi -> SetParameter (parameter);
275 parameter -> SetDefaultValue(45.);
276 fpCommandLightsThetaPhi -> SetParameter (parameter);
277 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
278 parameter -> SetDefaultValue (
"deg");
279 fpCommandLightsThetaPhi -> SetParameter (parameter);
282 (
"/vis/viewer/set/lightsVector",
this);
283 fpCommandLightsVector->SetGuidance
284 (
"Set direction from target to lights.");
286 parameter -> SetDefaultValue (1);
287 fpCommandLightsVector -> SetParameter (parameter);
289 parameter -> SetDefaultValue (1);
290 fpCommandLightsVector -> SetParameter (parameter);
292 parameter -> SetDefaultValue (1);
293 fpCommandLightsVector -> SetParameter (parameter);
296 (
"/vis/viewer/set/lineSegmentsPerCircle",
this);
297 fpCommandLineSegments->SetGuidance
298 (
"Set number of sides per circle for polygon/polyhedron drawing.");
299 fpCommandLineSegments->SetGuidance
300 (
"Refers to graphical representation of objects with curved lines/surfaces.");
301 fpCommandLineSegments->SetParameterName(
"line-segments",omitable =
true);
302 fpCommandLineSegments->SetDefaultValue(24);
305 (
"/vis/viewer/set/lineWidth",
this);
306 fpCommandLineWidth->SetGuidance
307 (
"Use \"/vis/viewer/set/globalLineWidthScale\" instead."
308 "\nFor trajectories use \"/vis/modeling/trajectories/*/default/setLineWidth\"."
309 "\nFor volumes use \"/vis/geometry/set/lineWidth\".");
312 (
"/vis/viewer/set/numberOfCloudPoints",
this);
313 fpCommandNumberOfCloudPoints->SetGuidance
314 (
"Set number of points to be used for cloud representation of volumes.");
315 fpCommandNumberOfCloudPoints->SetParameterName(
"points",omitable =
true);
316 fpCommandNumberOfCloudPoints->SetDefaultValue(10000);
319 (
"/vis/viewer/set/picking",
this);
320 fpCommandPicking->SetGuidance(
"Sets picking, if available.");
321 fpCommandPicking->SetGuidance
322 (
"If true, view is set up for picking, if available.");
323 fpCommandPicking->SetGuidance
324 (
"You may need to issue \"/vis/viewer/update\".");
325 fpCommandPicking->SetGuidance
326 (
"For required actions, watch for instructions for viewer.");
327 fpCommandPicking->SetParameterName(
"picking",omitable =
true);
328 fpCommandPicking->SetDefaultValue(
true);
330 fpCommandProjection =
new G4UIcommand(
"/vis/viewer/set/projection",
this);
331 fpCommandProjection->SetGuidance
332 (
"Set projection style - o[rthogonal] or p[erspective]."
333 "\nIf p[erspective], also set field half angle.");
334 parameter =
new G4UIparameter(
"projection",
's',omitable =
true);
337 fpCommandProjection->SetParameter(parameter);
338 parameter =
new G4UIparameter(
"field-half-angle",
'd',omitable =
true);
341 fpCommandProjection->SetParameter(parameter);
345 fpCommandProjection->SetParameter(parameter);
348 (
"/vis/viewer/set/rotationStyle",
this);
349 fpCommandRotationStyle->SetGuidance
350 (
"Set style of rotation - constrainUpDirection or freeRotation.");
351 fpCommandRotationStyle->SetGuidance
352 (
"constrainUpDirection: conventional HEP view.");
353 fpCommandRotationStyle->SetGuidance
354 (
"freeRotation: Google-like rotation, using mouse-grab.");
355 fpCommandRotationStyle->SetParameterName (
"style",omitable =
false);
356 fpCommandRotationStyle->SetCandidates(
"constrainUpDirection freeRotation");
358 fpCommandSectionPlane =
new G4UIcommand(
"/vis/viewer/set/sectionPlane",
this);
359 fpCommandSectionPlane -> SetGuidance
360 (
"Set plane for drawing section (DCUT).");
361 fpCommandSectionPlane -> SetGuidance
362 (
"E.g., for a y-z plane at x = 1 cm:"
363 "\n\"/vis/viewer/set/sectionPlane on 1 0 0 cm 1 0 0\"."
364 "\nTo turn off: /vis/viewer/set/sectionPlane off");
366 parameter -> SetDefaultValue (
"on");
367 fpCommandSectionPlane->SetParameter(parameter);
369 parameter -> SetDefaultValue (0);
370 parameter -> SetGuidance (
"Coordinate of point on the plane.");
371 fpCommandSectionPlane->SetParameter(parameter);
373 parameter -> SetDefaultValue (0);
374 parameter -> SetGuidance (
"Coordinate of point on the plane.");
375 fpCommandSectionPlane->SetParameter(parameter);
377 parameter -> SetDefaultValue (0);
378 parameter -> SetGuidance (
"Coordinate of point on the plane.");
379 fpCommandSectionPlane->SetParameter(parameter);
381 parameter -> SetDefaultValue (
"m");
382 parameter -> SetGuidance (
"Unit of point on the plane.");
383 fpCommandSectionPlane->SetParameter(parameter);
385 parameter -> SetDefaultValue (1);
386 parameter -> SetGuidance (
"Component of plane normal.");
387 fpCommandSectionPlane->SetParameter(parameter);
389 parameter -> SetDefaultValue (0);
390 parameter -> SetGuidance (
"Component of plane normal.");
391 fpCommandSectionPlane->SetParameter(parameter);
393 parameter -> SetDefaultValue (0);
394 parameter -> SetGuidance (
"Component of plane normal.");
395 fpCommandSectionPlane->SetParameter(parameter);
398 (
"/vis/viewer/set/specialMeshRendering",
this);
399 fpCommandSpecialMeshRendering -> SetGuidance
400 (
"Request special rendering of volumes (meshes) that use G4VParameterisation.");
401 fpCommandSpecialMeshRendering->SetParameterName(
"render",omitable =
true);
402 fpCommandSpecialMeshRendering->SetDefaultValue(
true);
405 (
"/vis/viewer/set/specialMeshRenderingOption",
this);
406 fpCommandSpecialMeshRenderingOption->SetGuidance
407 (
"Set special mesh rendering option - \"default\", \"dots\" or \"surfaces\".");
408 fpCommandSpecialMeshRenderingOption->SetParameterName (
"option",omitable =
true);
409 fpCommandSpecialMeshRenderingOption->SetCandidates(
"default dots surfaces");
410 fpCommandSpecialMeshRenderingOption->SetDefaultValue(
"default");
413 (
"/vis/viewer/set/specialMeshVolumes",
this);
414 fpCommandSpecialMeshVolumes -> SetGuidance
415 (
"Specify the volumes for special rendering. No arguments resets the list"
416 "\nand is interpreted to mean \"all found meshes\".");
417 fpCommandSpecialMeshVolumes->SetGuidance
418 (
"Please provide a list of space-separated physical volume names and copy"
419 "\nnumber pairs. Negative copy number means \"all volumes of that name\".");
420 parameter =
new G4UIparameter(
"volumes",
's',omitable =
true);
422 (
"List of physical volume names and copy number pairs");
423 fpCommandSpecialMeshVolumes->SetParameter(parameter);
426 fpCommandStyle->SetGuidance
427 (
"Set style of drawing - w[ireframe] or s[urface] or c[loud].");
428 fpCommandStyle->SetGuidance
429 (
"(Hidden line drawing is controlled by \"/vis/viewer/set/hiddenEdge\".)");
430 fpCommandStyle->SetParameterName (
"style",omitable =
false);
431 fpCommandStyle->SetCandidates(
"w wireframe s surface c cloud");
434 (
"/vis/viewer/set/targetPoint",
this);
435 fpCommandTargetPoint->SetGuidance
436 (
"Set target point.");
437 fpCommandTargetPoint->SetGuidance
438 (
"This sets the \"Current Target Point\" relative to the \"Standard");
439 fpCommandTargetPoint->SetGuidance
440 (
"Target Point\" so that the actual target point is as requested.");
441 fpCommandTargetPoint->SetGuidance
442 (
"(See G4ViewParameters.hh for an explanation of target points.)");
443 fpCommandTargetPoint->SetParameterName(
"x",
"y",
"z", omitable =
false);
444 fpCommandTargetPoint->SetUnitCategory(
"Length");
447 (
"/vis/viewer/set/transparencyByDepth",
this);
448 fpCommandTransparencyByDepth -> SetGuidance
449 (
"Set overall transparency by depth in geometry tree.");
450 fpCommandTransparencyByDepth -> SetGuidance
451 (
"For a volume at depth D, the opacity (alpha) is:"
452 "\nOption 1: Unwrap: 0 if D <= d (sudden invisibility);"
453 "\nOption 2: Fade: D - d (fade progresssively layer by layer);"
454 "\nOption 3: X-ray: as (2), but fade over whole range of depth."
455 "\nThe opacity calculated here is truncated [0,1] and then"
456 " multiplies any existing opacity."
457 "\nSee G4PhysicalVolumeModel.cc:644(approx) for details.");
459 fpCommandTransparencyByDepth -> SetParameter (parameter);
460 parameter =
new G4UIparameter(
"option",
'i', omitable =
true);
461 parameter -> SetGuidance(
"1: Unwrap; 2: Fade; 3: X-ray");
462 parameter -> SetDefaultValue (1);
463 fpCommandTransparencyByDepth -> SetParameter (parameter);
466 (
"/vis/viewer/set/upThetaPhi",
this);
467 fpCommandUpThetaPhi -> SetGuidance (
"Set up vector.");
468 fpCommandUpThetaPhi -> SetGuidance
469 (
"Viewer will attempt always to show this direction upwards.");
470 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
471 parameter -> SetDefaultValue (90.);
472 fpCommandUpThetaPhi -> SetParameter (parameter);
474 parameter -> SetDefaultValue (90.);
475 fpCommandUpThetaPhi -> SetParameter (parameter);
476 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
477 parameter -> SetDefaultValue (
"deg");
478 fpCommandUpThetaPhi -> SetParameter (parameter);
481 (
"/vis/viewer/set/upVector",
this);
482 fpCommandUpVector -> SetGuidance (
"Set up vector.");
483 fpCommandUpVector -> SetGuidance
484 (
"Viewer will attempt always to show this direction upwards.");
486 parameter -> SetDefaultValue (0.);
487 fpCommandUpVector -> SetParameter (parameter);
489 parameter -> SetDefaultValue (1.);
490 fpCommandUpVector -> SetParameter (parameter);
492 parameter -> SetDefaultValue (0.);
493 fpCommandUpVector -> SetParameter (parameter);
496 (
"/vis/viewer/set/viewpointThetaPhi",
this);
497 fpCommandViewpointThetaPhi -> SetGuidance
498 (
"Set direction from target to camera.");
499 fpCommandViewpointThetaPhi -> SetGuidance
500 (
"Also changes lightpoint direction if lights are set to move with camera.");
501 parameter =
new G4UIparameter(
"theta",
'd', omitable =
true);
502 parameter -> SetDefaultValue (60.);
503 fpCommandViewpointThetaPhi -> SetParameter (parameter);
505 parameter -> SetDefaultValue (45.);
506 fpCommandViewpointThetaPhi -> SetParameter (parameter);
507 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
508 parameter -> SetDefaultValue (
"deg");
509 fpCommandViewpointThetaPhi -> SetParameter (parameter);
512 (
"/vis/viewer/set/viewpointVector",
this);
513 fpCommandViewpointVector -> SetGuidance
514 (
"Set direction from target to camera.");
515 fpCommandViewpointVector -> SetGuidance
516 (
"Also changes lightpoint direction if lights are set to move with camera.");
518 parameter -> SetDefaultValue (1.);
519 fpCommandViewpointVector -> SetParameter (parameter);
521 parameter -> SetDefaultValue (1.);
522 fpCommandViewpointVector -> SetParameter (parameter);
524 parameter -> SetDefaultValue (1.);
525 fpCommandViewpointVector -> SetParameter (parameter);
527 fpTimeWindowDirectory =
new G4UIdirectory (
"/vis/viewer/set/timeWindow/");
528 fpTimeWindowDirectory -> SetGuidance (
"Set time window parameters of current viewer.");
530 "For these commands use"
531 "\n /vis/scene/add/trajectories rich"
532 "\n /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns"
534 "\n /vis/viewer/set/timeWindow/displayLightFront true 0 0 -50 cm -0.5 ns"
535 "\n /vis/viewer/set/timeWindow/displayHeadTime true"
536 "\n /vis/viewer/set/timeWindow/fadeFactor 1"
537 "\n /run/beamOn # or several until you get a good event or events"
538 "\n /vis/viewer/set/timeWindow/startTime 0 ns 1 ns"
539 "\n /vis/viewer/save"
540 "\n /vis/viewer/set/timeWindow/startTime 1 ns 1 ns"
541 "\nthen zoom, pan etc to a view of interest and"
542 "\n /vis/viewer/save"
543 "\nthen repeat with next start time, another view and a save, then try"
544 "\n /vis/viewer/interpolate";
546 fpCommandTimeWindowDisplayHeadTime =
547 new G4UIcommand(
"/vis/viewer/set/timeWindow/displayHeadTime",
this);
548 fpCommandTimeWindowDisplayHeadTime->SetGuidance
549 (
"Display head time of range in 2D text.");
550 fpCommandTimeWindowDisplayHeadTime->SetGuidance(timeWindowGuidance);
551 parameter =
new G4UIparameter (
"displayHeadTime",
'b', omitable =
false);
553 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
554 parameter =
new G4UIparameter (
"screenX",
'd', omitable =
true);
558 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
559 parameter =
new G4UIparameter (
"screenY",
'd', omitable =
true);
563 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
564 parameter =
new G4UIparameter (
"screenSize",
'd', omitable =
true);
566 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
570 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
571 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
574 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
575 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
578 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
580 fpCommandTimeWindowDisplayLightFront =
581 new G4UIcommand(
"/vis/viewer/set/timeWindow/displayLightFront",
this);
582 fpCommandTimeWindowDisplayLightFront->SetGuidance
583 (
"Display the light front at head time.");
584 fpCommandTimeWindowDisplayLightFront->SetGuidance
585 (
"Tip: The trajectories can appear of jump ahead of the light front"
586 "\nbecause their time range overlaps the viewer's time range. To"
587 "\naverage out this discrete time effect, advance the light front by"
588 "\nhalf the trajectories interval. E.g., if the trajectory time slice"
589 "\ninterval is 0.01 ns:"
590 "\n /vis/viewer/set/timeWindow/displayLightFront true -90 0 0 mm -0.005 ns"
591 "\nTo prevent them beating the light front at all:"
592 "\n /vis/viewer/set/timeWindow/displayLightFront true -90 0 0 mm -0.01 ns");
593 fpCommandTimeWindowDisplayLightFront->SetGuidance(timeWindowGuidance);
594 parameter =
new G4UIparameter (
"displayLightFront",
'b', omitable =
true);
596 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
597 parameter =
new G4UIparameter (
"originX",
'd', omitable =
true);
599 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
600 parameter =
new G4UIparameter (
"originY",
'd', omitable =
true);
602 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
603 parameter =
new G4UIparameter (
"originZ",
'd', omitable =
true);
605 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
606 parameter =
new G4UIparameter (
"space_unit",
's', omitable =
true);
608 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
609 parameter =
new G4UIparameter (
"originT",
'd', omitable =
true);
611 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
612 parameter =
new G4UIparameter (
"time_unit",
's', omitable =
true);
614 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
618 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
619 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
622 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
623 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
626 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
628 fpCommandTimeWindowEndTime =
629 new G4UIcommand(
"/vis/viewer/set/timeWindow/endTime",
this);
630 fpCommandTimeWindowEndTime->SetGuidance(
"Set end and range of track time.");
631 fpCommandTimeWindowEndTime->SetGuidance(timeWindowGuidance);
632 parameter =
new G4UIparameter (
"end-time",
'd', omitable =
false);
634 fpCommandTimeWindowEndTime->SetParameter(parameter);
635 parameter =
new G4UIparameter (
"end-time-unit",
's', omitable =
false);
637 fpCommandTimeWindowEndTime->SetParameter(parameter);
638 parameter =
new G4UIparameter (
"time-range",
'd', omitable =
true);
640 fpCommandTimeWindowEndTime->SetParameter(parameter);
641 parameter =
new G4UIparameter (
"time-range-unit",
's', omitable =
true);
643 fpCommandTimeWindowEndTime->SetParameter(parameter);
645 fpCommandTimeWindowFadeFactor =
647 fpCommandTimeWindowFadeFactor->SetGuidance
648 (
"0: no fade; 1: maximum fade with time window.");
649 fpCommandTimeWindowFadeFactor->SetGuidance(timeWindowGuidance);
650 fpCommandTimeWindowFadeFactor->SetParameterName(
"fade_factor", omitable =
false);
651 fpCommandTimeWindowFadeFactor->SetRange(
"fade_factor>=0.&&fade_factor<=1.");
652 fpCommandTimeWindowFadeFactor->SetDefaultValue(0.);
654 fpCommandTimeWindowStartTime =
655 new G4UIcommand(
"/vis/viewer/set/timeWindow/startTime",
this);
656 fpCommandTimeWindowStartTime->SetGuidance(
"Set start and range of track time.");
657 fpCommandTimeWindowStartTime->SetGuidance(timeWindowGuidance);
658 parameter =
new G4UIparameter (
"start-time",
'd', omitable =
false);
660 fpCommandTimeWindowStartTime->SetParameter(parameter);
661 parameter =
new G4UIparameter (
"start-time-unit",
's', omitable =
false);
663 fpCommandTimeWindowStartTime->SetParameter(parameter);
664 parameter =
new G4UIparameter (
"time-range",
'd', omitable =
true);
666 fpCommandTimeWindowStartTime->SetParameter(parameter);
667 parameter =
new G4UIparameter (
"time-range-unit",
's', omitable =
true);
669 fpCommandTimeWindowStartTime->SetParameter(parameter);
671 fpCommandZoomToCursor =
new G4UIcmdWithABool(
"/vis/viewer/set/zoomToCursor",
this);
672 fpCommandZoomToCursor->SetGuidance(
"True/false to enable/disable zoom to cursor with mouse wheel");
673 fpCommandZoomToCursor->SetParameterName(
"zoomToCursor-enabled", omitable =
true);
674 fpCommandZoomToCursor->SetDefaultValue(
true);
750 if (!currentViewer) {
753 "ERROR: G4VisCommandsViewerSet::SetNewValue: no current viewer."
761 if (command == fpCommandAll) {
766 "ERROR: G4VisCommandsViewerSet::SetNewValue: all:"
767 "\n unrecognised from-viewer."
772 if (fromViewer == currentViewer) {
775 "WARNING: G4VisCommandsViewerSet::SetNewValue: all:"
776 "\n from-viewer and current viewer are identical."
788 const std::vector<G4ModelingParameters::VisAttributesModifier>*
791 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator i;
792 for (i = privateVAMs->begin(); i != privateVAMs->end(); ++i) {
797 G4cout <<
"View parameters of viewer \"" << currentViewer->
GetName()
798 <<
"\"\n set to those of viewer \"" << fromViewer->
GetName()
803 G4warn <<
"You may need \"/vis/viewer/rebuild\"."
808 else if (command == fpCommandAutoRefresh) {
816 << currentViewer->
GetName() <<
" is NOT auto-refesh by default"
817 <<
"\n so cannot be set to auto-refresh."
826 G4cout <<
"be automatically refreshed after a change of view parameters."
835 else if (command == fpCommandAuxEdge) {
838 G4cout <<
"Auxiliary edges will ";
844 else if (command == fpCommandBackground) {
847 std::istringstream iss(newValue);
848 iss >> redOrString >> green >> blue >> opacity;
853 G4cout <<
"Background colour "
860 else if (command == fpCommandCulling) {
861 G4String cullingOption, stringFlag, unit;
863 std::istringstream is (newValue);
864 is >> cullingOption >> stringFlag >> density >> unit;
866 if (cullingOption ==
"global") {
870 "G4VisCommandsViewerSet::SetNewValue: culling: global culling flag"
872 ".\n Does not change specific culling flags."
876 else if (cullingOption ==
"coveredDaughters") {
880 "G4VisCommandsViewerSet::SetNewValue: culling: culling covered"
881 "\n daughters flag set to "
883 ". Daughters covered by opaque mothers"
884 "\n will be culled, i.e., not drawn, if this flag is true."
885 "\n Note: this is only effective in surface drawing style,"
886 "\n and then only if the volumes are visible and opaque, and then"
887 "\n only if no sections or cutaways are in operation."
891 else if (cullingOption ==
"invisible") {
895 "G4VisCommandsViewerSet::SetNewValue: culling: culling invisible"
898 ". Volumes marked invisible will be culled,"
899 "\n i.e., not drawn, if this flag is true."
903 else if (cullingOption ==
"density") {
905 "G4VisCommandsViewerSet::SetNewValue: culling: culling by density";
912 density *= valueOfUnit;
926 <<
". Volumes with density less than "
928 <<
"\n will be culled, i.e., not drawn, if this flag is true."
935 "ERROR: G4VisCommandsViewerSet::SetNewValue: culling:"
936 "\n option not recognised."
942 else if (command == fpCommandCutawayMode) {
943 if (newValue ==
"add" || newValue ==
"union")
945 if (newValue ==
"multiply" || newValue ==
"intersection")
949 G4cout <<
"Cutaway mode set to ";
953 G4cout <<
"cutawayIntersection";
958 else if (command == fpCommandDefaultColour) {
961 std::istringstream iss(newValue);
962 iss >> redOrString >> green >> blue >> opacity;
969 G4cout <<
"Default colour "
976 else if (command == fpCommandDefaultTextColour) {
979 std::istringstream iss(newValue);
980 iss >> redOrString >> green >> blue >> opacity;
987 G4cout <<
"Default colour "
994 else if (command == fpCommandDotsSize) {
995 G4double dotsSize = fpCommandDotsSize->GetNewDoubleValue(newValue);
1002 else if (command == fpCommandDotsSmooth) {
1009 else if (command == fpCommandEdge) {
1012 switch (existingStyle) {
1027 switch (existingStyle) {
1042 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1048 else if (command == fpCommandExplodeFactor) {
1051 std::istringstream is (newValue);
1052 is >> explodeFactor >> x >> y >> z >> unitString;
1063 else if (command == fpCommandGlobalLineWidthScale) {
1065 = fpCommandGlobalLineWidthScale->GetNewDoubleValue(newValue);
1068 G4cout <<
"Global Line Width Scale changed to "
1073 else if (command == fpCommandGlobalMarkerScale) {
1075 = fpCommandGlobalMarkerScale->GetNewDoubleValue(newValue);
1078 G4cout <<
"Global Marker Scale changed to "
1083 else if (command == fpCommandHiddenEdge) {
1086 switch (existingStyle) {
1102 switch (existingStyle) {
1118 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1124 else if (command == fpCommandHiddenMarker) {
1129 G4cout <<
"Markers will ";
1135 else if (command == fpCommandLightsMove) {
1136 if (newValue.find(
"cam") != G4String::npos)
1138 else if(newValue.find(
"obj") != G4String::npos)
1142 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised."
1143 " Looking for \"cam\" or \"obj\" in string." <<
G4endl;
1147 G4cout <<
"Lights move with ";
1149 G4cout <<
"camera (object appears to rotate).";
1150 else G4cout <<
"object (the viewer appears to be moving).";
1155 else if (command == fpCommandLightsThetaPhi) {
1158 G4double x = std::sin (theta) * std::cos (phi);
1159 G4double y = std::sin (theta) * std::sin (phi);
1164 G4cout <<
"Lights direction set to "
1170 else if (command == fpCommandLightsVector) {
1174 G4cout <<
"Lights direction set to "
1179 else if (command == fpCommandLineWidth) {
1186 else if (command == fpCommandLineSegments) {
1191 "Number of line segments per circle in polygon approximation is "
1196 else if (command == fpCommandNumberOfCloudPoints) {
1201 "Number of points to be used in cloud representation of volumes is "
1206 else if (command == fpCommandPicking) {
1211 else G4cout <<
"inhibited.";
1215 G4warn <<
"You may need to issue \"/vis/viewer/update\"."
1220 else if (command == fpCommandProjection) {
1222 const size_t iPos0 = 0;
1223 if (newValue[iPos0] ==
'o') {
1224 fieldHalfAngle = 0.;
1226 else if (newValue[iPos0] ==
'p') {
1229 std::istringstream is (newValue);
1230 is >> dummy >> fieldHalfAngle >> unit;
1232 if (fieldHalfAngle > 89.5 * deg || fieldHalfAngle <= 0.0) {
1235 "ERROR: Field half angle should be 0 < angle <= 89.5 degrees.";
1243 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised."
1244 " Looking for 'o' or 'p' first character." <<
G4endl;
1250 G4cout <<
"Projection style of viewer \"" << currentViewer->
GetName()
1252 if (fieldHalfAngle == 0.) {
1256 G4cout <<
"perspective\n with half angle " << fieldHalfAngle / deg
1263 else if (command == fpCommandRotationStyle) {
1265 if (newValue ==
"constrainUpDirection")
1267 else if (newValue ==
"freeRotation")
1271 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised." <<
G4endl;
1277 G4cout <<
"Rotation style of viewer \"" << currentViewer->
GetName()
1283 else if (command == fpCommandSectionPlane) {
1285 G4double x, y, z, nx, ny, nz, F = 1.;
1286 std::istringstream is (newValue);
1287 is >> choice >> x >> y >> z >> unit >> nx >> ny >> nz;
1288 G4int iSelector = -1;
1293 if (iSelector < 0) {
1295 G4warn <<
"Choice not recognised (on/true or off/false)." <<
G4endl;
1300 switch (iSelector) {
1306 x *= F; y *= F; z *= F;
1307 if (nx == 0. && ny == 0. && nz == 0.) {
1321 G4cout <<
"Section drawing is: ";
1324 G4cout <<
".\nSection plane is now: "
1330 else if (command == fpCommandSpecialMeshRendering) {
1333 G4cout <<
"Special mesh rendering";
1335 G4cout <<
" requested. Current option is \""
1340 G4cout <<
"selected volumes:";
1342 G4cout <<
"\n " << pvNameCopyNo.GetName();
1343 if (pvNameCopyNo.GetCopyNo() >= 0)
G4cout <<
':' << pvNameCopyNo.GetCopyNo();
1352 else if (command == fpCommandSpecialMeshRenderingOption) {
1354 if (newValue ==
"dots") {
1357 else if(newValue ==
"surfaces") {
1362 G4cout <<
"Special mesh rendering option set to \""
1368 else if (command == fpCommandSpecialMeshVolumes) {
1369 std::vector<G4ModelingParameters::PVNameCopyNo> requestedMeshes;
1370 if (newValue.empty()) {
1374 G4String::size_type iBegin, iEnd;
1375 iBegin = newValue.find_first_not_of(
' ');
1376 while (iBegin != G4String::npos) {
1377 iEnd = newValue.find_first_of(
' ',iBegin);
1378 if (iEnd == G4String::npos) {
1379 iEnd = newValue.length();
1381 const G4String& name(newValue.substr(iBegin,iEnd-iBegin));
1382 iBegin = newValue.find_first_not_of(
' ',iEnd);
1383 if (iBegin == G4String::npos) {
1386 "WARNING: G4VisCommandsViewerSet::SetNewValue: /vis/viewer/set/specialMeshVolumes"
1387 "\n A pair not found. (There should be an even number of parameters.)"
1388 "\n Command ignored."
1393 iEnd = newValue.find_first_of(
' ',iBegin);
1394 if (iEnd == G4String::npos) {
1395 iEnd = newValue.length();
1398 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
1399 if (!(iss >> copyNo)) {
1402 "WARNING: G4VisCommandsViewerSet::SetNewValue: /vis/viewer/set/specialMeshVolumes"
1403 "\n Error reading copy number - it was not numeric?"
1404 "\n Command ignored."
1410 iBegin = newValue.find_first_not_of(
' ',iEnd);
1417 "Special mesh list empty, which means \"all meshes\"."
1420 G4cout <<
"Selected special mesh volumes are:";
1422 G4cout <<
"\n " << pvNameCopyNo.GetName();
1423 if (pvNameCopyNo.GetCopyNo() >= 0)
G4cout <<
':' << pvNameCopyNo.GetCopyNo();
1430 else if (command == fpCommandStyle) {
1432 const size_t iPos0 = 0;
1433 if (newValue[iPos0] ==
'w') {
1434 switch (existingStyle) {
1450 else if (newValue[iPos0] ==
's') {
1451 switch (existingStyle) {
1467 else if (newValue[iPos0] ==
'c') {
1468 switch (existingStyle) {
1487 G4warn <<
"ERROR: \"" << newValue <<
"\" not recognised."
1488 " Looking for 'w' or 's' or 'c' first character." <<
G4endl;
1493 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1499 else if (command == fpCommandTargetPoint) {
1501 fpCommandTargetPoint->GetNew3VectorValue(newValue);
1506 G4cout <<
"Target point set to "
1507 << fpCommandTargetPoint->ConvertToStringWithBestUnit
1509 <<
"\n\"Current Target Point\" set to "
1510 << fpCommandTargetPoint->ConvertToStringWithBestUnit
1512 <<
"\n\"Standard Target Point\" is "
1513 << fpCommandTargetPoint->ConvertToStringWithBestUnit
1514 (standardTargetPoint)
1519 else if (command == fpCommandTransparencyByDepth) {
1522 std::istringstream is (newValue);
1523 is >> transparencyByDepth >> option;
1527 G4cout <<
"Transparency by depth set to " << transparencyByDepth
1528 <<
" with option " << option <<
G4endl;
1532 else if (command == fpCommandUpThetaPhi) {
1535 G4double x = std::sin (theta) * std::cos (phi);
1536 G4double y = std::sin (theta) * std::sin (phi);
1546 else if (command == fpCommandUpVector) {
1554 else if (command == fpCommandViewpointThetaPhi) {
1557 G4double x = std::sin (theta) * std::cos (phi);
1558 G4double y = std::sin (theta) * std::sin (phi);
1563 G4cout <<
"Viewpoint direction set to "
1566 G4cout <<
"Lightpoint direction set to "
1573 else if (command == fpCommandViewpointVector) {
1575 if (viewpointVector.
mag2() <= 0.) {
1577 G4warn <<
"ERROR: Null viewpoint vector. No action taken." <<
G4endl;
1580 fViewpointVector = viewpointVector.
unit();
1583 G4cout <<
"Viewpoint direction set to "
1586 G4cout <<
"Lightpoint direction set to "
1593 else if (command == fpCommandTimeWindowDisplayHeadTime)
1596 G4double screenX, screenY, screenSize, red, green, blue;
1597 std::istringstream iss(newValue);
1598 iss >> display >> screenX >> screenY
1599 >> screenSize >> red >> green >> blue;
1602 timeParameters.fDisplayHeadTimeX = screenX;
1603 timeParameters.fDisplayHeadTimeY = screenY;
1604 timeParameters.fDisplayHeadTimeSize = screenSize;
1605 timeParameters.fDisplayHeadTimeRed = red;
1606 timeParameters.fDisplayHeadTimeGreen = green;
1607 timeParameters.fDisplayHeadTimeBlue = blue;
1610 G4cout <<
"Display head time flag set: "
1616 else if (command == fpCommandTimeWindowDisplayLightFront)
1618 G4String display, originX, originY, originZ, unitS, originT, unitT;
1620 std::istringstream iss(newValue);
1622 >> originX >> originY >> originZ >> unitS
1624 >> red >> green >> blue;
1627 timeParameters.fDisplayLightFrontX
1629 timeParameters.fDisplayLightFrontY
1631 timeParameters.fDisplayLightFrontZ
1633 timeParameters.fDisplayLightFrontT
1635 timeParameters.fDisplayLightFrontRed = red;
1636 timeParameters.fDisplayLightFrontGreen = green;
1637 timeParameters.fDisplayLightFrontBlue = blue;
1640 G4cout <<
"Display light front flag set: "
1646 else if (command == fpCommandTimeWindowEndTime)
1648 G4String end_time_string, end_time_unit, time_range_string, time_range_unit;
1649 std::istringstream iss(newValue);
1650 iss >> end_time_string >> end_time_unit >> time_range_string >> time_range_unit;
1652 (
G4String(end_time_string +
' ' + end_time_unit));
1654 (
G4String(time_range_string +
' ' + time_range_unit));
1657 if (timeRange > 0.) {
1658 timeParameters.fStartTime = endTime - timeRange;
1665 if (timeRange > 0.) {
1666 G4cout <<
"\n (time range: " << timeRange/
ns <<
" ns)";
1672 else if (command == fpCommandTimeWindowFadeFactor) {
1682 else if (command == fpCommandTimeWindowStartTime)
1684 G4String start_time_string, start_time_unit, time_range_string, time_range_unit;
1685 std::istringstream iss(newValue);
1686 iss >> start_time_string >> start_time_unit >> time_range_string >> time_range_unit;
1688 (
G4String(start_time_string +
' ' + start_time_unit));
1690 (
G4String(time_range_string +
' ' + time_range_unit));
1693 if (timeRange > 0.) {
1694 timeParameters.fEndTime = startTime + timeRange;
1701 if (timeRange > 0.) {
1702 G4cout <<
"\n (time range: " << timeRange/
ns <<
" ns)";
1708 else if (command == fpCommandZoomToCursor) {
1718 "ERROR: G4VisCommandsViewerSet::SetNewValue: unrecognised command."