Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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-2025 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
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
28
31class GNERoute;
32class GNEPathCreator;
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
38class GNERouteFrame : public GNEFrame {
39
40public:
41
43 enum class RouteMode {
44 INVALID, // invalid RouteMode
45 NONCONSECUTIVE_EDGES, // Create route clicking over non consecutive edges
46 CONSECUTIVE_EDGES // Create route clicking over consecutive edges
47 };
48
49 // ===========================================================================
50 // class RouteModeSelector
51 // ===========================================================================
52
56
57 public:
59 RouteModeSelector(GNERouteFrame* routeFrameParent);
60
63
65 const RouteMode& getCurrentRouteMode() const;
66
68 bool isValidMode() const;
69
71 bool isValidVehicleClass() const;
72
74 void areParametersValid();
75
79 long onCmdSelectRouteMode(FXObject*, FXSelector, void*);
80
82 long onCmdSelectVClass(FXObject*, FXSelector, void*);
84
85 protected:
86 FOX_CONSTRUCTOR(RouteModeSelector)
87
88 private:
91
94
97
100
102 bool myValidVClass = true;
103
105 std::vector<std::pair<RouteMode, std::string> > myRouteModesStrings;
106 };
107
112 GNERouteFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
113
116
118 void show();
119
121 void hide();
122
128 bool addEdgeRoute(GNEEdge* clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed);
129
132
133protected:
135 bool createPath(const bool useLastRoute);
136
137private:
140
143
146
149
152};
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
MFXComboBoxIcon * myVClassMatchBox
comboBox with the list of VClass
bool isValidMode() const
check if current mode is Valid
GNERouteFrame * myRouteFrameParent
pointer to Frame Parent
bool isValidVehicleClass() const
check if current VClass is Valid
MFXComboBoxIcon * myRouteModeMatchBox
comboBox with the list of route modes
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
GNEPathLegendModule * myPathLegend
path legend modul
~GNERouteFrame()
Destructor.
GNEAttributesEditor * myRouteAttributesEditor
internal route attributes editor
bool createPath(const bool useLastRoute)
create path
RouteMode
route creation modes
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
A single child window which contains a view of the simulation area.
MFXGroupBoxModule (based on FXGroupBox)
class used to group all variables related with mouse buttons and key pressed after certain events