20 #ifndef _TULIPWITHPARAMETER
21 #define _TULIPWITHPARAMETER
26 #include <tulip/tulipconf.h>
32 template<
class itType >
70 std::string defaultValue;
76 const std::string& help,
const std::string& defaultValue,
78 : name(name), type(type), help(help),
79 defaultValue(defaultValue), mandatory(mandatory), direction(direction) {
109 defaultValue = defVal;
146 template<
typename T>
void add(
const std::string& parameterName,
147 const std::string& help,
148 const std::string& defaultValue,
149 bool isMandatory =
true,
151 for (
unsigned int i = 0; i < parameters.size(); ++i) {
152 if (parameters[i].getName() == parameterName) {
154 qWarning() <<
"ParameterDescriptionList::addVar " << parameterName <<
" already exists";
164 isMandatory, direction);
165 parameters.push_back(newParameter);
173 tlp::Iterator<ParameterDescription>* getParameters()
const;
181 const std::string& getDefaultValue(
const std::string& parameterName)
const;
190 void setDefaultValue(
const std::string& parameterName,
191 const std::string& value);
199 bool isMandatory(
const std::string& parameterName)
const;
209 void buildDefaultDataSet(
DataSet& ioDataSet,
Graph* inG = NULL)
const;
211 unsigned int size()
const {
212 return parameters.size();
215 ParameterDescription* getParameter(
const std::string& parameterName);
216 template<
typename TYPEINTERFACE>
217 void insertData(
tlp::DataSet &,
const std::string ¶m,
const std::string &defaultValue)
const;
218 std::vector<ParameterDescription> parameters;
222 #define HTML_HELP_OPEN() "<!DOCTYPE html><html><head>\
223 <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; }\
224 .paramtable { width: 100%; border: 0px; border-bottom: 1px solid #C9C9C9; padding: 5px; }\
225 .help { font-style: italic; font-size: 90%; }</style>\
226 </head><body><table border=\"0\" class=\"paramtable\">"
228 #define HTML_HELP_DEF(A,B) "<tr><td><b>"A"</b><td>"B"</td></tr>"
230 #define HTML_HELP_BODY() "</table><p class=\"help\">"
232 #define HTML_HELP_CLOSE() "</p></body></html>"
260 void addInParameter(
const std::string &name,
261 const std::string &help,
262 const std::string &defaultValue,
263 bool isMandatory =
true) {
264 parameters.template add<T>(name, help, defaultValue, isMandatory, IN_PARAM);
277 void addOutParameter(
const std::string &name,
278 const std::string &help=std::string(),
279 const std::string &defaultValue = std::string(),
280 bool isMandatory =
true) {
281 parameters.template add<T>(name, help, defaultValue, isMandatory, OUT_PARAM);
294 void addInOutParameter(
const std::string &name,
295 const std::string &help=std::string(),
296 const std::string &defaultValue = std::string(),
297 bool isMandatory =
true) {
298 parameters.template add<T>(name, help, defaultValue, isMandatory, INOUT_PARAM);
314 void _DEPRECATED addParameter(
const std::string &name,
315 const std::string &help=std::string(),
316 const std::string &defaultValue = std::string(),
317 bool isMandatory =
true) {
318 addInParameter<T>(name, help, defaultValue, isMandatory);