52 (
"Defines number of line segments per circle for drawing 3D arrows"
53 " for future \"/vis/scene/add/\" commands.");
77 "Number of line segments per circle for drawing 3D arrows for future"
78 "\n \"/vis/scene/add/\" commands has been set to "
89 fpCommand =
new G4UIcommand(
"/vis/set/colour",
this);
91 (
"Defines colour and opacity for future \"/vis/scene/add/\" commands.");
93 (
"(Except \"/vis/scene/add/text\" commands - see \"/vis/set/textColour\".)");
95 fpCommand->
SetGuidance(
"Default: white and opaque.");
99 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
102 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
105 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
108 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
130 std::istringstream iss(newValue);
131 iss >> redOrString >> green >> blue >> opacity;
137 "Colour for future \"/vis/scene/add/\" commands has been set to "
139 ".\n(Except \"/vis/scene/add/text\" commands - use \"/vis/set/textColour\".)"
149 fpCommand =
new G4UIcommand(
"/vis/set/extentForField",
this);
151 (
"Sets an extent for future \"/vis/scene/add/*Field\" commands.");
153 (
"The default is a null extent, which is interpreted by the commands as the"
154 "\nextent of the whole scene.");
156 parameter =
new G4UIparameter (
"xmin",
'd', omitable =
false);
158 parameter =
new G4UIparameter (
"xmax",
'd', omitable =
false);
160 parameter =
new G4UIparameter (
"ymin",
'd', omitable =
false);
162 parameter =
new G4UIparameter (
"ymax",
'd', omitable =
false);
164 parameter =
new G4UIparameter (
"zmin",
'd', omitable =
false);
166 parameter =
new G4UIparameter (
"zmax",
'd', omitable =
false);
168 parameter =
new G4UIparameter (
"unit",
's', omitable =
false);
186 G4double xmin, xmax, ymin, ymax, zmin, zmax;
188 std::istringstream iss(newValue);
189 iss >> xmin >> xmax >> ymin >> ymax >> zmin >> zmax >> unitString;
191 xmin *= unit; xmax *= unit;
192 ymin *= unit; ymax *= unit;
193 zmin *= unit; zmax *= unit;
200 "Extent for future \"/vis/scene/add/*Field\" commands has been set to "
202 <<
"\nVolume for field has been cleared."
214 (
"Defines line width for future \"/vis/scene/add/\" commands."
215 "\nSee \"/vis/viewer/set/lineWidth\" for more information.");
218 fpCommand->
SetRange(
"lineWidth >= 1.");
239 "Line width for *future* \"/vis/scene/add/\" commands has been set to "
241 "\nSee \"/vis/viewer/set/lineWidth\" for more information."
251 fpCommand =
new G4UIcommand(
"/vis/set/textColour",
this);
253 (
"Defines colour and opacity for future \"/vis/scene/add/text\" commands.");
255 fpCommand->
SetGuidance(
"Default: blue and opaque.");
259 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
262 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
265 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
268 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
290 std::istringstream iss(newValue);
291 iss >> redOrString >> green >> blue >> opacity;
297 "Colour for future \"/vis/scene/add/text\" commands has been set to "
310 (
"Defines layout future \"/vis/scene/add/text\" commands.");
312 (
"\"left\" (default) for left justification to provided coordinate.");
314 (
"\"centre\" or \"center\" for text centered on provided coordinate.");
316 (
"\"right\" for right justification to provided coordinate.");
337 else if (newValue ==
"centre" || newValue ==
"center")
345 G4cout <<
"Text layout (for future \"text\" commands) has been set to \""
358 (
"Defines text size (pixels) for future \"/vis/scene/add/\" commands.");
361 fpCommand->
SetRange(
"textSize >= 8.");
382 "Text size for future \"/vis/scene/add/\" commands has been set to "
394 fpCommand =
new G4UIcommand(
"/vis/set/touchable",
this);
396 (
"Defines touchable for future \"/vis/touchable/set/\" commands.");
398 (
"Please provide a list of space-separated physical volume names and"
399 "\ncopy number pairs starting at the world volume, e.g:"
400 "\n /vis/set/touchable World 0 Envelope 0 Shape1 0"
401 "\n(To get list of touchables, use \"/vis/drawTree\")"
402 "\n(To save, use \"/vis/viewer/save\")");
403 parameter =
new G4UIparameter (
"list",
's', omitable =
true);
405 (
"List of physical volume names and copy number pairs");
423 if (newValue.empty()) {
436 G4String::size_type iBegin, iEnd;
437 iBegin = newValue.find_first_not_of(
' ');
438 while (iBegin != G4String::npos) {
439 iEnd = newValue.find_first_of(
' ',iBegin);
440 if (iEnd == G4String::npos) {
441 iEnd = newValue.length();
443 G4String name(newValue.substr(iBegin,iEnd-iBegin));
444 iBegin = newValue.find_first_not_of(
' ',iEnd);
445 if (iBegin == G4String::npos) {
448 "WARNING: G4VisCommandSetTouchable::SetNewValue"
449 "\n A pair not found. (There should be an even number of parameters.)"
450 "\n Command ignored."
455 iEnd = newValue.find_first_of(
' ',iBegin);
456 if (iEnd == G4String::npos) {
457 iEnd = newValue.length();
460 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
461 if (!(iss >> copyNo)) {
464 "WARNING: G4VisCommandSetTouchable::SetNewValue"
465 "\n Error reading copy number - it was not numeric?"
466 "\n Command ignored."
471 currentTouchablePath.push_back
473 iBegin = newValue.find_first_not_of(
' ',iEnd);
477 G4bool successful =
false;
480 size_t nWorlds = transportationManager->
GetNoWorlds();
481 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
483 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
506 "WARNING: G4VisCommandSetTouchable::SetNewValue"
507 "\n Touchable not found."
520 fpCommand =
new G4UIcommand(
"/vis/set/volumeForField",
this);
522 (
"Sets a volume for \"/vis/scene/add/*Field\" commands.");
524 (
"Takes a volume name or a /regular expression/ -- see guidance for"
525 "\n\"/vis/drawVolume\"");
526 parameter =
new G4UIparameter (
"physical-volume-name",
's', omitable =
false);
527 fpCommand -> SetParameter (parameter);
528 parameter =
new G4UIparameter (
"copy-no",
'i', omitable =
true);
529 parameter -> SetGuidance (
"If negative, matches any copy no.");
530 parameter -> SetDefaultValue (-1);
531 fpCommand -> SetParameter (parameter);
532 parameter =
new G4UIparameter (
"draw",
'b', omitable =
true);
533 parameter -> SetGuidance (
"If true, draw extent of found volumes.");
534 parameter -> SetDefaultValue (
false);
535 fpCommand -> SetParameter (parameter);
554 std::istringstream is (newValue);
555 is >> name >> copyNo >> drawString;
560 size_t nWorlds = transportationManager->
GetNoWorlds();
561 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
565 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
572 for (
const auto& findings: searchScene.
GetFindings()) {
574 G4VisExtent extent = findings.fpFoundPV->GetLogicalVolume()->GetSolid()->GetExtent();
575 extent.
Transform(findings.fFoundObjectTransformation);
582 G4warn <<
"ERROR: Volume \"" << name <<
"\"";
584 G4warn <<
", copy no. " << copyNo <<
",";
598 <<
"\"" << findings.fpFoundPV->GetName()
599 <<
"\", copy no. " << findings.fFoundPVCopyNo
600 <<
", found\nin searched volume \""
601 << findings.fpSearchPV->GetName()
602 <<
"\" at depth " << findings.fFoundDepth
603 <<
",\nbase path: \"" << findings.fFoundBasePVPath
604 <<
"\",\nand has been set as volume for field."
G4GLOB_DLL std::ostream G4cout
void AccrueBoundingExtent(const G4VisExtent &)
const G4VisExtent & GetExtent() const
std::vector< PVNameCopyNo > PVNameCopyNoPath
void DescribeYourselfTo(G4VGraphicsScene &)
const std::vector< Findings > & GetFindings() const
const G4PhysicalVolumeModel::TouchableProperties & GetFoundTouchableProperties() const
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
std::size_t GetNoWorlds() const
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)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
static G4double ValueOf(const char *unitName)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4bool ConvertToBool(const char *st)
void SetRange(const char *rs)
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetModelingParameters(const G4ModelingParameters *)
static G4double fCurrentTextSize
static G4Colour fCurrentTextColour
static std::vector< G4PhysicalVolumesSearchScene::Findings > fCurrrentPVFindingsForField
void ConvertToColour(G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
static G4VisManager * fpVisManager
static G4VisExtent fCurrentExtentForField
void DrawExtent(const G4VisExtent &)
const G4String & ConvertToColourGuidance()
static G4int fCurrentArrow3DLineSegmentsPerCircle
static G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties
static G4Text::Layout fCurrentTextLayout
static G4double fCurrentLineWidth
static G4Colour fCurrentColour
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSetArrow3DLineSegmentsPerCircle()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSetArrow3DLineSegmentsPerCircle()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSetColour()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSetExtentForField()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSetExtentForField()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSetLineWidth()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSetLineWidth()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSetTextColour()
virtual ~G4VisCommandSetTextColour()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSetTextLayout()
virtual ~G4VisCommandSetTextLayout()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4VisCommandSetTextSize()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSetTextSize()
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSetTouchable()
virtual ~G4VisCommandSetTouchable()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4VisCommandSetVolumeForField()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSetVolumeForField()
G4VisExtent & Transform(const G4Transform3D &)
static Verbosity GetVerbosity()
G4ModelingParameters::PVNameCopyNoPath fTouchablePath
G4VPhysicalVolume * fpTouchablePV