49 for (
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 G4cout <<
"ERROR: Logical volume \"" << requestedName
60 <<
"\" not found in logical volume store." <<
G4endl;
79 *newVisAtts = *oldVisAtts;
81 setFunction(newVisAtts);
86 <<
"\": setting vis attributes:\nwas: " << *oldVisAtts
87 <<
"\nnow: " << *newVisAtts
90 if (requestedDepth < 0 || depth++ < requestedDepth) {
92 for (
G4int i = 0; i < nDaughters; ++i) {
94 setFunction, depth, requestedDepth);
104 fpCommand =
new G4UIcommand(
"/vis/geometry/set/colour",
this);
105 fpCommand->
SetGuidance(
"Sets colour of logical volume(s).");
106 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
108 (
"Optionally propagates down hierarchy to given depth.");
110 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
113 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
116 (
"Depth of propagation (-1 means unlimited depth).");
121 (
"Red component or a string, e.g., \"blue\", in which case succeeding colour components are ignored.");
123 parameter =
new G4UIparameter(
"green",
'd', omitable =
true);
129 parameter =
new G4UIparameter(
"opacity",
'd', omitable =
true);
148 G4int requestedDepth;
150 std::istringstream iss(newValue);
151 iss >> name >> requestedDepth >> redOrString >> green >> blue >> opacity;
153 const size_t iPos0 = 0;
154 if (std::isalpha(redOrString[iPos0])) {
157 G4cout <<
"WARNING: Colour \"" << redOrString
158 <<
"\" not found. Defaulting to white and opaque."
169 Set(name, setColour, requestedDepth);
177 fpCommand =
new G4UIcommand(
"/vis/geometry/set/daughtersInvisible",
this);
178 fpCommand->
SetGuidance(
"Makes daughters of logical volume(s) invisible.");
179 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
181 (
"Optionally propagates down hierarchy to given depth.");
183 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
186 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
189 (
"Depth of propagation (-1 means unlimited depth).");
191 parameter =
new G4UIparameter(
"daughtersInvisible",
'b', omitable =
true);
211 G4int requestedDepth;
213 std::istringstream iss(newValue);
214 iss >> name >> requestedDepth >> daughtersInvisibleString;
215 G4bool daughtersInvisible =
218 if (requestedDepth !=0) {
221 G4cout <<
"Recursive application suppressed for this attribute."
227 setDaughtersInvisible(daughtersInvisible);
228 Set(name, setDaughtersInvisible, requestedDepth);
236 "Culling must be on - \"/vis/viewer/set/culling global true\" - to see effect."
248 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceAuxEdgeVisible",
this);
250 (
"Forces auxiliary (soft) edges of logical volume(s) to be visible,"
251 "\nregardless of the view parameters.");
252 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
254 (
"Optionally propagates down hierarchy to given depth.");
256 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
259 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
262 (
"Depth of propagation (-1 means unlimited depth).");
264 parameter =
new G4UIparameter(
"forceAuxEdgeVisible",
'b', omitable =
true);
284 G4int requestedDepth;
286 std::istringstream iss(newValue);
287 iss >> name >> requestedDepth >> forceAuxEdgeVisibleString;
288 G4bool forceAuxEdgeVisible =
292 setForceAuxEdgeVisible(forceAuxEdgeVisible);
293 Set(name, setForceAuxEdgeVisible, requestedDepth);
301 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceLineSegmentsPerCircle",
this);
303 (
"Forces number of line segments per circle, the precision with which a"
304 "\ncurved line or surface is represented by a polygon or polyhedron,"
305 "\nregardless of the view parameters.");
306 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
308 (
"Optionally propagates down hierarchy to given depth.");
310 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
313 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
316 (
"Depth of propagation (-1 means unlimited depth).");
318 parameter =
new G4UIparameter(
"lineSegmentsPerCircle",
'd', omitable =
true);
320 (
"< 0 means not forced, i.e., under control of viewer.");
340 G4int requestedDepth;
341 G4int lineSegmentsPerCircle;
342 std::istringstream iss(newValue);
343 iss >> name >> requestedDepth >> lineSegmentsPerCircle;
346 Set(name, setForceLineSegmentsPerCircle, requestedDepth);
354 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceSolid",
this);
356 (
"Forces logical volume(s) always to be drawn solid (surface drawing),"
357 "\nregardless of the view parameters.");
358 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
360 (
"Optionally propagates down hierarchy to given depth.");
362 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
365 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
368 (
"Depth of propagation (-1 means unlimited depth).");
370 parameter =
new G4UIparameter(
"forceSolid",
'b', omitable =
true);
390 G4int requestedDepth;
392 std::istringstream iss(newValue);
393 iss >> name >> requestedDepth >> forceSolidString;
397 Set(name, setForceSolid, requestedDepth);
405 fpCommand =
new G4UIcommand(
"/vis/geometry/set/forceWireframe",
this);
407 (
"Forces logical volume(s) always to be drawn as wireframe,"
408 "\nregardless of the view parameters.");
409 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
411 (
"Optionally propagates down hierarchy to given depth.");
413 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
416 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
419 (
"Depth of propagation (-1 means unlimited depth).");
421 parameter =
new G4UIparameter(
"forceWireframe",
'b', omitable =
true);
441 G4int requestedDepth;
443 std::istringstream iss(newValue);
444 iss >> name >> requestedDepth >> forceWireframeString;
448 setForceWireframe(forceWireframe);
449 Set(name, setForceWireframe, requestedDepth);
457 fpCommand =
new G4UIcommand(
"/vis/geometry/set/lineStyle",
this);
458 fpCommand->
SetGuidance(
"Sets line style of logical volume(s) drawing.");
459 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
461 (
"Optionally propagates down hierarchy to given depth.");
463 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
466 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
469 (
"Depth of propagation (-1 means unlimited depth).");
471 parameter =
new G4UIparameter(
"lineStyle",
's', omitable =
true);
492 G4int requestedDepth;
493 std::istringstream iss(newValue);
494 iss >> name >> requestedDepth >> lineStyleString;
501 Set(name, setLineStyle, requestedDepth);
509 fpCommand =
new G4UIcommand(
"/vis/geometry/set/lineWidth",
this);
510 fpCommand->
SetGuidance(
"Sets line width of logical volume(s) drawing.");
511 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
513 (
"Optionally propagates down hierarchy to given depth.");
515 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
518 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
521 (
"Depth of propagation (-1 means unlimited depth).");
523 parameter =
new G4UIparameter(
"lineWidth",
'd', omitable =
true);
543 G4int requestedDepth;
545 std::istringstream iss(newValue);
546 iss >> name >> requestedDepth >> lineWidth;
549 Set(name, setLineWidth, requestedDepth);
557 fpCommand =
new G4UIcommand(
"/vis/geometry/set/visibility",
this);
558 fpCommand->
SetGuidance(
"Sets visibility of logical volume(s).");
559 fpCommand->
SetGuidance(
"\"all\" sets all logical volumes.");
561 (
"Optionally propagates down hierarchy to given depth.");
563 parameter =
new G4UIparameter (
"logical-volume-name",
's', omitable =
true);
566 parameter =
new G4UIparameter(
"depth",
'd', omitable =
true);
569 (
"Depth of propagation (-1 means unlimited depth).");
571 parameter =
new G4UIparameter(
"visibility",
'b', omitable =
true);
590 G4int requestedDepth;
592 std::istringstream iss(newValue);
593 iss >> name >> requestedDepth >> visibilityString;
597 Set(name, setVisibility, requestedDepth);
606 "Culling must be on - \"/vis/viewer/set/culling global true\" and"
607 "\n \"/vis/viewer/set/culling invisible true\" - to see effect."
629 "Culling must be on - \"/vis/viewer/set/culling global true\" and"
630 "\n \"/vis/viewer/set/culling invisible true\" - to see effect."
G4DLLIMPORT std::ostream G4cout
static G4bool GetColour(const G4String &key, G4Colour &result)
G4double GetGreen() const
static G4LogicalVolumeStore * GetInstance()
const G4VisAttributes * GetVisAttributes() const
G4int GetNoDaughters() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
void SetVisAttributes(const G4VisAttributes *pVA)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4bool ConvertToBool(const char *st)
static G4double ConvertToDouble(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
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 ~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
static Verbosity GetVerbosity()