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-2025 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
21#include <netedit/GNENet.h>
27
29#include "GNEElementSet.h"
30
31// ===========================================================================
32// FOX callback mapping
33// ===========================================================================
34
46
47// Object implementation
48FXIMPLEMENT(GNEMatchGenericDataAttribute, MFXGroupBoxModule, GNEMatchGenericDataAttributeMap, ARRAYNUMBER(GNEMatchGenericDataAttributeMap))
49
50// ===========================================================================
51// method definitions
52// ===========================================================================
53
54GNEMatchGenericDataAttribute::GNEMatchGenericDataAttribute(GNEElementSet* elementSet, SumoXMLTag defaultTag, SumoXMLAttr defaultAttr, const std::string& defaultValue) :
55 MFXGroupBoxModule(elementSet->getSelectorFrameParent(), TL("Match Data Attribute")),
56 myElementSet(elementSet),
57 myIntervalSelector(nullptr),
58 myBegin(nullptr),
59 myEnd(nullptr),
60 myMatchGenericDataTagComboBox(nullptr),
61 myMatchGenericDataAttrComboBox(nullptr),
62 myCurrentTag(defaultTag),
63 myCurrentAttribute(toString(defaultAttr)),
64 myMatchGenericDataString(nullptr) {
65 // Create MFXComboBoxIcon for interval
66 new FXLabel(getCollapsableFrame(), TL("Interval [begin, end]"), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
67 myIntervalSelector = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItems,
69 // Create textfield for begin and end
70 FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
71 myBegin = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETBEGIN, GUIDesignTextField);
72 myEnd = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETEND, GUIDesignTextField);
73 // Create MFXComboBoxIcon for generic datas
74 myMatchGenericDataTagComboBox = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, false, GUIDesignComboBoxVisibleItems,
76 // Create textfield for begin and end
77 myTAZHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
78 myFromTAZComboBox = new MFXComboBoxIcon(myTAZHorizontalFrame, GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItems,
80 myToTAZComboBox = new MFXComboBoxIcon(myTAZHorizontalFrame, GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItems,
82 // Create listBox for Attributes
83 myMatchGenericDataAttrComboBox = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItems,
85 // Create TextField for MatchGenericData string
86 myMatchGenericDataString = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField);
87 // Create help button
88 GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Help"), "", "", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
89 // Fill list of sub-items (first element will be "edge")
90 enableMatchGenericDataAttribute();
91 // Set default value for MatchGenericData string
92 myMatchGenericDataString->setText(defaultValue.c_str());
93}
94
95
97
98
99void
101 // first drop intervals
102 myIntervals.clear();
103 // iterate over all data sets
104 for (const auto& dataSet : myElementSet->getSelectorFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->getDataSets()) {
105 for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) {
106 myIntervals[std::make_pair(dataInterval.second->getAttributeDouble(SUMO_ATTR_BEGIN), dataInterval.second->getAttributeDouble(SUMO_ATTR_END))] = -1;
107 }
108 }
109 // disable modul if there isn't intervals
110 if (myIntervals.size() == 0) {
112 } else {
113 // enable comboboxes and text field
115 myBegin->enable();
116 myEnd->enable();
119 myMatchGenericDataString->enable();
120 // clear combo box interval selector
122 // fill combo Box
123 for (auto& interval : myIntervals) {
124 interval.second = myIntervalSelector->appendIconItem((" [" + toString(interval.first.first) + "," + toString(interval.first.second) + "]").c_str(), GUIIconSubSys::getIcon(GUIIcon::DATAINTERVAL));
125 }
126 // Clear items of myMatchGenericDataTagComboBox
128 // update begin and end
129 myBegin->setText(toString(myIntervals.begin()->first.first).c_str());
130 myBegin->setTextColor(FXRGB(0, 0, 0));
131 myEnd->setText(toString(myIntervals.begin()->first.second).c_str());
132 myEnd->setTextColor(FXRGB(0, 0, 0));
133 // get generic datas
135 // fill combo box (only with drawable elements)
136 for (const auto& genericDataTag : tagPropertiesGenericDatas) {
137 if (genericDataTag->isDrawable()) {
138 myMatchGenericDataTagComboBox->appendIconItem(genericDataTag->getSelectorText().c_str(), GUIIconSubSys::getIcon(genericDataTag->getGUIIcon()));
139 }
140 }
141 // set first item as current item
143 // call select tag
144 onCmdSelectTag(nullptr, 0, nullptr);
145 }
146}
147
148
149void
151 // disable comboboxes and text field
153 myBegin->disable();
154 myEnd->disable();
157 myMatchGenericDataString->disable();
158 // change colors to black (even if there are invalid values)
161 myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0));
162}
163
164
165void
167 // just show Module
168 show();
169}
170
171
172void
174 // just hide modul
175 hide();
176}
177
178
179long
181 // iterate over interval and update begin and end
182 for (auto& interval : myIntervals) {
183 if (interval.second == myIntervalSelector->getCurrentItem()) {
184 // update begin
185 myBegin->setTextColor(FXRGB(0, 0, 0));
186 myBegin->setText(toString(interval.first.first).c_str());
187 // update end
188 myEnd->setTextColor(FXRGB(0, 0, 0));
189 myEnd->setText(toString(interval.first.second).c_str());
190 }
191 }
192 // call onCmdSelectTag
193 onCmdSelectTag(0, 0, 0);
194 return 1;
195}
196
197
198long
199GNEMatchGenericDataAttribute::onCmdSetBegin(FXObject*, FXSelector, void*) {
200 // check if can be parsed to double
201 if (GNEAttributeCarrier::canParse<double>(myBegin->getText().text()) &&
202 GNEAttributeCarrier::canParse<double>(myEnd->getText().text())) {
203 // set value in double format
204 myBegin->setText(toString(GNEAttributeCarrier::parse<double>(myBegin->getText().text())).c_str());
205 // set valid color text and kill focus
206 myBegin->setTextColor(FXRGB(0, 0, 0));
207 myBegin->killFocus();
208 // enable elements
211 myMatchGenericDataString->enable();
212 // call onCmdSelectTag
213 onCmdSelectTag(0, 0, 0);
214 } else {
215 // set invalid color text
216 myBegin->setTextColor(FXRGB(255, 0, 0));
217 // disable elements
220 myMatchGenericDataString->disable();
221 }
222 return 1;
223}
224
225
226long
227GNEMatchGenericDataAttribute::onCmdSetEnd(FXObject*, FXSelector, void*) {
228 // check if can be parsed to double
229 if (GNEAttributeCarrier::canParse<double>(myBegin->getText().text()) &&
230 GNEAttributeCarrier::canParse<double>(myEnd->getText().text())) {
231 // set value in double format
232 myEnd->setText(toString(GNEAttributeCarrier::parse<double>(myEnd->getText().text())).c_str());
233 // set valid color text and kill focus
234 myEnd->setTextColor(FXRGB(0, 0, 0));
235 myEnd->killFocus();
236 // enable elements
239 myMatchGenericDataString->enable();
240 // call onCmdSelectTag
241 onCmdSelectTag(0, 0, 0);
242 } else {
243 // set invalid color text
244 myEnd->setTextColor(FXRGB(255, 0, 0));
245 // disable elements
248 myMatchGenericDataString->disable();
249 }
250 return 1;
251}
252
253
254long
256 if (myFromTAZComboBox->getText() == TL("<from TAZ>")) {
257 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
258 return 1;
259 } else {
261 if (TAZ.second->getID().c_str() == myFromTAZComboBox->getText()) {
262 myFromTAZComboBox->setTextColor(FXRGB(0, 0, 0));
263 return 1;
264 }
265 }
266 }
267 myFromTAZComboBox->setTextColor(FXRGB(255, 0, 0));
268 return 1;
269}
270
271
272long
273GNEMatchGenericDataAttribute::onCmdSetToTAZ(FXObject*, FXSelector, void*) {
274 if (myToTAZComboBox->getText() == TL("<to TAZ>")) {
275 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
276 return 1;
277 } else {
279 if (TAZ.second->getID().c_str() == myToTAZComboBox->getText()) {
280 myToTAZComboBox->setTextColor(FXRGB(0, 0, 0));
281 return 1;
282 }
283 }
284 }
285 myToTAZComboBox->setTextColor(FXRGB(255, 0, 0));
286 return 1;
287}
288
289
290long
291GNEMatchGenericDataAttribute::onCmdSelectTag(FXObject*, FXSelector, void*) {
292 // First check what type of elementes is being selected
294 // get generic data tags
296 // fill myMatchGenericDataTagComboBox
297 for (const auto& genericDataTag : tagPropertiesGenericDatas) {
298 if (genericDataTag->isDrawable() && (genericDataTag->getSelectorText() == myMatchGenericDataTagComboBox->getText().text())) {
299 myCurrentTag = genericDataTag->getTag();
300 }
301 }
302 // check that typed-by-user value is correct
304 // obtain begin and end
305 const double begin = GNEAttributeCarrier::parse<double>(myBegin->getText().text());
306 const double end = GNEAttributeCarrier::parse<double>(myEnd->getText().text());
307 // obtain all Generic Data attributes for current generic tag
309 // set color and enable items
312 myMatchGenericDataString->enable();
314 // add data set parent
316 // fill attribute combo box
317 for (const auto& attribute : attributes) {
319 }
320 // check if shown TAZ text fields
322 myTAZHorizontalFrame->show();
324 } else {
325 myTAZHorizontalFrame->hide();
326 }
327 onCmdSelectAttribute(nullptr, 0, nullptr);
328 } else {
329 // change color to red and disable items
332 myMatchGenericDataString->disable();
333 }
334 update();
335 return 1;
336}
337
338
339long
341 // obtain all Generic Data attributes for current generic tag
343 toString(myCurrentTag), GNEAttributeCarrier::parse<double>(myBegin->getText().text()),
344 GNEAttributeCarrier::parse<double>(myEnd->getText().text()));
345 // add extra data set parent attribute
346 attributes.insert(toString(GNE_ATTR_DATASET));
347 // clear current attribute
348 myCurrentAttribute.clear();
349 // set current selected attribute
350 for (const auto& attribute : attributes) {
351 if (attribute == myMatchGenericDataAttrComboBox->getText().text()) {
352 myCurrentAttribute = attribute;
353 }
354 }
355 // check if selected attribute is valid
356 if (myCurrentAttribute.empty()) {
358 myMatchGenericDataString->disable();
359 } else {
361 myMatchGenericDataString->enable();
362 }
363 return 1;
364}
365
366
367long
369 // obtain expression and tag value
370 std::string expression = myMatchGenericDataString->getText().text();
371 bool valid = true;
372 // get all Generic datas
374 GNEAttributeCarrier::parse<double>(myBegin->getText().text()),
375 GNEAttributeCarrier::parse<double>(myEnd->getText().text()));
376 // extra filter for TAZ rel datas
378 std::vector<GNEGenericData*> TAZReldatasFrom, TAZReldatasTo;
379 // filter from TAZs
380 for (const auto& TAZRelData : genericDatas) {
381 if (myFromTAZComboBox->getTextColor() == FXRGB(128, 128, 128)) {
382 TAZReldatasFrom.push_back(TAZRelData);
383 } else if ((myFromTAZComboBox->getTextColor() == FXRGB(0, 0, 0)) && (TAZRelData->getAttribute(SUMO_ATTR_FROM) == myFromTAZComboBox->getText().text())) {
384 TAZReldatasFrom.push_back(TAZRelData);
385 }
386 }
387 // filter to TAZs
388 for (const auto& TAZRelData : TAZReldatasFrom) {
389 if (myToTAZComboBox->getTextColor() == FXRGB(128, 128, 128)) {
390 TAZReldatasTo.push_back(TAZRelData);
391 } else if ((myToTAZComboBox->getTextColor() == FXRGB(0, 0, 0)) && (TAZRelData->getAttribute(SUMO_ATTR_TO) == myToTAZComboBox->getText().text())) {
392 TAZReldatasTo.push_back(TAZRelData);
393 }
394 }
395 // update generic datas
396 genericDatas = TAZReldatasTo;
397 }
398 if (expression == "") {
399 // the empty expression matches all objects
402 // The expression must have the form
403 // <val matches if attr < val
404 // >val matches if attr > val
405 // =val matches if attr = val
406 // val matches if attr = val
407 char compOp = expression[0];
408 if ((compOp == '<') || (compOp == '>') || (compOp == '=')) {
409 expression = expression.substr(1);
410 } else {
411 compOp = '=';
412 }
413 // check if value can be parsed to double
414 if (GNEAttributeCarrier::canParse<double>(expression.c_str())) {
415 myElementSet->getSelectorFrameParent()->handleIDs(myElementSet->getSelectorFrameParent()->getGenericMatches(genericDatas, myCurrentAttribute, compOp, GNEAttributeCarrier::parse<double>(expression.c_str()), expression));
416 } else {
417 valid = false;
418 }
419 } else {
420 // The expression must have the form
421 // =str: matches if <str> is an exact match
422 // !str: matches if <str> is not a substring
423 // ^str: matches if <str> is not an exact match
424 // str: matches if <str> is a substring (sends compOp '@')
425 // Alternatively, if the expression is empty it matches all objects
426 char compOp = expression[0];
427 if ((compOp == '=') || (compOp == '!') || (compOp == '^')) {
428 expression = expression.substr(1);
429 } else {
430 compOp = '@';
431 }
433 }
434 // change color depending of flag "valid"
435 if (valid) {
436 myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0));
437 myMatchGenericDataString->killFocus();
438 } else {
439 myMatchGenericDataString->setTextColor(FXRGB(255, 0, 0));
440 }
441 return 1;
442}
443
444
445long
446GNEMatchGenericDataAttribute::onCmdHelp(FXObject*, FXSelector, void*) {
447 // Create dialog box
448 FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), TL("Netedit Parameters Help"), GUIDesignDialogBox);
449 additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
450 // set help text
451 std::ostringstream help;
452 help
453 << TL("- The 'MatchGenericData Attribute' controls allow to specify a set of objects which are then applied to the current selection\n")
454 << TL(" according to the current 'Modification Mode'.\n")
455 << TL(" 1. Select an object type from the first input box\n")
456 << TL(" 2. Select an attribute from the second input box\n")
457 << TL(" 3. Enter a 'match expression' in the third input box and press <return>\n")
458 << "\n"
459 << TL("- The empty expression matches all objects\n")
460 << TL("- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n")
461 << TL("- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n")
462 << "\n"
463 << TL("- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n")
464 << TL(" '' (no operator) matches if string is a substring of that object's attribute.\n")
465 << TL(" '=' matches if string is an exact match.\n")
466 << TL(" '!' matches if string is not a substring.\n")
467 << TL(" '^' matches if string is not an exact match.\n")
468 << "\n"
469 << TL("- Examples:\n")
470 << TL(" junction; id; 'foo' -> match all junctions that have 'foo' in their id\n")
471 << TL(" junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n")
472 << TL(" edge; speed; '>10' -> match all edges with a speed above 10\n");
473 // Create label with the help text
474 new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
475 // Create horizontal separator
476 new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
477 // Create frame for OK Button
478 FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
479 // Create Button Close (And two more horizontal frames to center it)
480 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
481 GUIDesigns::buildFXButton(myHorizontalFrameOKButton, TL("OK"), "", TL("close"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
482 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
483 // create Dialog
484 additionalNeteditAttributesHelpDialog->create();
485 // show in the given position
486 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
487 // refresh APP
488 getApp()->refresh();
489 // open as modal dialog (will block all windows until stop() or stopModal() is called)
490 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
491 return 1;
492}
493
494
495void
497 // clear fromTAZComboBox
500 // add first element
501 myFromTAZComboBox->appendIconItem("<from TAZ>");
502 myToTAZComboBox->appendIconItem("<to TAZ>");
503 // add all TAZs
505 myFromTAZComboBox->appendIconItem(TAZ.second->getID().c_str());
506 myToTAZComboBox->appendIconItem(TAZ.second->getID().c_str());
507 }
508 // set first items
511 // set color
512 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
513 myToTAZComboBox->setTextColor(FXRGB(128, 128, 128));
514}
515
516/****************************************************************************/
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:293
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:311
#define GUIDesignTextField
Definition GUIDesigns.h:59
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:399
#define GUIDesignDialogBox
Definition GUIDesigns.h:599
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:94
#define GUIDesignComboBoxStaticExtended
Combo box static (not editable) extended over the all frame.
Definition GUIDesigns.h:299
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:74
#define GUIDesignButtonOK
Definition GUIDesigns.h:153
#define GUIDesignComboBoxVisibleItems
Definition GUIDesigns.h:49
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
Definition GUIDesigns.h:249
#define GUIDesignHorizontalSeparator
Definition GUIDesigns.h:463
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:279
@ MODEADDITIONAL
@ DATAINTERVAL
#define TL(string)
Definition MsgHandler.h:301
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
GNESelectorFrame * getSelectorFrameParent() const
get Selector Frame Parent
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:154
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,
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
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEAdditional * >, std::hash< int > > & getAdditionals() const
get additionals
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:146
const GNETagPropertiesDatabase * getTagPropertiesDatabase() const
get tag properties database
Definition GNENet.cpp:140
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,
const std::vector< const GNETagProperties * > getTagPropertiesByType(const int tagPropertyCategory) const
get tagProperties associated to the given GNETagProperties::TagType (NETWORKELEMENT,...
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