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-2020 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 
23 
24 // ===========================================================================
25 // class definitions
26 // ===========================================================================
31 class GNECrossingFrame : public GNEFrame {
32 
33 public:
34 
35  // ===========================================================================
36  // class CurrentJunction
37  // ===========================================================================
38 
39  class CurrentJunction : protected FXGroupBox {
40 
41  public:
43  CurrentJunction(GNECrossingFrame* crossingFrameParent);
44 
47 
49  void updateCurrentJunctionLabel(const std::string& junctionID);
50 
51  private:
53  FXTextField* myTextFieldJunctionID;
54  };
55 
56  // ===========================================================================
57  // class EdgesSelector
58  // ===========================================================================
59 
60  class EdgesSelector : protected FXGroupBox {
63 
64  public:
66  EdgesSelector(GNECrossingFrame* crossingFrameParent);
67 
70 
73 
75  void enableEdgeSelector(GNEJunction* currentJunction);
76 
78  void disableEdgeSelector();
79 
81  void restoreEdgeColors();
82 
86  long onCmdUseSelectedEdges(FXObject*, FXSelector, void*);
87 
89  long onCmdClearSelection(FXObject*, FXSelector, void*);
90 
92  long onCmdInvertSelection(FXObject*, FXSelector, void*);
94 
95  protected:
96  FOX_CONSTRUCTOR(EdgesSelector)
97 
98  private:
101 
104 
107 
110 
113  };
114 
115  // ===========================================================================
116  // class CrossingParameters
117  // ===========================================================================
118 
119  class CrossingParameters : protected FXGroupBox {
122 
123  public:
125  CrossingParameters(GNECrossingFrame* crossingFrameParent);
126 
129 
131  void enableCrossingParameters(bool hasTLS);
132 
135 
137  bool isCrossingParametersEnabled() const;
138 
140  void markEdge(GNEEdge* edge);
141 
143  void clearEdges();
144 
146  void invertEdges(GNEJunction* parentJunction);
147 
149  void useSelectedEdges(GNEJunction* parentJunction);
150 
152  std::vector<NBEdge*> getCrossingEdges() const;
153 
155  bool getCrossingPriority() const;
156 
158  double getCrossingWidth() const;
159 
161  bool isCurrentParametersValid() const;
162 
166  long onCmdSetAttribute(FXObject*, FXSelector, void*);
167 
169  long onCmdHelp(FXObject*, FXSelector, void*);
171 
172  protected:
173  FOX_CONSTRUCTOR(CrossingParameters)
174 
175  private:
178 
180  std::vector<GNEEdge*> myCurrentSelectedEdges;
181 
184 
186  FXTextField* myCrossingEdges;
187 
190 
193 
196 
198  FXTextField* myCrossingWidth;
199 
202 
205  };
206 
207  // ===========================================================================
208  // class CreateCrossing
209  // ===========================================================================
210 
211  class CreateCrossing : protected FXGroupBox {
214 
215  public:
217  CreateCrossing(GNECrossingFrame* crossingFrameParent);
218 
220  ~CreateCrossing();
221 
223  void setCreateCrossingButton(bool value);
224 
228  long onCmdCreateCrossing(FXObject*, FXSelector, void*);
230 
231  protected:
232  FOX_CONSTRUCTOR(CreateCrossing)
233 
234  private:
237 
240  };
241 
246  GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
247 
250 
252  void hide();
253 
257  void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
258 
260  void createCrossingHotkey();
261 
262 protected:
263  FOX_CONSTRUCTOR(GNECrossingFrame)
264 
265 private:
268 
271 
274 
277 };
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.
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.
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
~GNECrossingFrame()
Destructor.
GNECrossingFrame::CurrentJunction * myCurrentJunction
current junction modul
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(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
class used to group all variables related with objects under cursor after a click over view