49 for (
auto* pLV : *pLVStore) {
50 const G4String& logVolName = pLV->GetName();
51 if (logVolName == requestedName) found =
true;
52 if (requestedName ==
"all" || logVolName == requestedName) {
56 if (requestedName !=
"all" && !found) {
58 G4warn <<
"ERROR: Logical volume \"" << requestedName
59 <<
"\" not found in logical volume store." <<
G4endl;
65 const auto& runDurationModelList = scene->GetRunDurationModelList();
66 for (
const auto& sceneModel : runDurationModelList) {
67 auto model = sceneModel.fpModel;
72 scene->CalculateExtent();
89 *newVisAtts = *oldVisAtts;
91 setFunction(newVisAtts);
96 <<
"\": setting vis attributes:";
98 G4cout <<
"\nwas: " << *oldVisAtts;
100 G4cout <<
"\n(no old attributes)";
102 G4cout <<
"\nnow: " << *newVisAtts
105 if (requestedDepth < 0 || depth < requestedDepth) {
107 for (
G4int i = 0; i < nDaughters; ++i) {
109 setFunction, ++depth, requestedDepth);
119 fpCommand =
new G4UIcommand(
"/vis/geometry/set/colour",
this);
120 fpCommand->SetGuidance(
"Sets colour of logical volume(s).");
121 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
122 fpCommand->SetGuidance
123 (
"Optionally propagates down hierarchy to given depth.");
125 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
127 fpCommand->SetParameter(parameter);
128 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
131 (
"Depth of propagation (-1 means unlimited depth).");
132 fpCommand->SetParameter(parameter);
136 (
"Red component or a string, e.g., \"blue\", in which case succeeding colour components are ignored.");
137 fpCommand->SetParameter(parameter);
138 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
140 fpCommand->SetParameter(parameter);
143 fpCommand->SetParameter(parameter);
144 parameter =
new G4UIparameter(
"opacity",
'd', omitable =
true);
146 fpCommand->SetParameter(parameter);
163 G4int requestedDepth;
165 std::istringstream iss(newValue);
166 iss >> name >> requestedDepth >> redOrString >> green >> blue >> opacity;
170 Set(name, setColour, requestedDepth);
178 fpCommand =
new G4UIcommand(
"/vis/geometry/set/daughtersInvisible",
this);
179 fpCommand->SetGuidance(
"Makes daughters of logical volume(s) invisible.");
180 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
181 fpCommand->SetGuidance
182 (
"Optionally propagates down hierarchy to given depth.");
184 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
186 fpCommand->SetParameter(parameter);
187 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
190 (
"Depth of propagation (-1 means unlimited depth).");
191 fpCommand->SetParameter(parameter);
192 parameter =
new G4UIparameter(
"daughtersInvisible",
'b', omitable =
true);
194 fpCommand->SetParameter(parameter);
212 G4int requestedDepth;
214 std::istringstream iss(newValue);
215 iss >> name >> requestedDepth >> daughtersInvisibleString;
216 G4bool daughtersInvisible =
219 if (requestedDepth !=0) {
222 G4warn <<
"Recursive application suppressed for this attribute."
228 setDaughtersInvisible(daughtersInvisible);
229 Set(name, setDaughtersInvisible, requestedDepth);
237 "Culling must be on - \"/vis/viewer/set/culling global true\" - to see effect."
249 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceAuxEdgeVisible",
this);
250 fpCommand->SetGuidance
251 (
"Forces auxiliary (soft) edges of logical volume(s) to be visible,"
252 "\nregardless of the view parameters.");
253 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
254 fpCommand->SetGuidance
255 (
"Optionally propagates down hierarchy to given depth.");
257 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
259 fpCommand->SetParameter(parameter);
260 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
263 (
"Depth of propagation (-1 means unlimited depth).");
264 fpCommand->SetParameter(parameter);
265 parameter =
new G4UIparameter(
"forceAuxEdgeVisible",
'b', omitable =
true);
267 fpCommand->SetParameter(parameter);
285 G4int requestedDepth;
287 std::istringstream iss(newValue);
288 iss >> name >> requestedDepth >> forceAuxEdgeVisibleString;
289 G4bool forceAuxEdgeVisible =
293 setForceAuxEdgeVisible(forceAuxEdgeVisible);
294 Set(name, setForceAuxEdgeVisible, requestedDepth);
302 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceCloud",
this);
303 fpCommand->SetGuidance
304 (
"Forces logical volume(s) always to be drawn as a cloud of points,"
305 "\nregardless of the view parameters.");
306 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
307 fpCommand->SetGuidance
308 (
"Optionally propagates down hierarchy to given depth.");
310 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
312 fpCommand->SetParameter(parameter);
313 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
316 (
"Depth of propagation (-1 means unlimited depth).");
317 fpCommand->SetParameter(parameter);
318 parameter =
new G4UIparameter(
"forceCloud",
'b', omitable =
true);
320 fpCommand->SetParameter(parameter);
321 parameter =
new G4UIparameter(
"nPoints",
'd', omitable =
true);
323 (
"<= 0 means under control of viewer.");
325 fpCommand->SetParameter(parameter);
343 G4int requestedDepth, nPoints;
344 std::istringstream iss(newValue);
345 iss >> name >> requestedDepth >> forceCloudString >> nPoints;
349 Set(name, setForceCloud, requestedDepth);
357 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceLineSegmentsPerCircle",
this);
358 fpCommand->SetGuidance
359 (
"Forces number of line segments per circle, the precision with which a"
360 "\ncurved line or surface is represented by a polygon or polyhedron,"
361 "\nregardless of the view parameters.");
362 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
363 fpCommand->SetGuidance
364 (
"Optionally propagates down hierarchy to given depth.");
366 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
368 fpCommand->SetParameter(parameter);
369 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
372 (
"Depth of propagation (-1 means unlimited depth).");
373 fpCommand->SetParameter(parameter);
374 parameter =
new G4UIparameter(
"lineSegmentsPerCircle",
'd', omitable =
true);
376 (
"<= 0 means not forced, i.e., under control of viewer.");
378 fpCommand->SetParameter(parameter);
396 G4int requestedDepth;
397 G4int lineSegmentsPerCircle;
398 std::istringstream iss(newValue);
399 iss >> name >> requestedDepth >> lineSegmentsPerCircle;
402 setForceLineSegmentsPerCircle(lineSegmentsPerCircle);
403 Set(name, setForceLineSegmentsPerCircle, requestedDepth);
411 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceSolid",
this);
412 fpCommand->SetGuidance
413 (
"Forces logical volume(s) always to be drawn solid (surface drawing),"
414 "\nregardless of the view parameters.");
415 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
416 fpCommand->SetGuidance
417 (
"Optionally propagates down hierarchy to given depth.");
419 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
421 fpCommand->SetParameter(parameter);
422 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
425 (
"Depth of propagation (-1 means unlimited depth).");
426 fpCommand->SetParameter(parameter);
427 parameter =
new G4UIparameter(
"force",
'b', omitable =
true);
429 fpCommand->SetParameter(parameter);
447 G4int requestedDepth;
449 std::istringstream iss(newValue);
450 iss >> name >> requestedDepth >> forceString;
454 Set(name, setForceSolid, requestedDepth);
462 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceWireframe",
this);
463 fpCommand->SetGuidance
464 (
"Forces logical volume(s) always to be drawn as wireframe,"
465 "\nregardless of the view parameters.");
466 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
467 fpCommand->SetGuidance
468 (
"Optionally propagates down hierarchy to given depth.");
470 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
472 fpCommand->SetParameter(parameter);
473 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
476 (
"Depth of propagation (-1 means unlimited depth).");
477 fpCommand->SetParameter(parameter);
478 parameter =
new G4UIparameter(
"forceWireframe",
'b', omitable =
true);
480 fpCommand->SetParameter(parameter);
498 G4int requestedDepth;
500 std::istringstream iss(newValue);
501 iss >> name >> requestedDepth >> forceWireframeString;
505 setForceWireframe(forceWireframe);
506 Set(name, setForceWireframe, requestedDepth);
514 fpCommand =
new G4UIcommand(
"/vis/geometry/set/lineStyle",
this);
515 fpCommand->SetGuidance(
"Sets line style of logical volume(s) drawing.");
516 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
517 fpCommand->SetGuidance
518 (
"Optionally propagates down hierarchy to given depth.");
520 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
522 fpCommand->SetParameter(parameter);
523 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
526 (
"Depth of propagation (-1 means unlimited depth).");
527 fpCommand->SetParameter(parameter);
528 parameter =
new G4UIparameter(
"lineStyle",
's', omitable =
true);
531 fpCommand->SetParameter(parameter);
549 G4int requestedDepth;
550 std::istringstream iss(newValue);
551 iss >> name >> requestedDepth >> lineStyleString;
558 Set(name, setLineStyle, requestedDepth);
566 fpCommand =
new G4UIcommand(
"/vis/geometry/set/lineWidth",
this);
567 fpCommand->SetGuidance(
"Sets line width of logical volume(s) drawing.");
568 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
569 fpCommand->SetGuidance
570 (
"Optionally propagates down hierarchy to given depth.");
572 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
574 fpCommand->SetParameter(parameter);
575 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
578 (
"Depth of propagation (-1 means unlimited depth).");
579 fpCommand->SetParameter(parameter);
580 parameter =
new G4UIparameter(
"lineWidth",
'd', omitable =
true);
582 fpCommand->SetParameter(parameter);
600 G4int requestedDepth;
602 std::istringstream iss(newValue);
603 iss >> name >> requestedDepth >> lineWidth;
606 Set(name, setLineWidth, requestedDepth);
614 fpCommand =
new G4UIcommand(
"/vis/geometry/set/visibility",
this);
615 fpCommand->SetGuidance(
"Sets visibility of logical volume(s).");
616 fpCommand->SetGuidance(
"\"all\" sets all logical volumes.");
617 fpCommand->SetGuidance
618 (
"Optionally propagates down hierarchy to given depth.");
620 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
622 fpCommand->SetParameter(parameter);
623 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
626 (
"Depth of propagation (-1 means unlimited depth).");
627 fpCommand->SetParameter(parameter);
628 parameter =
new G4UIparameter(
"visibility",
'b', omitable =
true);
630 fpCommand->SetParameter(parameter);
647 G4int requestedDepth;
649 std::istringstream iss(newValue);
650 iss >> name >> requestedDepth >> visibilityString;
654 Set(name, setVisibility, requestedDepth);
663 "Culling must be on - \"/vis/viewer/set/culling global true\" and"
664 "\n \"/vis/viewer/set/culling invisible true\" - to see effect."
686 "Culling must be on - \"/vis/viewer/set/culling global true\" and"
687 "\n \"/vis/viewer/set/culling invisible true\" - to see effect."
G4GLOB_DLL std::ostream G4cout
G4LogicalVolumeStore is a singleton class, acting as container for all logical volumes,...
static G4LogicalVolumeStore * GetInstance()
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
const G4VisAttributes * GetVisAttributes() const
std::size_t GetNoDaughters() const
G4VPhysicalVolume * GetDaughter(const std::size_t i) const
void SetVisAttributes(const G4VisAttributes *pVA)
const G4String & GetName() const
static G4bool ConvertToBool(const char *st)
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetParameterCandidates(const char *theString)
G4LogicalVolume * GetLogicalVolume() const
const G4ViewParameters & GetViewParameters() const
void SetLVVisAtts(G4LogicalVolume *, const G4VVisCommandGeometrySetFunction &, G4int depth, G4int requestedDepth)
void Set(const G4String &logVolName, const G4VVisCommandGeometrySetFunction &, G4int requestedDepth)
static std::map< G4LogicalVolume *, const G4VisAttributes * > fVisAttsMap
void ConvertToColour(G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
static G4VisManager * fpVisManager
G4bool IsCullingInvisible() const
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandGeometrySetColour()
G4VisCommandGeometrySetColour()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandGeometrySetDaughtersInvisible()
G4VisCommandGeometrySetDaughtersInvisible()
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandGeometrySetForceAuxEdgeVisible()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandGeometrySetForceAuxEdgeVisible()
virtual ~G4VisCommandGeometrySetForceCloud()
G4VisCommandGeometrySetForceCloud()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandGeometrySetForceLineSegmentsPerCircle()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandGeometrySetForceLineSegmentsPerCircle()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandGeometrySetForceSolid()
virtual ~G4VisCommandGeometrySetForceSolid()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
virtual ~G4VisCommandGeometrySetForceWireframe()
G4VisCommandGeometrySetForceWireframe()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandGeometrySetLineStyle()
G4VisCommandGeometrySetLineStyle()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandGeometrySetLineWidth()
virtual ~G4VisCommandGeometrySetLineWidth()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandGeometrySetVisibility()
void SetNewValueOnLV(G4LogicalVolume *pLV, G4int, G4bool)
G4VisCommandGeometrySetVisibility()