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-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 remove network-elements
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
23 
24 // ===========================================================================
25 // class declarations
26 // ===========================================================================
27 class GNEConnection;
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
37 class GNEProhibitionFrame : public GNEFrame {
39  FXDECLARE(GNEProhibitionFrame)
40 
41 public:
42 
44  enum ConnStatus {
48  };
49 
50  // ===========================================================================
51  // class RelativeToConnection
52  // ===========================================================================
53 
55 
56  public:
58  RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent);
59 
62 
64  void updateDescription() const;
65 
66  private:
69 
72  };
73 
74  // ===========================================================================
75  // class Legend
76  // ===========================================================================
77 
78  class Legend : public FXGroupBoxModule {
79 
80  public:
82  Legend(GNEProhibitionFrame* prohibitionFrameParent);
83 
85  ~Legend();
86 
88  const RGBColor& getUndefinedColor() const;
89 
91  const RGBColor& getProhibitedColor() const;
92 
94  const RGBColor& getProhibitingColor() const;
95 
98 
100  const RGBColor& getMutualConflictColor() const;
101 
102  private:
105 
108 
111 
114 
117  };
118 
119  // ===========================================================================
120  // class Modifications
121  // ===========================================================================
122 
124 
125  public:
127  Modifications(GNEProhibitionFrame* prohibitionFrameParent);
128 
130  ~Modifications();
131 
132  private:
134  FXButton* mySaveButton;
135 
137  FXButton* myCancelButton;
138  };
139 
144  GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
145 
148 
152  void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
153 
155  void show();
156 
158  void hide();
159 
163  long onCmdOK(FXObject*, FXSelector, void*);
164 
166  long onCmdCancel(FXObject*, FXSelector, void*);
167 
169 
170 protected:
171  FOX_CONSTRUCTOR(GNEProhibitionFrame)
172 
173 
174  void buildProhibition(GNEConnection* conn, bool mayDefinitelyPass, bool allowConflict, bool toggle);
175 
176 private:
179 
182 
185 
188 
190  std::set<GNEConnection*> myConcernedConns;
191 };
FXGroupBoxModule (based on FXGroupBox)
Legend(GNEProhibitionFrame *prohibitionFrameParent)
constructor
const RGBColor & getProhibitingColor() const
get color for connections with precedence
RGBColor myUndefinedColor
color for non-conflicting pairs of connections
const RGBColor & getProhibitedColor() const
get color for waiting connections
RGBColor myMutualConflictColor
color for mutual conflicts
const RGBColor & getUndefinedColor() const
get color for non-conflicting pairs of connections
RGBColor myProhibitedColor
color for waiting connections
RGBColor myUnregulatedConflictColor
color for unregulated conflicts
const RGBColor & getMutualConflictColor() const
get color for mutual conflicts
const RGBColor & getUnregulatedConflictColor() const
get color for unregulated conflicts
RGBColor myProhibitingColor
color for connections with precedence
Modifications(GNEProhibitionFrame *prohibitionFrameParent)
constructor
FXButton * myCancelButton
"Cancel" button
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
GNEProhibitionFrame::Legend * myLegend
prohibition legend
RelativeToConnection * myRelativeToConnection
Relative To Connection.
ConnStatus
FOX-declaration.
GNEProhibitionFrame::Modifications * myModifications
Modifications.
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
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition 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