48 myElementSet(elementSet),
49 myCurrentTag(defaultTag),
50 myCurrentAttribute(defaultAttr) {
62 myMatchString->setText(defaultValue.c_str());
98 std::vector<GNETagProperties> tagPropertiesStrings;
116 for (
const auto& tagProperty : tagPropertiesStrings) {
117 if (tagProperty.isDrawable() && (!tagProperty.requireProj() || proj)) {
167 GNEAttributeProperties::AttrProperty::STRING,
169 tagPropertiesCopy.addAttribute(extraAttrProperty);
171 if (tagValue.canCloseShape()) {
174 GNEAttributeProperties::AttrProperty::BOOL | GNEAttributeProperties::AttrProperty::DEFAULTVALUE,
177 tagPropertiesCopy.addAttribute(extraAttrProperty);
180 if (tagValue.isChild()) {
183 GNEAttributeProperties::AttrProperty::STRING,
185 tagPropertiesCopy.addAttribute(extraAttrProperty);
189 for (
const auto& attribute : tagPropertiesCopy) {
223 char compOp = expr[0];
224 if (compOp ==
'<' || compOp ==
'>' || compOp ==
'=') {
225 expr = expr.substr(1);
230 if (GNEAttributeCarrier::canParse<double>(expr.c_str())) {
242 char compOp = expr[0];
243 if (compOp ==
'=' || compOp ==
'!' || compOp ==
'^') {
244 expr = expr.substr(1);
268 std::ostringstream help;
270 <<
TL(
"- The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection\n")
271 <<
TL(
" according to the current 'Modification Mode'.\n")
272 <<
TL(
" 1. Select an object type from the first input box\n")
273 <<
TL(
" 2. Select an attribute from the second input box\n")
274 <<
TL(
" 3. Enter a 'match expression' in the third input box and press <return>\n")
276 <<
TL(
"- The empty expression matches all objects\n")
277 <<
TL(
"- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n")
278 <<
TL(
"- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n")
280 <<
TL(
"- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n")
281 <<
TL(
" '' (no operator) matches if string is a substring of that object'ts attribute.\n")
282 <<
TL(
" '=' matches if string is an exact match.\n")
283 <<
TL(
" '!' matches if string is not a substring.\n")
284 <<
TL(
" '^' matches if string is not an exact match.\n")
286 <<
TL(
"- Examples:\n")
287 <<
TL(
" junction; id; 'foo' -> match all junctions that have 'foo' in their id\n")
288 <<
TL(
" junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n")
289 <<
TL(
" edge; speed; '>10' -> match all edges with a speed above 10\n");
301 WRITE_DEBUG(
"Opening help dialog of selector frame");
303 additionalNeteditAttributesHelpDialog->create();
305 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
309 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
311 WRITE_DEBUG(
"Close help dialog of selector frame");
335 if (tagIndex == -1) {
357 for (
int i = 0; i < (int)tagProperty.getNumberOfAttributes(); i++) {
365 if (tagProperty.hasParameters()) {
372 if (tagProperty.canCloseShape()) {
379 if (tagProperty.isChild()) {
388 if (attrIndex == -1) {
FXDEFMAP(GNEMatchAttribute) GNEMatchAttributeMap[]
@ MID_GNE_SELECTORFRAME_SELECTATTRIBUTE
select attribute in selector frame
@ MID_GNE_SELECTORFRAME_SELECTTAG
select tag in selector frame
@ MID_GNE_SELECTORFRAME_PROCESSSTRING
process string
#define GUIDesignComboBox
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignDialogBox
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignButtonOK
#define GUIDesignHorizontalSeparator
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_NOTHING
invalid tag
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
@ SUMO_ATTR_NOTHING
invalid attribute
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static const std::vector< GNETagProperties > getTagPropertiesByType(const int tagPropertyCategory)
get tagProperties associated to the given GNETagProperties::TagType (NETWORKELEMENT,...
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNESelectorFrame * getSelectorFrameParent() const
get Selector Frame Parent
void showMatchAttribute(const GNEElementSet::Type type)
show match attributes
~GNEMatchAttribute()
destructor
FXButton * myMatchStringButton
match string button
SumoXMLAttr myCurrentAttribute
current SumoXMLTag Attribute
FXComboBox * myMatchAttrComboBox
attributes of the match box
MFXIconComboBox * myMatchTagComboBox
tag of the match box
GNEElementSet * myElementSet
pointer to element set Parent
void updateTag()
FOX need this.
std::vector< GNETagProperties > myTagPropertiesString
vector with tagProperties
void updateAttribute()
update attribute
FXTextField * myMatchString
string of the match
void hideMatchAttribute()
hide match attributes
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
long onCmdSelMBString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
long onCmdSelMBAttribute(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
void enableMatchAttribute()
enable match attributes
void disableMatchAttribute()
disable match attributes
SumoXMLTag myCurrentTag
current SumoXMLTag tag
std::vector< GNEAttributeCarrier * > getMatches(const SumoXMLTag ACTag, const SumoXMLAttr ACAttr, const char compOp, const double val, const std::string &expr)
return ACs 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,
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
const std::string & getProjString() const
Returns the original projection definition.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
FXString getText() const
Get the text.
virtual void enable()
Enable combo box.
void setCurrentItem(FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
void setTextColor(FXColor clr)
Change text color.
void clearItems()
Remove all items from the list.
FXint getNumItems() const
Return the number of items in the list.
void setNumVisible(FXint nvis)
Set the number of visible items in the drop down list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon
virtual void disable()
Disable combo box.