50 (
"Defines number of line segments per circle for drawing 3D arrows"
51 " for future \"/vis/scene/add/\" commands.");
75 "Number of line segments per circle for drawing 3D arrows for future"
76 "\n \"/vis/scene/add/\" commands has been set to "
89 (
"Defines colour and opacity for future \"/vis/scene/add/\" commands.");
91 (
"(Except \"/vis/scene/add/text\" commands - see \"/vis/set/textColour\".)");
97 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
100 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
103 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
106 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
128 std::istringstream iss(newValue);
129 iss >> redOrString >> green >> blue >> opacity;
135 "Colour for future \"/vis/scene/add/\" commands has been set to "
137 ".\n(Except \"/vis/scene/add/text\" commands - use \"/vis/set/textColour\".)"
149 (
"Sets an extent for future \"/vis/scene/add/*Field\" commands.");
151 (
"The default is a null extent, which is interpreted by the commands as the"
152 "\nextent of the whole scene.");
154 parameter =
new G4UIparameter (
"xmin",
'd', omitable =
true);
157 parameter =
new G4UIparameter (
"xmax",
'd', omitable =
true);
160 parameter =
new G4UIparameter (
"ymin",
'd', omitable =
true);
163 parameter =
new G4UIparameter (
"ymax",
'd', omitable =
true);
166 parameter =
new G4UIparameter (
"zmin",
'd', omitable =
true);
169 parameter =
new G4UIparameter (
"zmax",
'd', omitable =
true);
172 parameter =
new G4UIparameter (
"unit",
's', omitable =
true);
193 std::istringstream iss(newValue);
194 iss >> xmin >> xmax >> ymin >> ymax >> zmin >> zmax >> unitString;
196 xmin *= unit; xmax *= unit;
197 ymin *= unit; ymax *= unit;
198 zmin *= unit; zmax *= unit;
205 "Extent for future \"/vis/scene/add/*Field\" commands has been set to "
207 <<
"\nVolume for field has been cleared."
219 (
"Defines line width for future \"/vis/scene/add/\" commands.");
243 "Line width for future \"/vis/scene/add/\" commands has been set to "
256 (
"Defines colour and opacity for future \"/vis/scene/add/text\" commands.");
262 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
265 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
268 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
271 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
293 std::istringstream iss(newValue);
294 iss >> redOrString >> green >> blue >> opacity;
300 "Colour for future \"/vis/scene/add/text\" commands has been set to "
313 (
"Defines layout future \"/vis/scene/add/text\" commands.");
315 (
"\"left\" (default) for left justification to provided coordinate.");
317 (
"\"centre\" or \"center\" for text centered on provided coordinate.");
319 (
"\"right\" for right justification to provided coordinate.");
340 else if (newValue ==
"centre" || newValue ==
"center")
348 G4cout <<
"Text layout (for future \"text\" commands) has been set to \""
361 (
"Defines text size (pixels) for future \"/vis/scene/add/\" commands.");
385 "Text size for future \"/vis/scene/add/\" commands has been set to "
399 (
"Defines touchable for future \"/vis/touchable/set/\" commands.");
401 (
"Please provide a list of space-separated physical volume names and"
402 "\ncopy number pairs starting at the world volume, e.g:"
403 "\n /vis/set/touchable World 0 Envelope 0 Shape1 0"
404 "\n(To get list of touchables, use \"/vis/drawTree\")"
405 "\n(To save, use \"/vis/viewer/save\")");
406 parameter =
new G4UIparameter (
"list",
's', omitable =
true);
408 (
"List of physical volume names and copy number pairs");
439 G4String::size_type iBegin, iEnd;
440 iBegin = newValue.find_first_not_of(
' ');
441 while (iBegin != G4String::npos) {
442 iEnd = newValue.find_first_of(
' ',iBegin);
443 if (iEnd == G4String::npos) {
444 iEnd = newValue.length();
447 iBegin = newValue.find_first_not_of(
' ',iEnd);
448 if (iBegin == G4String::npos) {
451 "WARNING: G4VisCommandSetTouchable::SetNewValue"
452 "\n A pair not found. (Did you have an even number of parameters?)"
453 "\n Command ignored."
458 iEnd = newValue.find_first_of(
' ',iBegin);
459 if (iEnd == G4String::npos) {
460 iEnd = newValue.length();
463 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
464 if (!(iss >> copyNo)) {
467 "WARNING: G4VisCommandSetTouchable::SetNewValue"
468 "\n Error reading copy number - it was not numeric?"
469 "\n Command ignored."
474 currentTouchablePath.push_back
476 iBegin = newValue.find_first_not_of(
' ',iEnd);
480 G4bool successful =
false;
483 size_t nWorlds = transportationManager->
GetNoWorlds();
484 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
486 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
509 "WARNING: G4VisCommandSetTouchable::SetNewValue"
510 "\n Touchable not found."
525 (
"Sets a volume for \"/vis/scene/add/*Field\" commands.");
527 (
"Takes a volume name or a /regular expression/ -- see guidance for"
528 "\n\"/vis/drawVolume\"");
529 parameter =
new G4UIparameter (
"physical-volume-name",
's', omitable =
true);
530 parameter -> SetDefaultValue (
"none");
532 parameter =
new G4UIparameter (
"copy-no",
'i', omitable =
true);
533 parameter -> SetGuidance (
"If negative, matches any copy no.");
534 parameter -> SetDefaultValue (-1);
536 parameter =
new G4UIparameter (
"draw",
'b', omitable =
true);
537 parameter -> SetGuidance (
"If true, draw extent of found volumes.");
538 parameter -> SetDefaultValue (
false);
558 std::istringstream is (newValue);
559 is >> name >> copyNo >> drawString;
562 if (name ==
"none") {
573 size_t nWorlds = transportationManager->
GetNoWorlds();
574 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
578 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
584 for (
const auto& findings: searchScene.
GetFindings()) {
586 G4VisExtent extent = findings.fpFoundPV->GetLogicalVolume()->GetSolid()->GetExtent();
587 extent.
Transform(findings.fFoundObjectTransformation);
594 G4cerr <<
"ERROR: Volume \"" << name <<
"\"";
596 G4cerr <<
", copy no. " << copyNo <<
",";
610 <<
"\"" << findings.fpFoundPV->GetName()
611 <<
"\", copy no. " << findings.fFoundPVCopyNo
612 <<
", found\nin searched volume \""
613 << findings.fpSearchPV->GetName()
614 <<
"\" at depth " << findings.fFoundDepth
615 <<
",\nbase path: \"" << findings.fFoundBasePVPath
616 <<
"\",\nand has been set as volume for field."