Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPythonToolDialogElements.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Elements used in GNEPythonToolDialog
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24#include <string>
25#include <vector>
26
27// ===========================================================================
28// class declaration
29// ===========================================================================
30
32class MFXLabelTooltip;
34class Option;
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
39
42
43public:
45 class Category : public FXHorizontalFrame {
46
47 public:
49 Category(FXVerticalFrame* argumentFrame, const std::string& category);
50
52 ~Category();
53
54 private:
56 Category(const Category&) = delete;
57
59 Category& operator=(const Category&) = delete;
60 };
61
63 class Argument : public FXHorizontalFrame {
66
67 public:
69 Argument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string& parameter, Option* option);
70
72 ~Argument();
73
75 virtual void reset() = 0;
76
79
81 const std::string getArgument() const;
82
84 bool requiredAttributeSet() const;
85
88
90 virtual long onCmdSetValue(FXObject*, FXSelector, void*) = 0;
91
93 long onCmdResetValue(FXObject*, FXSelector, void*);
94
96 long onUpdResetValue(FXObject*, FXSelector, void*);
97
99
100 protected:
102 Argument();
103
105 virtual const std::string getValue() const = 0;
106
109
112
114 const std::string myDefaultValue;
115
117 FXHorizontalFrame* myElementsFrame = nullptr;
118
119 private:
122
124 FXButton* myResetButton = nullptr;
125
127 Argument(const Argument&) = delete;
128
130 Argument& operator=(const Argument&) = delete;
131 };
132
133
138
139 public:
141 EdgeVectorArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
142 const std::string name, Option* option);
143
145 void reset();
146
148 long onCmdSetValue(FXObject*, FXSelector, void*);
149
151 long onCmdUseCurrent(FXObject*, FXSelector, void*);
152
154 long onUpdUseCurrent(FXObject* sender, FXSelector, void*);
155
156 protected:
159
161 const std::string getValue() const;
162
164 FXTextField* myEdgeVectorTextField = nullptr;
165
166 private:
169
172
175 };
176
177
179 class FileNameArgument : public Argument {
182
183 public:
185 FileNameArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
186 const std::string name, Option* option);
187
189 void reset();
190
192 long onCmdOpenFilename(FXObject*, FXSelector, void*);
193
195 long onCmdSetValue(FXObject*, FXSelector, void*);
196
197 protected:
200
202 FileNameArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
203 const std::string name, Option* option, const std::string& useCurrent);
204
206 const std::string getValue() const;
207
209 FXTextField* myFilenameTextField = nullptr;
210
211 private:
214
217
220
223 };
224
229
230 public:
232 NetworkArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
233 const std::string name, Option* option);
234
236 long onCmdOpenFilename(FXObject*, FXSelector, void*);
237
239 long onCmdUseCurrentNetworkFile(FXObject*, FXSelector, void*);
240
242 long onUpdUseCurrentNetworkFile(FXObject* sender, FXSelector, void*);
243
244 protected:
247
248 private:
251
254 };
255
260
261 public:
263 AdditionalArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
264 const std::string name, Option* option);
265
267 long onCmdOpenFilename(FXObject*, FXSelector, void*);
268
270 long onCmdUseCurrentAdditionalFile(FXObject*, FXSelector, void*);
271
273 long onUpdUseCurrentAdditionalFile(FXObject* sender, FXSelector, void*);
274
275 protected:
278
279 private:
282
285 };
286
291
292 public:
294 RouteArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
295 const std::string name, Option* option);
296
298 long onCmdOpenFilename(FXObject*, FXSelector, void*);
299
301 long onCmdUseCurrentRouteFile(FXObject*, FXSelector, void*);
302
304 long onUpdUseCurrentRouteFile(FXObject* sender, FXSelector, void*);
305
306 protected:
309
310 private:
312 RouteArgument(const RouteArgument&) = delete;
313
316 };
317
322
323 public:
325 DataArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
326 const std::string name, Option* option);
327
329 long onCmdOpenFilename(FXObject*, FXSelector, void*);
330
332 long onCmdUseCurrentDataFile(FXObject*, FXSelector, void*);
333
335 long onUpdUseCurrentDataFile(FXObject* sender, FXSelector, void*);
336
337 protected:
339 DataArgument();
340
341 private:
343 DataArgument(const DataArgument&) = delete;
344
347 };
348
353
354 public:
356 SumoConfigArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
357 const std::string name, Option* option);
358
360 long onCmdOpenFilename(FXObject*, FXSelector, void*);
361
363 long onCmdUseCurrentSumoConfigFile(FXObject*, FXSelector, void*);
364
366 long onUpdUseCurrentSumoConfigFile(FXObject* sender, FXSelector, void*);
367
368 protected:
371
372 private:
375
378 };
379
381 class EdgeArgument : public Argument {
382
383 public:
385 EdgeArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option);
386
388 void reset();
389
391 long onCmdSetValue(FXObject*, FXSelector, void*);
392
393 protected:
395 const std::string getValue() const;
396
398 FXTextField* myEdgeTextField = nullptr;
399
400 private:
402 static const std::string INVALID_INT_STR;
403
405 EdgeArgument(const EdgeArgument&) = delete;
406
409 };
410
412 class StringArgument : public Argument {
413
414 public:
416 StringArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option);
417
419 void reset();
420
422 long onCmdSetValue(FXObject*, FXSelector, void*);
423
424 protected:
426 const std::string getValue() const;
427
429 FXTextField* myStringTextField = nullptr;
430
431 private:
434
437 };
438
440 class IntArgument : public Argument {
441
442 public:
444 IntArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option);
445
447 void reset();
448
450 long onCmdSetValue(FXObject*, FXSelector, void*);
451
452 protected:
454 const std::string getValue() const;
455
457 FXTextField* myIntTextField = nullptr;
458
459 private:
461 static const std::string INVALID_INT_STR;
462
464 IntArgument(const IntArgument&) = delete;
465
468 };
469
471 class FloatArgument : public Argument {
472
473 public:
475 FloatArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option);
476
478 void reset();
479
481 long onCmdSetValue(FXObject*, FXSelector, void*);
482
483 protected:
485 const std::string getValue() const;
486
488 FXTextField* myFloatTextField = nullptr;
489
490 private:
492 static const std::string INVALID_DOUBLE_STR;
493
495 FloatArgument(const IntArgument&) = delete;
496
499 };
500
501
503 class BoolArgument : public Argument {
504
505 public:
507 BoolArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option);
508
510 void reset();
511
513 long onCmdSetValue(FXObject*, FXSelector, void*);
514
515 protected:
517 const std::string getValue() const;
518
520 FXCheckButton* myCheckButton = nullptr;
521
522 private:
524 BoolArgument(const IntArgument&) = delete;
525
528 };
529};
long onUpdUseCurrentAdditionalFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
long onCmdUseCurrentAdditionalFile(FXObject *, FXSelector, void *)
Called when user press use current button.
AdditionalArgument & operator=(const AdditionalArgument &)=delete
Invalidated assignment operator.
AdditionalArgument(const AdditionalArgument &)=delete
Invalidated copy constructor.
Argument & operator=(const Argument &)=delete
Invalidated assignment operator.
GNEPythonToolDialog * myToolDialogParent
tool dialog parent
virtual long onCmdSetValue(FXObject *, FXSelector, void *)=0
Called when user changes argument value.
MFXLabelTooltip * myParameterLabel
parameter label
Argument(const Argument &)=delete
Invalidated copy constructor.
virtual void reset()=0
reset to default value
bool requiredAttributeSet() const
check if required attribute is set
long onUpdResetValue(FXObject *, FXSelector, void *)
Called when user press reset button.
MFXLabelTooltip * getParameterLabel() const
get parameter label
long onCmdResetValue(FXObject *, FXSelector, void *)
Called when user press reset button.
FXHorizontalFrame * myElementsFrame
auxiliar elements frame
const std::string getArgument() const
get argument
virtual const std::string getValue() const =0
get value
BoolArgument & operator=(const IntArgument &)=delete
Invalidated assignment operator.
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set bool value.
BoolArgument(const IntArgument &)=delete
Invalidated copy constructor.
Category(const Category &)=delete
Invalidated copy constructor.
Category & operator=(const Category &)=delete
Invalidated assignment operator.
long onUpdUseCurrentDataFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
DataArgument & operator=(const DataArgument &)=delete
Invalidated assignment operator.
DataArgument(const DataArgument &)=delete
Invalidated copy constructor.
long onCmdUseCurrentDataFile(FXObject *, FXSelector, void *)
Called when user press use current button.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
static const std::string INVALID_INT_STR
invalid int in string format
EdgeArgument(const EdgeArgument &)=delete
Invalidated copy constructor.
EdgeArgument & operator=(const EdgeArgument &)=delete
Invalidated assignment operator.
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set int value.
long onCmdUseCurrent(FXObject *, FXSelector, void *)
Called when user press use seleted edges button.
EdgeVectorArgument & operator=(const EdgeVectorArgument &)=delete
Invalidated assignment operator.
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user changes argument value.
MFXButtonTooltip * myCurrentEdgesButton
current edges button
EdgeVectorArgument(const EdgeVectorArgument &)=delete
Invalidated copy constructor.
long onUpdUseCurrent(FXObject *sender, FXSelector, void *)
enable or disable use selected edges button
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set filename.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
FileNameArgument & operator=(const FileNameArgument &)=delete
Invalidated assignment operator.
FileNameArgument(const FileNameArgument &)=delete
Invalidated copy constructor.
FloatArgument(const IntArgument &)=delete
Invalidated copy constructor.
static const std::string INVALID_DOUBLE_STR
invalid float in string format
FloatArgument & operator=(const IntArgument &)=delete
Invalidated assignment operator.
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set float value.
IntArgument(const IntArgument &)=delete
Invalidated copy constructor.
static const std::string INVALID_INT_STR
invalid int in string format
IntArgument & operator=(const IntArgument &)=delete
Invalidated assignment operator.
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set int value.
NetworkArgument(const NetworkArgument &)=delete
Invalidated copy constructor.
long onCmdUseCurrentNetworkFile(FXObject *, FXSelector, void *)
Called when user press use current button.
long onUpdUseCurrentNetworkFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
NetworkArgument & operator=(const NetworkArgument &)=delete
Invalidated assignment operator.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
long onCmdUseCurrentRouteFile(FXObject *, FXSelector, void *)
Called when user press use current button.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
RouteArgument(const RouteArgument &)=delete
Invalidated copy constructor.
RouteArgument & operator=(const RouteArgument &)=delete
Invalidated assignment operator.
long onUpdUseCurrentRouteFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
StringArgument & operator=(const StringArgument &)=delete
Invalidated assignment operator.
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set string value.
StringArgument(const StringArgument &)=delete
Invalidated copy constructor.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
SumoConfigArgument & operator=(const SumoConfigArgument &)=delete
Invalidated assignment operator.
long onCmdUseCurrentSumoConfigFile(FXObject *, FXSelector, void *)
Called when user press use current button.
SumoConfigArgument(const SumoConfigArgument &)=delete
Invalidated copy constructor.
long onUpdUseCurrentSumoConfigFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
elements used in Tool Dialogs
Dialog for python tool dialog.
A class representing a single program option.
Definition Option.h:74