20 #ifndef _TULIPWITHPARAMETER
21 #define _TULIPWITHPARAMETER
27 #include <tulip/tulipconf.h>
33 template<
class itType >
71 std::string defaultValue;
77 const std::string& help,
const std::string& defaultValue,
79 : name(name), type(type), help(help),
80 defaultValue(defaultValue), mandatory(mandatory), direction(direction) {
110 defaultValue = defVal;
153 template<
typename T>
void add(
const std::string& parameterName,
154 const std::string& help,
155 const std::string& defaultValue,
156 bool isMandatory =
true,
158 for (
unsigned int i = 0; i < parameters.size(); ++i) {
159 if (parameters[i].getName() == parameterName) {
161 tlp::warning() <<
"ParameterDescriptionList::addVar " << parameterName <<
" already exists" << std::endl;
171 isMandatory, direction);
172 parameters.push_back(newParameter);
180 tlp::Iterator<ParameterDescription>* getParameters()
const;
188 const std::string& getDefaultValue(
const std::string& parameterName)
const;
197 void setDefaultValue(
const std::string& parameterName,
198 const std::string& value);
207 void setDirection(
const std::string& parameterName,
216 bool isMandatory(
const std::string& parameterName)
const;
226 void buildDefaultDataSet(
DataSet& ioDataSet,
Graph* inG = NULL)
const;
233 inline unsigned int size()
const {
234 return parameters.size();
243 return parameters.empty();
248 std::vector<ParameterDescription> parameters;
252 #define HTML_HELP_OPEN() "<!DOCTYPE html><html><head>\
253 <style type=\"text/css\">.body { font-family: \"Segoe UI\", Candara, \"Bitstream Vera Sans\", \"DejaVu Sans\", \"Bitstream Vera Sans\", \"Trebuchet MS\", Verdana, \"Verdana Ref\", sans-serif; }\
254 .paramtable { width: 100%; border: 0px; border-bottom: 1px solid #C9C9C9; padding: 5px; }\
255 .help { font-style: italic; font-size: 90%; }</style>\
256 </head><body><table border=\"0\" class=\"paramtable\">"
258 #define HTML_HELP_DEF(A,B) "<tr><td><b>" A "</b><td>" B "</td></tr>"
260 #define HTML_HELP_BODY() "</table><p class=\"help\">"
262 #define HTML_HELP_CLOSE() "</p></body></html>"
290 void addInParameter(
const std::string &name,
291 const std::string &help,
292 const std::string &defaultValue,
293 bool isMandatory =
true) {
294 parameters.template add<T>(name, help, defaultValue, isMandatory, IN_PARAM);
307 void addOutParameter(
const std::string &name,
308 const std::string &help=std::string(),
309 const std::string &defaultValue = std::string(),
310 bool isMandatory =
true) {
311 parameters.template add<T>(name, help, defaultValue, isMandatory, OUT_PARAM);
324 void addInOutParameter(
const std::string &name,
325 const std::string &help=std::string(),
326 const std::string &defaultValue = std::string(),
327 bool isMandatory =
true) {
328 parameters.template add<T>(name, help, defaultValue, isMandatory, INOUT_PARAM);
344 _DEPRECATED
void addParameter(
const std::string &name,
345 const std::string &help=std::string(),
346 const std::string &defaultValue = std::string(),
347 bool isMandatory =
true) {
348 addInParameter<T>(name, help, defaultValue, isMandatory);
356 bool inputRequired()
const;