SUMO - Simulation of Urban MObility
GNESelectorFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for modifying selections of network-elements
8 // (some elements adapted from GUIDialog_GLChosenEditor)
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GNESelectorFrame_h
22 #define GNESelectorFrame_h
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEFrame.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
49  FXDECLARE(GNESelectorFrame)
50 
51 public:
53  enum SetOperation {
54  SET_ADD = 1,
55  SET_SUB = 2,
58  SET_DEFAULT = 5 // use mySetOperation instead of override
59  };
60 
65  GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
66 
69 
71  void show();
72 
74  void hide();
75 
79  long onCmdSelectOperation(FXObject*, FXSelector, void*);
80 
82  long onCmdSubset(FXObject*, FXSelector, void*);
83 
88  long onCmdLoad(FXObject*, FXSelector, void*);
89 
94  long onCmdSave(FXObject*, FXSelector, void*);
95 
99  long onCmdClear(FXObject*, FXSelector, void*);
100 
104  long onCmdInvert(FXObject*, FXSelector, void*);
105 
109  long onCmdSelMBTag(FXObject*, FXSelector, void*);
110 
114  long onCmdSelMBAttribute(FXObject*, FXSelector, void*);
115 
119  long onCmdSelMBString(FXObject*, FXSelector, void*);
120 
124  long onCmdHelp(FXObject*, FXSelector, void*);
125 
127  long onCmdScaleSelection(FXObject*, FXSelector, void*);
129 
133  void handleIDs(std::vector<GUIGlID> ids, bool selectEdgesEnabled, SetOperation setop = SET_DEFAULT);
134 
136  void selectionUpdated();
137 
138 protected:
141 
142 private:
145 
147  FXRadioButton* myAddRadioButton;
148 
150  FXRadioButton* myRemoveRadioButton;
151 
153  FXRadioButton* myKeepRadioButton;
154 
156  FXRadioButton* myReplaceRadioButton;
157 
159  FXComboBox* mySetComboBox;
160 
162  FXComboBox* myMatchTagComboBox;
163 
165  FXComboBox* myMatchAttrComboBox;
166 
168  FXTextField* myMatchString;
169 
171  FXRealSpinDial* mySelectionScaling;
172 
175 
178 
179 private:
181  std::string getStats() const;
182 
186  std::vector<GUIGlID> getMatches(SumoXMLTag tag, SumoXMLAttr attr, char compOp, double val, const std::string& expr);
187 
189  const std::string ALL_VCLASS_NAMES_MATCH_STRING;
190 };
191 
192 
193 #endif
194 
195 /****************************************************************************/
196 
FXRadioButton * myReplaceRadioButton
replace radio button
SumoXMLTag
Numbers representing SUMO-XML - element names.
void selectionUpdated()
called if currently registered for updates for changes of global selection
long onCmdSelMBString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
FXComboBox * myMatchAttrComboBox
attributes of the match box
SetOperation
FOX-declaration.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
std::vector< GUIGlID > getMatches(SumoXMLTag tag, SumoXMLAttr attr, char compOp, double val, const std::string &expr)
return objects of the given type with matching attrs
void show()
show Frame
SumoXMLAttr myCurrentAttribute
current SumoXMLTag Attribute
FXTextField * myMatchString
string of the match
FXRealSpinDial * mySelectionScaling
selection scaling
SumoXMLTag myCurrentTag
current SumoXMLTag tag
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void handleIDs(std::vector< GUIGlID > ids, bool selectEdgesEnabled, SetOperation setop=SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
GNESelectorFrame()
FOX needs this.
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
~GNESelectorFrame()
Destructor.
long onCmdScaleSelection(FXObject *, FXSelector, void *)
Called when the user changes visual scaling.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
SetOperation mySetOperation
how to modify selection
long onCmdSelMBAttribute(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
const std::string ALL_VCLASS_NAMES_MATCH_STRING
the string that should be matched against if attr &#39;allowed&#39; or &#39;disallowed&#39; are set to "all" ...
FXRadioButton * myKeepRadioButton
keep button
long onCmdSelectOperation(FXObject *, FXSelector, void *)
long onCmdSubset(FXObject *, FXSelector, void *)
Called when the user change the type of element to search (netElement or Additional) ...
FXRadioButton * myRemoveRadioButton
remove radio button
FXComboBox * myMatchTagComboBox
tag of the match box
long onCmdInvert(FXObject *, FXSelector, void *)
Called when the user presses the Invert-button.
std::string getStats() const
get stats
void hide()
hide Frame
FXRadioButton * myAddRadioButton
add radio button
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
FXComboBox * mySetComboBox
tag of the sets of elements