Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandsViewerSet.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27
28// /vis/viewer/set commands - John Allison 16th May 2000
29
31
32#include "G4UIcommand.hh"
34#include "G4UIcmdWithAString.hh"
35#include "G4UIcmdWithABool.hh"
37#include "G4UIcmdWithADouble.hh"
39#include "G4UnitsTable.hh"
40#include "G4VisManager.hh"
41#include "G4Polyhedron.hh"
42#include "G4SystemOfUnits.hh"
43
44#include <sstream>
45#include <iomanip>
46
47#define G4warn G4cout
48
50fLightsVector (G4ThreeVector(1.,1.,1.)),
51fUpVector (G4ThreeVector(0.,1.,0.)),
52fViewpointVector (G4ThreeVector(0.,0.,1.))
53{
54 G4bool omitable;
55 G4UIparameter* parameter;
56
57 fpCommandAll = new G4UIcmdWithAString ("/vis/viewer/set/all",this);
58 fpCommandAll->SetGuidance
59 ("Copies view parameters.");
60 fpCommandAll->SetGuidance
61 ("Copies ALL view parameters (except the autoRefresh status) from"
62 "\nfrom-viewer to current viewer. You may need \"/vis/viewer/rebuild\".");
63 fpCommandAll->SetGuidance
64 ("Note: to copy only the camera-specific parameters use"
65 "\n\"/vis/viewer/copyfrom\".");
66 fpCommandAll->SetParameterName ("from-viewer-name",omitable = false);
67
68 fpCommandAutoRefresh = new G4UIcmdWithABool
69 ("/vis/viewer/set/autoRefresh",this);
70 fpCommandAutoRefresh->SetGuidance("Sets auto-refresh.");
71 fpCommandAutoRefresh->SetGuidance
72 ("If true, view is automatically refreshed after a change of"
73 "\nview parameters.");
74 fpCommandAutoRefresh->SetParameterName("auto-refresh",omitable = true);
75 fpCommandAutoRefresh->SetDefaultValue(true);
76
77 fpCommandAuxEdge = new G4UIcmdWithABool
78 ("/vis/viewer/set/auxiliaryEdge",this);
79 fpCommandAuxEdge->SetGuidance("Sets visibility of auxiliary edges");
80 fpCommandAuxEdge->SetGuidance
81 ("Auxiliary edges, i.e., those that are part of a curved surface,"
82 "\nsometimes called soft edges, become visible/invisible.");
83 fpCommandAuxEdge->SetParameterName("edge",omitable = true);
84 fpCommandAuxEdge->SetDefaultValue(true);
85
86 fpCommandBackground = new G4UIcommand
87 ("/vis/viewer/set/background",this);
88 fpCommandBackground->SetGuidance
89 ("Set background colour and transparency (default black and opaque).");
90 fpCommandBackground->SetGuidance(ConvertToColourGuidance());
91 parameter = new G4UIparameter("red_or_string", 's', omitable = true);
92 parameter -> SetDefaultValue ("0.");
93 fpCommandBackground -> SetParameter (parameter);
94 parameter = new G4UIparameter("green", 'd', omitable = true);
95 parameter -> SetDefaultValue (0.);
96 fpCommandBackground -> SetParameter (parameter);
97 parameter = new G4UIparameter ("blue", 'd', omitable = true);
98 parameter -> SetDefaultValue (0.);
99 fpCommandBackground -> SetParameter (parameter);
100 parameter = new G4UIparameter ("opacity", 'd', omitable = true);
101 parameter -> SetDefaultValue (1.);
102 fpCommandBackground -> SetParameter (parameter);
103
104 fpCommandCulling = new G4UIcommand("/vis/viewer/set/culling",this);
105 fpCommandCulling->SetGuidance ("Set culling options.");
106 fpCommandCulling->SetGuidance
107 ("\"global\": enables/disables all other culling options.");
108 fpCommandCulling->SetGuidance
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.");
114 fpCommandCulling->SetGuidance
115 ("\"invisible\": culls objects with the invisible attribute set.");
116 fpCommandCulling->SetGuidance
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)."
121 );
122 parameter = new G4UIparameter("culling-option",'s',omitable = false);
123 parameter->SetParameterCandidates
124 ("global coveredDaughters invisible density");
125 fpCommandCulling->SetParameter(parameter);
126 parameter = new G4UIparameter("action",'b',omitable = true);
127 parameter->SetDefaultValue(1);
128 fpCommandCulling->SetParameter(parameter);
129 parameter = new G4UIparameter("density-threshold",'d',omitable = true);
130 parameter->SetDefaultValue("0.01");
131 fpCommandCulling->SetParameter(parameter);
132 parameter = new G4UIparameter("unit",'s',omitable = true);
133 // parameter->SetParameterCandidates ("g/cm3 mg/cm3 kg/m3");
134 // Instead of the above, SetNewValue accepts *any* density unit.
135 parameter->SetDefaultValue("g/cm3");
136 fpCommandCulling->SetParameter(parameter);
137
138 fpCommandCutawayMode =
139 new G4UIcmdWithAString ("/vis/viewer/set/cutawayMode", this);
140 fpCommandCutawayMode->SetGuidance
141 ("Sets cutaway mode - add (union) or multiply (intersection).");
142 fpCommandCutawayMode->SetParameterName ("cutaway-mode",omitable = false);
143 fpCommandCutawayMode->SetCandidates ("add union multiply intersection");
144 fpCommandCutawayMode->SetDefaultValue("union");
145
146 fpCommandDefaultColour = new G4UIcommand
147 ("/vis/viewer/set/defaultColour",this);
148 fpCommandDefaultColour->SetGuidance
149 ("Set defaultColour colour and transparency (default white and opaque).");
150 fpCommandDefaultColour->SetGuidance(ConvertToColourGuidance());
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);
163
164 fpCommandDefaultTextColour = new G4UIcommand
165 ("/vis/viewer/set/defaultTextColour",this);
166 fpCommandDefaultTextColour->SetGuidance
167 ("Set defaultTextColour colour and transparency (default blue and opaque).");
168 fpCommandDefaultTextColour->SetGuidance(ConvertToColourGuidance());
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);
181
182 fpCommandEdge = new G4UIcmdWithABool("/vis/viewer/set/edge",this);
183 fpCommandEdge->SetGuidance
184 ("Edges become visible/invisible in surface mode.");
185 fpCommandEdge->SetParameterName("edge",omitable = true);
186 fpCommandEdge->SetDefaultValue(true);
187
188 fpCommandExplodeFactor = new G4UIcommand
189 ("/vis/viewer/set/explodeFactor", this);
190 fpCommandExplodeFactor->SetGuidance
191 ("Moves top-level drawn volumes by this factor from this centre.");
192 parameter = new G4UIparameter("explodeFactor", 'd', omitable=true);
193 parameter->SetParameterRange("explodeFactor>=1.");
194 parameter->SetDefaultValue(1.);
195 fpCommandExplodeFactor->SetParameter(parameter);
196 parameter = new G4UIparameter("x",'d',omitable = true);
197 parameter->SetDefaultValue (0);
198 parameter->SetGuidance ("Coordinate of explode centre.");
199 fpCommandExplodeFactor->SetParameter(parameter);
200 parameter = new G4UIparameter("y",'d',omitable = true);
201 parameter->SetDefaultValue (0);
202 parameter->SetGuidance ("Coordinate of explode centre.");
203 fpCommandExplodeFactor->SetParameter(parameter);
204 parameter = new G4UIparameter("z",'d',omitable = true);
205 parameter->SetDefaultValue (0);
206 parameter->SetGuidance ("Coordinate of explode centre.");
207 fpCommandExplodeFactor->SetParameter(parameter);
208 parameter = new G4UIparameter("unit",'s',omitable = true);
209 parameter->SetDefaultValue ("m");
210 parameter->SetGuidance ("Unit of explode centre.");
211 fpCommandExplodeFactor->SetParameter(parameter);
212
213 fpCommandGlobalLineWidthScale = new G4UIcmdWithADouble
214 ("/vis/viewer/set/globalLineWidthScale", this);
215 fpCommandGlobalLineWidthScale->SetGuidance
216 ("Multiplies line widths by this factor.");
217 fpCommandGlobalLineWidthScale->
218 SetParameterName("scale-factor", omitable=true);
219 fpCommandGlobalLineWidthScale->SetDefaultValue(1.);
220
221 fpCommandGlobalMarkerScale = new G4UIcmdWithADouble
222 ("/vis/viewer/set/globalMarkerScale", this);
223 fpCommandGlobalMarkerScale->SetGuidance
224 ("Multiplies marker sizes by this factor.");
225 fpCommandGlobalMarkerScale->
226 SetParameterName("scale-factor", omitable=true);
227 fpCommandGlobalMarkerScale->SetDefaultValue(1.);
228
229 fpCommandHiddenEdge =
230 new G4UIcmdWithABool("/vis/viewer/set/hiddenEdge",this);
231 fpCommandHiddenEdge->SetGuidance
232 ("Edges become hidden/seen in wireframe or surface mode.");
233 fpCommandHiddenEdge->SetParameterName("hidden-edge",omitable = true);
234 fpCommandHiddenEdge->SetDefaultValue(true);
235
236 fpCommandHiddenMarker =
237 new G4UIcmdWithABool("/vis/viewer/set/hiddenMarker",this);
238 fpCommandHiddenMarker->SetGuidance
239 ("If true, closer objects hide markers. Otherwise, markers always show.");
240 fpCommandHiddenMarker->SetParameterName("hidden-marker",omitable = true);
241 fpCommandHiddenMarker->SetDefaultValue(true);
242
243 fpCommandLightsMove = new G4UIcmdWithAString
244 ("/vis/viewer/set/lightsMove",this);
245 fpCommandLightsMove->SetGuidance
246 ("Lights move with camera or with object");
247 fpCommandLightsMove->SetParameterName("lightsMove",omitable = false);
248 fpCommandLightsMove->SetCandidates
249 ("cam camera with-camera obj object with-object");
250
251 fpCommandLightsThetaPhi = new G4UIcommand
252 ("/vis/viewer/set/lightsThetaPhi", this);
253 fpCommandLightsThetaPhi->SetGuidance
254 ("Set direction from target to lights.");
255 parameter = new G4UIparameter("theta", 'd', omitable = true);
256 parameter -> SetDefaultValue(60.);
257 fpCommandLightsThetaPhi -> SetParameter (parameter);
258 parameter = new G4UIparameter("phi", 'd', omitable = true);
259 parameter -> SetDefaultValue(45.);
260 fpCommandLightsThetaPhi -> SetParameter (parameter);
261 parameter = new G4UIparameter ("unit", 's', omitable = true);
262 parameter -> SetDefaultValue ("deg");
263 fpCommandLightsThetaPhi -> SetParameter (parameter);
264
265 fpCommandLightsVector = new G4UIcommand
266 ("/vis/viewer/set/lightsVector", this);
267 fpCommandLightsVector->SetGuidance
268 ("Set direction from target to lights.");
269 parameter = new G4UIparameter("x", 'd', omitable = true);
270 parameter -> SetDefaultValue (1);
271 fpCommandLightsVector -> SetParameter (parameter);
272 parameter = new G4UIparameter("y", 'd', omitable = true);
273 parameter -> SetDefaultValue (1);
274 fpCommandLightsVector -> SetParameter (parameter);
275 parameter = new G4UIparameter ("z", 'd', omitable = true);
276 parameter -> SetDefaultValue (1);
277 fpCommandLightsVector -> SetParameter (parameter);
278
279 fpCommandLineSegments = new G4UIcmdWithAnInteger
280 ("/vis/viewer/set/lineSegmentsPerCircle",this);
281 fpCommandLineSegments->SetGuidance
282 ("Set number of sides per circle for polygon/polyhedron drawing.");
283 fpCommandLineSegments->SetGuidance
284 ("Refers to graphical representation of objects with curved lines/surfaces.");
285 fpCommandLineSegments->SetParameterName("line-segments",omitable = true);
286 fpCommandLineSegments->SetDefaultValue(24);
287
288 fpCommandLineWidth = new G4UIcmdWithoutParameter
289 ("/vis/viewer/set/lineWidth",this);
290 fpCommandLineWidth->SetGuidance
291 ("Use \"/vis/viewer/set/globalLineWidthScale\" instead."
292 "\nFor trajectories use \"/vis/modeling/trajectories/*/default/setLineWidth\"."
293 "\nFor volumes use \"/vis/geometry/set/lineWidth\".");
294
295 fpCommandNumberOfCloudPoints = new G4UIcmdWithAnInteger
296 ("/vis/viewer/set/numberOfCloudPoints",this);
297 fpCommandNumberOfCloudPoints->SetGuidance
298 ("Set number of points to be used for cloud representation of volumes.");
299 fpCommandNumberOfCloudPoints->SetParameterName("points",omitable = true);
300 fpCommandNumberOfCloudPoints->SetDefaultValue(10000);
301
302 fpCommandPicking = new G4UIcmdWithABool
303 ("/vis/viewer/set/picking",this);
304 fpCommandPicking->SetGuidance("Sets picking, if available.");
305 fpCommandPicking->SetGuidance
306 ("If true, view is set up for picking, if available.");
307 fpCommandPicking->SetGuidance
308 ("You may need to issue \"/vis/viewer/update\".");
309 fpCommandPicking->SetGuidance
310 ("For required actions, watch for instructions for viewer.");
311 fpCommandPicking->SetParameterName("picking",omitable = true);
312 fpCommandPicking->SetDefaultValue(true);
313
314 fpCommandProjection = new G4UIcommand("/vis/viewer/set/projection",this);
315 fpCommandProjection->SetGuidance
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);
319 parameter->SetParameterCandidates("o orthogonal p perspective");
320 parameter->SetDefaultValue("orthogonal");
321 fpCommandProjection->SetParameter(parameter);
322 parameter = new G4UIparameter("field-half-angle",'d',omitable = true);
323 parameter->SetDefaultValue(30.);
324 //parameter->SetCurrentAsDefault(true);
325 fpCommandProjection->SetParameter(parameter);
326 parameter = new G4UIparameter("unit",'s',omitable = true);
327 parameter->SetDefaultValue("deg");
328 //parameter->SetCurrentAsDefault(true);
329 fpCommandProjection->SetParameter(parameter);
330
331 fpCommandRotationStyle = new G4UIcmdWithAString
332 ("/vis/viewer/set/rotationStyle",this);
333 fpCommandRotationStyle->SetGuidance
334 ("Set style of rotation - constrainUpDirection or freeRotation.");
335 fpCommandRotationStyle->SetGuidance
336 ("constrainUpDirection: conventional HEP view.");
337 fpCommandRotationStyle->SetGuidance
338 ("freeRotation: Google-like rotation, using mouse-grab.");
339 fpCommandRotationStyle->SetParameterName ("style",omitable = false);
340 fpCommandRotationStyle->SetCandidates("constrainUpDirection freeRotation");
341
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");
349 parameter = new G4UIparameter("Selector",'c',true);
350 parameter -> SetDefaultValue ("on");
351 fpCommandSectionPlane->SetParameter(parameter);
352 parameter = new G4UIparameter("x",'d',omitable = true);
353 parameter -> SetDefaultValue (0);
354 parameter -> SetGuidance ("Coordinate of point on the plane.");
355 fpCommandSectionPlane->SetParameter(parameter);
356 parameter = new G4UIparameter("y",'d',omitable = true);
357 parameter -> SetDefaultValue (0);
358 parameter -> SetGuidance ("Coordinate of point on the plane.");
359 fpCommandSectionPlane->SetParameter(parameter);
360 parameter = new G4UIparameter("z",'d',omitable = true);
361 parameter -> SetDefaultValue (0);
362 parameter -> SetGuidance ("Coordinate of point on the plane.");
363 fpCommandSectionPlane->SetParameter(parameter);
364 parameter = new G4UIparameter("unit",'s',omitable = true);
365 parameter -> SetDefaultValue ("m");
366 parameter -> SetGuidance ("Unit of point on the plane.");
367 fpCommandSectionPlane->SetParameter(parameter);
368 parameter = new G4UIparameter("nx",'d',omitable = true);
369 parameter -> SetDefaultValue (1);
370 parameter -> SetGuidance ("Component of plane normal.");
371 fpCommandSectionPlane->SetParameter(parameter);
372 parameter = new G4UIparameter("ny",'d',omitable = true);
373 parameter -> SetDefaultValue (0);
374 parameter -> SetGuidance ("Component of plane normal.");
375 fpCommandSectionPlane->SetParameter(parameter);
376 parameter = new G4UIparameter("nz",'d',omitable = true);
377 parameter -> SetDefaultValue (0);
378 parameter -> SetGuidance ("Component of plane normal.");
379 fpCommandSectionPlane->SetParameter(parameter);
380
381 fpCommandSpecialMeshRendering = new G4UIcmdWithABool
382 ("/vis/viewer/set/specialMeshRendering",this);
383 fpCommandSpecialMeshRendering -> SetGuidance
384 ("Request special rendering of volumes (meshes) that use G4VParameterisation.");
385 fpCommandSpecialMeshRendering->SetParameterName("render",omitable = true);
386 fpCommandSpecialMeshRendering->SetDefaultValue(true);
387
388 fpCommandSpecialMeshRenderingOption = new G4UIcmdWithAString
389 ("/vis/viewer/set/specialMeshRenderingOption",this);
390 fpCommandSpecialMeshRenderingOption->SetGuidance
391 ("Set special mesh rendering option - \"default\", \"dots\" or \"surfaces\".");
392 fpCommandSpecialMeshRenderingOption->SetParameterName ("option",omitable = true);
393 fpCommandSpecialMeshRenderingOption->SetCandidates("default dots surfaces");
394 fpCommandSpecialMeshRenderingOption->SetDefaultValue("default");
395
396 fpCommandSpecialMeshVolumes = new G4UIcommand
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\".");
401 fpCommandSpecialMeshVolumes->SetGuidance
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);
405 parameter->SetGuidance
406 ("List of physical volume names and copy number pairs");
407 fpCommandSpecialMeshVolumes->SetParameter(parameter);
408
409 fpCommandStyle = new G4UIcmdWithAString ("/vis/viewer/set/style",this);
410 fpCommandStyle->SetGuidance
411 ("Set style of drawing - w[ireframe] or s[urface] or c[loud].");
412 fpCommandStyle->SetGuidance
413 ("(Hidden line drawing is controlled by \"/vis/viewer/set/hiddenEdge\".)");
414 fpCommandStyle->SetParameterName ("style",omitable = false);
415 fpCommandStyle->SetCandidates("w wireframe s surface c cloud");
416
417 fpCommandTargetPoint = new G4UIcmdWith3VectorAndUnit
418 ("/vis/viewer/set/targetPoint", this);
419 fpCommandTargetPoint->SetGuidance
420 ("Set target point.");
421 fpCommandTargetPoint->SetGuidance
422 ("This sets the \"Current Target Point\" relative to the \"Standard");
423 fpCommandTargetPoint->SetGuidance
424 ("Target Point\" so that the actual target point is as requested.");
425 fpCommandTargetPoint->SetGuidance
426 ("(See G4ViewParameters.hh for an explanation of target points.)");
427 fpCommandTargetPoint->SetParameterName("x", "y", "z", omitable = false);
428 fpCommandTargetPoint->SetUnitCategory("Length");
429
430 fpCommandUpThetaPhi = new G4UIcommand
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);
438 parameter = new G4UIparameter("phi", 'd', omitable = true);
439 parameter -> SetDefaultValue (90.);
440 fpCommandUpThetaPhi -> SetParameter (parameter);
441 parameter = new G4UIparameter ("unit", 's', omitable = true);
442 parameter -> SetDefaultValue ("deg");
443 fpCommandUpThetaPhi -> SetParameter (parameter);
444
445 fpCommandUpVector = new G4UIcommand
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.");
450 parameter = new G4UIparameter("x", 'd', omitable = true);
451 parameter -> SetDefaultValue (0.);
452 fpCommandUpVector -> SetParameter (parameter);
453 parameter = new G4UIparameter("y", 'd', omitable = true);
454 parameter -> SetDefaultValue (1.);
455 fpCommandUpVector -> SetParameter (parameter);
456 parameter = new G4UIparameter ("z", 'd', omitable = true);
457 parameter -> SetDefaultValue (0.);
458 fpCommandUpVector -> SetParameter (parameter);
459
460 fpCommandViewpointThetaPhi = new G4UIcommand
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);
469 parameter = new G4UIparameter("phi", 'd', omitable = true);
470 parameter -> SetDefaultValue (45.);
471 fpCommandViewpointThetaPhi -> SetParameter (parameter);
472 parameter = new G4UIparameter ("unit", 's', omitable = true);
473 parameter -> SetDefaultValue ("deg");
474 fpCommandViewpointThetaPhi -> SetParameter (parameter);
475
476 fpCommandViewpointVector = new G4UIcommand
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.");
482 parameter = new G4UIparameter("x", 'd', omitable = true);
483 parameter -> SetDefaultValue (1.);
484 fpCommandViewpointVector -> SetParameter (parameter);
485 parameter = new G4UIparameter("y", 'd', omitable = true);
486 parameter -> SetDefaultValue (1.);
487 fpCommandViewpointVector -> SetParameter (parameter);
488 parameter = new G4UIparameter ("z", 'd', omitable = true);
489 parameter -> SetDefaultValue (1.);
490 fpCommandViewpointVector -> SetParameter (parameter);
491
492 fpTimeWindowDirectory = new G4UIdirectory ("/vis/viewer/set/timeWindow/");
493 fpTimeWindowDirectory -> SetGuidance ("Set time window parameters of current viewer.");
494 G4String timeWindowGuidance =
495 "For these commands use"
496 "\n /vis/scene/add/trajectories rich"
497 "\n /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns"
498 "\nthen typically"
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";
510
511 fpCommandTimeWindowDisplayHeadTime =
512 new G4UIcommand("/vis/viewer/set/timeWindow/displayHeadTime", this);
513 fpCommandTimeWindowDisplayHeadTime->SetGuidance
514 ("Display head time of range in 2D text.");
515 fpCommandTimeWindowDisplayHeadTime->SetGuidance(timeWindowGuidance);
516 parameter = new G4UIparameter ("displayHeadTime", 'b', omitable = false);
517 parameter->SetDefaultValue(false);
518 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
519 parameter = new G4UIparameter ("screenX", 'd', omitable = true);
520 parameter->SetGuidance("-1 < screenX < 1");
521 parameter->SetParameterRange("screenX >= -1. && screenX <= 1.");
522 parameter->SetDefaultValue(-0.9);
523 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
524 parameter = new G4UIparameter ("screenY", 'd', omitable = true);
525 parameter->SetGuidance("-1 < screenY < 1");
526 parameter->SetParameterRange("screenY >= -1. && screenY <= 1.");
527 parameter->SetDefaultValue(-0.9);
528 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
529 parameter = new G4UIparameter ("screenSize", 'd', omitable = true);
530 parameter->SetDefaultValue(24.);
531 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
532 parameter = new G4UIparameter ("red", 'd', omitable = true);
533 parameter->SetParameterRange("red >= 0. && red <= 1.");
534 parameter->SetDefaultValue(0.);
535 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
536 parameter = new G4UIparameter ("green", 'd', omitable = true);
537 parameter->SetParameterRange("green >= 0. && green <= 1.");
538 parameter->SetDefaultValue(1.);
539 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
540 parameter = new G4UIparameter ("blue", 'd', omitable = true);
541 parameter->SetParameterRange("blue >= 0. && blue <= 1.");
542 parameter->SetDefaultValue(1.);
543 fpCommandTimeWindowDisplayHeadTime->SetParameter(parameter);
544
545 fpCommandTimeWindowDisplayLightFront =
546 new G4UIcommand("/vis/viewer/set/timeWindow/displayLightFront", this);
547 fpCommandTimeWindowDisplayLightFront->SetGuidance
548 ("Display the light front at head time.");
549 fpCommandTimeWindowDisplayLightFront->SetGuidance
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);
560 parameter->SetDefaultValue(true);
561 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
562 parameter = new G4UIparameter ("originX", 'd', omitable = true);
563 parameter->SetDefaultValue(0.);
564 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
565 parameter = new G4UIparameter ("originY", 'd', omitable = true);
566 parameter->SetDefaultValue(0.);
567 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
568 parameter = new G4UIparameter ("originZ", 'd', omitable = true);
569 parameter->SetDefaultValue(0.);
570 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
571 parameter = new G4UIparameter ("space_unit", 's', omitable = true);
572 parameter->SetDefaultValue("m");
573 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
574 parameter = new G4UIparameter ("originT", 'd', omitable = true);
575 parameter->SetDefaultValue(0.);
576 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
577 parameter = new G4UIparameter ("time_unit", 's', omitable = true);
578 parameter->SetDefaultValue("s");
579 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
580 parameter = new G4UIparameter ("red", 'd', omitable = true);
581 parameter->SetParameterRange("red >= 0. && red <= 1.");
582 parameter->SetDefaultValue(0.);
583 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
584 parameter = new G4UIparameter ("green", 'd', omitable = true);
585 parameter->SetParameterRange("green >= 0. && green <= 1.");
586 parameter->SetDefaultValue(1.);
587 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
588 parameter = new G4UIparameter ("blue", 'd', omitable = true);
589 parameter->SetParameterRange("blue >= 0. && blue <= 1.");
590 parameter->SetDefaultValue(0.);
591 fpCommandTimeWindowDisplayLightFront->SetParameter(parameter);
592
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);
599 fpCommandTimeWindowEndTime->SetParameter(parameter);
600 parameter = new G4UIparameter ("end-time-unit", 's', omitable = false);
601 parameter->SetDefaultValue("ns");
602 fpCommandTimeWindowEndTime->SetParameter(parameter);
603 parameter = new G4UIparameter ("time-range", 'd', omitable = true);
604 parameter->SetDefaultValue(-1.);
605 fpCommandTimeWindowEndTime->SetParameter(parameter);
606 parameter = new G4UIparameter ("time-range-unit", 's', omitable = true);
607 parameter->SetDefaultValue("ns");
608 fpCommandTimeWindowEndTime->SetParameter(parameter);
609
610 fpCommandTimeWindowFadeFactor =
611 new G4UIcmdWithADouble("/vis/viewer/set/timeWindow/fadeFactor", this);
612 fpCommandTimeWindowFadeFactor->SetGuidance
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.");
617 fpCommandTimeWindowFadeFactor->SetDefaultValue(0.);
618
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);
625 fpCommandTimeWindowStartTime->SetParameter(parameter);
626 parameter = new G4UIparameter ("start-time-unit", 's', omitable = false);
627 parameter->SetDefaultValue("ns");
628 fpCommandTimeWindowStartTime->SetParameter(parameter);
629 parameter = new G4UIparameter ("time-range", 'd', omitable = true);
630 parameter->SetDefaultValue(-1.);
631 fpCommandTimeWindowStartTime->SetParameter(parameter);
632 parameter = new G4UIparameter ("time-range-unit", 's', omitable = true);
633 parameter->SetDefaultValue("ns");
634 fpCommandTimeWindowStartTime->SetParameter(parameter);
635}
636
638 delete fpCommandTimeWindowStartTime;
639 delete fpCommandTimeWindowFadeFactor;
640 delete fpCommandTimeWindowEndTime;
641 delete fpCommandTimeWindowDisplayLightFront;
642 delete fpCommandTimeWindowDisplayHeadTime;
643 delete fpTimeWindowDirectory;
644 delete fpCommandViewpointVector;
645 delete fpCommandViewpointThetaPhi;
646 delete fpCommandUpVector;
647 delete fpCommandUpThetaPhi;
648 delete fpCommandTargetPoint;
649 delete fpCommandStyle;
650 delete fpCommandSpecialMeshVolumes;
651 delete fpCommandSpecialMeshRenderingOption;
652 delete fpCommandSpecialMeshRendering;
653 delete fpCommandSectionPlane;
654 delete fpCommandRotationStyle;
655 delete fpCommandProjection;
656 delete fpCommandPicking;
657 delete fpCommandNumberOfCloudPoints;
658 delete fpCommandLineWidth;
659 delete fpCommandLineSegments;
660 delete fpCommandLightsVector;
661 delete fpCommandLightsThetaPhi;
662 delete fpCommandLightsMove;
663 delete fpCommandHiddenMarker;
664 delete fpCommandHiddenEdge;
665 delete fpCommandGlobalMarkerScale;
666 delete fpCommandGlobalLineWidthScale;
667 delete fpCommandExplodeFactor;
668 delete fpCommandEdge;
669 delete fpCommandDefaultTextColour;
670 delete fpCommandDefaultColour;
671 delete fpCommandCutawayMode;
672 delete fpCommandCulling;
673 delete fpCommandBackground;
674 delete fpCommandAuxEdge;
675 delete fpCommandAutoRefresh;
676 delete fpCommandAll;
677}
678
682
684(G4UIcommand* command,G4String newValue) {
685
687
688 G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
689 if (!currentViewer) {
690 if (verbosity >= G4VisManager::errors) {
691 G4warn <<
692 "ERROR: G4VisCommandsViewerSet::SetNewValue: no current viewer."
693 << G4endl;
694 }
695 return;
696 }
697
698 G4ViewParameters vp = currentViewer->GetViewParameters();
699
700 if (command == fpCommandAll) {
701 G4VViewer* fromViewer = fpVisManager->GetViewer(newValue);
702 if (!fromViewer) {
703 if (verbosity >= G4VisManager::errors) {
704 G4warn <<
705 "ERROR: G4VisCommandsViewerSet::SetNewValue: all:"
706 "\n unrecognised from-viewer."
707 << G4endl;
708 }
709 return;
710 }
711 if (fromViewer == currentViewer) {
712 if (verbosity >= G4VisManager::warnings) {
713 G4warn <<
714 "WARNING: G4VisCommandsViewerSet::SetNewValue: all:"
715 "\n from-viewer and current viewer are identical."
716 << G4endl;
717 }
718 return;
719 }
720 // Copy view parameters except for autoRefresh and background...
721 auto keepAutoRefresh = vp.IsAutoRefresh();
722 auto keepBackground = vp.GetBackgroundColour();
723 vp = fromViewer->GetViewParameters();
724 vp.SetAutoRefresh(keepAutoRefresh);
725 vp.SetBackgroundColour(keepBackground);
726 // Concatenate any private vis attributes modifiers...
727 const std::vector<G4ModelingParameters::VisAttributesModifier>*
728 privateVAMs = fromViewer->GetPrivateVisAttributesModifiers();
729 if (privateVAMs) {
730 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator i;
731 for (i = privateVAMs->begin(); i != privateVAMs->end(); ++i) {
733 }
734 }
735 if (verbosity >= G4VisManager::confirmations) {
736 G4cout << "View parameters of viewer \"" << currentViewer->GetName()
737 << "\"\n set to those of viewer \"" << fromViewer->GetName()
738 << "\"."
739 << G4endl;
740 }
741 if (verbosity >= G4VisManager::warnings) {
742 G4warn << "You may need \"/vis/viewer/rebuild\"."
743 << G4endl;
744 }
745 }
746
747 else if (command == fpCommandAutoRefresh) {
748 G4bool autoRefresh = G4UIcommand::ConvertToBool(newValue);
749 const G4ViewParameters& defaultVP =
750 currentViewer->GetDefaultViewParameters();
751 if (autoRefresh && !defaultVP.IsAutoRefresh()) {
752 if (verbosity >= G4VisManager::warnings) {
753 G4warn
754 << "WARNING: "
755 << currentViewer->GetName() << " is NOT auto-refesh by default"
756 << "\n so cannot be set to auto-refresh."
757 << G4endl;
758 }
759 return;
760 }
761 vp.SetAutoRefresh(autoRefresh);
762 if (verbosity >= G4VisManager::confirmations) {
763 G4cout << "Views will ";
764 if (!vp.IsAutoRefresh()) G4cout << "not ";
765 G4cout << "be automatically refreshed after a change of view parameters."
766 << G4endl;
767 }
768 if (!vp.IsAutoRefresh()) {
769 currentViewer->SetViewParameters(vp);
770 return; // Avoid a refresh if auto-refresh has been set to off...
771 } // ...otherwise take normal action.
772 }
773
774 else if (command == fpCommandAuxEdge) {
776 if (verbosity >= G4VisManager::confirmations) {
777 G4cout << "Auxiliary edges will ";
778 if (!vp.IsAuxEdgeVisible()) G4cout << "not ";
779 G4cout << "be visible." << G4endl;
780 }
781 }
782
783 else if (command == fpCommandBackground) {
784 G4String redOrString;
785 G4double green, blue, opacity;
786 std::istringstream iss(newValue);
787 iss >> redOrString >> green >> blue >> opacity;
788 G4Colour colour(0.,0.,0.); // Default black and opaque.
789 ConvertToColour(colour, redOrString, green, blue, opacity);
790 vp.SetBackgroundColour(colour);
791 if (verbosity >= G4VisManager::confirmations) {
792 G4cout << "Background colour "
793 << vp.GetBackgroundColour()
794 << " requested."
795 << G4endl;
796 }
797 }
798
799 else if (command == fpCommandCulling) {
800 G4String cullingOption, stringFlag, unit;
801 G4double density;
802 std::istringstream is (newValue);
803 is >> cullingOption >> stringFlag >> density >> unit;
804 G4bool boolFlag = G4UIcommand::ConvertToBool(stringFlag);
805 if (cullingOption == "global") {
806 vp.SetCulling(boolFlag);
807 if (verbosity >= G4VisManager::confirmations) {
808 G4cout <<
809 "G4VisCommandsViewerSet::SetNewValue: culling: global culling flag"
810 " set to " << G4UIcommand::ConvertToString(boolFlag) <<
811 ".\n Does not change specific culling flags."
812 << G4endl;
813 }
814 }
815 else if (cullingOption == "coveredDaughters") {
816 vp.SetCullingCovered(boolFlag);
817 if (verbosity >= G4VisManager::confirmations) {
818 G4cout <<
819 "G4VisCommandsViewerSet::SetNewValue: culling: culling covered"
820 "\n daughters flag set to "
821 << G4UIcommand::ConvertToString(boolFlag) <<
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."
827 << G4endl;
828 }
829 }
830 else if (cullingOption == "invisible") {
831 vp.SetCullingInvisible(boolFlag);
832 if (verbosity >= G4VisManager::confirmations) {
833 G4cout <<
834 "G4VisCommandsViewerSet::SetNewValue: culling: culling invisible"
835 "\n flag set to "
836 << boolFlag << G4UIcommand::ConvertToString(boolFlag) <<
837 ". Volumes marked invisible will be culled,"
838 "\n i.e., not drawn, if this flag is true."
839 << G4endl;
840 }
841 }
842 else if (cullingOption == "density") {
843 const G4String where =
844 "G4VisCommandsViewerSet::SetNewValue: culling: culling by density";
845 if (boolFlag) {
846 G4double valueOfUnit;
847 // "Volumic Mass" is Michel's phrase for "Density"
848 if (ProvideValueOfUnit(where,unit,"Volumic Mass",valueOfUnit)) {
849 // Successful outcome of unit search
850 vp.SetDensityCulling(boolFlag);
851 density *= valueOfUnit;
852 vp.SetVisibleDensity(density);
853 } else {
854 // Unsuccessful outcome of unit search. Flag and density unchanged.
855 density = vp.GetVisibleDensity();
856 }
857 } else { // Reset flag but density unchanged.
858 vp.SetDensityCulling(boolFlag);
859 }
860 if (verbosity >= G4VisManager::confirmations) {
861 G4cout
862 << where
863 << "\n flag set to "
864 << std::boolalpha << vp.IsDensityCulling()
865 << ". Volumes with density less than "
866 << G4BestUnit(density,"Volumic Mass")
867 << "\n will be culled, i.e., not drawn, if this flag is true."
868 << G4endl;
869 }
870 }
871 else {
872 if (verbosity >= G4VisManager::errors) {
873 G4warn <<
874 "ERROR: G4VisCommandsViewerSet::SetNewValue: culling:"
875 "\n option not recognised."
876 << G4endl;
877 }
878 }
879 }
880
881 else if (command == fpCommandCutawayMode) {
882 if (newValue == "add" || newValue == "union")
884 if (newValue == "multiply" || newValue == "intersection")
886
887 if (verbosity >= G4VisManager::confirmations) {
888 G4cout << "Cutaway mode set to ";
890 G4cout << "cutawayUnion";
892 G4cout << "cutawayIntersection";
893 G4cout << G4endl;
894 }
895 }
896
897 else if (command == fpCommandDefaultColour) {
898 G4String redOrString;
899 G4double green, blue, opacity;
900 std::istringstream iss(newValue);
901 iss >> redOrString >> green >> blue >> opacity;
902 G4Colour colour(1.,1.,1.); // Default white and opaque.
903 ConvertToColour(colour, redOrString, green, blue, opacity);
905 va.SetColour(colour);
907 if (verbosity >= G4VisManager::confirmations) {
908 G4cout << "Default colour "
910 << " requested."
911 << G4endl;
912 }
913 }
914
915 else if (command == fpCommandDefaultTextColour) {
916 G4String redOrString;
917 G4double green, blue, opacity;
918 std::istringstream iss(newValue);
919 iss >> redOrString >> green >> blue >> opacity;
920 G4Colour colour(1.,1.,1.); // Default white and opaque.
921 ConvertToColour(colour, redOrString, green, blue, opacity);
923 va.SetColour(colour);
925 if (verbosity >= G4VisManager::confirmations) {
926 G4cout << "Default colour "
928 << " requested."
929 << G4endl;
930 }
931 }
932
933 else if (command == fpCommandEdge) {
935 if (G4UIcommand::ConvertToBool(newValue)) { // true
936 switch (existingStyle) {
938 break;
940 break;
943 break;
945 break;
947 break;
948 }
949 }
950 else { // false
951 switch (existingStyle) {
953 break;
955 break;
957 break;
960 break;
962 break;
963 }
964 }
965 if (verbosity >= G4VisManager::confirmations) {
966 G4cout << "Drawing style of viewer \"" << currentViewer->GetName()
967 << "\" set to " << vp.GetDrawingStyle()
968 << G4endl;
969 }
970 }
971
972 else if (command == fpCommandExplodeFactor) {
973 G4double explodeFactor, x, y, z;
974 G4String unitString;
975 std::istringstream is (newValue);
976 is >> explodeFactor >> x >> y >> z >> unitString;
977 G4double unit = G4UIcommand::ValueOf(unitString);
978 vp.SetExplodeFactor(explodeFactor);
979 vp.SetExplodeCentre(G4Point3D(x * unit, y * unit, z * unit));
980 if (verbosity >= G4VisManager::confirmations) {
981 G4cout << "Explode factor changed to " << vp.GetExplodeFactor()
982 << " from centre " << vp.GetExplodeCentre()
983 << G4endl;
984 }
985 }
986
987 else if (command == fpCommandGlobalLineWidthScale) {
988 G4double globalLineWidthScale
989 = fpCommandGlobalLineWidthScale->GetNewDoubleValue(newValue);
990 vp.SetGlobalLineWidthScale(globalLineWidthScale);
991 if (verbosity >= G4VisManager::confirmations) {
992 G4cout << "Global Line Width Scale changed to "
994 }
995 }
996
997 else if (command == fpCommandGlobalMarkerScale) {
998 G4double globalMarkerScale
999 = fpCommandGlobalMarkerScale->GetNewDoubleValue(newValue);
1000 vp.SetGlobalMarkerScale(globalMarkerScale);
1001 if (verbosity >= G4VisManager::confirmations) {
1002 G4cout << "Global Marker Scale changed to "
1003 << vp.GetGlobalMarkerScale() << G4endl;
1004 }
1005 }
1006
1007 else if (command == fpCommandHiddenEdge) {
1009 if (G4UIcommand::ConvertToBool(newValue)) {
1010 switch (existingStyle) {
1013 break;
1015 break;
1018 break;
1020 break;
1022 break;
1023 }
1024 }
1025 else {
1026 switch (existingStyle) {
1028 break;
1031 break;
1033 break;
1036 break;
1038 break;
1039 }
1040 }
1041 if (verbosity >= G4VisManager::confirmations) {
1042 G4cout << "Drawing style of viewer \"" << currentViewer->GetName()
1043 << "\" set to " << vp.GetDrawingStyle()
1044 << G4endl;
1045 }
1046 }
1047
1048 else if (command == fpCommandHiddenMarker) {
1049 G4bool hidden = G4UIcommand::ConvertToBool(newValue);
1050 if (hidden) vp.SetMarkerHidden();
1051 else vp.SetMarkerNotHidden();
1052 if (verbosity >= G4VisManager::confirmations) {
1053 G4cout << "Markers will ";
1054 if (vp.IsMarkerNotHidden()) G4cout << "not ";
1055 G4cout << "be hidden under solid objects." << G4endl;
1056 }
1057 }
1058
1059 else if (command == fpCommandLightsMove) {
1060 if (newValue.find("cam") != G4String::npos)
1061 vp.SetLightsMoveWithCamera(true);
1062 else if(newValue.find("obj") != G4String::npos)
1063 vp.SetLightsMoveWithCamera(false);
1064 else {
1065 if (verbosity >= G4VisManager::errors) {
1066 G4warn << "ERROR: \"" << newValue << "\" not recognised."
1067 " Looking for \"cam\" or \"obj\" in string." << G4endl;
1068 }
1069 }
1070 if (verbosity >= G4VisManager::confirmations) {
1071 G4cout << "Lights move with ";
1072 if (vp.GetLightsMoveWithCamera())
1073 G4cout << "camera (object appears to rotate).";
1074 else G4cout << "object (the viewer appears to be moving).";
1075 G4cout << G4endl;
1076 }
1077 }
1078
1079 else if (command == fpCommandLightsThetaPhi) {
1080 G4double theta, phi;
1081 if (ConvertToDoublePair(newValue, theta, phi)) {
1082 G4double x = std::sin (theta) * std::cos (phi);
1083 G4double y = std::sin (theta) * std::sin (phi);
1084 G4double z = std::cos (theta);
1085 fLightsVector = G4ThreeVector (x, y, z);
1086 vp.SetLightpointDirection(fLightsVector);
1087 if (verbosity >= G4VisManager::confirmations) {
1088 G4cout << "Lights direction set to "
1089 << vp.GetLightpointDirection() << G4endl;
1090 }
1091 }
1092 }
1093
1094 else if (command == fpCommandLightsVector) {
1095 fLightsVector = G4UIcommand::ConvertTo3Vector(newValue);
1096 vp.SetLightpointDirection(fLightsVector);
1097 if (verbosity >= G4VisManager::confirmations) {
1098 G4cout << "Lights direction set to "
1099 << vp.GetLightpointDirection() << G4endl;
1100 }
1101 }
1102
1103 else if (command == fpCommandLineWidth) {
1104 if (verbosity >= G4VisManager::errors) {
1105 // A do-nothing command
1106 G4warn << command->GetGuidanceLine(0) << G4endl;
1107 }
1108 }
1109
1110 else if (command == fpCommandLineSegments) {
1111 G4int nSides = G4UIcommand::ConvertToInt(newValue);
1112 nSides = vp.SetNoOfSides(nSides);
1113 if (verbosity >= G4VisManager::confirmations) {
1114 G4cout <<
1115 "Number of line segments per circle in polygon approximation is "
1116 << nSides << G4endl;
1117 }
1118 }
1119
1120 else if (command == fpCommandNumberOfCloudPoints) {
1121 G4int nPoints = G4UIcommand::ConvertToInt(newValue);
1122 nPoints = vp.SetNumberOfCloudPoints(nPoints);
1123 if (verbosity >= G4VisManager::confirmations) {
1124 G4cout <<
1125 "Number of points to be used in cloud representation of volumes is "
1126 << nPoints << G4endl;
1127 }
1128 }
1129
1130 else if (command == fpCommandPicking) {
1132 if (verbosity >= G4VisManager::confirmations) {
1133 G4cout << "Picking ";
1134 if (vp.IsPicking()) G4cout << "requested.";
1135 else G4cout << "inhibited.";
1136 G4cout << G4endl;
1137 }
1138 if (verbosity >= G4VisManager::warnings) {
1139 G4warn << "You may need to issue \"/vis/viewer/update\"."
1140 << G4endl;
1141 }
1142 }
1143
1144 else if (command == fpCommandProjection) {
1145 G4double fieldHalfAngle;
1146 const size_t iPos0 = 0;
1147 if (newValue[iPos0] == 'o') { // "orthogonal"
1148 fieldHalfAngle = 0.;
1149 }
1150 else if (newValue[iPos0] == 'p') { // "perspective"
1151 G4String dummy;
1152 G4String unit;
1153 std::istringstream is (newValue);
1154 is >> dummy >> fieldHalfAngle >> unit;
1155 fieldHalfAngle *= G4UIcommand::ValueOf(unit);
1156 if (fieldHalfAngle > 89.5 * deg || fieldHalfAngle <= 0.0) {
1157 if (verbosity >= G4VisManager::errors) {
1158 G4warn <<
1159 "ERROR: Field half angle should be 0 < angle <= 89.5 degrees.";
1160 G4warn << G4endl;
1161 }
1162 return;
1163 }
1164 }
1165 else {
1166 if (verbosity >= G4VisManager::errors) {
1167 G4warn << "ERROR: \"" << newValue << "\" not recognised."
1168 " Looking for 'o' or 'p' first character." << G4endl;
1169 }
1170 return;
1171 }
1172 vp.SetFieldHalfAngle(fieldHalfAngle);
1173 if (verbosity >= G4VisManager::confirmations) {
1174 G4cout << "Projection style of viewer \"" << currentViewer->GetName()
1175 << "\" set to ";
1176 if (fieldHalfAngle == 0.) {
1177 G4cout << "orthogonal.";
1178 }
1179 else {
1180 G4cout << "perspective\n with half angle " << fieldHalfAngle / deg
1181 << " degrees.";
1182 }
1183 G4cout << G4endl;
1184 }
1185 }
1186
1187 else if (command == fpCommandRotationStyle) {
1189 if (newValue == "constrainUpDirection")
1191 else if (newValue == "freeRotation")
1193 else {
1194 if (verbosity >= G4VisManager::errors) {
1195 G4warn << "ERROR: \"" << newValue << "\" not recognised." << G4endl;
1196 }
1197 return;
1198 }
1199 vp.SetRotationStyle(style);
1200 if (verbosity >= G4VisManager::confirmations) {
1201 G4cout << "Rotation style of viewer \"" << currentViewer->GetName()
1202 << "\" set to " << vp.GetRotationStyle()
1203 << G4endl;
1204 }
1205 }
1206
1207 else if (command == fpCommandSectionPlane) {
1208 G4String choice, unit;
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 ||
1214 !G4UIcommand::ConvertToBool(choice)) iSelector = 0;
1215 if (G4StrUtil::icompare(choice, "on") == 0 ||
1216 G4UIcommand::ConvertToBool(choice)) iSelector = 1;
1217 if (iSelector < 0) {
1218 if (verbosity >= G4VisManager::errors) {
1219 G4warn << "Choice not recognised (on/true or off/false)." << G4endl;
1220 }
1221 goto write_result;
1222 }
1223 // iSelector can only be 0 or 1
1224 switch (iSelector) {
1225 case 0:
1226 vp.UnsetSectionPlane();
1227 break;
1228 case 1:
1229 F = G4UIcommand::ValueOf(unit);
1230 x *= F; y *= F; z *= F;
1231 if (nx == 0. && ny == 0. && nz == 0.) {
1232 if (verbosity >= G4VisManager::errors) {
1233 G4warn << "Null normal." << G4endl;
1234 }
1235 break;;
1236 }
1237 // Make sure normal is normalised
1238 const G4Normal3D& normal = G4Normal3D(nx,ny,nz).unit();
1239 vp.SetSectionPlane(G4Plane3D(normal, G4Point3D(x,y,z)));
1240 vp.SetViewpointDirection(normal);
1241 break;
1242 }
1243 write_result:
1244 if (verbosity >= G4VisManager::confirmations) {
1245 G4cout << "Section drawing is: ";
1246 if (vp.IsSection ()) G4cout << "on";
1247 else G4cout << "off";
1248 G4cout << ".\nSection plane is now: "
1249 << vp.GetSectionPlane ();
1250 G4cout << G4endl;
1251 }
1252 }
1253
1254 else if (command == fpCommandSpecialMeshRendering) {
1256 if (verbosity >= G4VisManager::confirmations) {
1257 G4cout << "Special mesh rendering";
1258 if (vp.IsSpecialMeshRendering()) {
1259 G4cout << " requested. Current option is \""
1260 << vp.GetSpecialMeshRenderingOption() << "\" for ";
1261 if (vp.GetSpecialMeshVolumes().empty()) {
1262 G4cout << "any mesh.";
1263 } else{
1264 G4cout << "selected volumes:";
1265 for (const auto& pvNameCopyNo: vp.GetSpecialMeshVolumes()) {
1266 G4cout << "\n " << pvNameCopyNo.GetName();
1267 if (pvNameCopyNo.GetCopyNo() >= 0) G4cout << ':' << pvNameCopyNo.GetCopyNo();
1268 }
1269 }
1270 }
1271 else G4cout << ": off.";
1272 G4cout << G4endl;
1273 }
1274 }
1275
1276 else if (command == fpCommandSpecialMeshRenderingOption) {
1278 if (newValue == "dots") {
1280 }
1281 else if(newValue == "surfaces") {
1283 }
1285 if (verbosity >= G4VisManager::confirmations) {
1286 G4cout << "Special mesh rendering option set to \""
1287 << vp.GetSpecialMeshRenderingOption() << "\"."
1288 << G4endl;
1289 }
1290 }
1291
1292 else if (command == fpCommandSpecialMeshVolumes) {
1293 std::vector<G4ModelingParameters::PVNameCopyNo> requestedMeshes;
1294 if (newValue.empty()) {
1295 vp.SetSpecialMeshVolumes(requestedMeshes); // Empty list
1296 } else {
1297 // Algorithm from Josuttis p.476.
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();
1304 }
1305 G4String name(newValue.substr(iBegin,iEnd-iBegin));
1306 iBegin = newValue.find_first_not_of(' ',iEnd);
1307 if (iBegin == G4String::npos) {
1308 if (verbosity >= G4VisManager::warnings) {
1309 G4warn <<
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."
1313 << G4endl;
1314 return;
1315 }
1316 }
1317 iEnd = newValue.find_first_of(' ',iBegin);
1318 if (iEnd == G4String::npos) {
1319 iEnd = newValue.length();
1320 }
1321 G4int copyNo;
1322 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
1323 if (!(iss >> copyNo)) {
1324 if (verbosity >= G4VisManager::warnings) {
1325 G4warn <<
1326 "WARNING: G4VisCommandsViewerSet::SetNewValue: /vis/viewer/set/specialMeshVolumes"
1327 "\n Error reading copy number - it was not numeric?"
1328 "\n Command ignored."
1329 << G4endl;
1330 return;
1331 }
1332 }
1333 requestedMeshes.push_back(G4ModelingParameters::PVNameCopyNo(name,copyNo));
1334 iBegin = newValue.find_first_not_of(' ',iEnd);
1335 }
1336 vp.SetSpecialMeshVolumes(requestedMeshes);
1337 }
1338 if (verbosity >= G4VisManager::confirmations) {
1339 if (vp.GetSpecialMeshVolumes().empty()) {
1340 G4cout <<
1341 "Special mesh list empty, which means \"all meshes\"."
1342 << G4endl;
1343 } else {
1344 G4cout << "Selected special mesh volumes are:";
1345 for (const auto& pvNameCopyNo: vp.GetSpecialMeshVolumes()) {
1346 G4cout << "\n " << pvNameCopyNo.GetName();
1347 if (pvNameCopyNo.GetCopyNo() >= 0) G4cout << ':' << pvNameCopyNo.GetCopyNo();
1348 }
1349 G4cout << G4endl;
1350 }
1351 }
1352 }
1353
1354 else if (command == fpCommandStyle) {
1356 const size_t iPos0 = 0;
1357 if (newValue[iPos0] == 'w') { // "wireframe"
1358 switch (existingStyle) {
1360 break;
1362 break;
1365 break;
1368 break;
1371 break;
1372 }
1373 }
1374 else if (newValue[iPos0] == 's') { // "surface"
1375 switch (existingStyle) {
1378 break;
1381 break;
1383 break;
1385 break;
1388 break;
1389 }
1390 }
1391 else if (newValue[iPos0] == 'c') { // "cloud"
1392 switch (existingStyle) {
1395 break;
1398 break;
1401 break;
1404 break;
1406 break;
1407 }
1408 }
1409 else {
1410 if (verbosity >= G4VisManager::errors) {
1411 G4warn << "ERROR: \"" << newValue << "\" not recognised."
1412 " Looking for 'w' or 's' or 'c' first character." << G4endl;
1413 }
1414 return;
1415 }
1416 if (verbosity >= G4VisManager::confirmations) {
1417 G4cout << "Drawing style of viewer \"" << currentViewer->GetName()
1418 << "\" set to " << vp.GetDrawingStyle()
1419 << G4endl;
1420 }
1421 }
1422
1423 else if (command == fpCommandTargetPoint) {
1424 G4ThreeVector targetPoint =
1425 fpCommandTargetPoint->GetNew3VectorValue(newValue);
1426 const G4Point3D& standardTargetPoint =
1427 currentViewer->GetSceneHandler()->GetScene()->GetStandardTargetPoint();
1428 vp.SetCurrentTargetPoint(targetPoint - standardTargetPoint);
1429 if (verbosity >= G4VisManager::confirmations) {
1430 G4cout << "Target point set to "
1431 << fpCommandTargetPoint->ConvertToStringWithBestUnit
1432 (targetPoint)
1433 << "\n\"Current Target Point\" set to "
1434 << fpCommandTargetPoint->ConvertToStringWithBestUnit
1436 << "\n\"Standard Target Point\" is "
1437 << fpCommandTargetPoint->ConvertToStringWithBestUnit
1438 (standardTargetPoint)
1439 << G4endl;
1440 }
1441 }
1442
1443 else if (command == fpCommandUpThetaPhi) {
1444 G4double theta, phi;
1445 if (ConvertToDoublePair(newValue, theta, phi)) {
1446 G4double x = std::sin (theta) * std::cos (phi);
1447 G4double y = std::sin (theta) * std::sin (phi);
1448 G4double z = std::cos (theta);
1449 fUpVector = G4ThreeVector (x, y, z);
1450 vp.SetUpVector(fUpVector);
1451 if (verbosity >= G4VisManager::confirmations) {
1452 G4cout << "Up direction set to " << vp.GetUpVector() << G4endl;
1453 }
1454 }
1455 }
1456
1457 else if (command == fpCommandUpVector) {
1458 fUpVector = G4UIcommand::ConvertTo3Vector(newValue).unit();
1459 vp.SetUpVector(fUpVector);
1460 if (verbosity >= G4VisManager::confirmations) {
1461 G4cout << "Up direction set to " << vp.GetUpVector() << G4endl;
1462 }
1463 }
1464
1465 else if (command == fpCommandViewpointThetaPhi) {
1466 G4double theta, phi;
1467 if (ConvertToDoublePair(newValue, theta, phi)) {
1468 G4double x = std::sin (theta) * std::cos (phi);
1469 G4double y = std::sin (theta) * std::sin (phi);
1470 G4double z = std::cos (theta);
1471 fViewpointVector = G4ThreeVector (x, y, z);
1472 vp.SetViewAndLights(fViewpointVector);
1473 if (verbosity >= G4VisManager::confirmations) {
1474 G4cout << "Viewpoint direction set to "
1475 << vp.GetViewpointDirection() << G4endl;
1476 if (vp.GetLightsMoveWithCamera ()) {
1477 G4cout << "Lightpoint direction set to "
1479 }
1480 }
1481 }
1482 }
1483
1484 else if (command == fpCommandViewpointVector) {
1485 G4ThreeVector viewpointVector = G4UIcommand::ConvertTo3Vector(newValue);
1486 if (viewpointVector.mag2() <= 0.) {
1487 if (verbosity >= G4VisManager::errors) {
1488 G4warn << "ERROR: Null viewpoint vector. No action taken." << G4endl;
1489 }
1490 } else {
1491 fViewpointVector = viewpointVector.unit();
1492 vp.SetViewAndLights(fViewpointVector);
1493 if (verbosity >= G4VisManager::confirmations) {
1494 G4cout << "Viewpoint direction set to "
1495 << vp.GetViewpointDirection() << G4endl;
1496 if (vp.GetLightsMoveWithCamera ()) {
1497 G4cout << "Lightpoint direction set to "
1499 }
1500 }
1501 }
1502 }
1503
1504 else if (command == fpCommandTimeWindowDisplayHeadTime)
1505 {
1506 G4String display;
1507 G4double screenX, screenY, screenSize, red, green, blue;
1508 std::istringstream iss(newValue);
1509 iss >> display >> screenX >> screenY
1510 >> screenSize >> red >> green >> blue;
1511 vp.SetDisplayHeadTime(command->ConvertToBool(display));
1512 vp.SetDisplayHeadTimeX(screenX);
1513 vp.SetDisplayHeadTimeY(screenY);
1514 vp.SetDisplayHeadTimeSize(screenSize);
1515 vp.SetDisplayHeadTimeRed(red);
1516 vp.SetDisplayHeadTimeGreen(green);
1517 vp.SetDisplayHeadTimeBlue(blue);
1518 if (verbosity >= G4VisManager::confirmations) {
1519 G4cout << "Display head time flag set: "
1520 << vp
1521 << G4endl;
1522 }
1523 }
1524
1525 else if (command == fpCommandTimeWindowDisplayLightFront)
1526 {
1527 G4String display, originX, originY, originZ, unitS, originT, unitT;
1528 G4double red, green, blue;
1529 std::istringstream iss(newValue);
1530 iss >> display
1531 >> originX >> originY >> originZ >> unitS
1532 >> originT >> unitT
1533 >> red >> green >> blue;
1534 vp.SetDisplayLightFront(command->ConvertToBool(display));
1536 (command->ConvertToDimensionedDouble(G4String(originX + ' ' + unitS)));
1538 (command->ConvertToDimensionedDouble(G4String(originY + ' ' + unitS)));
1540 (command->ConvertToDimensionedDouble(G4String(originZ + ' ' + unitS)));
1542 (command->ConvertToDimensionedDouble(G4String(originT + ' ' + unitT)));
1544 vp.SetDisplayLightFrontGreen(green);
1545 vp.SetDisplayLightFrontBlue(blue);
1546 if (verbosity >= G4VisManager::confirmations) {
1547 G4cout << "Display light front flag set: "
1548 << vp
1549 << G4endl;
1550 }
1551 }
1552
1553 else if (command == fpCommandTimeWindowEndTime)
1554 {
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;
1560 vp.SetEndTime
1562 (G4String(end_time_string + ' ' + end_time_unit)));
1563 G4double timeRange = command->ConvertToDimensionedDouble
1564 (G4String(time_range_string + ' ' + time_range_unit));
1565 if (timeRange > 0.) {
1566 vp.SetStartTime
1567 (vp.GetEndTime() - timeRange);
1568 }
1569 if (verbosity >= G4VisManager::confirmations) {
1570 G4cout
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)";
1575 }
1576 G4cout << G4endl;
1577 }
1578 }
1579
1580 else if (command == fpCommandTimeWindowFadeFactor) {
1581 vp.SetFadeFactor(command->ConvertToDouble(newValue));
1582 if (verbosity >= G4VisManager::confirmations) {
1583 G4cout << "Time window fade factor changed to " << vp.GetFadeFactor()
1584 << G4endl;
1585 }
1586 }
1587
1588 else if (command == fpCommandTimeWindowStartTime)
1589 {
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;
1595 vp.SetStartTime
1597 (G4String(start_time_string + ' ' + start_time_unit)));
1598 G4double timeRange = command->ConvertToDimensionedDouble
1599 (G4String(time_range_string + ' ' + time_range_unit));
1600 if (timeRange > 0.) {
1601 vp.SetEndTime
1602 (vp.GetStartTime() + timeRange);
1603 }
1604 if (verbosity >= G4VisManager::confirmations) {
1605 G4cout
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)";
1610 }
1611 G4cout << G4endl;
1612 }
1613 }
1614
1615 else {
1616 if (verbosity >= G4VisManager::errors) {
1617 G4warn <<
1618 "ERROR: G4VisCommandsViewerSet::SetNewValue: unrecognised command."
1619 << G4endl;
1620 }
1621 return;
1622 }
1623
1624 SetViewParameters(currentViewer,vp);
1625}
HepGeom::Normal3D< G4double > G4Normal3D
Definition G4Normal3D.hh:34
HepGeom::Plane3D< G4double > G4Plane3D
Definition G4Plane3D.hh:34
HepGeom::Point3D< G4double > G4Point3D
Definition G4Point3D.hh:34
#define G4warn
Definition G4Scene.cc:41
#define G4BestUnit(a, b)
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
Hep3Vector unit() const
double mag2() const
const G4Point3D & GetStandardTargetPoint() const
G4String ConvertToStringWithBestUnit(const G4ThreeVector &vec)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4double GetNewDoubleValue(const char *paramString)
void SetDefaultValue(G4double defVal)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
const G4String & GetGuidanceLine(G4int i) const
static G4ThreeVector ConvertTo3Vector(const char *st)
static G4double ValueOf(const char *unitName)
static G4String ConvertToString(G4bool boolVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4int ConvertToInt(const char *st)
static G4bool ConvertToBool(const char *st)
void SetRange(const char *rs)
static G4double ConvertToDouble(const char *st)
static G4double ConvertToDimensionedDouble(const char *st)
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
G4Scene * GetScene() const
const G4String & GetName() const
const G4ViewParameters & GetViewParameters() const
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers() const
const G4ViewParameters & GetDefaultViewParameters() const
void SetViewParameters(const G4ViewParameters &vp)
Definition G4VViewer.cc:128
G4VSceneHandler * GetSceneHandler() const
void ConvertToColour(G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
static G4VisManager * fpVisManager
static G4bool ConvertToDoublePair(const G4String &paramString, G4double &xval, G4double &yval)
void SetViewParameters(G4VViewer *viewer, const G4ViewParameters &viewParams)
const G4String & ConvertToColourGuidance()
G4bool ProvideValueOfUnit(const G4String &where, const G4String &unit, const G4String &category, G4double &value)
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
G4int SetNumberOfCloudPoints(G4int)
G4int SetNoOfSides(G4int nSides)
void SetViewAndLights(const G4Vector3D &viewpointDirection)
void SetAutoRefresh(G4bool)
void SetBackgroundColour(const G4Colour &)
void SetGlobalMarkerScale(G4double globalMarkerScale)
void SetExplodeCentre(const G4Point3D &explodeCentre)
void SetDisplayLightFrontY(G4double)
G4bool IsSpecialMeshRendering() const
CutawayMode GetCutawayMode() const
G4double GetExplodeFactor() const
void SetSpecialMeshRenderingOption(SMROption)
G4bool IsMarkerNotHidden() const
void SetDisplayHeadTimeBlue(G4double)
void SetVisibleDensity(G4double visibleDensity)
G4double GetGlobalLineWidthScale() const
void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier &)
G4Vector3D & GetActualLightpointDirection()
void SetCulling(G4bool)
void SetCurrentTargetPoint(const G4Point3D &currentTargetPoint)
void SetDisplayLightFrontT(G4double)
void UnsetSectionPlane()
void SetDrawingStyle(G4ViewParameters::DrawingStyle style)
const G4Colour & GetBackgroundColour() const
const G4Vector3D & GetLightpointDirection() const
void SetDisplayHeadTimeX(G4double)
void SetDefaultVisAttributes(const G4VisAttributes &)
void SetFieldHalfAngle(G4double fieldHalfAngle)
void SetCullingCovered(G4bool)
const G4Vector3D & GetViewpointDirection() const
G4bool IsSection() const
void SetExplodeFactor(G4double explodeFactor)
void SetGlobalLineWidthScale(G4double globalLineWidthScale)
const G4Point3D & GetCurrentTargetPoint() const
G4bool IsPicking() const
void SetStartTime(G4double)
void SetSpecialMeshVolumes(const std::vector< G4ModelingParameters::PVNameCopyNo > &)
void SetPicking(G4bool)
void SetDisplayLightFrontBlue(G4double)
void SetMarkerHidden()
void SetDisplayHeadTime(G4bool)
const G4VisAttributes * GetDefaultTextVisAttributes() const
void SetDisplayHeadTimeY(G4double)
void SetDensityCulling(G4bool)
void SetDisplayLightFrontZ(G4double)
G4double GetStartTime() const
void SetDisplayLightFront(G4bool)
void SetDisplayLightFrontRed(G4double)
const G4Vector3D & GetUpVector() const
void SetDisplayHeadTimeSize(G4double)
void SetMarkerNotHidden()
void SetDisplayHeadTimeRed(G4double)
G4double GetEndTime() const
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() const
G4double GetFadeFactor() const
G4double GetGlobalMarkerScale() const
const G4VisAttributes * GetDefaultVisAttributes() const
void SetCullingInvisible(G4bool)
void SetUpVector(const G4Vector3D &upVector)
void SetEndTime(G4double)
void SetFadeFactor(G4double)
RotationStyle GetRotationStyle() const
void SetCutawayMode(CutawayMode)
void SetSpecialMeshRendering(G4bool)
G4bool IsDensityCulling() const
void SetDefaultTextVisAttributes(const G4VisAttributes &)
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
void SetDisplayLightFrontX(G4double)
void SetLightsMoveWithCamera(G4bool moves)
void SetDisplayHeadTimeGreen(G4double)
void SetRotationStyle(RotationStyle)
G4bool IsAutoRefresh() const
G4double GetVisibleDensity() const
SMROption GetSpecialMeshRenderingOption() const
G4bool GetLightsMoveWithCamera() const
void SetSectionPlane(const G4Plane3D &sectionPlane)
void SetAuxEdgeVisible(G4bool)
void SetDisplayLightFrontGreen(G4double)
const G4Point3D & GetExplodeCentre() const
const G4Plane3D & GetSectionPlane() const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const
void SetColour(const G4Colour &)
const G4Colour & GetColour() const
static constexpr G4double fVeryLongTime
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4VViewer * GetCurrentViewer() const
static Verbosity GetVerbosity()
G4VViewer * GetViewer(const G4String &viewerName) const
BasicVector3D< T > unit() const