36 #include <Base/Common/BIASpragma.hh>
38 #include <Gui/ParamGUI.hh>
39 #include <Gui/StringConv.hh>
40 #include <Utils/Param.hh>
53 MyAlgorithm(){coollevel = NULL;};
56 void ParamAdd(
Param &p) {
57 coollevel = p.
AddParamInt(
"coollevel",
"Really cool threshold",0,0,100,0,1);
58 cooldbl = p.
AddParamDouble(
"cooldbl",
"Really cool double ",0,0,100,0,1);
65 void ParameterChanged(
const std::string &name,
const void *data){
66 cout <<
"Here is MyAlgorithm! My parameter \""<<name<<
"\" changed"<<endl;
67 if (data == coollevel)
68 cout <<
"Hey, it was \"coollevel\", new cool level is: "<<*coollevel
79 class MyApp :
public wxApp
82 virtual bool OnInit();
88 class MyFrame : public wxFrame
105 MyFrame *frame =
new MyFrame();
112 : wxFrame(NULL, -1, _T(
"ParamGUISample1"), wxDefaultPosition,
115 param_.AddParamInt(
"SampleInt1",
"Hilfetext zu SampleInt1",0,-100,100,0,1);
116 param_.AddParamBool(
"SampleBool1",
"Hilfetext zu SampleBool1",
false,0,1);
117 param_.AddParamDouble(
"SampleDouble1",
"Hilfetext zu SampleDouble1");
118 param_.AddParamString(
"SampleString1",
"Hilfetext zu SampleString1");
120 vector<string> enums;
121 enums.push_back(
"Enum 1");
122 enums.push_back(
"Enum 2");
123 enums.push_back(
"Enum 3");
124 enums.push_back(
"Enum 4");
126 param_.AddParamEnum(
"SampleEnum",
"Hilfetext zu SampleEnum",enums);
128 algo =
new MyAlgorithm();
129 algo->ParamAdd(param_);
131 param_.ParseCommandLine(wxTheApp->argc,
WxToAsciiArray(wxTheApp->argv,wxTheApp->argc));
The main Parameter Gui interface, derived from BIAS::Param and extends this class.
int RegisterCallbackObject(const std::string &name, ParamCallbackInterface *obj)
double * AddParamDouble(const std::string &name, const std::string &help, double deflt=0.0, double min=-DBL_MAX, double max=DBL_MAX, char cmdshort=0, int Group=GRP_NOSHOW)
This class provides an interface to be called if parameter changes occured.
This class Param provides generic support for parameters.
Class for converting an array of wxStrings to an array of non-const ASCII strings.
int * AddParamInt(const std::string &name, const std::string &help, int deflt=0, int min=std::numeric_limits< int >::min(), int max=std::numeric_limits< int >::max(), char cmdshort=0, int Group=GRP_NOSHOW)
For all adding routines: