Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMatchAttribute.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
23#include <netedit/GNENet.h>
24#include <netedit/GNEViewNet.h>
34
35#include "GNEMatchAttribute.h"
36
37// ===========================================================================
38// FOX callback mapping
39// ===========================================================================
40
48
49// Object implementation
50FXIMPLEMENT(GNEMatchAttribute, MFXGroupBoxModule, GNEMatchAttributeMap, ARRAYNUMBER(GNEMatchAttributeMap))
51
52// ===========================================================================
53// method definitions
54// ===========================================================================
55
56// ---------------------------------------------------------------------------
57// GNEMatchAttribute - methods
58// ---------------------------------------------------------------------------
59#ifdef _MSC_VER
60#pragma warning(push)
61#pragma warning(disable: 4355) // mask warning about "this" in initializers
62#endif
64 MFXGroupBoxModule(selectorFrameParent, TL("Match Attribute")),
65 mySelectorFrameParent(selectorFrameParent),
67 const auto staticTooltipMenu = selectorFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
68 // Create MFXComboBoxIcons (sum 1 due children)
69 for (int i = 0; i < selectorFrameParent->getViewNet()->getNet()->getTagPropertiesDatabase()->getHierarchyDepth() + 1; i++) {
70 auto comboBoxIcon = new MFXComboBoxTagProperty(getCollapsableFrame(), staticTooltipMenu, true, GUIDesignComboBoxVisibleItems,
72 myTagComboBoxVector.push_back(comboBoxIcon);
73 }
75 myShowOnlyCommonAttributes->setCheck(FALSE);
76 // Create MFXComboBoxIcon for Attributes
79 // Create TextField for Match string
81 // create button
83 // Create help button
85 // refresh with the current tag and attr
87}
88#ifdef _MSC_VER
89#pragma warning(pop)
90#endif
91
95
96
97void
99 for (const auto& tagComboBox : myTagComboBoxVector) {
100 tagComboBox->enable();
101 }
102 myAttributeComboBox->enable();
103 myMatchString->enable();
104 myMatchStringButton->enable();
105}
106
107
108void
110 for (const auto& tagComboBox : myTagComboBoxVector) {
111 tagComboBox->disable();
112 tagComboBox->setTextColor(GUIDesignTextColorBlack);
113 }
114 myAttributeComboBox->disable();
115 myMatchString->disable();
116 myMatchStringButton->disable();
117 // change colors to black (even if there are invalid values)
120}
121
122
123void
125 // refresh before show
127 // show groupbox
128 show();
129}
130
131
132void
134 // hide groupbox
135 hide();
136}
137
138
139void
141 // continue depending of current
142 auto parentHierarchy = myCurrentEditedProperties->getTagProperties()->getHierarchicalParentsRecuersively();
143 // fill hierarchy
144 for (size_t i = 0; i < parentHierarchy.size(); i++) {
145 auto comboBox = myTagComboBoxVector.at(i);
146 // clear previous elements
147 comboBox->clearItems();
148 // add <all> always as first element
149 myTagComboBoxVector.at(i)->appendTagItem(myCurrentEditedProperties->getTagPropertiesAll());
150 // add siblings (except for root)
151 if (parentHierarchy.at(i)->getHierarchicalParent()) {
152 for (const auto tagSibling : parentHierarchy.at(i)->getHierarchicalParent()->getHierarchicalChildren()) {
153 if (tagSibling->isDrawable()) {
154 myTagComboBoxVector.at(i)->appendTagItem(tagSibling);
155 }
156 }
157 // update tag
158 if (myTagComboBoxVector.at(i)->hasTagProperty(parentHierarchy.at(i))) {
159 myTagComboBoxVector.at(i)->setCurrentItem(parentHierarchy.at(i), FALSE);
160 myTagComboBoxVector.at(i)->show();
161 } else {
162 myTagComboBoxVector.at(i)->hide();
163 }
164 }
165 }
166 // hide the two first combo boxes(root and supermode)
167 myTagComboBoxVector.at(0)->hide();
168 myTagComboBoxVector.at(1)->hide();
169 // hide comboBox with only one element (+ <all>)
170 if (myTagComboBoxVector.at(parentHierarchy.size() - 1)->getNumItems() == 2) {
171 myTagComboBoxVector.at(parentHierarchy.size() - 1)->hide();
172 }
173 // check if show children
174 auto comboBoxChildren = myTagComboBoxVector.at(parentHierarchy.size());
175 if (parentHierarchy.back()->getHierarchicalChildren().size() > 0) {
176 // clear previous elements
177 comboBoxChildren->clearItems();
178 // add <all> always as first element
179 comboBoxChildren->appendTagItem(myCurrentEditedProperties->getTagPropertiesAll());
180 for (const auto childTagProperty : parentHierarchy.back()->getHierarchicalChildren()) {
181 comboBoxChildren->appendTagItem(childTagProperty);
182 }
183 comboBoxChildren->show();
184 } else {
185 comboBoxChildren->hide();
186 }
187 // hide rest of combo boxes
188 for (size_t i = (parentHierarchy.size() + 1); i < myTagComboBoxVector.size(); i++) {
189 myTagComboBoxVector.at(i)->hide();
190 }
191 // now fill attributes
192 myAttributeComboBox->clearItems();
193 // get all children recursivelly
194 const auto attributes = myCurrentEditedProperties->getTagProperties()->getHierarchicalChildrenAttributesRecursively(myShowOnlyCommonAttributes->getCheck() == TRUE, true);
195 for (const auto& attribute : attributes) {
196 myAttributeComboBox->appendAttrItem(attribute.second);
197 }
198 // update tag
199 if (myAttributeComboBox->getNumItems() == 0) {
200 myAttributeComboBox->appendAttrItem(myCurrentEditedProperties->getAttributePropertiesNoCommon());
201 myAttributeComboBox->disable();
202 // set match string
203 myMatchString->setText("", FALSE);
204 myMatchString->disable();
205 } else {
206 myAttributeComboBox->enable();
207 if (myAttributeComboBox->hasAttrProperty(myCurrentEditedProperties->getAttributeProperties())) {
208 myAttributeComboBox->setCurrentItem(myCurrentEditedProperties->getAttributeProperties(), FALSE);
209 } else {
210 myAttributeComboBox->setCurrentItem(attributes.begin()->second, FALSE);
211 myCurrentEditedProperties->setAttributeProperties(myAttributeComboBox->getCurrentAttrProperty());
212 }
213 // set match string
214 myMatchString->setText(myCurrentEditedProperties->getMatchValue().c_str(), FALSE);
215 myMatchString->enable();
216 }
217}
218
219
220long
221GNEMatchAttribute::onCmdTagSelected(FXObject* obj, FXSelector, void*) {
222 // iterate over all comboBoxes
223 int tagComboBoxIndex = 0;
224 for (int i = 0; i < (int)myTagComboBoxVector.size(); i++) {
225 if (myTagComboBoxVector.at(i) == obj) {
226 tagComboBoxIndex = i;
227 }
228 }
229 // check if tag property exist
230 if (myTagComboBoxVector.at(tagComboBoxIndex)->getCurrentTagProperty()) {
231 const auto selectedTag = myTagComboBoxVector.at(tagComboBoxIndex)->getCurrentTagProperty();
232 // if we select <all>, use parent tag
233 if (selectedTag == myCurrentEditedProperties->getTagPropertiesAll()) {
234 myCurrentEditedProperties->setTagProperties(myTagComboBoxVector.at(tagComboBoxIndex - 1)->getCurrentTagProperty());
235 } else {
236 myCurrentEditedProperties->setTagProperties(selectedTag);
237 }
239 }
240 return 0;
241}
242
243
244long
245GNEMatchAttribute::onCmdAttributeSelected(FXObject*, FXSelector, void*) {
246 myCurrentEditedProperties->setAttributeProperties(myAttributeComboBox->getCurrentAttrProperty());
248 return 1;
249}
250
251
252long
253GNEMatchAttribute::onCmdToogleOnlyCommon(FXObject*, FXSelector, void*) {
254 // simply refresh attribute
256 return 1;
257}
258
259
260long
261GNEMatchAttribute::onCmdProcessString(FXObject*, FXSelector, void*) {
262 std::vector<GNEAttributeCarrier*> matches;
263 // obtain expresion
264 std::string expr = myMatchString->getText().text();
265 bool valid = true;
266 if (expr == "") {
267 // the empty expression matches all objects
268 matches = getMatches('@', 0, expr);
269 } else if (myCurrentEditedProperties->getAttributeProperties()->isNumerical()) {
270 // The expression must have the form
271 // <val matches if attr < val
272 // >val matches if attr > val
273 // =val matches if attr = val
274 // val matches if attr = val
275 char compOp = expr[0];
276 if (compOp == '<' || compOp == '>' || compOp == '=') {
277 expr = expr.substr(1);
278 } else {
279 compOp = '=';
280 }
281 // check if value can be parsed to double
282 if (GNEAttributeCarrier::canParse<double>(expr.c_str())) {
283 matches = getMatches(compOp, GNEAttributeCarrier::parse<double>(expr.c_str()), expr);
284 } else {
285 valid = false;
286 }
287 } else {
288 // The expression must have the form
289 // =str: matches if <str> is an exact match
290 // !str: matches if <str> is not a substring
291 // ^str: matches if <str> is not an exact match
292 // str: matches if <str> is a substring (sends compOp '@')
293 // Alternatively, if the expression is empty it matches all objects
294 char compOp = expr[0];
295 if (compOp == '=' || compOp == '!' || compOp == '^') {
296 expr = expr.substr(1);
297 } else {
298 compOp = '@';
299 }
300 matches = getMatches(compOp, 0, expr);
301 }
302 if (valid) {
303 mySelectorFrameParent->handleIDs(matches);
305 myMatchString->killFocus();
306 } else {
308 }
309 return 1;
310
311}
312
313
314long
315GNEMatchAttribute::onCmdHelp(FXObject*, FXSelector, void*) {
316 // set help text
317 std::ostringstream help;
318 help
319 << TL("- The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection") << "\n"
320 << TL(" according to the current 'Modification Mode'.") << "\n"
321 << TL(" 1. Select an object type from the first input box") << "\n"
322 << TL(" 2. Select an attribute from the second input box") << "\n"
323 << TL(" 3. Enter a 'match expression' in the third input box and press <return>") << "\n"
324 << "\n"
325 << TL("- The empty expression matches all objects") << "\n"
326 << TL("- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.") << "\n"
327 << TL("- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'") << "\n"
328 << "\n"
329 << TL("- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.") << "\n"
330 << TL(" '' (no operator) matches if string is a substring of that object's attribute.") << "\n"
331 << TL(" '=' matches if string is an exact match.") << "\n"
332 << TL(" '!' matches if string is not a substring.") << "\n"
333 << TL(" '^' matches if string is not an exact match.") << "\n"
334 << "\n"
335 << TL("- Examples:")
336 << TL(" junction; id; 'foo' -> match all junctions that have 'foo' in their id") << "\n"
337 << TL(" junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'") << "\n"
338 << TL(" edge; speed; '>10' -> match all edges with a speed above 10");
339 // open help dialog
340 GNEHelpBasicDialog(mySelectorFrameParent->getViewNet()->getViewParent()->getGNEAppWindows(),
341 TL("Netedit parameters Help"), help);
342 return 1;
343}
344
345
346std::vector<GNEAttributeCarrier*>
347GNEMatchAttribute::getMatches(const char compOp, const double val, const std::string& expr) {
348 std::vector<GNEAttributeCarrier*> result;
349 // first retrieve all ACs using ACTag
350 const auto allACbyTag = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveAttributeCarriers(myCurrentEditedProperties->getTagProperties()->getTag());
351 // iterate over all ACs
352 for (const auto& AC : allACbyTag) {
353 // first check if the attribute exist in the given tag
354 if (AC->getTagProperty()->hasAttribute(myCurrentEditedProperties->getAttributeProperties()->getAttr())) {
355 if (expr == "" && compOp == '@') {
356 result.push_back(AC);
357 } else if (myCurrentEditedProperties->getAttributeProperties()->isNumerical()) {
358 double acVal;
359 std::istringstream buf(AC->getAttribute(myCurrentEditedProperties->getAttributeProperties()->getAttr()));
360 buf >> acVal;
361 switch (compOp) {
362 case '<':
363 if (acVal < val) {
364 result.push_back(AC);
365 }
366 break;
367 case '>':
368 if (acVal > val) {
369 result.push_back(AC);
370 }
371 break;
372 case '=':
373 if (acVal == val) {
374 result.push_back(AC);
375 }
376 break;
377 default:
378 break;
379 }
380 } else {
381 // string match
382 std::string acVal = AC->getAttributeForSelection(myCurrentEditedProperties->getAttributeProperties()->getAttr());
383 switch (compOp) {
384 case '@':
385 if (acVal.find(expr) != std::string::npos) {
386 result.push_back(AC);
387 }
388 break;
389 case '!':
390 if (acVal.find(expr) == std::string::npos) {
391 result.push_back(AC);
392 }
393 break;
394 case '=':
395 if (acVal == expr) {
396 result.push_back(AC);
397 }
398 break;
399 case '^':
400 if (acVal != expr) {
401 result.push_back(AC);
402 }
403 break;
404 default:
405 break;
406 }
407 }
408 }
409 }
410 return result;
411}
412
413
414std::vector<GNEAttributeCarrier*>
415GNEMatchAttribute::getGenericMatches(const std::vector<GNEGenericData*>& genericDatas, const std::string& attr, const char compOp, const double val, const std::string& expr) {
416 std::vector<GNEAttributeCarrier*> result;
417 // iterate over generic datas
418 for (const auto& genericData : genericDatas) {
419 if (expr == "" && compOp == '@') {
420 result.push_back(genericData);
421 } else if (attr != toString(GNE_ATTR_PARENT)) {
422 double acVal;
423 std::istringstream buf(genericData->getParameter(attr, "0"));
424 buf >> acVal;
425 switch (compOp) {
426 case '<':
427 if (acVal < val) {
428 result.push_back(genericData);
429 }
430 break;
431 case '>':
432 if (acVal > val) {
433 result.push_back(genericData);
434 }
435 break;
436 case '=':
437 if (acVal == val) {
438 result.push_back(genericData);
439 }
440 break;
441 default:
442 break;
443 }
444 } else {
445 // string match
446 std::string acVal = genericData->getAttributeForSelection(GNE_ATTR_PARENT);
447 switch (compOp) {
448 case '@':
449 if (acVal.find(expr) != std::string::npos) {
450 result.push_back(genericData);
451 }
452 break;
453 case '!':
454 if (acVal.find(expr) == std::string::npos) {
455 result.push_back(genericData);
456 }
457 break;
458 case '=':
459 if (acVal == expr) {
460 result.push_back(genericData);
461 }
462 break;
463 case '^':
464 if (acVal != expr) {
465 result.push_back(genericData);
466 }
467 break;
468 default:
469 break;
470 }
471 }
472 }
473 return result;
474}
475
476// ---------------------------------------------------------------------1------
477// GNEMatchAttribute::CurrentEditedProperties - methods
478// ---------------------------------------------------------------------------
479
481 myMatchAttributeParent(matchAttributeParent) {
482 // build special attributes
484 nullptr,
486 TL("Show all attributes"),
487 FXRGBA(255, 255, 255, 255),
488 TL("<all>"));
491 TL("No common attributes defined"));
492 // set default tag and attribute for every property
493 const auto database = myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getNet()->getTagPropertiesDatabase();
494 setTagProperties(database->getTagProperty(SUMO_TAG_EDGE, true));
495 setAttributeProperties(myNetworkTagProperties.back()->getAttributeProperties(SUMO_ATTR_SPEED));
496 myNetworkMatchValue = ">10";
497 setTagProperties(database->getTagProperty(SUMO_TAG_VEHICLE, true));
498 setAttributeProperties(myDemandTagProperties.back()->getAttributeProperties(SUMO_ATTR_ID));
499 setTagProperties(database->getTagProperty(GNE_TAG_DATAS, true));
500}
501
502
506
507
508const GNETagProperties*
512
513
518
519
520const GNETagProperties*
522 if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
523 return myNetworkTagProperties.back();
524 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
525 return myDemandTagProperties.back();
526 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData()) {
527 return myDataTagProperties.back();
528 } else {
529 throw ProcessError("Invalid supermode");
530 }
531}
532
533
536 if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
538 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
540 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData()) {
542 } else {
543 throw ProcessError("Invalid supermode");
544 }
545}
546
547
548const std::string&
550 if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
551 return myNetworkMatchValue;
552 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
553 return myDemandMatchValue;
554 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData()) {
555 return myDataMatchValue;
556 } else {
557 throw ProcessError("Invalid supermode");
558 }
559}
560
561
562void
572
573
574void
576 if (attrProperty->getTagPropertyParent()->getSupermode() == Supermode::NETWORK) {
577 myNetworkAttributeProperties = attrProperty;
578 } else if (attrProperty->getTagPropertyParent()->getSupermode() == Supermode::DEMAND) {
579 myDemandAttributeProperties = attrProperty;
580 } else if (attrProperty->getTagPropertyParent()->getSupermode() == Supermode::DATA) {
581 myDataAttributeProperties = attrProperty;
582 }
583}
584
585
586void
588 if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
590 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
592 } else if (myMatchAttributeParent->mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData()) {
594 }
595}
596
597/****************************************************************************/
FXDEFMAP(GNEMatchAttribute) GNEMatchAttributeMap[]
@ NETWORK
Network mode (Edges, junctions, etc..).
@ DATA
Data mode (edgeData, LaneData etc..).
@ DEMAND
Demand mode (Routes, Vehicles etc..).
@ MID_GNE_SELECTORFRAME_SELECTATTRIBUTE
select attribute in selector frame
@ MID_GNE_SELECTORFRAME_SELECTTAG
select tag in selector frame
@ MID_HELP
help button
Definition GUIAppEnum.h:655
@ MID_GNE_SELECTORFRAME_PROCESSSTRING
process string
@ MID_GNE_SELECTORFRAME_TOGGLECOMMON
toogle only show common
#define GUIDesignTextColorRed
red color (for invalid text)
Definition GUIDesigns.h:44
#define GUIDesignButton
Definition GUIDesigns.h:100
#define GUIDesignComboBox
Definition GUIDesigns.h:295
#define GUIDesignTextField
Definition GUIDesigns.h:74
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:112
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:92
#define GUIDesignComboBoxVisibleItems
Definition GUIDesigns.h:64
#define GUIDesignTextColorBlack
black color (for correct text)
Definition GUIDesigns.h:38
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:194
@ EMPTY
Definition GUIIcons.h:59
#define TL(string)
Definition MsgHandler.h:304
const std::string invalid_return< std::string >::value
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_ATTRIBUTES_ALL
@ GNE_TAG_DATAS
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_NOCOMMON
no common attributes
@ SUMO_ATTR_SPEED
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_ID
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
const GNETagProperties * getTagPropertyParent() const
get reference to tagProperty parent
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:145
container with current edited properties
std::string myDemandMatchValue
current demand match value
CurrentEditedProperties()=delete
default constructor
std::vector< const GNETagProperties * > myDemandTagProperties
current demand tag properties
const GNEAttributeProperties * getAttributePropertiesNoCommon() const
get attr properties no common
const GNEAttributeProperties * myDataAttributeProperties
current data attribute properties
std::vector< const GNETagProperties * > myNetworkTagProperties
current network tag properties
std::string myNetworkMatchValue
current network match value
GNETagProperties * myTagPropertiesAllAttributes
tag properties <all>
void setTagProperties(const GNETagProperties *tagProperty)
set tag property (depending of supermode)
const GNEAttributeProperties * myNetworkAttributeProperties
current network attribute properties
const std::string & getMatchValue() const
get match value (depending of supermode)
const GNETagProperties * getTagPropertiesAll() const
get special tag <all>
void setAttributeProperties(const GNEAttributeProperties *attrProperty)
set attribute property (depending of supermode)
std::string myDataMatchValue
current data match value
const GNEMatchAttribute * myMatchAttributeParent
pointer to match attribute parent
const GNEAttributeProperties * myAttributePropertiesNoCommon
attribute properties no common
const GNETagProperties * getTagProperties() const
get tag property (depending of supermode)
void setMatchValue(const std::string value)
set match value (depending of supermode)
const GNEAttributeProperties * getAttributeProperties() const
get attribute property (depending of supermode)
std::vector< const GNETagProperties * > myDataTagProperties
current data tag properties
const GNEAttributeProperties * myDemandAttributeProperties
current demand attribute properties
CurrentEditedProperties * myCurrentEditedProperties
current edited properties
~GNEMatchAttribute()
destructor
FXButton * myMatchStringButton
match string button
long onCmdAttributeSelected(FXObject *, FXSelector, void *)
Called when the user selects an attribute in the match box.
void showMatchAttribute()
show match attributes
std::vector< MFXComboBoxTagProperty * > myTagComboBoxVector
vector with tag property comboBoxes
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
long onCmdProcessString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
GNESelectorFrame * mySelectorFrameParent
pointer to selector frame parent
long onCmdToogleOnlyCommon(FXObject *, FXSelector, void *)
Called when the user toogle the only common checkbox.
long onCmdTagSelected(FXObject *obj, FXSelector, void *)
Called when the user selects a tag in the match box.
FXTextField * myMatchString
string of the match
void hideMatchAttribute()
hide match attributes
FXCheckButton * myShowOnlyCommonAttributes
checkbox for enable/disable show only common attributes
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
void refreshMatchAttribute()
refresh match attribute
std::vector< GNEAttributeCarrier * > getMatches(const char compOp, const double val, const std::string &expr)
FOX need this.
void enableMatchAttribute()
enable match attributes
void disableMatchAttribute()
disable match attributes
MFXComboBoxAttrProperty * myAttributeComboBox
attribute property comboBox
GNEMatchAttribute(GNESelectorFrame *selectorFrameParent)
FOX-declaration.
const std::vector< const GNETagProperties * > getHierarchicalParentsRecuersively() const
get all parents, beginning from current element (root not included) until this element
Supermode getSupermode() const
get supermode associated with this tag
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
MFXGroupBoxModule (based on FXGroupBox).
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
MFXGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames