 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
43 FXIMPLEMENT(
GNEProhibitionFrame, FXVerticalFrame, GNEProhibitionFrameMap, ARRAYNUMBER(GNEProhibitionFrameMap))
55 myProhibitionFrameParent(prohibitionFrameParent) {
69 if (myProhibitionFrameParent->myCurrentConn ==
nullptr) {
70 myConnDescriptionLabel->setText(
"No Connection selected\n");
72 myConnDescriptionLabel->setText((
"from lane " + myProhibitionFrameParent->myCurrentConn->getLaneFrom()->getMicrosimID() +
73 "\nto lane " + myProhibitionFrameParent->myCurrentConn->getLaneTo()->getMicrosimID()).c_str());
84 myProhibitedColor(
RGBColor(0, 179, 0)),
86 myUnregulatedConflictColor(
RGBColor::ORANGE),
87 myMutualConflictColor(
RGBColor::CYAN) {
115 return myUndefinedColor;
121 return myProhibitedColor;
127 return myProhibitingColor;
133 return myUnregulatedConflictColor;
139 return myMutualConflictColor;
150 mySaveButton =
new FXButton(
this,
"OK\t\tSave prohibition modifications (Enter)",
154 myCancelButton =
new FXButton(
this,
"Cancel\t\tDiscard prohibition modifications (Esc)",
170 GNEFrame(horizontalFrameParent, viewNet,
"Prohibits"),
212 conn->setSpecialColor(
nullptr);
246 std::string currentFoesString = node->
getFoes(currentLinkIndex);
247 std::string currentResponseString = node->
getResponse(currentLinkIndex);
248 std::reverse(currentFoesString.begin(), currentFoesString.end());
249 std::reverse(currentResponseString.begin(), currentResponseString.end());
251 for (
const auto& i : allConns) {
253 NBEdge* otherConnFrom = i->getEdgeFrom()->getNBEdge();
254 const int linkIndex = node->
getConnectionIndex(otherConnFrom, i->getNBEdgeConnection());
255 std::string responseString = node->
getResponse(linkIndex);
256 std::reverse(responseString.begin(), responseString.end());
258 bool foes = ((int)currentFoesString.size() > linkIndex) && (currentFoesString[linkIndex] ==
'1');
259 bool forbids = ((int)responseString.size() > currentLinkIndex) && (responseString[currentLinkIndex] ==
'1');
260 bool forbidden = ((int)currentResponseString.size() > linkIndex) && (currentResponseString[linkIndex] ==
'1');
267 if (forbids && forbidden) {
269 }
else if (forbids) {
271 }
else if (forbidden) {
const std::string getResponse(int linkIndex) const
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
const RGBColor & getUndefinedColor() const
get color for non-conflicting pairs of connections
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
const RGBColor & getMutualConflictColor() const
get color for mutual conflicts
ProhibitionLegend(GNEProhibitionFrame *prohibitionFrameParent)
constructor
bool controlKeyPressed() const
check if CONTROL key was pressed during click
RGBColor myProhibitingColor
color for connections with precedence
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
~Modifications()
destructor
FXButton * mySaveButton
"Save" button
@ MID_CANCEL
Cancel-button pressed.
void update() const
Mark the entire GNEViewNet to be repainted later.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
RGBColor selectedProhibitionColor
prohibition selection color
The representation of a single edge during network building.
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
NBNode * getNBNode() const
Return net build node.
void setSpecialColor(const RGBColor *Color2)
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
GNEConnection * myCurrentConn
the connection which prohibits
void buildProhibition(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
build prohibition
~ProhibitionLegend()
destructor
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
NBEdge * getNBEdge() const
returns the internal NBEdge
class used to group all variables related with objects under cursor after a click over view
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
RGBColor myProhibitedColor
color for waiting connections
@ MID_OK
Ok-button pressed.
void updateDescription() const
update description
~GNEProhibitionFrame()
Destructor.
const GNEViewNetHelper::KeyPressed & getKeyPressed() const
get Key Pressed modul
GNEViewNet * myViewNet
View Net.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
void show()
show prohibition frame
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn't)
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
~RelativeToConnection()
destructor
GUIVisualizationColorSettings colorSettings
color settings
std::set< GNEConnection * > myConcernedConns
the set of connections which
FXButton * myCancelButton
"Cancel" button
GNEProhibitionFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void hide()
hide prohibition frame
FXDEFMAP(GNEProhibitionFrame) GNEProhibitionFrameMap[]
const RGBColor & getUnregulatedConflictColor() const
get color for unregulated conflicts
RGBColor myMutualConflictColor
color for mutual conflicts
long onCmdOK(FXObject *, FXSelector, void *)
RGBColor myUnregulatedConflictColor
color for unregulated conflicts
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Represents a single node (junction) during network building.
RelativeToConnection * myRelativeToConnection
Relative To Connection.
Modifications * myModifications
Modifications.
virtual void show()
show Frame
Modifications(GNEProhibitionFrame *prohibitionFrameParent)
constructor
const RGBColor & getProhibitedColor() const
get color for waiting connections
RGBColor myUndefinedColor
color for non-conflicting pairs of connections
const std::string getFoes(int linkIndex) const
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
virtual void hide()
hide Frame
ProhibitionLegend * myProhibitionLegend
prohibition legend
static const RGBColor WHITE
const RGBColor & getProhibitingColor() const
get color for connections with precedence