Eclipse SUMO - Simulation of Urban MObility
GNERouteFrame.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-2020 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 // The Widget for create route elements
19 /****************************************************************************/
20 #pragma once
21 
23 
24 // ===========================================================================
25 // class definitions
26 // ===========================================================================
31 class GNERouteFrame : public GNEFrame {
32 
33 public:
34 
36  enum class RouteMode {
37  INVALID, // invalid RouteMode
38  NONCONSECUTIVE_EDGES, // Create route clicking over non consecutive edges
39  CONSECUTIVE_EDGES // Create route clicking over consecutive edges
40  };
41 
42  // ===========================================================================
43  // class RouteModeSelector
44  // ===========================================================================
45 
46  class RouteModeSelector : protected FXGroupBox {
49 
50  public:
52  RouteModeSelector(GNERouteFrame* routeFrameParent);
53 
56 
58  const RouteMode& getCurrentRouteMode() const;
59 
61  bool isValidMode() const;
62 
64  bool isValidVehicleClass() const;
65 
67  void areParametersValid();
68 
72  long onCmdSelectRouteMode(FXObject*, FXSelector, void*);
73 
75  long onCmdSelectVClass(FXObject*, FXSelector, void*);
77 
78  protected:
79  FOX_CONSTRUCTOR(RouteModeSelector)
80 
81  private:
84 
86  FXComboBox* myRouteModeMatchBox;
87 
89  FXComboBox* myVClassMatchBox;
90 
93 
96 
98  std::vector<std::pair<RouteMode, std::string> > myRouteModesStrings;
99  };
100 
105  GNERouteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
106 
108  ~GNERouteFrame();
109 
111  void show();
112 
114  void hide();
115 
121  bool addEdgeRoute(GNEEdge* clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed);
122 
125 
126 protected:
128  void createPath();
129 
130 private:
133 
136 
139 
142 };
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
long onCmdSelectVClass(FXObject *, FXSelector, void *)
Called when the user select another VClass.
FXComboBox * myRouteModeMatchBox
comboBox with the list of route modes
Definition: GNERouteFrame.h:86
long onCmdSelectRouteMode(FXObject *, FXSelector, void *)
const RouteMode & getCurrentRouteMode() const
get current route mode
FXComboBox * myVClassMatchBox
comboBox with the list of VClass
Definition: GNERouteFrame.h:89
RouteModeSelector(GNERouteFrame *routeFrameParent)
FOX-declaration.
bool isValidMode() const
check if current mode is Valid
GNERouteFrame * myRouteFrameParent
pointer to Frame Parent
Definition: GNERouteFrame.h:83
bool isValidVehicleClass() const
check if current VClass is Valid
bool myValidVClass
flag to check if VClass is Valid
Definition: GNERouteFrame.h:95
std::vector< std::pair< RouteMode, std::string > > myRouteModesStrings
list of Route modes that will be shown in Match Box
Definition: GNERouteFrame.h:98
void areParametersValid()
called after setting a new route or vclass, for showing moduls
RouteMode myCurrentRouteMode
current selected route mode
Definition: GNERouteFrame.h:92
GNEFrameModuls::PathCreator * myPathCreator
path creator modul
void show()
show delete frame
~GNERouteFrame()
Destructor.
GNEFrameAttributesModuls::AttributesCreator * myRouteAttributes
internal route attributes
RouteMode
route creation modes
Definition: GNERouteFrame.h:36
void hide()
hide delete frame
GNEFrameModuls::PathCreator * getPathCreator() const
get path creator modul
RouteModeSelector * myRouteModeSelector
route mode selector
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
GNEFrameModuls::PathLegend * myPathLegend
path legend modul
GNERouteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void createPath()
create path
class used to group all variables related with mouse buttons and key pressed after certain events