Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMatchGenericDataAttribute.cpp
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// The Widget for modifying selections of network-elements
19/****************************************************************************/
20#include <config.h>
21
22#include <netedit/GNENet.h>
23#include <netedit/GNEViewNet.h>
28
30#include "GNEElementSet.h"
31
32// ===========================================================================
33// FOX callback mapping
34// ===========================================================================
35
47
48// Object implementation
49FXIMPLEMENT(GNEMatchGenericDataAttribute, MFXGroupBoxModule, GNEMatchGenericDataAttributeMap, ARRAYNUMBER(GNEMatchGenericDataAttributeMap))
50
51// ===========================================================================
52// method definitions
53// ===========================================================================
54
55GNEMatchGenericDataAttribute::GNEMatchGenericDataAttribute(GNEElementSet* elementSet, SumoXMLTag defaultTag, SumoXMLAttr defaultAttr, const std::string& defaultValue) :
56 MFXGroupBoxModule(elementSet->getSelectorFrameParent(), TL("Match Data Attribute")),
57 myElementSet(elementSet),
58 myIntervalSelector(nullptr),
59 myBegin(nullptr),
60 myEnd(nullptr),
61 myMatchGenericDataTagComboBox(nullptr),
62 myMatchGenericDataAttrComboBox(nullptr),
63 myCurrentTag(defaultTag),
64 myCurrentAttribute(toString(defaultAttr)),
65 myMatchGenericDataString(nullptr) {
66 // Create MFXComboBoxIcon for interval
67 new FXLabel(getCollapsableFrame(), TL("Interval [begin, end]"), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
68 myIntervalSelector = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItemsMedium,
70 // Create textfield for begin and end
71 FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
72 myBegin = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETBEGIN, GUIDesignTextField);
73 myEnd = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETEND, GUIDesignTextField);
74 // Create MFXComboBoxIcon for generic datas
75 myMatchGenericDataTagComboBox = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, false, GUIDesignComboBoxVisibleItemsMedium,
77 // Create textfield for begin and end
78 myTAZHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
79 myFromTAZComboBox = new MFXComboBoxIcon(myTAZHorizontalFrame, GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItemsMedium,
81 myToTAZComboBox = new MFXComboBoxIcon(myTAZHorizontalFrame, GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItemsMedium,
83 // Create listBox for Attributes
84 myMatchGenericDataAttrComboBox = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItemsMedium,
86 // Create TextField for MatchGenericData string
87 myMatchGenericDataString = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField);
88 // Create help button
89 GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Help"), "", "", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
90 // Fill list of sub-items (first element will be "edge")
91 enableMatchGenericDataAttribute();
92 // Set default value for MatchGenericData string
93 myMatchGenericDataString->setText(defaultValue.c_str());
94}
95
96
98
99
100void
102 // first drop intervals
103 myIntervals.clear();
104 // iterate over all data sets
105 for (const auto& dataSet : myElementSet->getSelectorFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->getDataSets()) {
106 for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) {
107 myIntervals[std::make_pair(dataInterval.second->getAttributeDouble(SUMO_ATTR_BEGIN), dataInterval.second->getAttributeDouble(SUMO_ATTR_END))] = -1;
108 }
109 }
110 // disable modul if there isn't intervals
111 if (myIntervals.size() == 0) {
113 } else {
114 // enable comboboxes and text field
116 myBegin->enable();
117 myEnd->enable();
120 myMatchGenericDataString->enable();
121 // clear combo box interval selector
123 // fill combo Box
124 for (auto& interval : myIntervals) {
125 interval.second = myIntervalSelector->appendIconItem((" [" + toString(interval.first.first) + "," + toString(interval.first.second) + "]").c_str(), GUIIconSubSys::getIcon(GUIIcon::DATAINTERVAL));
126 }
127 // Clear items of myMatchGenericDataTagComboBox
129 // update begin and end
130 myBegin->setText(toString(myIntervals.begin()->first.first).c_str());
131 myBegin->setTextColor(FXRGB(0, 0, 0));
132 myEnd->setText(toString(myIntervals.begin()->first.second).c_str());
133 myEnd->setTextColor(FXRGB(0, 0, 0));
134 // get generic datas
136 // fill combo box (only with drawable elements)
137 for (const auto& genericDataTag : genericDataTags) {
138 if (genericDataTag.isDrawable()) {
139 myMatchGenericDataTagComboBox->appendIconItem(genericDataTag.getFieldString().c_str(), GUIIconSubSys::getIcon(genericDataTag.getGUIIcon()));
140 }
141 }
142 // set first item as current item
144 // call select tag
145 onCmdSelectTag(nullptr, 0, nullptr);
146 }
147}
148
149
150void
152 // disable comboboxes and text field
154 myBegin->disable();
155 myEnd->disable();
158 myMatchGenericDataString->disable();
159 // change colors to black (even if there are invalid values)
162 myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0));
163}
164
165
166void
168 // just show Module
169 show();
170}
171
172
173void
175 // just hide modul
176 hide();
177}
178
179
180long
182 // iterate over interval and update begin and end
183 for (auto& interval : myIntervals) {
184 if (interval.second == myIntervalSelector->getCurrentItem()) {
185 // update begin
186 myBegin->setTextColor(FXRGB(0, 0, 0));
187 myBegin->setText(toString(interval.first.first).c_str());
188 // update end
189 myEnd->setTextColor(FXRGB(0, 0, 0));
190 myEnd->setText(toString(interval.first.second).c_str());
191 }
192 }
193 // call onCmdSelectTag
194 onCmdSelectTag(0, 0, 0);
195 return 1;
196}
197
198
199long
200GNEMatchGenericDataAttribute::onCmdSetBegin(FXObject*, FXSelector, void*) {
201 // check if can be parsed to double
202 if (GNEAttributeCarrier::canParse<double>(myBegin->getText().text()) &&
203 GNEAttributeCarrier::canParse<double>(myEnd->getText().text())) {
204 // set value in double format
205 myBegin->setText(toString(GNEAttributeCarrier::parse<double>(myBegin->getText().text())).c_str());
206 // set valid color text and kill focus
207 myBegin->setTextColor(FXRGB(0, 0, 0));
208 myBegin->killFocus();
209 // enable elements
212 myMatchGenericDataString->enable();
213 // call onCmdSelectTag
214 onCmdSelectTag(0, 0, 0);
215 } else {
216 // set invalid color text
217 myBegin->setTextColor(FXRGB(255, 0, 0));
218 // disable elements
221 myMatchGenericDataString->disable();
222 }
223 return 1;
224}
225
226
227long
228GNEMatchGenericDataAttribute::onCmdSetEnd(FXObject*, FXSelector, void*) {
229 // check if can be parsed to double
230 if (GNEAttributeCarrier::canParse<double>(myBegin->getText().text()) &&
231 GNEAttributeCarrier::canParse<double>(myEnd->getText().text())) {
232 // set value in double format
233 myEnd->setText(toString(GNEAttributeCarrier::parse<double>(myEnd->getText().text())).c_str());
234 // set valid color text and kill focus
235 myEnd->setTextColor(FXRGB(0, 0, 0));
236 myEnd->killFocus();
237 // enable elements
240 myMatchGenericDataString->enable();
241 // call onCmdSelectTag
242 onCmdSelectTag(0, 0, 0);
243 } else {
244 // set invalid color text
245 myEnd->setTextColor(FXRGB(255, 0, 0));
246 // disable elements
249 myMatchGenericDataString->disable();
250 }
251 return 1;
252}
253
254
255long
257 if (myFromTAZComboBox->getText() == TL("<from TAZ>")) {
258 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
259 return 1;
260 } else {
262 if (TAZ.second->getID().c_str() == myFromTAZComboBox->getText()) {
263 myFromTAZComboBox->setTextColor(FXRGB(0, 0, 0));
264 return 1;
265 }
266 }
267 }
268 myFromTAZComboBox->setTextColor(FXRGB(255, 0, 0));
269 return 1;
270}
271
272
273long
274GNEMatchGenericDataAttribute::onCmdSetToTAZ(FXObject*, FXSelector, void*) {
275 if (myToTAZComboBox->getText() == TL("<to TAZ>")) {
276 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
277 return 1;
278 } else {
280 if (TAZ.second->getID().c_str() == myToTAZComboBox->getText()) {
281 myToTAZComboBox->setTextColor(FXRGB(0, 0, 0));
282 return 1;
283 }
284 }
285 }
286 myToTAZComboBox->setTextColor(FXRGB(255, 0, 0));
287 return 1;
288}
289
290
291long
292GNEMatchGenericDataAttribute::onCmdSelectTag(FXObject*, FXSelector, void*) {
293 // First check what type of elementes is being selected
295 // get generic data tags
297 // fill myMatchGenericDataTagComboBox
298 for (const auto& genericDataTag : listOfTags) {
299 if (genericDataTag.isDrawable() && (genericDataTag.getFieldString() == myMatchGenericDataTagComboBox->getText().text())) {
300 myCurrentTag = genericDataTag.getTag();
301 }
302 }
303 // check that typed-by-user value is correct
305 // obtain begin and end
306 const double begin = GNEAttributeCarrier::parse<double>(myBegin->getText().text());
307 const double end = GNEAttributeCarrier::parse<double>(myEnd->getText().text());
308 // obtain all Generic Data attributes for current generic tag
310 // set color and enable items
313 myMatchGenericDataString->enable();
315 // add data set parent
317 // fill attribute combo box
318 for (const auto& attribute : attributes) {
320 }
321 // check if shown TAZ text fields
323 myTAZHorizontalFrame->show();
325 } else {
326 myTAZHorizontalFrame->hide();
327 }
328 onCmdSelectAttribute(nullptr, 0, nullptr);
329 } else {
330 // change color to red and disable items
333 myMatchGenericDataString->disable();
334 }
335 update();
336 return 1;
337}
338
339
340long
342 // obtain all Generic Data attributes for current generic tag
344 toString(myCurrentTag), GNEAttributeCarrier::parse<double>(myBegin->getText().text()),
345 GNEAttributeCarrier::parse<double>(myEnd->getText().text()));
346 // add extra data set parent attribute
347 attributes.insert(toString(GNE_ATTR_DATASET));
348 // clear current attribute
349 myCurrentAttribute.clear();
350 // set current selected attribute
351 for (const auto& attribute : attributes) {
352 if (attribute == myMatchGenericDataAttrComboBox->getText().text()) {
353 myCurrentAttribute = attribute;
354 }
355 }
356 // check if selected attribute is valid
357 if (myCurrentAttribute.empty()) {
359 myMatchGenericDataString->disable();
360 } else {
362 myMatchGenericDataString->enable();
363 }
364 return 1;
365}
366
367
368long
370 // obtain expression and tag value
371 std::string expression = myMatchGenericDataString->getText().text();
372 bool valid = true;
373 // get all Generic datas
375 GNEAttributeCarrier::parse<double>(myBegin->getText().text()),
376 GNEAttributeCarrier::parse<double>(myEnd->getText().text()));
377 // extra filter for TAZ rel datas
379 std::vector<GNEGenericData*> TAZReldatasFrom, TAZReldatasTo;
380 // filter from TAZs
381 for (const auto& TAZRelData : genericDatas) {
382 if (myFromTAZComboBox->getTextColor() == FXRGB(128, 128, 128)) {
383 TAZReldatasFrom.push_back(TAZRelData);
384 } else if ((myFromTAZComboBox->getTextColor() == FXRGB(0, 0, 0)) && (TAZRelData->getAttribute(SUMO_ATTR_FROM) == myFromTAZComboBox->getText().text())) {
385 TAZReldatasFrom.push_back(TAZRelData);
386 }
387 }
388 // filter to TAZs
389 for (const auto& TAZRelData : TAZReldatasFrom) {
390 if (myToTAZComboBox->getTextColor() == FXRGB(128, 128, 128)) {
391 TAZReldatasTo.push_back(TAZRelData);
392 } else if ((myToTAZComboBox->getTextColor() == FXRGB(0, 0, 0)) && (TAZRelData->getAttribute(SUMO_ATTR_TO) == myToTAZComboBox->getText().text())) {
393 TAZReldatasTo.push_back(TAZRelData);
394 }
395 }
396 // update generic datas
397 genericDatas = TAZReldatasTo;
398 }
399 if (expression == "") {
400 // the empty expression matches all objects
403 // The expression must have the form
404 // <val matches if attr < val
405 // >val matches if attr > val
406 // =val matches if attr = val
407 // val matches if attr = val
408 char compOp = expression[0];
409 if ((compOp == '<') || (compOp == '>') || (compOp == '=')) {
410 expression = expression.substr(1);
411 } else {
412 compOp = '=';
413 }
414 // check if value can be parsed to double
415 if (GNEAttributeCarrier::canParse<double>(expression.c_str())) {
416 myElementSet->getSelectorFrameParent()->handleIDs(myElementSet->getSelectorFrameParent()->getGenericMatches(genericDatas, myCurrentAttribute, compOp, GNEAttributeCarrier::parse<double>(expression.c_str()), expression));
417 } else {
418 valid = false;
419 }
420 } else {
421 // The expression must have the form
422 // =str: matches if <str> is an exact match
423 // !str: matches if <str> is not a substring
424 // ^str: matches if <str> is not an exact match
425 // str: matches if <str> is a substring (sends compOp '@')
426 // Alternatively, if the expression is empty it matches all objects
427 char compOp = expression[0];
428 if ((compOp == '=') || (compOp == '!') || (compOp == '^')) {
429 expression = expression.substr(1);
430 } else {
431 compOp = '@';
432 }
434 }
435 // change color depending of flag "valid"
436 if (valid) {
437 myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0));
438 myMatchGenericDataString->killFocus();
439 } else {
440 myMatchGenericDataString->setTextColor(FXRGB(255, 0, 0));
441 }
442 return 1;
443}
444
445
446long
447GNEMatchGenericDataAttribute::onCmdHelp(FXObject*, FXSelector, void*) {
448 // Create dialog box
449 FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), TL("Netedit Parameters Help"), GUIDesignDialogBox);
450 additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
451 // set help text
452 std::ostringstream help;
453 help
454 << TL("- The 'MatchGenericData Attribute' controls allow to specify a set of objects which are then applied to the current selection\n")
455 << TL(" according to the current 'Modification Mode'.\n")
456 << TL(" 1. Select an object type from the first input box\n")
457 << TL(" 2. Select an attribute from the second input box\n")
458 << TL(" 3. Enter a 'match expression' in the third input box and press <return>\n")
459 << "\n"
460 << TL("- The empty expression matches all objects\n")
461 << TL("- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n")
462 << TL("- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n")
463 << "\n"
464 << TL("- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n")
465 << TL(" '' (no operator) matches if string is a substring of that object's attribute.\n")
466 << TL(" '=' matches if string is an exact match.\n")
467 << TL(" '!' matches if string is not a substring.\n")
468 << TL(" '^' matches if string is not an exact match.\n")
469 << "\n"
470 << TL("- Examples:\n")
471 << TL(" junction; id; 'foo' -> match all junctions that have 'foo' in their id\n")
472 << TL(" junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n")
473 << TL(" edge; speed; '>10' -> match all edges with a speed above 10\n");
474 // Create label with the help text
475 new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
476 // Create horizontal separator
477 new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
478 // Create frame for OK Button
479 FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
480 // Create Button Close (And two more horizontal frames to center it)
481 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
482 GUIDesigns::buildFXButton(myHorizontalFrameOKButton, TL("OK"), "", TL("close"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
483 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
484 // Write Warning in console if we're in testing mode
485 WRITE_DEBUG("Opening help dialog of selector frame");
486 // create Dialog
487 additionalNeteditAttributesHelpDialog->create();
488 // show in the given position
489 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
490 // refresh APP
491 getApp()->refresh();
492 // open as modal dialog (will block all windows until stop() or stopModal() is called)
493 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
494 // Write Warning in console if we're in testing mode
495 WRITE_DEBUG("Close help dialog of selector frame");
496 return 1;
497}
498
499
500void
502 // clear fromTAZComboBox
505 // add first element
506 myFromTAZComboBox->appendIconItem("<from TAZ>");
507 myToTAZComboBox->appendIconItem("<to TAZ>");
508 // add all TAZs
510 myFromTAZComboBox->appendIconItem(TAZ.second->getID().c_str());
511 myToTAZComboBox->appendIconItem(TAZ.second->getID().c_str());
512 }
513 // set first items
516 // set color
517 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
518 myToTAZComboBox->setTextColor(FXRGB(128, 128, 128));
519}
520
521/****************************************************************************/
FXDEFMAP(GNEMatchGenericDataAttribute) GNEMatchGenericDataAttributeMap[]
@ MID_GNE_SELECTORFRAME_SETINTERVAL
change interval
@ MID_GNE_SELECTORFRAME_TOTAZ
to TAZ field
@ MID_GNE_SELECTORFRAME_SELECTATTRIBUTE
select attribute in selector frame
@ MID_GNE_SELECTORFRAME_SETEND
end text field
@ MID_GNE_SELECTORFRAME_SELECTTAG
select tag in selector frame
@ MID_HELP
help button
Definition GUIAppEnum.h:653
@ MID_GNE_SELECTORFRAME_SETBEGIN
edit begin text field
@ MID_GNE_SELECTORFRAME_PROCESSSTRING
process string
@ MID_GNE_SELECTORFRAME_FROMTAZ
from TAZ text field
#define GUIDesignComboBox
Definition GUIDesigns.h:299
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:317
#define GUIDesignTextField
Definition GUIDesigns.h:65
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:405
#define GUIDesignDialogBox
Definition GUIDesigns.h:602
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:100
#define GUIDesignComboBoxStaticExtended
Combo box static (not editable) extended over the all frame.
Definition GUIDesigns.h:305
#define GUIDesignComboBoxVisibleItemsMedium
combo box medium small
Definition GUIDesigns.h:53
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:80
#define GUIDesignButtonOK
Definition GUIDesigns.h:159
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
Definition GUIDesigns.h:255
#define GUIDesignHorizontalSeparator
Definition GUIDesigns.h:466
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:285
@ MODEADDITIONAL
@ DATAINTERVAL
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define TL(string)
Definition MsgHandler.h:315
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_TAZREL
a relation between two TAZs
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_END
weights: time range end
@ GNE_ATTR_DATASET
data set of a generic data
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
static const std::vector< GNETagProperties > getTagPropertiesByType(const int tagPropertyCategory, const bool mergeCommonPlans)
get tagProperties associated to the given GNETagProperties::TagType (NETWORKELEMENT,...
GNESelectorFrame * getSelectorFrameParent() const
get Selector Frame Parent
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:150
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
long onCmdSetToTAZ(FXObject *, FXSelector, void *)
Called when the user change toTAZ text field.
long onCmdSetBegin(FXObject *, FXSelector, void *)
Called when the user change begin text field.
void disableMatchGenericDataAttribute()
disable match attributes
SumoXMLTag myCurrentTag
current SumoXMLTag tag
void enableMatchGenericDataAttribute()
enable match attributes
void hideMatchGenericDataAttribute()
hide match attributes
long onCmdSetInterval(FXObject *, FXSelector, void *)
Called when the user selects an interval.
std::string myCurrentAttribute
current string Attribute
GNEElementSet * myElementSet
pointer to element set Parent
FXTextField * myEnd
TextField for end.
MFXComboBoxIcon * myIntervalSelector
tag of the match box
FXTextField * myMatchGenericDataString
string of the match
MFXComboBoxIcon * myMatchGenericDataTagComboBox
tag of the match box
long onCmdSelectTag(FXObject *, FXSelector, void *)
Called when the user selects a tag in the match box.
long onCmdSetFromTAZ(FXObject *, FXSelector, void *)
Called when the user change fromTAZ text field.
void showMatchGenericDataAttribute()
show match attributes
MFXComboBoxIcon * myFromTAZComboBox
TextField for fromTAZ.
long onCmdSelectAttribute(FXObject *, FXSelector, void *)
Called when the user selects an attribute in the match box.
long onCmdProcessString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
FXTextField * myBegin
TextField for begin.
MFXComboBoxIcon * myToTAZComboBox
TextField for toTAZ.
long onCmdSetEnd(FXObject *, FXSelector, void *)
Called when the user change end text field.
MFXComboBoxIcon * myMatchGenericDataAttrComboBox
attributes of the match box
std::map< std::pair< double, double >, int > myIntervals
FXHorizontalFrame * myTAZHorizontalFrame
horizontal frame for TAZs,
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEAdditional * > > & getAdditionals() const
get additionals
std::vector< GNEGenericData * > retrieveGenericDatas(const SumoXMLTag genericDataTag, const double begin, const double end)
retrieve generic datas within the given interval
std::set< std::string > retrieveGenericDataParameters(const std::string &genericDataTag, const double begin, const double end) const
return a set of parameters for the given data Interval
const std::map< const std::string, GNEDataSet * > & getDataSets() const
get demand elements
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
std::vector< GNEAttributeCarrier * > getGenericMatches(const std::vector< GNEGenericData * > &genericDatas, const std::string &attr, const char compOp, const double val, const std::string &expr)
return GenericDatas of the given type with matching attrs
void handleIDs(const std::vector< GNEAttributeCarrier * > &ACs, const ModificationMode::Operation setop=ModificationMode::Operation::DEFAULT)
apply list of ids to the current selection according to Operation,
GNENet * getNet() const
get the net object
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
ComboBox with icon.
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint getCurrentItem() const
Get the current item's index.
FXString getText() const
Get the text.
void setTextColor(FXColor clr)
Change text color.
void clearItems()
Remove all items from the list.
void disable()
Disable combo box.
FXColor getTextColor() const
Return text color.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
void enable()
Enable combo box.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
Definition json.hpp:4471