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 
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 
GNEProhibitionFrame::PROHIBITING
Definition: GNEProhibitionFrame.h:49
GNEProhibitionFrame::handleProhibitionClick
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
Definition: GNEProhibitionFrame.cpp:191
GNEProhibitionFrame::ProhibitionLegend::getUndefinedColor
const RGBColor & getUndefinedColor() const
get color for non-conflicting pairs of connections
Definition: GNEProhibitionFrame.cpp:115
GNEProhibitionFrame
Definition: GNEProhibitionFrame.h:39
GNEProhibitionFrame::RelativeToConnection::RelativeToConnection
RelativeToConnection(GNEProhibitionFrame *prohibitionFrameParent)
constructor
Definition: GNEProhibitionFrame.cpp:54
GNEProhibitionFrame::ProhibitionLegend::getMutualConflictColor
const RGBColor & getMutualConflictColor() const
get color for mutual conflicts
Definition: GNEProhibitionFrame.cpp:139
GNEProhibitionFrame::ProhibitionLegend::ProhibitionLegend
ProhibitionLegend(GNEProhibitionFrame *prohibitionFrameParent)
constructor
Definition: GNEProhibitionFrame.cpp:82
GNEProhibitionFrame::RelativeToConnection::myConnDescriptionLabel
FXLabel * myConnDescriptionLabel
the label that shows the currently selected connection
Definition: GNEProhibitionFrame.h:73
GNEProhibitionFrame::ConnStatus
ConnStatus
FOX-declaration.
Definition: GNEProhibitionFrame.h:46
GNEProhibitionFrame::ProhibitionLegend::myProhibitingColor
RGBColor myProhibitingColor
color for connections with precedence
Definition: GNEProhibitionFrame.h:112
GNEFrame
Definition: GNEFrame.h:35
GNEViewNet
Definition: GNEViewNet.h:43
GNEProhibitionFrame::Modifications::~Modifications
~Modifications()
destructor
Definition: GNEProhibitionFrame.cpp:164
GNEProhibitionFrame::Modifications::mySaveButton
FXButton * mySaveButton
"Save" button
Definition: GNEProhibitionFrame.h:136
GNEProhibitionFrame::GNEProhibitionFrame
GNEProhibitionFrame()
FOX needs this.
Definition: GNEProhibitionFrame.h:174
GNEProhibitionFrame::RelativeToConnection::myProhibitionFrameParent
GNEProhibitionFrame * myProhibitionFrameParent
pointer to prohibition frame parent
Definition: GNEProhibitionFrame.h:70
GNEProhibitionFrame::Modifications
Definition: GNEProhibitionFrame.h:125
RGBColor
Definition: RGBColor.h:40
GNEProhibitionFrame::onCmdCancel
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
Definition: GNEProhibitionFrame.cpp:210
GNEProhibitionFrame::myCurrentConn
GNEConnection * myCurrentConn
the connection which prohibits
Definition: GNEProhibitionFrame.h:190
GNEProhibitionFrame::buildProhibition
void buildProhibition(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
build prohibition
Definition: GNEProhibitionFrame.cpp:235
GNEProhibitionFrame::ProhibitionLegend::~ProhibitionLegend
~ProhibitionLegend()
destructor
Definition: GNEProhibitionFrame.cpp:111
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:149
GNEProhibitionFrame::ProhibitionLegend::myProhibitedColor
RGBColor myProhibitedColor
color for waiting connections
Definition: GNEProhibitionFrame.h:109
GNEProhibitionFrame::RelativeToConnection::updateDescription
void updateDescription() const
update description
Definition: GNEProhibitionFrame.cpp:68
GNEProhibitionFrame::~GNEProhibitionFrame
~GNEProhibitionFrame()
Destructor.
Definition: GNEProhibitionFrame.cpp:187
GNEProhibitionFrame::show
void show()
show prohibition frame
Definition: GNEProhibitionFrame.cpp:198
GNEProhibitionFrame::UNDEFINED
Definition: GNEProhibitionFrame.h:47
GNEProhibitionFrame::RelativeToConnection
Definition: GNEProhibitionFrame.h:56
GNEProhibitionFrame::RelativeToConnection::~RelativeToConnection
~RelativeToConnection()
destructor
Definition: GNEProhibitionFrame.cpp:64
GNEProhibitionFrame::PROHIBITED
Definition: GNEProhibitionFrame.h:48
GNEProhibitionFrame::myConcernedConns
std::set< GNEConnection * > myConcernedConns
the set of connections which
Definition: GNEProhibitionFrame.h:193
GNEProhibitionFrame::Modifications::myCancelButton
FXButton * myCancelButton
"Cancel" button
Definition: GNEProhibitionFrame.h:139
GNEProhibitionFrame::hide
void hide()
hide prohibition frame
Definition: GNEProhibitionFrame.cpp:204
GNEProhibitionFrame::ProhibitionLegend::getUnregulatedConflictColor
const RGBColor & getUnregulatedConflictColor() const
get color for unregulated conflicts
Definition: GNEProhibitionFrame.cpp:133
GNEProhibitionFrame::ProhibitionLegend::myMutualConflictColor
RGBColor myMutualConflictColor
color for mutual conflicts
Definition: GNEProhibitionFrame.h:118
GNEProhibitionFrame::onCmdOK
long onCmdOK(FXObject *, FXSelector, void *)
Definition: GNEProhibitionFrame.cpp:226
GNEConnection
Definition: GNEConnection.h:38
GNEProhibitionFrame::ProhibitionLegend::myUnregulatedConflictColor
RGBColor myUnregulatedConflictColor
color for unregulated conflicts
Definition: GNEProhibitionFrame.h:115
GNEProhibitionFrame::myRelativeToConnection
RelativeToConnection * myRelativeToConnection
Relative To Connection.
Definition: GNEProhibitionFrame.h:181
GNEProhibitionFrame::myModifications
Modifications * myModifications
Modifications.
Definition: GNEProhibitionFrame.h:187
GNEFrame.h
GNEProhibitionFrame::ProhibitionLegend
Definition: GNEProhibitionFrame.h:80
GNEProhibitionFrame::Modifications::Modifications
Modifications(GNEProhibitionFrame *prohibitionFrameParent)
constructor
Definition: GNEProhibitionFrame.cpp:147
GNEProhibitionFrame::ProhibitionLegend::getProhibitedColor
const RGBColor & getProhibitedColor() const
get color for waiting connections
Definition: GNEProhibitionFrame.cpp:121
GNEProhibitionFrame::ProhibitionLegend::myUndefinedColor
RGBColor myUndefinedColor
color for non-conflicting pairs of connections
Definition: GNEProhibitionFrame.h:106
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
GNEProhibitionFrame::myProhibitionLegend
ProhibitionLegend * myProhibitionLegend
prohibition legend
Definition: GNEProhibitionFrame.h:184
GNEProhibitionFrame::ProhibitionLegend::getProhibitingColor
const RGBColor & getProhibitingColor() const
get color for connections with precedence
Definition: GNEProhibitionFrame.cpp:127