SUMO - Simulation of Urban MObility
GNESelectorFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The Widget for modifying selections of network-elements
18 // (some elements adapted from GUIDialog_GLChosenEditor)
19 /****************************************************************************/
20 #ifndef GNESelectorFrame_h
21 #define GNESelectorFrame_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEFrame.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
48  FXDECLARE(GNESelectorFrame)
49 
50 public:
52  enum SetOperation {
53  SET_ADD = 1,
54  SET_SUB = 2,
57  SET_DEFAULT = 5 // use mySetOperation instead of override
58  };
59 
64  GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
65 
68 
70  void show();
71 
73  void hide();
74 
78  long onCmdSelectOperation(FXObject*, FXSelector, void*);
79 
81  long onCmdSubset(FXObject*, FXSelector, void*);
82 
87  long onCmdLoad(FXObject*, FXSelector, void*);
88 
93  long onCmdSave(FXObject*, FXSelector, void*);
94 
98  long onCmdClear(FXObject*, FXSelector, void*);
99 
103  long onCmdInvert(FXObject*, FXSelector, void*);
104 
108  long onCmdSelMBTag(FXObject*, FXSelector, void*);
109 
113  long onCmdSelMBAttribute(FXObject*, FXSelector, void*);
114 
118  long onCmdSelMBString(FXObject*, FXSelector, void*);
119 
123  long onCmdHelp(FXObject*, FXSelector, void*);
124 
126  long onCmdScaleSelection(FXObject*, FXSelector, void*);
128 
129  bool locked(GUIGlObjectType type) {
130  return myTypeEntries[type].locked->getCheck() != FALSE;
131  }
132 
136  void handleIDs(std::vector<GUIGlID> ids, bool selectEdgesEnabled, SetOperation setop = SET_DEFAULT);
137 
139  void selectionUpdated();
140 
141 protected:
144 
145 private:
148 
150  FXRadioButton* myAddRadioButton;
151 
153  FXRadioButton* myRemoveRadioButton;
154 
156  FXRadioButton* myKeepRadioButton;
157 
159  FXRadioButton* myReplaceRadioButton;
160 
162  FXComboBox* mySetComboBox;
163 
165  FXComboBox* myMatchTagComboBox;
166 
168  FXComboBox* myMatchAttrComboBox;
169 
171  FXTextField* myMatchString;
172 
174  FXRealSpinDial* mySelectionScaling;
175 
178 
181 
183  ObjectTypeEntry(FXMatrix* parent, const std::string& label, const std::string& label2);
185  FXLabel* count;
186  FXLabel* typeName;
187  FXMenuCheck* locked;
188  };
189 
191  std::map<GUIGlObjectType, ObjectTypeEntry> myTypeEntries;
192 
193 private:
199  std::vector<GUIGlID> getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string& expr);
200 };
201 
202 
203 #endif
204 
205 /****************************************************************************/
206 
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
GUIGlObjectType
SetOperation
FOX-declaration.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
void show()
show Frame
std::vector< GUIGlID > getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string &expr)
return objects of the given type with matching attrs
SumoXMLAttr myCurrentAttribute
current SumoXMLTag Attribute
FXTextField * myMatchString
string of the match
FXRealSpinDial * mySelectionScaling
selection scaling
SumoXMLTag myCurrentTag
current SumoXMLTag tag
FXLabel * count
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
FXLabel * typeName
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXMenuCheck * locked
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.
FXRadioButton * myKeepRadioButton
keep button
long onCmdSelectOperation(FXObject *, FXSelector, void *)
ObjectTypeEntry()
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.
void hide()
hide Frame
FXRadioButton * myAddRadioButton
add radio button
bool locked(GUIGlObjectType type)
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
FXComboBox * mySetComboBox
tag of the sets of elements
std::map< GUIGlObjectType, ObjectTypeEntry > myTypeEntries
check boxes for type-based selection locking and selected object counts