49 for (std::size_t iLV = 0; iLV < pLVStore->size(); ++iLV ) {
52 if (logVolName == requestedName) found =
true;
53 if (requestedName ==
"all" || logVolName == requestedName) {
57 if (requestedName !=
"all" && !found) {
59 G4warn <<
"ERROR: Logical volume \"" << requestedName
60 <<
"\" not found in logical volume store." <<
G4endl;
66 const auto& runDurationModelList = scene->GetRunDurationModelList();
67 for (
const auto& sceneModel : runDurationModelList) {
68 auto model = sceneModel.fpModel;
73 scene->CalculateExtent();
90 *newVisAtts = *oldVisAtts;
92 setFunction(newVisAtts);
97 <<
"\": setting vis attributes:";
99 G4cout <<
"\nwas: " << *oldVisAtts;
101 G4cout <<
"\n(no old attributes)";
103 G4cout <<
"\nnow: " << *newVisAtts
106 if (requestedDepth < 0 || depth < requestedDepth) {
108 for (
G4int i = 0; i < nDaughters; ++i) {
110 setFunction, ++depth, requestedDepth);
120 fpCommand =
new G4UIcommand(
"/vis/geometry/set/colour",
this);
121 fpCommand->
SetGuidance(
"Sets colour of logical volume(s).");
122 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
124 (
"Optionally propagates down hierarchy to given depth.");
126 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
129 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
132 (
"Depth of propagation (-1 means unlimited depth).");
137 (
"Red component or a string, e.g., \"blue\", in which case succeeding colour components are ignored.");
139 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
145 parameter =
new G4UIparameter(
"opacity",
'd', omitable =
true);
164 G4int requestedDepth;
166 std::istringstream iss(newValue);
167 iss >> name >> requestedDepth >> redOrString >> green >> blue >> opacity;
171 Set(name, setColour, requestedDepth);
179 fpCommand =
new G4UIcommand(
"/vis/geometry/set/daughtersInvisible",
this);
180 fpCommand->
SetGuidance(
"Makes daughters of logical volume(s) invisible.");
181 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
183 (
"Optionally propagates down hierarchy to given depth.");
185 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
188 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
191 (
"Depth of propagation (-1 means unlimited depth).");
193 parameter =
new G4UIparameter(
"daughtersInvisible",
'b', omitable =
true);
213 G4int requestedDepth;
215 std::istringstream iss(newValue);
216 iss >> name >> requestedDepth >> daughtersInvisibleString;
217 G4bool daughtersInvisible =
220 if (requestedDepth !=0) {
223 G4warn <<
"Recursive application suppressed for this attribute."
229 setDaughtersInvisible(daughtersInvisible);
230 Set(name, setDaughtersInvisible, requestedDepth);
238 "Culling must be on - \"/vis/viewer/set/culling global true\" - to see effect."
250 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceAuxEdgeVisible",
this);
252 (
"Forces auxiliary (soft) edges of logical volume(s) to be visible,"
253 "\nregardless of the view parameters.");
254 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
256 (
"Optionally propagates down hierarchy to given depth.");
258 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
261 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
264 (
"Depth of propagation (-1 means unlimited depth).");
266 parameter =
new G4UIparameter(
"forceAuxEdgeVisible",
'b', omitable =
true);
286 G4int requestedDepth;
288 std::istringstream iss(newValue);
289 iss >> name >> requestedDepth >> forceAuxEdgeVisibleString;
290 G4bool forceAuxEdgeVisible =
294 setForceAuxEdgeVisible(forceAuxEdgeVisible);
295 Set(name, setForceAuxEdgeVisible, requestedDepth);
303 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceCloud",
this);
305 (
"Forces logical volume(s) always to be drawn as a cloud of points,"
306 "\nregardless of the view parameters.");
307 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
309 (
"Optionally propagates down hierarchy to given depth.");
311 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
314 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
317 (
"Depth of propagation (-1 means unlimited depth).");
319 parameter =
new G4UIparameter(
"forceCloud",
'b', omitable =
true);
322 parameter =
new G4UIparameter(
"nPoints",
'd', omitable =
true);
324 (
"<= 0 means under control of viewer.");
344 G4int requestedDepth, nPoints;
345 std::istringstream iss(newValue);
346 iss >> name >> requestedDepth >> forceCloudString >> nPoints;
350 Set(name, setForceCloud, requestedDepth);
358 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceLineSegmentsPerCircle",
this);
360 (
"Forces number of line segments per circle, the precision with which a"
361 "\ncurved line or surface is represented by a polygon or polyhedron,"
362 "\nregardless of the view parameters.");
363 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
365 (
"Optionally propagates down hierarchy to given depth.");
367 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
370 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
373 (
"Depth of propagation (-1 means unlimited depth).");
375 parameter =
new G4UIparameter(
"lineSegmentsPerCircle",
'd', omitable =
true);
377 (
"<= 0 means not forced, i.e., under control of viewer.");
397 G4int requestedDepth;
398 G4int lineSegmentsPerCircle;
399 std::istringstream iss(newValue);
400 iss >> name >> requestedDepth >> lineSegmentsPerCircle;
403 setForceLineSegmentsPerCircle(lineSegmentsPerCircle);
404 Set(name, setForceLineSegmentsPerCircle, requestedDepth);
412 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceSolid",
this);
414 (
"Forces logical volume(s) always to be drawn solid (surface drawing),"
415 "\nregardless of the view parameters.");
416 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
418 (
"Optionally propagates down hierarchy to given depth.");
420 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
423 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
426 (
"Depth of propagation (-1 means unlimited depth).");
428 parameter =
new G4UIparameter(
"force",
'b', omitable =
true);
448 G4int requestedDepth;
450 std::istringstream iss(newValue);
451 iss >> name >> requestedDepth >> forceString;
455 Set(name, setForceSolid, requestedDepth);
463 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceWireframe",
this);
465 (
"Forces logical volume(s) always to be drawn as wireframe,"
466 "\nregardless of the view parameters.");
467 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
469 (
"Optionally propagates down hierarchy to given depth.");
471 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
474 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
477 (
"Depth of propagation (-1 means unlimited depth).");
479 parameter =
new G4UIparameter(
"forceWireframe",
'b', omitable =
true);
499 G4int requestedDepth;
501 std::istringstream iss(newValue);
502 iss >> name >> requestedDepth >> forceWireframeString;
506 setForceWireframe(forceWireframe);
507 Set(name, setForceWireframe, requestedDepth);
515 fpCommand =
new G4UIcommand(
"/vis/geometry/set/lineStyle",
this);
516 fpCommand->
SetGuidance(
"Sets line style of logical volume(s) drawing.");
517 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
519 (
"Optionally propagates down hierarchy to given depth.");
521 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
524 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
527 (
"Depth of propagation (-1 means unlimited depth).");
529 parameter =
new G4UIparameter(
"lineStyle",
's', omitable =
true);
550 G4int requestedDepth;
551 std::istringstream iss(newValue);
552 iss >> name >> requestedDepth >> lineStyleString;
559 Set(name, setLineStyle, requestedDepth);
567 fpCommand =
new G4UIcommand(
"/vis/geometry/set/lineWidth",
this);
568 fpCommand->
SetGuidance(
"Sets line width of logical volume(s) drawing.");
569 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
571 (
"Optionally propagates down hierarchy to given depth.");
573 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
576 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
579 (
"Depth of propagation (-1 means unlimited depth).");
581 parameter =
new G4UIparameter(
"lineWidth",
'd', omitable =
true);
601 G4int requestedDepth;
603 std::istringstream iss(newValue);
604 iss >> name >> requestedDepth >> lineWidth;
607 Set(name, setLineWidth, requestedDepth);
615 fpCommand =
new G4UIcommand(
"/vis/geometry/set/visibility",
this);
616 fpCommand->
SetGuidance(
"Sets visibility of logical volume(s).");
617 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
619 (
"Optionally propagates down hierarchy to given depth.");
621 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
624 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
627 (
"Depth of propagation (-1 means unlimited depth).");
629 parameter =
new G4UIparameter(
"visibility",
'b', omitable =
true);
648 G4int requestedDepth;
650 std::istringstream iss(newValue);
651 iss >> name >> requestedDepth >> visibilityString;
655 Set(name, setVisibility, requestedDepth);
664 "Culling must be on - \"/vis/viewer/set/culling global true\" and"
665 "\n \"/vis/viewer/set/culling invisible true\" - to see effect."
687 "Culling must be on - \"/vis/viewer/set/culling global true\" and"
688 "\n \"/vis/viewer/set/culling invisible true\" - to see effect."
G4GLOB_DLL std::ostream G4cout
static G4LogicalVolumeStore * GetInstance()
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
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
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(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()
G4VViewer * GetCurrentViewer() const
const G4SceneList & GetSceneList() const
static Verbosity GetVerbosity()