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-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 add Crossing elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
30class GNECrossing;
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
39class GNECrossingFrame : public GNEFrame {
40
41public:
42
43 // ===========================================================================
44 // class CurrentJunction
45 // ===========================================================================
46
48
49 public:
51 JunctionInformation(GNECrossingFrame* crossingFrameParent);
52
55
57 void updateCurrentJunctionLabel(const std::string& junctionID);
58
59 private:
62 };
63
64 // ===========================================================================
65 // class EdgesSelector
66 // ===========================================================================
67
71
72 public:
74 EdgesSelector(GNECrossingFrame* crossingFrameParent);
75
78
81
83 void enableEdgeSelector(GNEJunction* currentJunction);
84
87
89 void restoreEdgeColors();
90
94 long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
95
97 long onCmdClearSelection(FXObject*, FXSelector, void*);
98
100
101 protected:
103 FOX_CONSTRUCTOR(EdgesSelector)
104
105 private:
108
111
114
117 };
118
119 // ===========================================================================
120 // class CrossingParameters
121 // ===========================================================================
122
126
127 public:
129 CrossingParameters(GNECrossingFrame* crossingFrameParent);
130
133
135 void enableCrossingParameters(bool hasTLS);
136
139
141 bool isCrossingParametersEnabled() const;
142
144 void markEdge(GNEEdge* edge);
145
147 void clearEdges();
148
150 void useSelectedEdges(GNEJunction* parentJunction);
151
153 std::vector<NBEdge*> getCrossingEdges() const;
154
156 bool getCrossingPriority() const;
157
159 double getCrossingWidth() const;
160
162 bool isCurrentParametersValid() const;
163
167 long onCmdSetAttribute(FXObject*, FXSelector, void*);
168
170 long onCmdHelp(FXObject*, FXSelector, void*);
172
173 protected:
175 FOX_CONSTRUCTOR(CrossingParameters)
176
177 private:
180
183
185 std::vector<GNEEdge*> myCurrentSelectedEdges;
186
188 std::vector<GNEEdge*> myCurrentInvalidEdges;
189
192
194 FXTextField* myCrossingEdges;
195
198
201
204
206 FXTextField* myCrossingWidth;
207
210
213 };
214
215 // ===========================================================================
216 // class CreateCrossing
217 // ===========================================================================
218
222
223 public:
225 CreateCrossing(GNECrossingFrame* crossingFrameParent);
226
229
231 void setCreateCrossingButton(bool value);
232
236 long onCmdCreateCrossing(FXObject*, FXSelector, void*);
238
239 protected:
241 FOX_CONSTRUCTOR(CreateCrossing)
242
243 private:
246
249 };
250
251 // ===========================================================================
252 // class Information
253 // ===========================================================================
254
256
257 public:
259 Information(GNECrossingFrame* crossingFrameParent);
260
262 ~Information();
263 };
264
269 GNECrossingFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
270
273
275 void hide();
276
280 void addCrossing(const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
281
284
286 void clearEdgesHotkey();
287
288protected:
290 FOX_CONSTRUCTOR(GNECrossingFrame)
291
292private:
295
298
301
304
307};
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.
GNECrossing * myCrossingTemplate
crossing template
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)
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
GNECrossingFrame::JunctionInformation * myJunctionInformation
FOX need this.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition GNECrossing.h:44
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)