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-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 // The Widget for create route elements
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
29 
30 class GNERoute;
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 class GNERouteFrame : public GNEFrame {
40 
41 public:
42 
44  enum class RouteMode {
45  INVALID, // invalid RouteMode
46  NONCONSECUTIVE_EDGES, // Create route clicking over non consecutive edges
47  CONSECUTIVE_EDGES // Create route clicking over consecutive edges
48  };
49 
50  // ===========================================================================
51  // class RouteModeSelector
52  // ===========================================================================
53 
57 
58  public:
60  RouteModeSelector(GNERouteFrame* routeFrameParent);
61 
64 
66  const RouteMode& getCurrentRouteMode() const;
67 
69  bool isValidMode() const;
70 
72  bool isValidVehicleClass() const;
73 
75  void areParametersValid();
76 
80  long onCmdSelectRouteMode(FXObject*, FXSelector, void*);
81 
83  long onCmdSelectVClass(FXObject*, FXSelector, void*);
85 
86  protected:
87  FOX_CONSTRUCTOR(RouteModeSelector)
88 
89  private:
92 
94  FXComboBox* myRouteModeMatchBox = nullptr;
95 
97  FXComboBox* myVClassMatchBox = nullptr;
98 
101 
104 
106  bool myValidVClass = true;
107 
109  std::vector<std::pair<RouteMode, std::string> > myRouteModesStrings;
110  };
111 
116  GNERouteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
117 
119  ~GNERouteFrame();
120 
122  void show();
123 
125  void hide();
126 
132  bool addEdgeRoute(GNEEdge* clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed);
133 
136 
137 protected:
139  void createPath();
140 
141 private:
144 
147 
150 
153 
156 
159 };
FXGroupBoxModule (based on FXGroupBox)
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
long onCmdSelectVClass(FXObject *, FXSelector, void *)
Called when the user select another VClass.
FXComboBox * myRouteModeMatchBox
comboBox with the list of route modes
Definition: GNERouteFrame.h:94
long onCmdSelectRouteMode(FXObject *, FXSelector, void *)
const RouteMode & getCurrentRouteMode() const
get current route mode
GNERoute * myRouteTemplate
route template
FXComboBox * myVClassMatchBox
comboBox with the list of VClass
Definition: GNERouteFrame.h:97
RouteModeSelector(GNERouteFrame *routeFrameParent)
FOX-declaration.
bool isValidMode() const
check if current mode is Valid
GNERouteFrame * myRouteFrameParent
pointer to Frame Parent
Definition: GNERouteFrame.h:91
bool isValidVehicleClass() const
check if current VClass is Valid
bool myValidVClass
flag to check if VClass is Valid
std::vector< std::pair< RouteMode, std::string > > myRouteModesStrings
list of Route modes that will be shown in Match Box
void areParametersValid()
called after setting a new route or vclass, for showing moduls
RouteMode myCurrentRouteMode
current selected route mode
void show()
show delete frame
CommonXMLStructure::SumoBaseObject * myRouteBaseObject
route base object
GNEFrameAttributeModules::AttributesCreator * myRouteAttributes
internal route attributes
GNEFrameModules::PathCreator * getPathCreator() const
get path creator modul
GNERouteHandler myRouteHandler
route handler
~GNERouteFrame()
Destructor.
GNEFrameModules::PathCreator * myPathCreator
path creator modul
RouteMode
route creation modes
Definition: GNERouteFrame.h:44
void hide()
hide delete frame
RouteModeSelector * myRouteModeSelector
route mode selector
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
GNERouteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
GNEFrameModules::PathLegend * myPathLegend
path legend modul
void createPath()
create path
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
class used to group all variables related with mouse buttons and key pressed after certain events