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 lineWidth 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 \""
276 fpCommand =
new G4UIcommand(
"/vis/set/touchable",
this);
278 (
"Defines touchable for future \"/vis/touchable/set/\" commands.");
280 (
"Please provide a list of space-separated physical volume names and"
281 "\ncopy number pairs starting at the world volume, e.g:"
282 "\n /vis/set/touchable World 0 Envelope 0 Shape1 0"
283 "\n(To get list of touchables, use \"/vis/drawTree\")"
284 "\n(To save, use \"/vis/viewer/save\")");
285 parameter =
new G4UIparameter (
"list",
's', omitable =
false);
287 (
"List of physical volume names and copy number pairs");
308 G4String::size_type iBegin, iEnd;
309 iBegin = newValue.find_first_not_of(
' ');
310 while (iBegin != G4String::npos) {
311 iEnd = newValue.find_first_of(
' ',iBegin);
312 if (iEnd == G4String::npos) {
313 iEnd = newValue.length();
316 iBegin = newValue.find_first_not_of(
' ',iEnd);
317 if (iBegin == G4String::npos) {
320 "WARNING: G4VisCommandSetTouchable::SetNewValue"
321 "\n A pair not found. (Did you have an even number of parameters?)"
322 "\n Command ignored."
327 iEnd = newValue.find_first_of(
' ',iBegin);
328 if (iEnd == G4String::npos) {
329 iEnd = newValue.length();
332 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
333 if (!(iss >> copyNo)) {
336 "WARNING: G4VisCommandSetTouchable::SetNewValue"
337 "\n Error reading copy number - it was not numeric?"
338 "\n Command ignored."
343 currentTouchablePath.push_back
345 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
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)
virtual ~G4VisCommandSetTextLayout()
virtual ~G4VisCommandSetColour()
G4GLOB_DLL std::ostream G4cout
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)
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