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
26
27// ===========================================================================
28// class definitions
29// ===========================================================================
30
31class GNECrossingFrame : public GNEFrame {
32
33public:
34
35 // ===========================================================================
36 // class CurrentJunction
37 // ===========================================================================
38
40
41 public:
43 JunctionInformation(GNECrossingFrame* crossingFrameParent);
44
47
49 void updateCurrentJunctionLabel(const std::string& junctionID);
50
51 private:
54 };
55
56 // ===========================================================================
57 // class EdgesSelector
58 // ===========================================================================
59
63
64 public:
66 EdgesSelector(GNECrossingFrame* crossingFrameParent);
67
70
73
75 void enableEdgeSelector(GNEJunction* currentJunction);
76
79
81 void restoreEdgeColors();
82
86 long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
87
89 long onCmdClearSelection(FXObject*, FXSelector, void*);
90
92
93 protected:
95 FOX_CONSTRUCTOR(EdgesSelector)
96
97 private:
100
103
106
109 };
110
111 // ===========================================================================
112 // class CrossingParameters
113 // ===========================================================================
114
118
119 public:
121 CrossingParameters(GNECrossingFrame* crossingFrameParent);
122
125
127 void enableCrossingParameters(bool hasTLS);
128
131
133 bool isCrossingParametersEnabled() const;
134
136 void markEdge(GNEEdge* edge);
137
139 void clearEdges();
140
142 void useSelectedEdges(GNEJunction* parentJunction);
143
145 std::vector<NBEdge*> getCrossingEdges() const;
146
148 bool getCrossingPriority() const;
149
151 double getCrossingWidth() const;
152
154 bool isCurrentParametersValid() const;
155
159 long onCmdSetAttribute(FXObject*, FXSelector, void*);
160
162 long onCmdHelp(FXObject*, FXSelector, void*);
164
165 protected:
167 FOX_CONSTRUCTOR(CrossingParameters)
168
169 private:
172
174 std::vector<GNEEdge*> myCurrentSelectedEdges;
175
177 std::vector<GNEEdge*> myCurrentInvalidEdges;
178
181
183 FXTextField* myCrossingEdges;
184
187
190
193
195 FXTextField* myCrossingWidth;
196
199
202 };
203
204 // ===========================================================================
205 // class CreateCrossing
206 // ===========================================================================
207
211
212 public:
214 CreateCrossing(GNECrossingFrame* crossingFrameParent);
215
218
220 void setCreateCrossingButton(bool value);
221
225 long onCmdCreateCrossing(FXObject*, FXSelector, void*);
227
228 protected:
230 FOX_CONSTRUCTOR(CreateCrossing)
231
232 private:
235
238 };
239
240 // ===========================================================================
241 // class Information
242 // ===========================================================================
243
245
246 public:
248 Information(GNECrossingFrame* crossingFrameParent);
249
251 ~Information();
252 };
253
258 GNECrossingFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
259
262
264 void hide();
265
269 void addCrossing(const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
270
273
275 void clearEdgesHotkey();
276
279
280protected:
282 FOX_CONSTRUCTOR(GNECrossingFrame)
283
284private:
287
290
293
296
299};
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.
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)