Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNECrossingFrame.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 add Crossing elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
30// ===========================================================================
31// class definitions
32// ===========================================================================
37class GNECrossingFrame : public GNEFrame {
38
39public:
40
41 // ===========================================================================
42 // class CurrentJunction
43 // ===========================================================================
44
46
47 public:
49 JunctionInformation(GNECrossingFrame* crossingFrameParent);
50
53
55 void updateCurrentJunctionLabel(const std::string& junctionID);
56
57 private:
60 };
61
62 // ===========================================================================
63 // class EdgesSelector
64 // ===========================================================================
65
69
70 public:
72 EdgesSelector(GNECrossingFrame* crossingFrameParent);
73
76
79
81 void enableEdgeSelector(GNEJunction* currentJunction);
82
85
87 void restoreEdgeColors();
88
92 long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
93
95 long onCmdClearSelection(FXObject*, FXSelector, void*);
96
98
99 protected:
101 FOX_CONSTRUCTOR(EdgesSelector)
102
103 private:
106
109
112
115 };
116
117 // ===========================================================================
118 // class CrossingParameters
119 // ===========================================================================
120
124
125 public:
127 CrossingParameters(GNECrossingFrame* crossingFrameParent);
128
131
133 void enableCrossingParameters(bool hasTLS);
134
137
139 bool isCrossingParametersEnabled() const;
140
142 void markEdge(GNEEdge* edge);
143
145 void clearEdges();
146
148 void useSelectedEdges(GNEJunction* parentJunction);
149
151 std::vector<NBEdge*> getCrossingEdges() const;
152
154 bool getCrossingPriority() const;
155
157 double getCrossingWidth() const;
158
160 bool isCurrentParametersValid() const;
161
165 long onCmdSetAttribute(FXObject*, FXSelector, void*);
166
168 long onCmdHelp(FXObject*, FXSelector, void*);
170
171 protected:
173 FOX_CONSTRUCTOR(CrossingParameters)
174
175 private:
178
180 std::vector<GNEEdge*> myCurrentSelectedEdges;
181
183 std::vector<GNEEdge*> myCurrentInvalidEdges;
184
187
189 FXTextField* myCrossingEdges;
190
193
196
199
201 FXTextField* myCrossingWidth;
202
205
208 };
209
210 // ===========================================================================
211 // class CreateCrossing
212 // ===========================================================================
213
217
218 public:
220 CreateCrossing(GNECrossingFrame* crossingFrameParent);
221
224
226 void setCreateCrossingButton(bool value);
227
231 long onCmdCreateCrossing(FXObject*, FXSelector, void*);
233
234 protected:
236 FOX_CONSTRUCTOR(CreateCrossing)
237
238 private:
241
244 };
245
246 // ===========================================================================
247 // class Information
248 // ===========================================================================
249
251
252 public:
254 Information(GNECrossingFrame* crossingFrameParent);
255
257 ~Information();
258 };
259
264 GNECrossingFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
265
268
270 void hide();
271
275 void addCrossing(const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
276
279
281 void clearEdgesHotkey();
282
285
286protected:
288 FOX_CONSTRUCTOR(GNECrossingFrame)
289
290private:
293
296
299
302
305};
void setCreateCrossingButton(bool value)
enable or disable button create crossing
FXButton * myCreateCrossingButton
@field FXButton for create Crossing
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
GNECrossingFrame * myCrossingFrameParent
FOX needs this.
void enableCrossingParameters(bool hasTLS)
enable crossing parameters and set the default value of parameters
std::vector< NBEdge * > getCrossingEdges() const
get crossing NBedges
double getCrossingWidth() const
get crossing width
std::vector< GNEEdge * > myCurrentInvalidEdges
current invalid edges
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
FXLabel * myCrossingWidthLabel
Label for width.
void markEdge(GNEEdge *edge)
mark or dismark edge
bool getCrossingPriority() const
get crossing priority
void disableCrossingParameters()
disable crossing parameters and clear parameters
FXTextField * myCrossingWidth
TextField for width.
bool myCurrentParametersValid
flag to check if current parameters are valid
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
bool isCrossingParametersEnabled() const
check if currently the CrossingParameters is enabled
FXButton * myHelpCrossingAttribute
button for help
FXTextField * myCrossingEdges
TextField for edges.
GNECrossingFrame * myCrossingFrameParent
FOX needs this.
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
FXLabel * myCrossingEdgesLabel
Label for edges.
bool isCurrentParametersValid() const
check if current parameters are valid
FXLabel * myCrossingPriorityLabel
Label for Priority.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
GNECrossingFrame * myCrossingFrameParent
FOX needs this.
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
GNEJunction * getCurrentJunction() const
get current junction
FXButton * myClearEdgesSelection
button for clear selection
void restoreEdgeColors()
restore colors of all edges
GNEJunction * myCurrentJunction
current Junction
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
void disableEdgeSelector()
disable edgeSelector
FXButton * myUseSelectedEdges
CheckBox for selected edges.
FXTextField * myTextFieldJunctionID
Text field for junction ID.
void updateCurrentJunctionLabel(const std::string &junctionID)
set current junction label
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
GNECrossingFrame::Information * myInformation
information modul
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
~GNECrossingFrame()
Destructor.
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
void hide()
hide crossing frame
GNECrossingFrame::CrossingParameters * myCrossingParameters
crossing parameters modul
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
GNECrossingFrame::EdgesSelector * getEdgesSelector() const
get edge selector modul
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
GNECrossingFrame::JunctionInformation * myJunctionInformation
FOX need this.
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
class used to group all variables related with objects under cursor after a click over view
A single child window which contains a view of the simulation area.
MFXGroupBoxModule (based on FXGroupBox)