50 :
54{
56 G4UIparameter* parameter;
57
58 fpCommandAll = new G4UIcmdWithAString ("/vis/viewer/set/all",this);
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);
68
69 fpCommandAutoRefresh = new G4UIcmdWithABool
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);
77
78 fpCommandAuxEdge = new G4UIcmdWithABool
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);
86
87 fpCommandBackground = new G4UIcommand
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);
95 parameter = new G4UIparameter("green", 'd', omitable = true);
96 parameter -> SetDefaultValue (0.);
97 fpCommandBackground -> SetParameter (parameter);
98 parameter = new G4UIparameter ("blue", 'd', omitable = true);
99 parameter -> SetDefaultValue (0.);
100 fpCommandBackground -> SetParameter (parameter);
101 parameter = new G4UIparameter ("opacity", 'd', omitable = true);
102 parameter -> SetDefaultValue (1.);
103 fpCommandBackground -> SetParameter (parameter);
104
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)."
122 );
123 parameter = new G4UIparameter("culling-option",'s',omitable = false);
125 ("global coveredDaughters invisible density");
126 fpCommandCulling->SetParameter(parameter);
127 parameter = new G4UIparameter("action",'b',omitable = true);
129 fpCommandCulling->SetParameter(parameter);
130 parameter = new G4UIparameter("density-threshold",'d',omitable = true);
132 fpCommandCulling->SetParameter(parameter);
133 parameter = new G4UIparameter("unit",'s',omitable = true);
134
135
137 fpCommandCulling->SetParameter(parameter);
138
139 fpCommandCutawayMode =
140 new G4UIcmdWithAString ("/vis/viewer/set/cutawayMode", this);
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");
146
147 fpCommandDefaultColour = new G4UIcommand
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);
164
165 fpCommandDefaultTextColour = new G4UIcommand
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);
182
183 fpCommandDotsSize = new G4UIcmdWithADouble("/vis/viewer/set/dotsSize", this);
184 fpCommandDotsSize->SetGuidance("Set dots size.");
185 fpCommandDotsSize->SetParameterName("dots-size", omitable=true);
186 fpCommandDotsSize->SetDefaultValue(1.);
187
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);
197
198 fpCommandEdge = new G4UIcmdWithABool("/vis/viewer/set/edge",this);
199 fpCommandEdge->SetGuidance
200 ("Edges become visible/invisible in surface mode.");
201 fpCommandEdge->SetParameterName("edge",omitable = true);
202 fpCommandEdge->SetDefaultValue(true);
203
204 fpCommandExplodeFactor = new G4UIcommand
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);
212 parameter = new G4UIparameter("x",'d',omitable = true);
214 parameter->
SetGuidance (
"Coordinate of explode centre.");
215 fpCommandExplodeFactor->SetParameter(parameter);
216 parameter = new G4UIparameter("y",'d',omitable = true);
218 parameter->
SetGuidance (
"Coordinate of explode centre.");
219 fpCommandExplodeFactor->SetParameter(parameter);
220 parameter = new G4UIparameter("z",'d',omitable = true);
222 parameter->
SetGuidance (
"Coordinate of explode centre.");
223 fpCommandExplodeFactor->SetParameter(parameter);
224 parameter = new G4UIparameter("unit",'s',omitable = true);
226 parameter->
SetGuidance (
"Unit of explode centre.");
227 fpCommandExplodeFactor->SetParameter(parameter);
228
229 fpCommandGlobalLineWidthScale = new G4UIcmdWithADouble
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.);
236
237 fpCommandGlobalMarkerScale = new G4UIcmdWithADouble
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.);
244
245 fpCommandHiddenEdge =
246 new G4UIcmdWithABool("/vis/viewer/set/hiddenEdge",this);
247 fpCommandHiddenEdge->SetGuidance
248 ("Edges become hidden/seen in wireframe or surface mode.");
249 fpCommandHiddenEdge->SetParameterName("hidden-edge",omitable = true);
250 fpCommandHiddenEdge->SetDefaultValue(true);
251
252 fpCommandHiddenMarker =
253 new G4UIcmdWithABool("/vis/viewer/set/hiddenMarker",this);
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);
258
259 fpCommandLightsMove = new G4UIcmdWithAString
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");
266
267 fpCommandLightsThetaPhi = new G4UIcommand
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);
274 parameter = new G4UIparameter("phi", 'd', omitable = true);
275 parameter -> SetDefaultValue(45.);
276 fpCommandLightsThetaPhi -> SetParameter (parameter);
277 parameter = new G4UIparameter ("unit", 's', omitable = true);
278 parameter -> SetDefaultValue ("deg");
279 fpCommandLightsThetaPhi -> SetParameter (parameter);
280
281 fpCommandLightsVector = new G4UIcommand
282 ("/vis/viewer/set/lightsVector", this);
283 fpCommandLightsVector->SetGuidance
284 ("Set direction from target to lights.");
285 parameter = new G4UIparameter("x", 'd', omitable = true);
286 parameter -> SetDefaultValue (1);
287 fpCommandLightsVector -> SetParameter (parameter);
288 parameter = new G4UIparameter("y", 'd', omitable = true);
289 parameter -> SetDefaultValue (1);
290 fpCommandLightsVector -> SetParameter (parameter);
291 parameter = new G4UIparameter ("z", 'd', omitable = true);
292 parameter -> SetDefaultValue (1);
293 fpCommandLightsVector -> SetParameter (parameter);
294
295 fpCommandLineSegments = new G4UIcmdWithAnInteger
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);
303
304 fpCommandLineWidth = new G4UIcmdWithoutParameter
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\".");
310
311 fpCommandNumberOfCloudPoints = new G4UIcmdWithAnInteger
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);
317
318 fpCommandPicking = new G4UIcmdWithABool
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);
329
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);
340
341 fpCommandProjection->SetParameter(parameter);
342 parameter = new G4UIparameter("unit",'s',omitable = true);
344
345 fpCommandProjection->SetParameter(parameter);
346
347 fpCommandRotationStyle = new G4UIcmdWithAString
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");
357
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");
365 parameter = new G4UIparameter("Selector",'c',true);
366 parameter -> SetDefaultValue ("on");
367 fpCommandSectionPlane->SetParameter(parameter);
368 parameter = new G4UIparameter("x",'d',omitable = true);
369 parameter -> SetDefaultValue (0);
370 parameter -> SetGuidance ("Coordinate of point on the plane.");
371 fpCommandSectionPlane->SetParameter(parameter);
372 parameter = new G4UIparameter("y",'d',omitable = true);
373 parameter -> SetDefaultValue (0);
374 parameter -> SetGuidance ("Coordinate of point on the plane.");
375 fpCommandSectionPlane->SetParameter(parameter);
376 parameter = new G4UIparameter("z",'d',omitable = true);
377 parameter -> SetDefaultValue (0);
378 parameter -> SetGuidance ("Coordinate of point on the plane.");
379 fpCommandSectionPlane->SetParameter(parameter);
380 parameter = new G4UIparameter("unit",'s',omitable = true);
381 parameter -> SetDefaultValue ("m");
382 parameter -> SetGuidance ("Unit of point on the plane.");
383 fpCommandSectionPlane->SetParameter(parameter);
384 parameter = new G4UIparameter("nx",'d',omitable = true);
385 parameter -> SetDefaultValue (1);
386 parameter -> SetGuidance ("Component of plane normal.");
387 fpCommandSectionPlane->SetParameter(parameter);
388 parameter = new G4UIparameter("ny",'d',omitable = true);
389 parameter -> SetDefaultValue (0);
390 parameter -> SetGuidance ("Component of plane normal.");
391 fpCommandSectionPlane->SetParameter(parameter);
392 parameter = new G4UIparameter("nz",'d',omitable = true);
393 parameter -> SetDefaultValue (0);
394 parameter -> SetGuidance ("Component of plane normal.");
395 fpCommandSectionPlane->SetParameter(parameter);
396
397 fpCommandSpecialMeshRendering = new G4UIcmdWithABool
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);
403
404 fpCommandSpecialMeshRenderingOption = new G4UIcmdWithAString
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");
411
412 fpCommandSpecialMeshVolumes = new G4UIcommand
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);
424
425 fpCommandStyle = new G4UIcmdWithAString ("/vis/viewer/set/style",this);
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");
432
433 fpCommandTargetPoint = new G4UIcmdWith3VectorAndUnit
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");
445
446 fpCommandTransparencyByDepth = new G4UIcommand
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.");
458 parameter = new G4UIparameter("d", 'd', omitable = false);
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);
464
465 fpCommandUpThetaPhi = new G4UIcommand
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);
473 parameter = new G4UIparameter("phi", 'd', omitable = true);
474 parameter -> SetDefaultValue (90.);
475 fpCommandUpThetaPhi -> SetParameter (parameter);
476 parameter = new G4UIparameter ("unit", 's', omitable = true);
477 parameter -> SetDefaultValue ("deg");
478 fpCommandUpThetaPhi -> SetParameter (parameter);
479
480 fpCommandUpVector = new G4UIcommand
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.");
485 parameter = new G4UIparameter("x", 'd', omitable = true);
486 parameter -> SetDefaultValue (0.);
487 fpCommandUpVector -> SetParameter (parameter);
488 parameter = new G4UIparameter("y", 'd', omitable = true);
489 parameter -> SetDefaultValue (1.);
490 fpCommandUpVector -> SetParameter (parameter);
491 parameter = new G4UIparameter ("z", 'd', omitable = true);
492 parameter -> SetDefaultValue (0.);
493 fpCommandUpVector -> SetParameter (parameter);
494
495 fpCommandViewpointThetaPhi = new G4UIcommand
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);
504 parameter = new G4UIparameter("phi", 'd', omitable = true);
505 parameter -> SetDefaultValue (45.);
506 fpCommandViewpointThetaPhi -> SetParameter (parameter);
507 parameter = new G4UIparameter ("unit", 's', omitable = true);
508 parameter -> SetDefaultValue ("deg");
509 fpCommandViewpointThetaPhi -> SetParameter (parameter);
510
511 fpCommandViewpointVector = new G4UIcommand
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.");
517 parameter = new G4UIparameter("x", 'd', omitable = true);
518 parameter -> SetDefaultValue (1.);
519 fpCommandViewpointVector -> SetParameter (parameter);
520 parameter = new G4UIparameter("y", 'd', omitable = true);
521 parameter -> SetDefaultValue (1.);
522 fpCommandViewpointVector -> SetParameter (parameter);
523 parameter = new G4UIparameter ("z", 'd', omitable = true);
524 parameter -> SetDefaultValue (1.);
525 fpCommandViewpointVector -> SetParameter (parameter);
526
527 fpTimeWindowDirectory = new G4UIdirectory ("/vis/viewer/set/timeWindow/");
528 fpTimeWindowDirectory -> SetGuidance ("Set time window parameters of current viewer.");
529 G4String timeWindowGuidance =
530 "For these commands use"
531 "\n /vis/scene/add/trajectories rich"
532 "\n /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns"
533 "\nthen typically"
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";
545
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);
567 parameter = new G4UIparameter ("red", 'd', omitable = true);
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);
579
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);
615 parameter = new G4UIparameter ("red", 'd', omitable = true);
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);
627
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);
644
645 fpCommandTimeWindowFadeFactor =
646 new G4UIcmdWithADouble("/vis/viewer/set/timeWindow/fadeFactor", this);
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.);
653
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);
670
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);
675}
CLHEP::Hep3Vector G4ThreeVector
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
void SetCurrentAsDefault(G4bool val)
const G4String & ConvertToColourGuidance()
static constexpr G4double fVeryLongTime