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-2023 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>
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(), "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(), "Interval [begin, end]", nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
67 myIntervalSelector = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, true, this, MID_GNE_SELECTORFRAME_SETINTERVAL, GUIDesignComboBoxStaticExtended);
68 // Create textfield for begin and end
69 FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
70 myBegin = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETBEGIN, GUIDesignTextField);
71 myEnd = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETEND, GUIDesignTextField);
72 // Create MFXComboBoxIcon for generic datas
73 myMatchGenericDataTagComboBox = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, true, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox);
74 // Create textfield for begin and end
75 myTAZHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
76 myFromTAZComboBox = new FXComboBox(myTAZHorizontalFrame, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_FROMTAZ, GUIDesignComboBox);
77 myToTAZComboBox = new FXComboBox(myTAZHorizontalFrame, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_TOTAZ, GUIDesignComboBox);
78 // Create listBox for Attributes
79 myMatchGenericDataAttrComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox);
80 // Create TextField for MatchGenericData string
81 myMatchGenericDataString = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField);
82 // Create help button
83 new FXButton(getCollapsableFrame(), TL("Help"), nullptr, this, MID_HELP, GUIDesignButtonRectangular);
84 // Fill list of sub-items (first element will be "edge")
85 enableMatchGenericDataAttribute();
86 // Set speed of edge as default attribute
87 myMatchGenericDataAttrComboBox->setText(TL("speed"));
88 myCurrentAttribute = SUMO_ATTR_SPEED;
89 // Set default value for MatchGenericData string
90 myMatchGenericDataString->setText(defaultValue.c_str());
91}
92
93
95
96
97void
99 // first drop intervals
100 myIntervals.clear();
101 // iterate over all data sets
102 for (const auto& dataSet : myElementSet->getSelectorFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->getDataSets()) {
103 for (const auto& dataInterval : dataSet->getDataIntervalChildren()) {
104 myIntervals[std::make_pair(dataInterval.second->getAttributeDouble(SUMO_ATTR_BEGIN), dataInterval.second->getAttributeDouble(SUMO_ATTR_END))] = -1;
105 }
106 }
107 // disable modul if there isn't intervals
108 if (myIntervals.size() == 0) {
110 } else {
111 // enable comboboxes and text field
113 myBegin->enable();
114 myEnd->enable();
117 myMatchGenericDataString->enable();
118 // clear combo box interval selector
120 // fill combo Box
121 for (auto& interval : myIntervals) {
122 interval.second = myIntervalSelector->appendIconItem((" [" + toString(interval.first.first) + "," + toString(interval.first.second) + "]").c_str(), GUIIconSubSys::getIcon(GUIIcon::DATAINTERVAL));
123 }
124 // set number of visible items
125 if (myIntervalSelector->getNumItems() < 10) {
127 } else {
129 }
130 // Clear items of myMatchGenericDataTagComboBox
132 // update begin and end
133 myBegin->setText(toString(myIntervals.begin()->first.first).c_str());
134 myBegin->setTextColor(FXRGB(0, 0, 0));
135 myEnd->setText(toString(myIntervals.begin()->first.second).c_str());
136 myEnd->setTextColor(FXRGB(0, 0, 0));
137 // get generic datas
139 // fill combo box (only with drawable elements)
140 for (const auto& genericDataTag : genericDataTags) {
141 if (genericDataTag.isDrawable()) {
142 myMatchGenericDataTagComboBox->appendIconItem(genericDataTag.getFieldString().c_str(), GUIIconSubSys::getIcon(genericDataTag.getGUIIcon()));
143 }
144 }
145 // set first item as current item
148 // call select tag
149 onCmdSelectTag(nullptr, 0, nullptr);
150 }
151}
152
153
154void
156 // disable comboboxes and text field
158 myBegin->disable();
159 myEnd->disable();
162 myMatchGenericDataString->disable();
163 // change colors to black (even if there are invalid values)
165 myMatchGenericDataAttrComboBox->setTextColor(FXRGB(0, 0, 0));
166 myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0));
167}
168
169
170void
172 // just show Module
173 show();
174}
175
176
177void
179 // just hide modul
180 hide();
181}
182
183
184long
186 // iterate over interval and update begin and end
187 for (auto& interval : myIntervals) {
188 if (interval.second == myIntervalSelector->getCurrentItem()) {
189 // update begin
190 myBegin->setTextColor(FXRGB(0, 0, 0));
191 myBegin->setText(toString(interval.first.first).c_str());
192 // update end
193 myEnd->setTextColor(FXRGB(0, 0, 0));
194 myEnd->setText(toString(interval.first.second).c_str());
195 }
196 }
197 // call onCmdSelectTag
198 onCmdSelectTag(0, 0, 0);
199 return 1;
200}
201
202
203long
204GNEMatchGenericDataAttribute::onCmdSetBegin(FXObject*, FXSelector, void*) {
205 // check if can be parsed to double
206 if (GNEAttributeCarrier::canParse<double>(myBegin->getText().text()) &&
207 GNEAttributeCarrier::canParse<double>(myEnd->getText().text())) {
208 // set value in double format
209 myBegin->setText(toString(GNEAttributeCarrier::parse<double>(myBegin->getText().text())).c_str());
210 // set valid color text and kill focus
211 myBegin->setTextColor(FXRGB(0, 0, 0));
212 myBegin->killFocus();
213 // enable elements
216 myMatchGenericDataString->enable();
217 // call onCmdSelectTag
218 onCmdSelectTag(0, 0, 0);
219 } else {
220 // set invalid color text
221 myBegin->setTextColor(FXRGB(255, 0, 0));
222 // disable elements
225 myMatchGenericDataString->disable();
226 }
227 return 1;
228}
229
230
231long
232GNEMatchGenericDataAttribute::onCmdSetEnd(FXObject*, FXSelector, void*) {
233 // check if can be parsed to double
234 if (GNEAttributeCarrier::canParse<double>(myBegin->getText().text()) &&
235 GNEAttributeCarrier::canParse<double>(myEnd->getText().text())) {
236 // set value in double format
237 myEnd->setText(toString(GNEAttributeCarrier::parse<double>(myEnd->getText().text())).c_str());
238 // set valid color text and kill focus
239 myEnd->setTextColor(FXRGB(0, 0, 0));
240 myEnd->killFocus();
241 // enable elements
244 myMatchGenericDataString->enable();
245 // call onCmdSelectTag
246 onCmdSelectTag(0, 0, 0);
247 } else {
248 // set invalid color text
249 myEnd->setTextColor(FXRGB(255, 0, 0));
250 // disable elements
253 myMatchGenericDataString->disable();
254 }
255 return 1;
256}
257
258
259long
261 if (myFromTAZComboBox->getText() == "<from TAZ>") {
262 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
263 return 1;
264 } else {
266 if (TAZ->getID().c_str() == myFromTAZComboBox->getText()) {
267 myFromTAZComboBox->setTextColor(FXRGB(0, 0, 0));
268 return 1;
269 }
270 }
271 }
272 myFromTAZComboBox->setTextColor(FXRGB(255, 0, 0));
273 return 1;
274}
275
276
277long
278GNEMatchGenericDataAttribute::onCmdSetToTAZ(FXObject*, FXSelector, void*) {
279 if (myToTAZComboBox->getText() == "<to TAZ>") {
280 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
281 return 1;
282 } else {
284 if (TAZ->getID().c_str() == myToTAZComboBox->getText()) {
285 myToTAZComboBox->setTextColor(FXRGB(0, 0, 0));
286 return 1;
287 }
288 }
289 }
290 myToTAZComboBox->setTextColor(FXRGB(255, 0, 0));
291 return 1;
292}
293
294
295long
296GNEMatchGenericDataAttribute::onCmdSelectTag(FXObject*, FXSelector, void*) {
297 // First check what type of elementes is being selected
299 // get generic data tags
301 // fill myMatchGenericDataTagComboBox
302 for (const auto& genericDataTag : listOfTags) {
303 if (genericDataTag.isDrawable() && (genericDataTag.getFieldString() == myMatchGenericDataTagComboBox->getText().text())) {
304 myCurrentTag = genericDataTag.getTag();
305 }
306 }
307 // check that typed-by-user value is correct
309 // obtain begin and end
310 const double begin = GNEAttributeCarrier::parse<double>(myBegin->getText().text());
311 const double end = GNEAttributeCarrier::parse<double>(myEnd->getText().text());
312 // obtain all Generic Data attributes for current generic tag
314 // set color and enable items
317 myMatchGenericDataString->enable();
318 myMatchGenericDataAttrComboBox->clearItems();
319 // add data set parent
321 // fill attribute combo box
322 for (const auto& attribute : attributes) {
323 myMatchGenericDataAttrComboBox->appendItem(attribute.c_str());
324 }
326 // check if shown TAZ text fields
328 myTAZHorizontalFrame->show();
330 } else {
331 myTAZHorizontalFrame->hide();
332 }
333 onCmdSelectAttribute(nullptr, 0, nullptr);
334 } else {
335 // change color to red and disable items
338 myMatchGenericDataString->disable();
339 }
340 update();
341 return 1;
342}
343
344
345long
347 // obtain all Generic Data attributes for current generic tag
349 toString(myCurrentTag), GNEAttributeCarrier::parse<double>(myBegin->getText().text()),
350 GNEAttributeCarrier::parse<double>(myEnd->getText().text()));
351 // add extra data set parent attribute
352 attributes.insert(toString(GNE_ATTR_DATASET));
353 // clear current attribute
354 myCurrentAttribute.clear();
355 // set current selected attribute
356 for (const auto& attribute : attributes) {
357 if (attribute == myMatchGenericDataAttrComboBox->getText().text()) {
358 myCurrentAttribute = attribute;
359 }
360 }
361 // check if selected attribute is valid
362 if (myCurrentAttribute.empty()) {
363 myMatchGenericDataAttrComboBox->setTextColor(FXRGB(255, 0, 0));
364 myMatchGenericDataString->disable();
365 } else {
366 myMatchGenericDataAttrComboBox->setTextColor(FXRGB(0, 0, 0));
367 myMatchGenericDataString->enable();
368 }
369 return 1;
370}
371
372
373long
375 // obtain expression and tag value
376 std::string expression = myMatchGenericDataString->getText().text();
377 bool valid = true;
378 // get all Generic datas
380 GNEAttributeCarrier::parse<double>(myBegin->getText().text()),
381 GNEAttributeCarrier::parse<double>(myEnd->getText().text()));
382 // extra filter for TAZ rel datas
384 std::vector<GNEGenericData*> TAZReldatasFrom, TAZReldatasTo;
385 // filter from TAZs
386 for (const auto& TAZRelData : genericDatas) {
387 if (myFromTAZComboBox->getTextColor() == FXRGB(128, 128, 128)) {
388 TAZReldatasFrom.push_back(TAZRelData);
389 } else if ((myFromTAZComboBox->getTextColor() == FXRGB(0, 0, 0)) && (TAZRelData->getAttribute(SUMO_ATTR_FROM) == myFromTAZComboBox->getText().text())) {
390 TAZReldatasFrom.push_back(TAZRelData);
391 }
392 }
393 // filter to TAZs
394 for (const auto& TAZRelData : TAZReldatasFrom) {
395 if (myToTAZComboBox->getTextColor() == FXRGB(128, 128, 128)) {
396 TAZReldatasTo.push_back(TAZRelData);
397 } else if ((myToTAZComboBox->getTextColor() == FXRGB(0, 0, 0)) && (TAZRelData->getAttribute(SUMO_ATTR_TO) == myToTAZComboBox->getText().text())) {
398 TAZReldatasTo.push_back(TAZRelData);
399 }
400 }
401 // update generic datas
402 genericDatas = TAZReldatasTo;
403 }
404 if (expression == "") {
405 // the empty expression matches all objects
408 // The expression must have the form
409 // <val matches if attr < val
410 // >val matches if attr > val
411 // =val matches if attr = val
412 // val matches if attr = val
413 char compOp = expression[0];
414 if ((compOp == '<') || (compOp == '>') || (compOp == '=')) {
415 expression = expression.substr(1);
416 } else {
417 compOp = '=';
418 }
419 // check if value can be parsed to double
420 if (GNEAttributeCarrier::canParse<double>(expression.c_str())) {
421 myElementSet->getSelectorFrameParent()->handleIDs(myElementSet->getSelectorFrameParent()->getGenericMatches(genericDatas, myCurrentAttribute, compOp, GNEAttributeCarrier::parse<double>(expression.c_str()), expression));
422 } else {
423 valid = false;
424 }
425 } else {
426 // The expression must have the form
427 // =str: matches if <str> is an exact match
428 // !str: matches if <str> is not a substring
429 // ^str: matches if <str> is not an exact match
430 // str: matches if <str> is a substring (sends compOp '@')
431 // Alternatively, if the expression is empty it matches all objects
432 char compOp = expression[0];
433 if ((compOp == '=') || (compOp == '!') || (compOp == '^')) {
434 expression = expression.substr(1);
435 } else {
436 compOp = '@';
437 }
439 }
440 // change color depending of flag "valid"
441 if (valid) {
442 myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0));
443 myMatchGenericDataString->killFocus();
444 } else {
445 myMatchGenericDataString->setTextColor(FXRGB(255, 0, 0));
446 }
447 return 1;
448}
449
450
451long
452GNEMatchGenericDataAttribute::onCmdHelp(FXObject*, FXSelector, void*) {
453 // Create dialog box
454 FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Parameters Help", GUIDesignDialogBox);
455 additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
456 // set help text
457 std::ostringstream help;
458 help
459 << TL("- The 'MatchGenericData Attribute' controls allow to specify a set of objects which are then applied to the current selection\n")
460 << TL(" according to the current 'Modification Mode'.\n")
461 << TL(" 1. Select an object type from the first input box\n")
462 << TL(" 2. Select an attribute from the second input box\n")
463 << TL(" 3. Enter a 'match expression' in the third input box and press <return>\n")
464 << "\n"
465 << TL("- The empty expression matches all objects\n")
466 << TL("- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n")
467 << TL("- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n")
468 << "\n"
469 << TL("- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n")
470 << TL(" '' (no operator) matches if string is a substring of that object'ts attribute.\n")
471 << TL(" '=' matches if string is an exact match.\n")
472 << TL(" '!' matches if string is not a substring.\n")
473 << TL(" '^' matches if string is not an exact match.\n")
474 << "\n"
475 << TL("- Examples:\n")
476 << TL(" junction; id; 'foo' -> match all junctions that have 'foo' in their id\n")
477 << TL(" junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n")
478 << TL(" edge; speed; '>10' -> match all edges with a speed above 10\n");
479 // Create label with the help text
480 new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
481 // Create horizontal separator
482 new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
483 // Create frame for OK Button
484 FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
485 // Create Button Close (And two more horizontal frames to center it)
486 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
487 new FXButton(myHorizontalFrameOKButton, (TL("OK") + std::string("\t\t") + TL("close")).c_str(), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
488 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
489 // Write Warning in console if we're in testing mode
490 WRITE_DEBUG("Opening help dialog of selector frame");
491 // create Dialog
492 additionalNeteditAttributesHelpDialog->create();
493 // show in the given position
494 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
495 // refresh APP
496 getApp()->refresh();
497 // open as modal dialog (will block all windows until stop() or stopModal() is called)
498 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
499 // Write Warning in console if we're in testing mode
500 WRITE_DEBUG("Close help dialog of selector frame");
501 return 1;
502}
503
504
505void
507 // clear fromTAZComboBox
508 myFromTAZComboBox->clearItems();
509 myToTAZComboBox->clearItems();
510 // add first element
511 myFromTAZComboBox->appendItem("<from TAZ>");
512 myToTAZComboBox->appendItem("<to TAZ>");
513 // add all TAZs
515 myFromTAZComboBox->appendItem(TAZ->getID().c_str());
516 myToTAZComboBox->appendItem(TAZ->getID().c_str());
517 }
518 // set num of visible items
519 myFromTAZComboBox->setNumVisible(myFromTAZComboBox->getNumItems());
520 myToTAZComboBox->setNumVisible(myFromTAZComboBox->getNumItems());
521 // set first items
522 myFromTAZComboBox->setCurrentItem(0, TRUE);
523 myToTAZComboBox->setCurrentItem(0, TRUE);
524 // set color
525 myFromTAZComboBox->setTextColor(FXRGB(128, 128, 128));
526 myToTAZComboBox->setTextColor(FXRGB(128, 128, 128));
527}
528
529/****************************************************************************/
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:645
@ 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:288
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:306
#define GUIDesignTextField
Definition GUIDesigns.h:51
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:394
#define GUIDesignDialogBox
Definition GUIDesigns.h:588
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:80
#define GUIDesignComboBoxStaticExtended
Combo box static (not editable) extended over the all frame.
Definition GUIDesigns.h:294
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:66
#define GUIDesignButtonOK
Definition GUIDesigns.h:148
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
Definition GUIDesigns.h:244
#define GUIDesignHorizontalSeparator
Definition GUIDesigns.h:452
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:274
@ MODEADDITIONAL
@ DATAINTERVAL
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:281
#define TL(string)
Definition MsgHandler.h:287
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_TAZREL
a relation between two TAZs
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_SPEED
@ 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)
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.
FXComboBox * myFromTAZComboBox
TextField for fromTAZ.
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.
FXComboBox * myMatchGenericDataAttrComboBox
attributes of the match box
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
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.
FXComboBox * myToTAZComboBox
TextField for toTAZ.
long onCmdSetEnd(FXObject *, FXSelector, void *)
Called when the user change end text field.
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::set< GNEDataSet * > & getDataSets() const
get demand elements
const std::map< SumoXMLTag, std::set< GNEAdditional * > > & getAdditionals() const
get additionals
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
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 FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
ComboBox with icon.
FXint getCurrentItem() const
Get the current item's index.
void setCurrentItem(FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint getNumItems() const
Return the number of items in the list.
FXString getText() const
Get the text.
void setTextColor(FXColor clr)
Change text color.
void setNumVisible(FXint nvis)
Set the number of visible items in the drop down list.
void clearItems()
Remove all items from the list.
virtual void disable()
Disable combo box.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon
virtual 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