46 fpCommand =
new G4UIcommand(
"/vis/set/colour",
this);
48 (
"Defines colour and opacity for future \"/vis/scene/add/\" commands.");
50 (
"(Except \"/vis/scene/add/text\" commands - see \"/vis/set/textColour\".)");
51 fpCommand->
SetGuidance(
"Default: white and opaque.");
55 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
58 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
64 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
86 std::istringstream iss(newValue);
87 iss >> redOrString >> green >> blue >> opacity;
90 if (std::isalpha(redOrString(0))) {
93 G4cout <<
"WARNING: Colour \"" << redOrString
94 <<
"\" not found. Defaulting to white and opaque."
108 "Colour for future \"/vis/scene/add/\" commands has been set to "
110 ".\n(Except \"/vis/scene/add/text\" commands - use \"/vis/set/textColour\".)"
122 (
"Defines lineWidth for future \"/vis/scene/add/\" commands.");
125 fpCommand->
SetRange(
"lineWidth >= 1.");
146 "Line width for future \"/vis/scene/add/\" commands has been set to "
157 fpCommand =
new G4UIcommand(
"/vis/set/textColour",
this);
159 (
"Defines colour and opacity for future \"/vis/scene/add/text\" commands.");
160 fpCommand->
SetGuidance(
"Default: blue and opaque.");
164 (
"Red component or a string, e.g., \"cyan\" (green and blue parameters are ignored).");
167 parameter =
new G4UIparameter (
"green",
'd', omitable =
true);
170 parameter =
new G4UIparameter (
"blue",
'd', omitable =
true);
173 parameter =
new G4UIparameter (
"alpha",
'd', omitable =
true);
195 std::istringstream iss(newValue);
196 iss >> redOrString >> green >> blue >> opacity;
199 if (std::isalpha(redOrString(0))) {
202 G4cout <<
"WARNING: Text colour \"" << redOrString
203 <<
"\" not found. Defaulting to blue and opaque."
217 "Colour for future \"/vis/scene/add/text\" commands has been set to "
230 (
"Defines layout future \"/vis/scene/add/text\" commands.");
232 (
"\"left\" (default) for left justification to provided coordinate.");
234 (
"\"centre\" or \"center\" for text centered on provided coordinate.");
236 (
"\"right\" for right justification to provided coordinate.");
257 else if (newValue ==
"centre" || newValue ==
"center")
265 G4cout <<
"Text layout (for future \"text\" commands) has been set to \""
277 fpCommand =
new G4UIcommand(
"/vis/set/touchable",
this);
279 (
"Defines touchable for future \"/vis/touchable/set/\" commands.");
281 (
"Please provide a list of space-separated physical volume names and"
282 "\ncopy number pairs starting at the world volume, e.g:"
283 "\n/vis/set/touchable World 0 Envelope 0 Shape1 0");
284 parameter =
new G4UIparameter (
"list",
's', omitable =
false);
286 (
"List of physical volume names and copy number pairs");
307 G4String::size_type iBegin, iEnd;
308 iBegin = newValue.find_first_not_of(
' ');
309 while (iBegin != G4String::npos) {
310 iEnd = newValue.find_first_of(
' ',iBegin);
311 if (iEnd == G4String::npos) {
312 iEnd = newValue.length();
315 iBegin = newValue.find_first_not_of(
' ',iEnd);
316 if (iBegin == G4String::npos) {
319 "WARNING: G4VisCommandSetTouchable::SetNewValue"
320 "\n A pair not found. (Did you have an even number of parameters?)"
321 "\n Command ignored."
326 iEnd = newValue.find_first_of(
' ',iBegin);
327 if (iEnd == G4String::npos) {
328 iEnd = newValue.length();
331 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
332 if (!(iss >> copyNo)) {
335 "WARNING: G4VisCommandSetTouchable::SetNewValue"
336 "\n Error reading copy number - it was not numeric?"
337 "\n Command ignored."
342 currentTouchablePath.push_back
344 iBegin = newValue.find_first_not_of(
' ',iEnd);