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-2023 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 long onCmdInvertSelection(FXObject*, FXSelector, void*);
102
103 protected:
105 FOX_CONSTRUCTOR(EdgesSelector)
106
107 private:
110
113
116
119
122 };
123
124 // ===========================================================================
125 // class CrossingParameters
126 // ===========================================================================
127
131
132 public:
134 CrossingParameters(GNECrossingFrame* crossingFrameParent);
135
138
140 void enableCrossingParameters(bool hasTLS);
141
144
146 bool isCrossingParametersEnabled() const;
147
149 void markEdge(GNEEdge* edge);
150
152 void clearEdges();
153
155 void invertEdges(GNEJunction* parentJunction);
156
158 void useSelectedEdges(GNEJunction* parentJunction);
159
161 std::vector<NBEdge*> getCrossingEdges() const;
162
164 bool getCrossingPriority() const;
165
167 double getCrossingWidth() const;
168
170 bool isCurrentParametersValid() const;
171
175 long onCmdSetAttribute(FXObject*, FXSelector, void*);
176
178 long onCmdHelp(FXObject*, FXSelector, void*);
180
181 protected:
183 FOX_CONSTRUCTOR(CrossingParameters)
184
185 private:
188
191
193 std::vector<GNEEdge*> myCurrentSelectedEdges;
194
196 std::vector<GNEEdge*> myCurrentInvalidEdges;
197
200
202 FXTextField* myCrossingEdges;
203
206
209
212
214 FXTextField* myCrossingWidth;
215
218
221 };
222
223 // ===========================================================================
224 // class CreateCrossing
225 // ===========================================================================
226
230
231 public:
233 CreateCrossing(GNECrossingFrame* crossingFrameParent);
234
237
239 void setCreateCrossingButton(bool value);
240
244 long onCmdCreateCrossing(FXObject*, FXSelector, void*);
246
247 protected:
249 FOX_CONSTRUCTOR(CreateCrossing)
250
251 private:
254
257 };
258
259 // ===========================================================================
260 // class Information
261 // ===========================================================================
262
264
265 public:
267 Information(GNECrossingFrame* crossingFrameParent);
268
270 ~Information();
271 };
272
277 GNECrossingFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
278
281
283 void hide();
284
288 void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
289
292
294 void clearEdgesHotkey();
295
296protected:
298 FOX_CONSTRUCTOR(GNECrossingFrame)
299
300private:
303
306
309
312
315};
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
void invertEdges(GNEJunction *parentJunction)
invert 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
FXButton * myInvertEdgesSelection
button for invert selection
GNEJunction * getCurrentJunction() const
get current junction
FXButton * myClearEdgesSelection
button for clear selection
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
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 addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
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)