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 
81  long onCmdLoad(FXObject*, FXSelector, void*);
82 
86  long onCmdSave(FXObject*, FXSelector, void*);
87 
90  long onCmdClear(FXObject*, FXSelector, void*);
91 
94  long onCmdInvert(FXObject*, FXSelector, void*);
95 
98  long onCmdSelMBTag(FXObject*, FXSelector, void*);
99 
102  long onCmdSelMBString(FXObject*, FXSelector, void*);
103 
106  long onCmdHelp(FXObject*, FXSelector, void*);
107 
109  long onCmdScaleSelection(FXObject*, FXSelector, void*);
111 
114  void handleIDs(std::vector<GUIGlID> ids, bool selectEdges, SetOperation setop = SET_DEFAULT);
115 
117  void selectionUpdated();
118 
119 protected:
122 
123 private:
126 
128  FXDataTarget mySetOperationTarget;
129 
131  FXListBox* myMatchTagBox;
132 
134  FXListBox* myMatchAttrBox;
135 
137  FXTextField* myMatchString;
138 
140  FXRealSpinDial* mySelectionScaling;
141 
142 private:
144  std::string getStats() const;
145 
148  std::vector<GUIGlID> getMatches(SumoXMLTag tag, SumoXMLAttr attr, char compOp, SUMOReal val, const std::string& expr);
149 
151  const std::string ALL_VCLASS_NAMES_MATCH_STRING;
152 };
153 
154 
155 #endif
156 
157 /****************************************************************************/
158 
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.
std::string getStats() const
get stats
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 *)
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 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
void hide()
hide Frame
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.