Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNECreateEdgeFrame.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 create edges (and junctions)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
26
27// ===========================================================================
28// class declaration
29// ===========================================================================
30
31class GNEEdgeType;
32
33// ===========================================================================
34// class definitions
35// ===========================================================================
41
42public:
43
44 // ===========================================================================
45 // class EdgeTypeSelector
46 // ===========================================================================
47
51
52 public:
54 EdgeTypeSelector(GNECreateEdgeFrame* createEdgeFrameParent);
55
58
61
63 void updateIDinComboBox(const std::string& oldID, const std::string& newID);
64
66 bool useDefaultEdgeType() const;
67
69 bool useDefaultEdgeTypeShort() const;
70
72 bool useEdgeTemplate() const;
73
76
79
82
84 bool isNoPedestriansEnabled() const;
85
87 bool isAddSidewalkEnabled() const;
88
90 bool isAddBikelaneEnabled() const;
91
94
96 void setCurrentEdgeType(const GNEEdgeType* edgeType);
97
99 void useTemplate();
100
104 long onCmdRadioButton(FXObject*, FXSelector, void*);
105
107 long onCmdAddEdgeType(FXObject*, FXSelector, void*);
108
110 long onCmdDeleteEdgeType(FXObject*, FXSelector, void*);
111
113 long onCmdSelectEdgeTypeOrTemplate(FXObject*, FXSelector, void*);
114
116 long onCmdCreateFromTemplate(FXObject*, FXSelector, void*);
117
119 long onUpdCheckButtons(FXObject*, FXSelector, void*);
120
122
123 protected:
126
128 void fillComboBox();
129
130 private:
133
136
139
142
144 FXRadioButton* myCreateDefaultEdgeType = nullptr;
145
147 FXRadioButton* myCreateDefaultShortEdgeType = nullptr;
148
150 FXCheckButton* myNoPedestriansCheckButton = nullptr;
151
153 FXCheckButton* myAddSidewalkCheckButton = nullptr;
154
156 FXCheckButton* myAddBikelaneCheckButton = nullptr;
157
159 FXRadioButton* myCreateCustomEdgeType = nullptr;
160
163
165 FXButton* myAddEdgeTypeButton = nullptr;
166
168 FXButton* myDeleteEdgeTypeButton = nullptr;
169
171 FXButton* myCreateFromTemplate = nullptr;
172 };
173
174 // ===========================================================================
175 // class LaneTypeSelector
176 // ===========================================================================
177
181
182 public:
184 LaneTypeSelector(GNECreateEdgeFrame* createEdgeFrameParent);
185
188
191
194
197
201 long onCmdAddLaneType(FXObject*, FXSelector, void*);
202
204 long onCmdDeleteLaneType(FXObject*, FXSelector, void*);
205
207 long onCmdSelectLaneType(FXObject*, FXSelector, void*);
208
210
211 protected:
214
216 void updateComboBox();
217
218 private:
221
226
228 FXButton* myAddLaneTypeButton = nullptr;
229
231 FXButton* myDeleteLaneTypeButton = nullptr;
232 };
233
234 // ===========================================================================
235 // class Legend
236 // ===========================================================================
237
238 class Legend : public MFXGroupBoxModule {
239
240 public:
242 Legend(GNECreateEdgeFrame* createEdgeFrameParent);
243
245 ~Legend();
246 };
247
252 GNECreateEdgeFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
253
256
263 void processClick(const Position& clickedPosition, const GNEViewNetHelper::ViewObjectsSelector& viewObjects, const bool oppositeEdge, const bool chainEdge);
264
266 void abortEdgeCreation();
267
269 const GNEJunction* getJunctionSource() const;
270
272 void show();
273
275 void hide();
276
279
282
285
288
290 void setUseEdgeTemplate();
291
292protected:
295
298
301
304
307
309 void disablePedestrians(GNEEdge* edge) const;
310
312 void addSidewalk(GNEEdge* edge, const std::string& sidewalkWidth) const;
313
315 void addBikelane(GNEEdge* edge, const std::string& bikelaneWidth) const;
316
317private:
320};
GNEEdgeType * getEdgeTypeSelected() const
get edgeType selected
FXRadioButton * myCreateDefaultShortEdgeType
create default edge short
GNEEdgeType * getDefaultEdgeType() const
get default edgeType
bool useEdgeTemplate() const
check if we have to use edge template
bool useDefaultEdgeTypeShort() const
check if we're using default edge type short
long onUpdCheckButtons(FXObject *, FXSelector, void *)
Called when check buttons are updated.
FXCheckButton * myAddBikelaneCheckButton
add bike check button
bool isAddBikelaneEnabled() const
check if add bikelane check button is enabled
void updateIDinComboBox(const std::string &oldID, const std::string &newID)
update id in comboBox
long onCmdAddEdgeType(FXObject *, FXSelector, void *)
Called when the user press button for add a new edge type.
void enableCheckBoxDisablePedestrians()
void enable checkbox for disable pedestrians
bool useDefaultEdgeType() const
check if we're using default edge type
FOX_CONSTRUCTOR(EdgeTypeSelector)
FOX need this.
FXButton * myDeleteEdgeTypeButton
button for delete edge type
long onCmdDeleteEdgeType(FXObject *, FXSelector, void *)
Called when the user press button for delete edge type.
GNEEdgeType * myDefaultEdgeType
default edge type
FXCheckButton * myAddSidewalkCheckButton
add sidewalk check button
long onCmdCreateFromTemplate(FXObject *, FXSelector, void *)
Called when the user press create edgeType from Template.
bool isAddSidewalkEnabled() const
check if add sidewalk check button is enabled
FXButton * myCreateFromTemplate
button for create edgeType from template
FXRadioButton * myCreateCustomEdgeType
create custom edge
MFXComboBoxIcon * myEdgeTypesComboBox
ComboBox for edge types.
FXRadioButton * myCreateDefaultEdgeType
create default edge
void refreshEdgeTypeSelector()
refresh edge type selector
FXCheckButton * myNoPedestriansCheckButton
no pedestrian check button
bool isNoPedestriansEnabled() const
check if no pedestrian check button is enabled
long onCmdRadioButton(FXObject *, FXSelector, void *)
GNEEdgeType * myEdgeTypeSelected
selected edgeType
GNECreateEdgeFrame * myCreateEdgeFrameParent
pointer to createEdgeFrameParent
void setCurrentEdgeType(const GNEEdgeType *edgeType)
set current edgeType
void clearEdgeTypeSelected()
clear edgeType selected
long onCmdSelectEdgeTypeOrTemplate(FXObject *, FXSelector, void *)
Called when the user press select an edgeType or template in comboBox.
FXButton * myAddEdgeTypeButton
button for create new edge type
GNECreateEdgeFrame * myCreateEdgeFrameParent
pointer to createEdgeFrameParent
FOX_CONSTRUCTOR(LaneTypeSelector)
FOX need this.
long onCmdSelectLaneType(FXObject *, FXSelector, void *)
Called when the user press select an laneType in comboBox.
FXButton * myDeleteLaneTypeButton
button for delete lane type
MFXComboBoxIcon * myLaneTypesComboBox
ComboBox for lane types.
void showLaneTypeSelector()
show lane type selector
void hideLaneTypeSelector()
hide lane type selector
long onCmdAddLaneType(FXObject *, FXSelector, void *)
FXButton * myAddLaneTypeButton
button for create new lane type
long onCmdDeleteLaneType(FXObject *, FXSelector, void *)
Called when the user press button for delete lane type.
void refreshLaneTypeSelector()
refresh LaneTypeSelector
EdgeTypeSelector * getEdgeTypeSelector() const
get edgeType selector
GNEJunction * myJunctionSource
source junction for new edge
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative coloring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
GNECreateEdgeFrame::LaneTypeSelector * myLaneTypeSelector
lane type selector
GNEAttributesCreator * getLaneTypeAttributes() const
get laneType attributes
GNEAttributesCreator * myEdgeTypeAttributes
internal edgeType attributes
void addSidewalk(GNEEdge *edge, const std::string &sidewalkWidth) const
add sidewalk in the given edge
GNEAttributesCreator * getEdgeTypeAttributes() const
get edgeType attributes
const GNEJunction * getJunctionSource() const
get junction source for new edge
GNEAttributesCreator * myLaneTypeAttributes
internal laneType attributes
void disablePedestrians(GNEEdge *edge) const
disable pedestrians in the given edge (within undoRedo)
GNECreateEdgeFrame::Legend * myLegend
Legend.
void addBikelane(GNEEdge *edge, const std::string &bikelaneWidth) const
add bikelane in the given edge
void hide()
hide create edge frame
EdgeTypeSelector * myEdgeTypeSelector
edge type selector
void setUseEdgeTemplate()
set default to using edge template
LaneTypeSelector * getLaneTypeSelector()
get lane type selector
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.
ComboBox with icon.
MFXGroupBoxModule (based on FXGroupBox)
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37