45 fpCommand =
new G4UIcommand(
"/vis/set/colour",
this);
47 (
"Defines colour and opacity for future \"/vis/scene/add/\" commands.");
49 (
"(Except \"/vis/scene/add/text\" commands - see \"/vis/set/textColour\".)");
50 fpCommand->
SetGuidance(
"Default: white and opaque.");
54 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
57 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
63 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
85 std::istringstream iss(newValue);
86 iss >> redOrString >> green >> blue >> opacity;
89 if (std::isalpha(redOrString(0))) {
92 G4cout <<
"WARNING: Colour \"" << redOrString
93 <<
"\" not found. Defaulting to white and opaque."
107 "Colour for future \"/vis/scene/add/\" commands has been set to "
109 ".\n(Except \"/vis/scene/add/text\" commands - use \"/vis/set/textColour\".)"
121 (
"Defines line width for future \"/vis/scene/add/\" commands.");
124 fpCommand->
SetRange(
"lineWidth >= 1.");
145 "Line width for future \"/vis/scene/add/\" commands has been set to "
156 fpCommand =
new G4UIcommand(
"/vis/set/textColour",
this);
158 (
"Defines colour and opacity for future \"/vis/scene/add/text\" commands.");
159 fpCommand->
SetGuidance(
"Default: blue and opaque.");
163 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
166 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
169 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
172 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
194 std::istringstream iss(newValue);
195 iss >> redOrString >> green >> blue >> opacity;
198 if (std::isalpha(redOrString(0))) {
201 G4cout <<
"WARNING: Text colour \"" << redOrString
202 <<
"\" not found. Defaulting to blue and opaque."
216 "Colour for future \"/vis/scene/add/text\" commands has been set to "
229 (
"Defines layout future \"/vis/scene/add/text\" commands.");
231 (
"\"left\" (default) for left justification to provided coordinate.");
233 (
"\"centre\" or \"center\" for text centered on provided coordinate.");
235 (
"\"right\" for right justification to provided coordinate.");
256 else if (newValue ==
"centre" || newValue ==
"center")
264 G4cout <<
"Text layout (for future \"text\" commands) has been set to \""
277 (
"Defines text size (pixels) for future \"/vis/scene/add/\" commands.");
280 fpCommand->
SetRange(
"textSize >= 1.");
301 "Text size for future \"/vis/scene/add/\" commands has been set to "
313 fpCommand =
new G4UIcommand(
"/vis/set/touchable",
this);
315 (
"Defines touchable for future \"/vis/touchable/set/\" commands.");
317 (
"Please provide a list of space-separated physical volume names and"
318 "\ncopy number pairs starting at the world volume, e.g:"
319 "\n /vis/set/touchable World 0 Envelope 0 Shape1 0"
320 "\n(To get list of touchables, use \"/vis/drawTree\")"
321 "\n(To save, use \"/vis/viewer/save\")");
322 parameter =
new G4UIparameter (
"list",
's', omitable =
false);
324 (
"List of physical volume names and copy number pairs");
345 G4String::size_type iBegin, iEnd;
346 iBegin = newValue.find_first_not_of(
' ');
347 while (iBegin != G4String::npos) {
348 iEnd = newValue.find_first_of(
' ',iBegin);
349 if (iEnd == G4String::npos) {
350 iEnd = newValue.length();
353 iBegin = newValue.find_first_not_of(
' ',iEnd);
354 if (iBegin == G4String::npos) {
357 "WARNING: G4VisCommandSetTouchable::SetNewValue"
358 "\n A pair not found. (Did you have an even number of parameters?)"
359 "\n Command ignored."
364 iEnd = newValue.find_first_of(
' ',iBegin);
365 if (iEnd == G4String::npos) {
366 iEnd = newValue.length();
369 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
370 if (!(iss >> copyNo)) {
373 "WARNING: G4VisCommandSetTouchable::SetNewValue"
374 "\n Error reading copy number - it was not numeric?"
375 "\n Command ignored."
380 currentTouchablePath.push_back
382 iBegin = newValue.find_first_not_of(
' ',iEnd);
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
static G4Colour fCurrentColour
virtual ~G4VisCommandSetTextSize()
G4VisCommandSetTextLayout()
G4VisCommandSetTouchable()
static G4Text::Layout fCurrentTextLayout
static G4bool GetColour(const G4String &key, G4Colour &result)
void SetDefaultValue(const char *theDefaultValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
static G4double fCurrentTextSize
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSetTextLayout()
virtual ~G4VisCommandSetColour()
G4GLOB_DLL std::ostream G4cout
G4VisCommandSetTextSize()
G4double GetGreen() const
static G4double GetNewDoubleValue(const char *paramString)
void SetRange(const char *rs)
void SetGuidance(const char *aGuidance)
static G4double ConvertToDouble(const char *st)
G4VisCommandSetLineWidth()
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
std::vector< PVNameCopyNo > PVNameCopyNoPath
virtual ~G4VisCommandSetTextColour()
virtual ~G4VisCommandSetTouchable()
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4double defVal)
void SetNewValue(G4UIcommand *command, G4String newValue)
static G4double fCurrentLineWidth
static G4Colour fCurrentTextColour
virtual ~G4VisCommandSetLineWidth()
static Verbosity GetVerbosity()
void SetCandidates(const char *candidateList)
G4VisCommandSetTextColour()
G4String GetCurrentValue(G4UIcommand *command)
void SetGuidance(const char *theGuidance)
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
static G4VisManager * fpVisManager