33 #ifndef G4APPLYCOMMANDST_HH
34 #define G4APPLYCOMMANDST_HH
37 #include "G4String.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");
114 template <
typename M>
118 delete fpComponentCmd;
121 template <
typename M>
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) {
145 std::istringstream is (newValue);
146 is >> parameter >>
red >> green >>
blue >> alpha;
152 Apply(parameter, myColour);
159 template <
typename M>
185 template <
typename M>
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.");
219 template <
typename M>
223 delete fpComponentCmd;
226 template <
typename M>
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) {
249 std::istringstream is (newValue);
250 is >>
red >> green >>
blue >> alpha;
263 template <
typename M>
286 template <
typename M>
290 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
296 template <
typename M>
302 template <
typename M>
305 Apply(fpCmd->GetNewBoolValue(newValue));
307 if (visManager) visManager->NotifyHandlers();
312 template <
typename M>
326 virtual void Apply() = 0;
336 template <
typename M>
340 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
344 template <
typename M>
350 template <
typename M>
360 template <
typename M>
384 template <
typename M>
388 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
394 template <
typename M>
400 template <
typename M>
403 Apply(fpCmd->GetNewDoubleValue(newValue));
405 if (visManager) visManager->NotifyHandlers();
410 template <
typename M>
434 template <
typename M>
438 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
444 template <
typename M>
450 template <
typename M>
453 Apply(fpCmd->GetNewDoubleValue(newValue));
455 if (visManager) visManager->NotifyHandlers();
460 template <
typename M>
483 template <
typename M>
487 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
493 template <
typename M>
499 template <
typename M>
502 Apply(fpCmd->GetNewIntValue(newValue));
504 if (visManager) visManager->NotifyHandlers();
509 template <
typename M>
533 template <
typename M>
537 G4String dir = placement+
"/"+model->Name()+
"/"+cmdName;
542 template <
typename M>
548 template <
typename M>
G4UIcmdWithADoubleAndUnit * Command()
void SetParameter(G4UIparameter *const newParameter)
G4ModelCmdApplyColour(M *model, const G4String &placement, const G4String &cmdName)
G4UIcommand * ComponentCommand()
virtual ~G4ModelCmdApplyNull()
std::ostringstream G4ExceptionDescription
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
virtual ~G4ModelCmdApplyColour()
G4ModelCmdApplyDoubleAndUnit(M *model, const G4String &placement, const G4String &cmdName)
static G4VVisManager * GetConcreteInstance()
G4UIcommand * StringCommand()
virtual ~G4ModelCmdApplyDouble()
virtual ~G4ModelCmdApplyString()
G4ModelCmdApplyString(M *model, const G4String &placement, const G4String &cmdName)
static G4bool GetColour(const G4String &key, G4Colour &result)
virtual void Apply(const G4double &)=0
G4ModelCmdApplyDouble(M *model, const G4String &placement, const G4String &cmdName)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4ModelCmdApplyStringColour()
G4UIcmdWithADouble * Command()
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
virtual void Apply(const G4String &, const G4Colour &)=0
virtual ~G4ModelCmdApplyDoubleAndUnit()
G4UIcmdWithAnInteger * Command()
G4UIcmdWithAString * Command()
void SetGuidance(const char *aGuidance)
G4UIcommand * ComponentCommand()
void SetNewValue(G4UIcommand *command, G4String newValue)
const XML_Char XML_Content * model
virtual void Apply(const G4int &)=0
virtual void NotifyHandlers()
G4UIcmdWithABool * Command()
virtual void Apply(const G4Colour &)=0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4ModelCmdApplyBool(M *model, const G4String &placement, const G4String &cmdName)
virtual ~G4ModelCmdApplyInteger()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4ModelCmdApplyBool()
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcommand * StringCommand()
G4ModelCmdApplyInteger(M *model, const G4String &placement, const G4String &cmdName)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual void Apply(const G4String &)=0
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual void Apply(const G4double &)=0
G4ModelCmdApplyNull(M *model, const G4String &placement, const G4String &cmdName)
G4ModelCmdApplyStringColour(M *model, const G4String &placement, const G4String &cmdName)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual void Apply(const G4bool &)=0
void SetNewValue(G4UIcommand *command, G4String newValue)