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-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 remove network-elements
19 /****************************************************************************/
20 #pragma once
22 
23 // ===========================================================================
24 // class declarations
25 // ===========================================================================
26 class GNEConnection;
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
36 class GNEProhibitionFrame : public GNEFrame {
38  FXDECLARE(GNEProhibitionFrame)
39 
40 public:
41 
43  enum ConnStatus {
47  };
48 
49  // ===========================================================================
50  // class RelativeToConnection
51  // ===========================================================================
52 
53  class RelativeToConnection : protected FXGroupBox {
54 
55  public:
57  RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent);
58 
61 
63  void updateDescription() const;
64 
65  private:
68 
71  };
72 
73  // ===========================================================================
74  // class ProhibitionLegend
75  // ===========================================================================
76 
77  class ProhibitionLegend : protected FXGroupBox {
78 
79  public:
81  ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent);
82 
85 
87  const RGBColor& getUndefinedColor() const;
88 
90  const RGBColor& getProhibitedColor() const;
91 
93  const RGBColor& getProhibitingColor() const;
94 
97 
99  const RGBColor& getMutualConflictColor() const;
100 
101  private:
104 
107 
110 
113 
116  };
117 
118  // ===========================================================================
119  // class Modifications
120  // ===========================================================================
121 
122  class Modifications : protected FXGroupBox {
123 
124  public:
126  Modifications(GNEProhibitionFrame* prohibitionFrameParent);
127 
129  ~Modifications();
130 
131  private:
133  FXButton* mySaveButton;
134 
136  FXButton* myCancelButton;
137  };
138 
143  GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
144 
147 
151  void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
152 
154  void show();
155 
157  void hide();
158 
162  long onCmdOK(FXObject*, FXSelector, void*);
163 
165  long onCmdCancel(FXObject*, FXSelector, void*);
166 
168 
169 protected:
170  FOX_CONSTRUCTOR(GNEProhibitionFrame)
171 
172 
173  void buildProhibition(GNEConnection* conn, bool mayDefinitelyPass, bool allowConflict, bool toggle);
174 
175 private:
178 
181 
184 
187 
189  std::set<GNEConnection*> myConcernedConns;
190 };
Modifications(GNEProhibitionFrame *prohibitionFrameParent)
constructor
FXButton * myCancelButton
"Cancel" button
const RGBColor & getUndefinedColor() const
get color for non-conflicting pairs of connections
RGBColor myUndefinedColor
color for non-conflicting pairs of connections
const RGBColor & getMutualConflictColor() const
get color for mutual conflicts
const RGBColor & getProhibitedColor() const
get color for waiting connections
RGBColor myProhibitingColor
color for connections with precedence
RGBColor myProhibitedColor
color for waiting connections
RGBColor myUnregulatedConflictColor
color for unregulated conflicts
const RGBColor & getUnregulatedConflictColor() const
get color for unregulated conflicts
RGBColor myMutualConflictColor
color for mutual conflicts
const RGBColor & getProhibitingColor() const
get color for connections with precedence
ProhibitionLegend(GNEProhibitionFrame *prohibitionFrameParent)
constructor
FXLabel * myConnDescriptionLabel
the label that shows the currently selected connection
RelativeToConnection(GNEProhibitionFrame *prohibitionFrameParent)
constructor
void updateDescription() const
update description
GNEProhibitionFrame * myProhibitionFrameParent
pointer to prohibition frame parent
RelativeToConnection * myRelativeToConnection
Relative To Connection.
ConnStatus
FOX-declaration.
void hide()
hide prohibition frame
long onCmdOK(FXObject *, FXSelector, void *)
GNEProhibitionFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
GNEConnection * myCurrentConn
the connection which prohibits
ProhibitionLegend * myProhibitionLegend
prohibition legend
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
Modifications * myModifications
Modifications.
void show()
show prohibition frame
void buildProhibition(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
build prohibition
std::set< GNEConnection * > myConcernedConns
the set of connections which
class used to group all variables related with objects under cursor after a click over view