33#ifndef G4APPLYCOMMANDST_HH
34#define G4APPLYCOMMANDST_HH
81 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
85 fpStringCmd->
SetGuidance(
"Set variable colour through a string");
96 fpComponentCmd =
new G4UIcommand(componentDir,
this);
97 fpComponentCmd->
SetGuidance(
"Set variable colour through red, green, blue and alpha components");
118 delete fpComponentCmd;
127 if (cmd == fpStringCmd) {
129 std::istringstream is (newValue);
130 is >> parameter >> colour;
135 ed <<
"G4Colour with key "<<colour<<
" does not exist ";
137 (
"G4ModelCmdApplyStringColour<M>::SetNewValue",
143 if (cmd == fpComponentCmd) {
144 G4double red(0), green(0), blue(0), alpha(0);
145 std::istringstream is (newValue);
146 is >> parameter >> red >> green >> blue >> alpha;
148 G4Colour colour(red, green, blue, alpha);
152 Apply(parameter, myColour);
190 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
194 fpStringCmd->
SetGuidance(
"Set colour through a string");
202 fpComponentCmd =
new G4UIcommand(componentDir,
this);
203 fpComponentCmd->
SetGuidance(
"Set colour through red, green, blue and alpha components");
204 fpComponentCmd->
SetGuidance(
"Four inputs are expected.");
223 delete fpComponentCmd;
231 if (cmd == fpStringCmd) {
233 std::istringstream is (newValue);
239 ed <<
"G4Colour with key "<<colour<<
" does not exist ";
241 (
"G4ModelCmdApplyColour<M>::SetNewValue",
247 if (cmd == fpComponentCmd) {
248 G4double red(0), green(0), blue(0), alpha(0);
249 std::istringstream is (newValue);
250 is >> red >> green >> blue >> alpha;
252 G4Colour colour(red, green, blue, alpha);
290 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
305 Apply(fpCmd->GetNewBoolValue(newValue));
340 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
388 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
403 Apply(fpCmd->GetNewDoubleValue(newValue));
438 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
453 Apply(fpCmd->GetNewDoubleValue(newValue));
487 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
502 Apply(fpCmd->GetNewIntValue(newValue));
537 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
static G4bool GetColour(const G4String &key, G4Colour &result)
virtual ~G4ModelCmdApplyBool()
G4UIcmdWithABool * Command()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4ModelCmdApplyBool(M *model, const G4String &placement, const G4String &cmdName)
virtual void Apply(const G4bool &)=0
G4UIcommand * StringCommand()
virtual ~G4ModelCmdApplyColour()
G4ModelCmdApplyColour(M *model, const G4String &placement, const G4String &cmdName)
virtual void Apply(const G4Colour &)=0
void SetNewValue(G4UIcommand *command, G4String newValue)
G4UIcommand * ComponentCommand()
G4UIcmdWithADoubleAndUnit * Command()
virtual void Apply(const G4double &)=0
virtual ~G4ModelCmdApplyDoubleAndUnit()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4ModelCmdApplyDoubleAndUnit(M *model, const G4String &placement, const G4String &cmdName)
virtual void Apply(const G4double &)=0
G4ModelCmdApplyDouble(M *model, const G4String &placement, const G4String &cmdName)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4ModelCmdApplyDouble()
G4UIcmdWithADouble * Command()
virtual ~G4ModelCmdApplyInteger()
G4ModelCmdApplyInteger(M *model, const G4String &placement, const G4String &cmdName)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual void Apply(const G4int &)=0
G4UIcmdWithAnInteger * Command()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4ModelCmdApplyNull()
G4ModelCmdApplyNull(M *model, const G4String &placement, const G4String &cmdName)
G4UIcommand * StringCommand()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual void Apply(const G4String &, const G4Colour &)=0
virtual ~G4ModelCmdApplyStringColour()
G4ModelCmdApplyStringColour(M *model, const G4String &placement, const G4String &cmdName)
G4UIcommand * ComponentCommand()
G4ModelCmdApplyString(M *model, const G4String &placement, const G4String &cmdName)
virtual void Apply(const G4String &)=0
virtual ~G4ModelCmdApplyString()
G4UIcmdWithAString * Command()
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
virtual void NotifyHandlers()
static G4VVisManager * GetConcreteInstance()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription