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 "
87 fpCommand =
new G4UIcommand(
"/vis/set/colour",
this);
89 (
"Defines colour and opacity for future \"/vis/scene/add/\" commands.");
91 (
"(Except \"/vis/scene/add/text\" commands - see \"/vis/set/textColour\".)");
93 fpCommand->
SetGuidance(
"Default: white and opaque.");
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\".)"
147 fpCommand =
new G4UIcommand(
"/vis/set/extentForField",
this);
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);
191 G4double xmin, xmax, ymin, ymax, zmin, zmax;
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.");
222 fpCommand->
SetRange(
"lineWidth >= 1.");
243 "Line width for future \"/vis/scene/add/\" commands has been set to "
254 fpCommand =
new G4UIcommand(
"/vis/set/textColour",
this);
256 (
"Defines colour and opacity for future \"/vis/scene/add/text\" commands.");
258 fpCommand->
SetGuidance(
"Default: blue and opaque.");
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.");
364 fpCommand->
SetRange(
"textSize >= 8.");
385 "Text size for future \"/vis/scene/add/\" commands has been set to "
397 fpCommand =
new G4UIcommand(
"/vis/set/touchable",
this);
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();
446 G4String name(newValue.substr(iBegin,iEnd-iBegin));
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."
523 fpCommand =
new G4UIcommand(
"/vis/set/volumeForField",
this);
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");
531 fpCommand -> SetParameter (parameter);
532 parameter =
new G4UIparameter (
"copy-no",
'i', omitable =
true);
533 parameter -> SetGuidance (
"If negative, matches any copy no.");
534 parameter -> SetDefaultValue (-1);
535 fpCommand -> SetParameter (parameter);
536 parameter =
new G4UIparameter (
"draw",
'b', omitable =
true);
537 parameter -> SetGuidance (
"If true, draw extent of found volumes.");
538 parameter -> SetDefaultValue (
false);
539 fpCommand -> SetParameter (parameter);
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."
G4GLOB_DLL std::ostream G4cerr
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()
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