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 /****************************************************************************/
14 // The Widget for remove network-elements
15 /****************************************************************************/
16 #ifndef GNEProhibitionFrame_h
17 #define GNEProhibitionFrame_h
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 
23 #include "GNEFrame.h"
24 
25 // ===========================================================================
26 // class declarations
27 // ===========================================================================
28 class GNEConnection;
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
38 class GNEProhibitionFrame : public GNEFrame {
40  FXDECLARE(GNEProhibitionFrame)
41 
42 public:
43 
45  enum ConnStatus {
49  };
50 
51  // ===========================================================================
52  // class RelativeToConnection
53  // ===========================================================================
54 
55  class RelativeToConnection : protected FXGroupBox {
56 
57  public:
59  RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent);
60 
63 
65  void updateDescription() const;
66 
67  private:
70 
73  };
74 
75  // ===========================================================================
76  // class ProhibitionLegend
77  // ===========================================================================
78 
79  class ProhibitionLegend : protected FXGroupBox {
80 
81  public:
83  ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent);
84 
87 
89  const RGBColor& getUndefinedColor() const;
90 
92  const RGBColor& getProhibitedColor() const;
93 
95  const RGBColor& getProhibitingColor() const;
96 
99 
101  const RGBColor& getMutualConflictColor() const;
102 
103  private:
106 
109 
112 
115 
118  };
119 
120  // ===========================================================================
121  // class Modifications
122  // ===========================================================================
123 
124  class Modifications : protected FXGroupBox {
125 
126  public:
128  Modifications(GNEProhibitionFrame* prohibitionFrameParent);
129 
131  ~Modifications();
132 
133  private:
135  FXButton* mySaveButton;
136 
138  FXButton* myCancelButton;
139  };
140 
145  GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
146 
149 
153  void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
154 
156  void show();
157 
159  void hide();
160 
164  long onCmdOK(FXObject*, FXSelector, void*);
165 
167  long onCmdCancel(FXObject*, FXSelector, void*);
168 
170 
171 protected:
173 
174 
175  void buildProhibition(GNEConnection* conn, bool mayDefinitelyPass, bool allowConflict, bool toggle);
176 
177 private:
180 
183 
186 
189 
191  std::set<GNEConnection*> myConcernedConns;
192 };
193 
194 
195 #endif
196 
197 /****************************************************************************/
198 
GNEProhibitionFrame::PROHIBITING
Definition: GNEProhibitionFrame.h:48
GNEProhibitionFrame::handleProhibitionClick
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
Definition: GNEProhibitionFrame.cpp:190
GNEProhibitionFrame::ProhibitionLegend::getUndefinedColor
const RGBColor & getUndefinedColor() const
get color for non-conflicting pairs of connections
Definition: GNEProhibitionFrame.cpp:114
GNEProhibitionFrame
Definition: GNEProhibitionFrame.h:38
GNEProhibitionFrame::RelativeToConnection::RelativeToConnection
RelativeToConnection(GNEProhibitionFrame *prohibitionFrameParent)
constructor
Definition: GNEProhibitionFrame.cpp:53
GNEProhibitionFrame::ProhibitionLegend::getMutualConflictColor
const RGBColor & getMutualConflictColor() const
get color for mutual conflicts
Definition: GNEProhibitionFrame.cpp:138
GNEProhibitionFrame::ProhibitionLegend::ProhibitionLegend
ProhibitionLegend(GNEProhibitionFrame *prohibitionFrameParent)
constructor
Definition: GNEProhibitionFrame.cpp:81
GNEProhibitionFrame::RelativeToConnection::myConnDescriptionLabel
FXLabel * myConnDescriptionLabel
the label that shows the currently selected connection
Definition: GNEProhibitionFrame.h:72
GNEProhibitionFrame::ConnStatus
ConnStatus
FOX-declaration.
Definition: GNEProhibitionFrame.h:45
GNEProhibitionFrame::ProhibitionLegend::myProhibitingColor
RGBColor myProhibitingColor
color for connections with precedence
Definition: GNEProhibitionFrame.h:111
GNEFrame
Definition: GNEFrame.h:34
GNEViewNet
Definition: GNEViewNet.h:42
GNEProhibitionFrame::Modifications::~Modifications
~Modifications()
destructor
Definition: GNEProhibitionFrame.cpp:163
GNEProhibitionFrame::Modifications::mySaveButton
FXButton * mySaveButton
"Save" button
Definition: GNEProhibitionFrame.h:135
GNEProhibitionFrame::RelativeToConnection::myProhibitionFrameParent
GNEProhibitionFrame * myProhibitionFrameParent
pointer to prohibition frame parent
Definition: GNEProhibitionFrame.h:69
GNEProhibitionFrame::Modifications
Definition: GNEProhibitionFrame.h:124
RGBColor
Definition: RGBColor.h:39
GNEProhibitionFrame::onCmdCancel
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
Definition: GNEProhibitionFrame.cpp:209
GNEProhibitionFrame::myCurrentConn
GNEConnection * myCurrentConn
the connection which prohibits
Definition: GNEProhibitionFrame.h:188
GNEProhibitionFrame::buildProhibition
void buildProhibition(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
build prohibition
Definition: GNEProhibitionFrame.cpp:234
GNEProhibitionFrame::ProhibitionLegend::~ProhibitionLegend
~ProhibitionLegend()
destructor
Definition: GNEProhibitionFrame.cpp:110
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:148
GNEProhibitionFrame::ProhibitionLegend::myProhibitedColor
RGBColor myProhibitedColor
color for waiting connections
Definition: GNEProhibitionFrame.h:108
GNEProhibitionFrame::RelativeToConnection::updateDescription
void updateDescription() const
update description
Definition: GNEProhibitionFrame.cpp:67
GNEProhibitionFrame::~GNEProhibitionFrame
~GNEProhibitionFrame()
Destructor.
Definition: GNEProhibitionFrame.cpp:186
FOX_CONSTRUCTOR
#define FOX_CONSTRUCTOR(classname)
Definition: config.h:13
GNEProhibitionFrame::show
void show()
show prohibition frame
Definition: GNEProhibitionFrame.cpp:197
GNEProhibitionFrame::UNDEFINED
Definition: GNEProhibitionFrame.h:46
GNEProhibitionFrame::RelativeToConnection
Definition: GNEProhibitionFrame.h:55
GNEProhibitionFrame::RelativeToConnection::~RelativeToConnection
~RelativeToConnection()
destructor
Definition: GNEProhibitionFrame.cpp:63
GNEProhibitionFrame::PROHIBITED
Definition: GNEProhibitionFrame.h:47
GNEProhibitionFrame::myConcernedConns
std::set< GNEConnection * > myConcernedConns
the set of connections which
Definition: GNEProhibitionFrame.h:191
GNEProhibitionFrame::Modifications::myCancelButton
FXButton * myCancelButton
"Cancel" button
Definition: GNEProhibitionFrame.h:138
GNEProhibitionFrame::GNEProhibitionFrame
GNEProhibitionFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEProhibitionFrame.cpp:169
GNEProhibitionFrame::hide
void hide()
hide prohibition frame
Definition: GNEProhibitionFrame.cpp:203
GNEProhibitionFrame::ProhibitionLegend::getUnregulatedConflictColor
const RGBColor & getUnregulatedConflictColor() const
get color for unregulated conflicts
Definition: GNEProhibitionFrame.cpp:132
GNEProhibitionFrame::ProhibitionLegend::myMutualConflictColor
RGBColor myMutualConflictColor
color for mutual conflicts
Definition: GNEProhibitionFrame.h:117
GNEProhibitionFrame::onCmdOK
long onCmdOK(FXObject *, FXSelector, void *)
Definition: GNEProhibitionFrame.cpp:225
GNEConnection
Definition: GNEConnection.h:38
GNEProhibitionFrame::ProhibitionLegend::myUnregulatedConflictColor
RGBColor myUnregulatedConflictColor
color for unregulated conflicts
Definition: GNEProhibitionFrame.h:114
GNEProhibitionFrame::myRelativeToConnection
RelativeToConnection * myRelativeToConnection
Relative To Connection.
Definition: GNEProhibitionFrame.h:179
GNEProhibitionFrame::myModifications
Modifications * myModifications
Modifications.
Definition: GNEProhibitionFrame.h:185
GNEFrame.h
GNEProhibitionFrame::ProhibitionLegend
Definition: GNEProhibitionFrame.h:79
GNEProhibitionFrame::Modifications::Modifications
Modifications(GNEProhibitionFrame *prohibitionFrameParent)
constructor
Definition: GNEProhibitionFrame.cpp:146
GNEProhibitionFrame::ProhibitionLegend::getProhibitedColor
const RGBColor & getProhibitedColor() const
get color for waiting connections
Definition: GNEProhibitionFrame.cpp:120
GNEProhibitionFrame::ProhibitionLegend::myUndefinedColor
RGBColor myUndefinedColor
color for non-conflicting pairs of connections
Definition: GNEProhibitionFrame.h:105
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
GNEProhibitionFrame::myProhibitionLegend
ProhibitionLegend * myProhibitionLegend
prohibition legend
Definition: GNEProhibitionFrame.h:182
GNEProhibitionFrame::ProhibitionLegend::getProhibitingColor
const RGBColor & getProhibitingColor() const
get color for connections with precedence
Definition: GNEProhibitionFrame.cpp:126