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.dev/sumo
3 // Copyright (C) 2001-2024 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 
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
31 
32 class GNERoute;
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
41 class GNERouteFrame : public GNEFrame {
42 
43 public:
44 
46  enum class RouteMode {
47  INVALID, // invalid RouteMode
48  NONCONSECUTIVE_EDGES, // Create route clicking over non consecutive edges
49  CONSECUTIVE_EDGES // Create route clicking over consecutive edges
50  };
51 
52  // ===========================================================================
53  // class RouteModeSelector
54  // ===========================================================================
55 
59 
60  public:
62  RouteModeSelector(GNERouteFrame* routeFrameParent);
63 
66 
68  const RouteMode& getCurrentRouteMode() const;
69 
71  bool isValidMode() const;
72 
74  bool isValidVehicleClass() const;
75 
77  void areParametersValid();
78 
82  long onCmdSelectRouteMode(FXObject*, FXSelector, void*);
83 
85  long onCmdSelectVClass(FXObject*, FXSelector, void*);
87 
88  protected:
89  FOX_CONSTRUCTOR(RouteModeSelector)
90 
91  private:
94 
97 
100 
103 
106 
108  bool myValidVClass = true;
109 
111  std::vector<std::pair<RouteMode, std::string> > myRouteModesStrings;
112  };
113 
118  GNERouteFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
119 
121  ~GNERouteFrame();
122 
124  void show();
125 
127  void hide();
128 
134  bool addEdgeRoute(GNEEdge* clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed);
135 
138 
139 protected:
141  bool createPath(const bool useLastRoute);
142 
143 private:
146 
149 
152 
155 
158 
161 };
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
long onCmdSelectVClass(FXObject *, FXSelector, void *)
Called when the user select another VClass.
long onCmdSelectRouteMode(FXObject *, FXSelector, void *)
const RouteMode & getCurrentRouteMode() const
get current route mode
GNERoute * myRouteTemplate
route template
RouteModeSelector(GNERouteFrame *routeFrameParent)
FOX-declaration.
MFXComboBoxIcon * myVClassMatchBox
comboBox with the list of VClass
Definition: GNERouteFrame.h:99
bool isValidMode() const
check if current mode is Valid
GNERouteFrame * myRouteFrameParent
pointer to Frame Parent
Definition: GNERouteFrame.h:93
bool isValidVehicleClass() const
check if current VClass is Valid
MFXComboBoxIcon * myRouteModeMatchBox
comboBox with the list of route modes
Definition: GNERouteFrame.h:96
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
GNEPathCreator * myPathCreator
path creator modul
GNEAttributesCreator * myRouteAttributes
internal route attributes
GNEPathLegendModule * myPathLegend
path legend modul
GNERouteHandler myRouteHandler
route handler
~GNERouteFrame()
Destructor.
GNERouteFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
bool createPath(const bool useLastRoute)
create path
RouteMode
route creation modes
Definition: GNERouteFrame.h:46
void hide()
hide delete frame
GNEPathCreator * getPathCreator() const
get path creator module
RouteModeSelector * myRouteModeSelector
route mode selector
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:88
ComboBox with icon.
MFXGroupBoxModule (based on FXGroupBox)
class used to group all variables related with mouse buttons and key pressed after certain events