Eclipse SUMO - Simulation of Urban MObility
GNECommonNetworkModules.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-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Common network modules
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
30 
32 
33 public:
34 
35  // ===========================================================================
36  // class NetworkElementSelector
37  // ===========================================================================
38 
42 
43  public:
45  enum class NetworkElementType {
46  EDGE,
47  LANE,
48  };
49 
51  NetworkElementsSelector(GNEFrame* frameParent, const NetworkElementType networkElementType);
52 
55 
57  std::vector<std::string> getSelectedIDs() const;
58 
60  bool isNetworkElementSelected(const GNENetworkElement* networkElement) const;
61 
64 
67 
69  bool isShown() const;
70 
72  bool toogleSelectedElement(const GNENetworkElement *networkElement);
73 
75  void clearSelection();
76 
80  long onCmdUseSelectedElements(FXObject*, FXSelector, void*);
81 
83  long onCmdClearSelection(FXObject*, FXSelector, void*);
85 
86  protected:
89 
90  private:
93 
95  FXButton* myUseSelected = nullptr;
96 
98  FXList* myList = nullptr;
99 
101  FXButton* myClearSelection = nullptr;
102 
105  };
106 
107  // ===========================================================================
108  // class ConsecutiveLaneSelector
109  // ===========================================================================
110 
114 
115  public:
117  ConsecutiveLaneSelector(GNEFrame* frameParent);
118 
121 
124 
127 
129  const std::vector<std::pair<GNELane*, double> > &getLanePath() const;
130 
132  const std::vector<std::string> getLaneIDPath() const;
133 
135  bool addLane(GNELane* lane);
136 
139 
141  void updateLaneColors();
142 
145 
147  void abortPathCreation();
148 
150  void removeLastElement();
151 
155  long onCmdCreatePath(FXObject*, FXSelector, void*);
156 
158  long onCmdAbortPathCreation(FXObject*, FXSelector, void*);
159 
161  long onCmdRemoveLastElement(FXObject*, FXSelector, void*);
162 
164  long onCmdShowCandidateLanes(FXObject*, FXSelector, void*);
166 
167  protected:
169  FOX_CONSTRUCTOR(ConsecutiveLaneSelector)
170 
171 
172  void updateInfoRouteLabel();
173 
175  void clearPath();
176 
177  private:
180 
182  std::vector<std::pair<GNELane*, double> > myLanePath;
183 
186 
189 
192 
195 
197  FXCheckButton* myShowCandidateLanes;
198 
199  private:
202 
205  };
206 };
GNECommonNetworkModules::NetworkElementsSelector::NetworkElementType::EDGE
@ EDGE
GNECommonNetworkModules::ConsecutiveLaneSelector::myRemoveLastInsertedElement
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
Definition: GNECommonNetworkModules.h:194
GNECommonNetworkModules::NetworkElementsSelector::myList
FXList * myList
List of NetworkElementsSelector.
Definition: GNECommonNetworkModules.h:98
GNECommonNetworkModules::ConsecutiveLaneSelector::drawTemporalConsecutiveLanePath
void drawTemporalConsecutiveLanePath(const GUIVisualizationSettings &s) const
draw temporal consecutive lane path
Definition: GNECommonNetworkModules.cpp:387
GNECommonNetworkModules::NetworkElementsSelector::clearSelection
void clearSelection()
clear selection
Definition: GNECommonNetworkModules.cpp:170
GNECommonNetworkModules::NetworkElementsSelector::getSelectedIDs
std::vector< std::string > getSelectedIDs() const
get selected IDs
Definition: GNECommonNetworkModules.cpp:101
GNECommonNetworkModules::ConsecutiveLaneSelector::clearPath
void clearPath()
clear lanes (and restore colors)
Definition: GNECommonNetworkModules.cpp:558
GNECommonNetworkModules::NetworkElementsSelector::myNetworkElementType
const NetworkElementType myNetworkElementType
@brrief network element type
Definition: GNECommonNetworkModules.h:104
GNEFrame
Definition: GNEFrame.h:33
GNECommonNetworkModules::ConsecutiveLaneSelector::myFrameParent
GNEFrame * myFrameParent
pointer to frame parent
Definition: GNECommonNetworkModules.h:179
GNECommonNetworkModules::ConsecutiveLaneSelector::myFinishCreationButton
FXButton * myFinishCreationButton
button for finish route creation
Definition: GNECommonNetworkModules.h:188
GNECommonNetworkModules
Definition: GNECommonNetworkModules.h:31
GNECommonNetworkModules::NetworkElementsSelector::NetworkElementsSelector
NetworkElementsSelector()
FOX need this.
Definition: GNECommonNetworkModules.cpp:214
GNECommonNetworkModules::ConsecutiveLaneSelector::operator=
ConsecutiveLaneSelector & operator=(ConsecutiveLaneSelector *)=delete
Invalidated assignment operator.
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdCreatePath
long onCmdCreatePath(FXObject *, FXSelector, void *)
Definition: GNECommonNetworkModules.cpp:504
GNECommonNetworkModules::ConsecutiveLaneSelector::myShowCandidateLanes
FXCheckButton * myShowCandidateLanes
CheckBox for show candidate lanes.
Definition: GNECommonNetworkModules.h:197
GNECommonNetworkModules::ConsecutiveLaneSelector::removeLastElement
void removeLastElement()
remove path element
Definition: GNECommonNetworkModules.cpp:476
GNECommonNetworkModules::NetworkElementsSelector::~NetworkElementsSelector
~NetworkElementsSelector()
destructor
Definition: GNECommonNetworkModules.cpp:97
GNECommonNetworkModules::ConsecutiveLaneSelector::~ConsecutiveLaneSelector
~ConsecutiveLaneSelector()
destructor
Definition: GNECommonNetworkModules.cpp:245
GNECommonNetworkModules::ConsecutiveLaneSelector::ConsecutiveLaneSelector
ConsecutiveLaneSelector(GNEFrame *frameParent)
FOX-declaration.
Definition: GNECommonNetworkModules.cpp:223
GNECommonNetworkModules::ConsecutiveLaneSelector::showConsecutiveLaneSelectorModule
void showConsecutiveLaneSelectorModule()
show ConsecutiveLaneSelector
Definition: GNECommonNetworkModules.cpp:249
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdRemoveLastElement
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted lane".
Definition: GNECommonNetworkModules.cpp:519
FXGroupBoxModule.h
GNECommonNetworkModules::NetworkElementsSelector::hideNetworkElementsSelector
void hideNetworkElementsSelector()
hide NetworkElementsSelector Module
Definition: GNECommonNetworkModules.cpp:138
GNECommonNetworkModules::NetworkElementsSelector::myUseSelected
FXButton * myUseSelected
button for use selected edges
Definition: GNECommonNetworkModules.h:95
GNECommonNetworkModules::NetworkElementsSelector::isShown
bool isShown() const
return true if modul is shown
Definition: GNECommonNetworkModules.cpp:144
GNECommonNetworkModules::NetworkElementsSelector::NetworkElementType
NetworkElementType
FOX-declaration.
Definition: GNECommonNetworkModules.h:45
GNECommonNetworkModules::NetworkElementsSelector::NetworkElementType::LANE
@ LANE
GNECommonNetworkModules::ConsecutiveLaneSelector::myAbortCreationButton
FXButton * myAbortCreationButton
button for abort route creation
Definition: GNECommonNetworkModules.h:191
GNECommonNetworkModules::ConsecutiveLaneSelector::drawCandidateLanesWithSpecialColor
bool drawCandidateLanesWithSpecialColor() const
draw candidate lanes with special color (Only for candidates, special and conflicted)
Definition: GNECommonNetworkModules.cpp:339
GNECommonNetworkModules::NetworkElementsSelector::onCmdUseSelectedElements
long onCmdUseSelectedElements(FXObject *, FXSelector, void *)
Definition: GNECommonNetworkModules.cpp:179
GNECommonNetworkModules::NetworkElementsSelector::myFrameParent
GNEFrame * myFrameParent
pointer to frame parent
Definition: GNECommonNetworkModules.h:92
GNECommonNetworkModules::NetworkElementsSelector
Definition: GNECommonNetworkModules.h:39
GNECommonNetworkModules::ConsecutiveLaneSelector::myLanePath
std::vector< std::pair< GNELane *, double > > myLanePath
vector with lanes and clicked positions
Definition: GNECommonNetworkModules.h:182
GNECommonNetworkModules::NetworkElementsSelector::showNetworkElementsSelector
void showNetworkElementsSelector()
show NetworkElementsSelector Module
Definition: GNECommonNetworkModules.cpp:129
GNECommonNetworkModules::ConsecutiveLaneSelector::updateLaneColors
void updateLaneColors()
update lane colors
Definition: GNECommonNetworkModules.cpp:345
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdShowCandidateLanes
long onCmdShowCandidateLanes(FXObject *, FXSelector, void *)
Called when the user click over check button "show candidate lanes".
Definition: GNECommonNetworkModules.cpp:527
GNECommonNetworkModules::ConsecutiveLaneSelector::getLaneIDPath
const std::vector< std::string > getLaneIDPath() const
get lane IDs
Definition: GNECommonNetworkModules.cpp:281
GNECommonNetworkModules::ConsecutiveLaneSelector
Definition: GNECommonNetworkModules.h:111
FXGroupBoxModule
FXGroupBoxModule (based on FXGroupBox)
Definition: FXGroupBoxModule.h:27
GNECommonNetworkModules::NetworkElementsSelector::isNetworkElementSelected
bool isNetworkElementSelected(const GNENetworkElement *networkElement) const
check if the given networkElement is being selected
Definition: GNECommonNetworkModules.cpp:115
GNECommonNetworkModules::NetworkElementsSelector::myClearSelection
FXButton * myClearSelection
button for clear selection
Definition: GNECommonNetworkModules.h:101
GNECommonNetworkModules::ConsecutiveLaneSelector::updateInfoRouteLabel
void updateInfoRouteLabel()
FOX need this.
Definition: GNECommonNetworkModules.cpp:537
GNENetworkElement
Definition: GNENetworkElement.h:41
GNECommonNetworkModules::ConsecutiveLaneSelector::getLanePath
const std::vector< std::pair< GNELane *, double > > & getLanePath() const
get vector with lanes and clicked positions
Definition: GNECommonNetworkModules.cpp:275
config.h
GNECommonNetworkModules::NetworkElementsSelector::toogleSelectedElement
bool toogleSelectedElement(const GNENetworkElement *networkElement)
toogle selected networkElement
Definition: GNECommonNetworkModules.cpp:150
GNECommonNetworkModules::NetworkElementsSelector::onCmdClearSelection
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
Definition: GNECommonNetworkModules.cpp:208
GNECommonNetworkModules::ConsecutiveLaneSelector::addLane
bool addLane(GNELane *lane)
add lane
Definition: GNECommonNetworkModules.cpp:291
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:583
GNECommonNetworkModules::ConsecutiveLaneSelector::hideConsecutiveLaneSelectorModule
void hideConsecutiveLaneSelectorModule()
show ConsecutiveLaneSelector
Definition: GNECommonNetworkModules.cpp:266
GNECommonNetworkModules::ConsecutiveLaneSelector::abortPathCreation
void abortPathCreation()
abort path creation
Definition: GNECommonNetworkModules.cpp:454
GNEFrame.h
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdAbortPathCreation
long onCmdAbortPathCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
Definition: GNECommonNetworkModules.cpp:511
GNECommonNetworkModules::ConsecutiveLaneSelector::myInfoRouteLabel
FXLabel * myInfoRouteLabel
label with route info
Definition: GNECommonNetworkModules.h:185