Eclipse SUMO - Simulation of Urban MObility
GNEAdditionalFrame.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for add additional elements
16 /****************************************************************************/
17 #ifndef GNEAdditionalFrame_h
18 #define GNEAdditionalFrame_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include "GNEFrame.h"
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
34 class GNEAdditionalFrame : public GNEFrame {
35 
36 public:
37 
38  // ===========================================================================
39  // class SelectorLaneParents
40  // ===========================================================================
41 
42  class SelectorLaneParents : protected FXGroupBox {
45  public:
47  SelectorLaneParents(GNEAdditionalFrame* additionalFrameParent);
48 
51 
54 
57 
59  void startConsecutiveLaneSelector(GNELane* lane, const Position& clickedPosition);
60 
63 
66 
68  bool addSelectedLane(GNELane* lane, const Position& clickedPosition);
69 
72 
74  bool isSelectingLanes() const;
75 
77  bool isShown() const;
78 
80  const RGBColor& getSelectedLaneColor() const;
81 
83  const std::vector<std::pair<GNELane*, double> >& getSelectedLanes() const;
84 
88  long onCmdStopSelection(FXObject*, FXSelector, void*);
89 
91  long onCmdAbortSelection(FXObject*, FXSelector, void*);
93 
94  protected:
97 
98  private:
101 
104 
107 
109  std::vector<std::pair<GNELane*, double> > mySelectedLanes;
110 
112  std::vector<GNELane*> myCandidateLanes;
113 
116 
119 
121  bool isLaneSelected(GNELane* lane) const;
122  };
123 
124  // ===========================================================================
125  // class SelectorEdgeChildren
126  // ===========================================================================
127 
128  class SelectorEdgeChildren : protected FXGroupBox {
131 
132  public:
134  SelectorEdgeChildren(GNEAdditionalFrame* additionalFrameParent);
135 
138 
140  std::string getEdgeIdsSelected() const;
141 
143  void showSelectorEdgeChildrenModul(std::string search = "");
144 
146  void hideSelectorEdgeChildrenModul();
147 
149  void updateUseSelectedEdges();
150 
154  long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
155 
157  long onCmdTypeInSearchBox(FXObject*, FXSelector, void*);
158 
160  long onCmdSelectEdge(FXObject*, FXSelector, void*);
161 
163  long onCmdClearSelection(FXObject*, FXSelector, void*);
164 
166  long onCmdInvertSelection(FXObject*, FXSelector, void*);
168 
169  protected:
172 
173  private:
176 
179 
181  FXList* myList;
182 
184  FXTextField* myEdgesSearch;
185 
188 
191  };
192 
193  // ===========================================================================
194  // class SelectorLaneChildren
195  // ===========================================================================
196 
197  class SelectorLaneChildren : protected FXGroupBox {
200 
201  public:
203  SelectorLaneChildren(GNEAdditionalFrame* additionalFrameParent);
204 
207 
209  std::string getLaneIdsSelected() const;
210 
212  void showSelectorLaneChildrenModul(std::string search = "");
213 
215  void hideSelectorLaneChildrenModul();
216 
217  // @brief Update use selectedLanes
218  void updateUseSelectedLanes();
219 
223  long onCmdUseSelectedLanes(FXObject*, FXSelector, void*);
224 
226  long onCmdTypeInSearchBox(FXObject*, FXSelector, void*);
227 
229  long onCmdSelectLane(FXObject*, FXSelector, void*);
230 
232  long onCmdClearSelection(FXObject*, FXSelector, void*);
233 
235  long onCmdInvertSelection(FXObject*, FXSelector, void*);
237 
238  protected:
241 
242  private:
245 
248 
250  FXList* myList;
251 
253  FXTextField* myLanesSearch;
254 
257 
260  };
261 
266  GNEAdditionalFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
267 
270 
272  void show();
273 
278  bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
279 
282 
285 
286 protected:
288  void tagSelected();
289 
290 private:
292  std::string generateID(GNENetElement* netElement) const;
293 
295  bool buildAdditionalCommonAttributes(std::map<SumoXMLAttr, std::string>& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues);
296 
298  bool buildAdditionalWithParent(std::map<SumoXMLAttr, std::string>& valuesMap, GNEAdditional* parent, const GNEAttributeCarrier::TagProperties& tagValues);
299 
301  bool buildAdditionalOverEdge(std::map<SumoXMLAttr, std::string>& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues);
302 
304  bool buildAdditionalOverLane(std::map<SumoXMLAttr, std::string>& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues);
305 
307  bool buildAdditionalOverLanes(std::map<SumoXMLAttr, std::string>& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues);
308 
310  bool buildAdditionalOverView(std::map<SumoXMLAttr, std::string>& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues);
311 
314 
317 
320 
323 
326 
329 
332 };
333 
334 
335 #endif
336 
337 /****************************************************************************/
FXTextField * myEdgesSearch
text field for search edge IDs
FXButton * invertLanesSelection
button for invert selection
const RGBColor & getSelectedLaneColor() const
get selected lane color
FXTextField * myLanesSearch
text field for search lane IDs
GNEFrameAttributesModuls::AttributesCreator * myAdditionalAttributes
internal additional attributes
void showSelectorLaneParentsModul()
show SelectorLaneParents modul
bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add additional element
GNEFrameModuls::TagSelector * myAdditionalTagSelector
item selector
FXCheckButton * myUseSelectedLanesCheckButton
CheckBox for selected lanes.
bool buildAdditionalCommonAttributes(std::map< SumoXMLAttr, std::string > &valuesMap, const GNEAttributeCarrier::TagProperties &tagValues)
build common additional attributes
struct with the attribute Properties
FXCheckButton * myUseSelectedEdgesCheckButton
CheckBox for selected edges.
bool isShown() const
return true if modul is shown
long onCmdAbortSelection(FXObject *, FXSelector, void *)
Called when the user press abort selection button.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
bool stopConsecutiveLaneSelector()
stop selection of consecutive lanes
long onCmdStopSelection(FXObject *, FXSelector, void *)
std::vector< GNELane * > myCandidateLanes
Vector with the colored lanes.
const std::vector< std::pair< GNELane *, double > > & getSelectedLanes() const
get current selected lanes
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additional frame parent
RGBColor myCandidateLaneColor
color for candidate lanes
bool buildAdditionalOverEdge(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over an edge (parent of lane)
FXButton * clearLanesSelection
button for clear selection
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additional frame parent
bool isLaneSelected(GNELane *lane) const
check if certain lane is selected
GNEAdditionalFrame::SelectorLaneParents * getConsecutiveLaneSelector() const
getConsecutive Lane Selector
void removeLastSelectedLane()
remove last added point
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additionalFrameParent
FXButton * myStopSelectingButton
button for stop selecting
bool buildAdditionalOverLane(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over a single lane
FXButton * myClearEdgesSelection
button for clear selection
~GNEAdditionalFrame()
Destructor.
class used to group all variables related with objects under cursor after a click over view ...
FXButton * myAbortSelectingButton
button for abort selecting
std::vector< std::pair< GNELane *, double > > mySelectedLanes
Vector with the selected lanes and the clicked position.
GNEFrameModuls::SelectorParent * myAdditionalParent
Modul for select a single additional parent.
FXButton * myInvertEdgesSelection
button for invert selection
SelectorLaneChildren * mySelectorLaneChildren
Modul for select lane children.
void tagSelected()
Tag selected in TagSelector.
FXList * myList
List of SelectorLaneChildren.
FXList * myList
List of SelectorEdgeChildren.
void showSelectorLaneChildrenModul()
show selector lane child and update use selected edges/lanes
bool addSelectedLane(GNELane *lane, const Position &clickedPosition)
return true if lane can be selected as consecutive lane
void show()
show Frame
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
SelectorLaneParents * mySelectorLaneParents
Modul for select lane parents (currently only consecutives)
SelectorEdgeChildren * mySelectorEdgeChildren
Modul for select edge children.
RGBColor mySelectedLaneColor
color for selected lanes
bool buildAdditionalOverView(std::map< SumoXMLAttr, std::string > &valuesMap, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over view
void hideSelectorLaneParentsModul()
hide SelectorLaneParents
std::string generateID(GNENetElement *netElement) const
generate a ID for an additiona element
bool buildAdditionalWithParent(std::map< SumoXMLAttr, std::string > &valuesMap, GNEAdditional *parent, const GNEAttributeCarrier::TagProperties &tagValues)
build additional with Parent
bool isSelectingLanes() const
return true if modul is selecting lane
void startConsecutiveLaneSelector(GNELane *lane, const Position &clickedPosition)
start selection of consecutive lanes
bool buildAdditionalOverLanes(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over lanes
GNEAdditionalFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void abortConsecutiveLaneSelector()
abort selection of consecutive lanes