Eclipse SUMO - Simulation of Urban MObility
GNECrossingFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 class GNECrossing;
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 class GNECrossingFrame : public GNEFrame {
40 
41 public:
42 
43  // ===========================================================================
44  // class CurrentJunction
45  // ===========================================================================
46 
48 
49  public:
51  CurrentJunction(GNECrossingFrame* crossingFrameParent);
52 
55 
57  void updateCurrentJunctionLabel(const std::string& junctionID);
58 
59  private:
61  FXTextField* myTextFieldJunctionID;
62  };
63 
64  // ===========================================================================
65  // class EdgesSelector
66  // ===========================================================================
67 
71 
72  public:
74  EdgesSelector(GNECrossingFrame* crossingFrameParent);
75 
78 
81 
83  void enableEdgeSelector(GNEJunction* currentJunction);
84 
86  void disableEdgeSelector();
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:
104  FOX_CONSTRUCTOR(EdgesSelector)
105 
106  private:
109 
112 
115 
118 
121  };
122 
123  // ===========================================================================
124  // class CrossingParameters
125  // ===========================================================================
126 
130 
131  public:
133  CrossingParameters(GNECrossingFrame* crossingFrameParent);
134 
137 
139  void enableCrossingParameters(bool hasTLS);
140 
143 
145  bool isCrossingParametersEnabled() const;
146 
148  void markEdge(GNEEdge* edge);
149 
151  void clearEdges();
152 
154  void invertEdges(GNEJunction* parentJunction);
155 
157  void useSelectedEdges(GNEJunction* parentJunction);
158 
160  std::vector<NBEdge*> getCrossingEdges() const;
161 
163  bool getCrossingPriority() const;
164 
166  double getCrossingWidth() const;
167 
169  bool isCurrentParametersValid() const;
170 
174  long onCmdSetAttribute(FXObject*, FXSelector, void*);
175 
177  long onCmdHelp(FXObject*, FXSelector, void*);
179 
180  protected:
181  FOX_CONSTRUCTOR(CrossingParameters)
182 
183  private:
186 
189 
191  std::vector<GNEEdge*> myCurrentSelectedEdges;
192 
195 
197  FXTextField* myCrossingEdges;
198 
201 
204 
207 
209  FXTextField* myCrossingWidth;
210 
213 
216  };
217 
218  // ===========================================================================
219  // class CreateCrossing
220  // ===========================================================================
221 
225 
226  public:
228  CreateCrossing(GNECrossingFrame* crossingFrameParent);
229 
231  ~CreateCrossing();
232 
234  void setCreateCrossingButton(bool value);
235 
239  long onCmdCreateCrossing(FXObject*, FXSelector, void*);
241 
242  protected:
243  FOX_CONSTRUCTOR(CreateCrossing)
244 
245  private:
248 
251  };
252 
253  // ===========================================================================
254  // class Information
255  // ===========================================================================
256 
258 
259  public:
261  Information(GNECrossingFrame* crossingFrameParent);
262 
264  ~Information();
265  };
266 
271  GNECrossingFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
272 
275 
277  void hide();
278 
282  void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
283 
285  void createCrossingHotkey();
286 
287 protected:
289  FOX_CONSTRUCTOR(GNECrossingFrame)
290 
291 private:
294 
297 
300 
303 
306 };
void setCreateCrossingButton(bool value)
enable or disable button create crossing
CreateCrossing(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
FXButton * myCreateCrossingButton
@field FXButton for create Crossing
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
GNECrossingFrame * myCrossingFrameParent
pointer to crossingFrame parent
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
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
CrossingParameters(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
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
pointer to GNECrossingFrame parent
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 *)
CurrentJunction(GNECrossingFrame *crossingFrameParent)
constructor
FXTextField * myTextFieldJunctionID
Text field for junction ID.
void updateCurrentJunctionLabel(const std::string &junctionID)
set current junction label
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
EdgesSelector(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
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.
Information(GNECrossingFrame *crossingFrameParent)
constructor
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
GNECrossingFrame::Information * myInformation
information modul
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
~GNECrossingFrame()
Destructor.
GNECrossingFrame::CurrentJunction * myCurrentJunction
FOX need this.
GNECrossingFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
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)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:42
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.
Definition: GNEViewParent.h:84
MFXGroupBoxModule (based on FXGroupBox)