Eclipse SUMO - Simulation of Urban MObility
GNEProhibitionFrame.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for remove network-elements
16 /****************************************************************************/
17 #ifndef GNEProhibitionFrame_h
18 #define GNEProhibitionFrame_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEFrame.h"
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 class GNEConnection;
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 class GNEProhibitionFrame : public GNEFrame {
41  FXDECLARE(GNEProhibitionFrame)
42 
43 public:
44 
46  enum ConnStatus {
50  };
51 
52  // ===========================================================================
53  // class RelativeToConnection
54  // ===========================================================================
55 
56  class RelativeToConnection : protected FXGroupBox {
57 
58  public:
60  RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent);
61 
64 
66  void updateDescription() const;
67 
68  private:
71 
74  };
75 
76  // ===========================================================================
77  // class ProhibitionLegend
78  // ===========================================================================
79 
80  class ProhibitionLegend : protected FXGroupBox {
81 
82  public:
84  ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent);
85 
88 
90  const RGBColor& getUndefinedColor() const;
91 
93  const RGBColor& getProhibitedColor() const;
94 
96  const RGBColor& getProhibitingColor() const;
97 
99  const RGBColor& getUnregulatedConflictColor() const;
100 
102  const RGBColor& getMutualConflictColor() const;
103 
104  private:
107 
110 
113 
116 
119  };
120 
121  // ===========================================================================
122  // class Modifications
123  // ===========================================================================
124 
125  class Modifications : protected FXGroupBox {
126 
127  public:
129  Modifications(GNEProhibitionFrame* prohibitionFrameParent);
130 
132  ~Modifications();
133 
134  private:
136  FXButton* mySaveButton;
137 
139  FXButton* myCancelButton;
140  };
141 
146  GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
147 
150 
154  void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
155 
157  void show();
158 
160  void hide();
161 
165  long onCmdOK(FXObject*, FXSelector, void*);
166 
168  long onCmdCancel(FXObject*, FXSelector, void*);
169 
171 
172 protected:
175 
177  void buildProhibition(GNEConnection* conn, bool mayDefinitelyPass, bool allowConflict, bool toggle);
178 
179 private:
182 
185 
188 
191 
193  std::set<GNEConnection*> myConcernedConns;
194 };
195 
196 
197 #endif
198 
199 /****************************************************************************/
200 
RGBColor myUnregulatedConflictColor
color for unregulated conflicts
void show()
show prohibition frame
Modifications * myModifications
Modifications.
RGBColor myProhibitingColor
color for connections with precedence
ProhibitionLegend * myProhibitionLegend
prohibition legend
std::set< GNEConnection * > myConcernedConns
the set of connections which
RGBColor myProhibitedColor
color for waiting connections
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
GNEConnection * myCurrentConn
the connection which prohibits
class used to group all variables related with objects under cursor after a click over view ...
FXButton * myCancelButton
"Cancel" button
GNEProhibitionFrame()
FOX needs this.
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
ConnStatus
FOX-declaration.
FXButton * mySaveButton
"Save" button
GNEProhibitionFrame * myProhibitionFrameParent
pointer to prohibition frame parent
FXLabel * myConnDescriptionLabel
the label that shows the currently selected connection
long onCmdOK(FXObject *, FXSelector, void *)
~GNEProhibitionFrame()
Destructor.
RGBColor myMutualConflictColor
color for mutual conflicts
RelativeToConnection(GNEProhibitionFrame *prohibitionFrameParent)
constructor
RGBColor myUndefinedColor
color for non-conflicting pairs of connections
RelativeToConnection * myRelativeToConnection
Relative To Connection.
void hide()
hide prohibition frame
void updateDescription() const
update description
void buildProhibition(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
build prohibition