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-2016 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(FXComposite* parent, GNEViewNet* viewNet);
66 
69 
71  void show();
72 
74  void hide();
75 
79  long onCmdSubset(FXObject*, FXSelector, void*);
80 
84  long onCmdLoad(FXObject*, FXSelector, void*);
85 
89  long onCmdSave(FXObject*, FXSelector, void*);
90 
93  long onCmdClear(FXObject*, FXSelector, void*);
94 
97  long onCmdInvert(FXObject*, FXSelector, void*);
98 
101  long onCmdSelMBTag(FXObject*, FXSelector, void*);
102 
105  long onCmdSelMBString(FXObject*, FXSelector, void*);
106 
109  long onCmdHelp(FXObject*, FXSelector, void*);
110 
112  long onCmdScaleSelection(FXObject*, FXSelector, void*);
114 
117  void handleIDs(std::vector<GUIGlID> ids, bool selectEdges, SetOperation setop = SET_DEFAULT);
118 
120  void selectionUpdated();
121 
122 protected:
125 
126 private:
129 
131  FXDataTarget mySetOperationTarget;
132 
134  FXListBox* mySetBox;
135 
137  FXListBox* myMatchTagBox;
138 
140  FXListBox* myMatchAttrBox;
141 
143  FXTextField* myMatchString;
144 
146  FXRealSpinDial* mySelectionScaling;
147 
148 private:
150  std::string getStats() const;
151 
154  std::vector<GUIGlID> getMatches(SumoXMLTag tag, SumoXMLAttr attr, char compOp, SUMOReal val, const std::string& expr);
155 
157  const std::string ALL_VCLASS_NAMES_MATCH_STRING;
158 };
159 
160 
161 #endif
162 
163 /****************************************************************************/
164 
FXDataTarget mySetOperationTarget
target of modify selection
SumoXMLTag
Numbers representing SUMO-XML - element names.
void selectionUpdated()
called if currently registered for updates for changes of global selection
FXuint mySetOperation
how to modify selection
long onCmdSelMBString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
SetOperation
FOX-declaration.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
void show()
show Frame
FXTextField * myMatchString
string of the match
FXRealSpinDial * mySelectionScaling
selection scaling
FXListBox * myMatchTagBox
tag of the match box
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
std::vector< GUIGlID > getMatches(SumoXMLTag tag, SumoXMLAttr attr, char compOp, SUMOReal val, const std::string &expr)
return objects of the given type with matching attrs
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
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.
const std::string ALL_VCLASS_NAMES_MATCH_STRING
the string that should be matched against if attr &#39;allowed&#39; or &#39;disalloed&#39; are set to "all" ...
long onCmdSubset(FXObject *, FXSelector, void *)
long onCmdInvert(FXObject *, FXSelector, void *)
Called when the user presses the Invert-button.
FXListBox * myMatchAttrBox
attributes of the match box
void handleIDs(std::vector< GUIGlID > ids, bool selectEdges, SetOperation setop=SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
#define SUMOReal
Definition: config.h:213
std::string getStats() const
get stats
void hide()
hide Frame
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
FXListBox * mySetBox
tag of the sets of elements