42 FXIMPLEMENT(
GNEProhibitionFrame, FXVerticalFrame, GNEProhibitionFrameMap, ARRAYNUMBER(GNEProhibitionFrameMap))
54 myProhibitionFrameParent(prohibitionFrameParent) {
68 if (myProhibitionFrameParent->myCurrentConn ==
nullptr) {
69 myConnDescriptionLabel->setText(
"No Connection selected\n");
71 myConnDescriptionLabel->setText((
"from lane " + myProhibitionFrameParent->myCurrentConn->getLaneFrom()->getMicrosimID() +
72 "\nto lane " + myProhibitionFrameParent->myCurrentConn->getLaneTo()->getMicrosimID()).c_str());
83 myProhibitedColor(
RGBColor(0, 179, 0)),
85 myUnregulatedConflictColor(
RGBColor::ORANGE),
86 myMutualConflictColor(
RGBColor::CYAN) {
114 return myUndefinedColor;
120 return myProhibitedColor;
126 return myProhibitingColor;
132 return myUnregulatedConflictColor;
138 return myMutualConflictColor;
149 mySaveButton =
new FXButton(
this,
"OK\t\tSave prohibition modifications (Enter)",
153 myCancelButton =
new FXButton(
this,
"Cancel\t\tDiscard prohibition modifications (Esc)",
169 GNEFrame(horizontalFrameParent, viewNet,
"Prohibits"),
211 conn->setSpecialColor(
nullptr);
245 std::string currentFoesString = node->
getFoes(currentLinkIndex);
246 std::string currentResponseString = node->
getResponse(currentLinkIndex);
247 std::reverse(currentFoesString.begin(), currentFoesString.end());
248 std::reverse(currentResponseString.begin(), currentResponseString.end());
250 for (
const auto& i : allConns) {
252 NBEdge* otherConnFrom = i->getEdgeFrom()->getNBEdge();
253 const int linkIndex = node->
getConnectionIndex(otherConnFrom, i->getNBEdgeConnection());
254 std::string responseString = node->
getResponse(linkIndex);
255 std::reverse(responseString.begin(), responseString.end());
257 bool foes = ((int)currentFoesString.size() > linkIndex) && (currentFoesString[linkIndex] ==
'1');
258 bool forbids = ((int)responseString.size() > currentLinkIndex) && (responseString[currentLinkIndex] ==
'1');
259 bool forbidden = ((int)currentResponseString.size() > linkIndex) && (currentResponseString[linkIndex] ==
'1');
266 if (forbids && forbidden) {
268 }
else if (forbids) {
270 }
else if (forbidden) {
FXDEFMAP(GNEProhibitionFrame) GNEProhibitionFrameMap[]
@ MID_CANCEL
Cancel-button pressed.
@ MID_OK
Ok-button pressed.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
void setSpecialColor(const RGBColor *Color2)
NBEdge * getNBEdge() const
returns the internal NBEdge
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
GNEViewNet * myViewNet
View Net.
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
virtual void show()
show Frame
virtual void hide()
hide Frame
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
NBNode * getNBNode() const
Return net build node.
Modifications(GNEProhibitionFrame *prohibitionFrameParent)
constructor
FXButton * myCancelButton
"Cancel" button
~Modifications()
destructor
FXButton * mySaveButton
"Save" button
const RGBColor & getUndefinedColor() const
get color for non-conflicting pairs of connections
RGBColor myUndefinedColor
color for non-conflicting pairs of connections
~ProhibitionLegend()
destructor
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
void updateDescription() const
update description
~RelativeToConnection()
destructor
RelativeToConnection * myRelativeToConnection
Relative To Connection.
~GNEProhibitionFrame()
Destructor.
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
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed modul
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
GUIVisualizationColorSettings colorSettings
color settings
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
The representation of a single edge during network building.
Represents a single node (junction) during network building.
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
const std::string getResponse(int linkIndex) const
get the 'response' string (right-of-way bit set) of the right-of-way logic
const std::string getFoes(int linkIndex) const
get the 'foes' string (conflict bit set) of the right-of-way logic
static const RGBColor WHITE
RGBColor selectedProhibitionColor
prohibition selection color