95 legendLabel->setTipText(
TL(
"Current selected connection"));
102 legendLabel->setTipText(
TL(
"No conflict with the selected connection"));
108 legendLabel->setTipText(
TL(
"Connection yields the selected connection"));
114 legendLabel->setTipText(
TL(
"Connection has right of way with the selected connection"));
120 legendLabel->setTipText(
TL(
"Connection has an unregulated conflict with the selected connection"));
126 legendLabel->setTipText(
TL(
"Connection has a mutual conflict with the selected connection"));
175 mySaveButton->setTipText(
TL(
"Save prohibition modifications (Enter)"));
179 TL(
"Unselect connection"),
200 conn->setSpecialColor(
nullptr);
229 GNEFrame(viewParent, viewNet,
TL(
"Prohibitions")),
279 if (conn !=
nullptr) {
281 myCurrentConn->setSpecialColor(&
myViewNet->getVisualisationSettings().colorSettings.selectedProhibitionColor);
290 std::string currentFoesString = node->
getFoes(currentLinkIndex);
291 std::string currentResponseString = node->
getResponse(currentLinkIndex);
292 std::reverse(currentFoesString.begin(), currentFoesString.end());
293 std::reverse(currentResponseString.begin(), currentResponseString.end());
295 for (
const auto& connection : connections) {
297 NBEdge* otherConnFrom = connection->getEdgeFrom()->getNBEdge();
298 const int linkIndex = node->
getConnectionIndex(otherConnFrom, connection->getNBEdgeConnection());
299 std::string responseString = node->
getResponse(linkIndex);
300 std::reverse(responseString.begin(), responseString.end());
302 bool foes = ((int)currentFoesString.size() > linkIndex) && (currentFoesString[linkIndex] ==
'1');
303 bool forbids = ((int)responseString.size() > currentLinkIndex) && (responseString[currentLinkIndex] ==
'1');
304 bool forbidden = ((int)currentResponseString.size() > linkIndex) && (currentResponseString[linkIndex] ==
'1');
309 connection->setSpecialColor(&
myLegend->getUndefinedColor());
311 if (forbids && forbidden) {
312 connection->setSpecialColor(&
myLegend->getMutualConflictColor());
313 }
else if (forbids) {
314 connection->setSpecialColor(&
myLegend->getProhibitedColor());
315 }
else if (forbidden) {
316 connection->setSpecialColor(&
myLegend->getProhibitingColor());
318 connection->setSpecialColor(&
myLegend->getUnregulatedConflictColor());
FXDEFMAP(GNEProhibitionFrame::Selection) SelectionMap[]
@ MID_CANCEL
Cancel-button pressed.
@ MID_OK
Ok-button pressed.
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
GNEViewNet * getViewNet() const
get view net
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
GNEFrame(GNEViewParent *viewParent, GNEViewNet *viewNet, const std::string &frameLabel)
Constructor.
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
NBNode * getNBNode() const
Return net build node.
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
FXLabel * myConnDescriptionLabel
the label that shows the currently selected connection
RelativeToConnection(GNEProhibitionFrame *prohibitionFrameParent)
constructor
void updateDescription() const
update description
~RelativeToConnection()
destructor
GNEProhibitionFrame * myProhibitionFrameParent
pointer to prohibition frame parent
MFXButtonTooltip * mySaveButton
"Save" button
MFXButtonTooltip * myCancelButton
"Cancel" button
long onCmdOK(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any prohibition modifications.
GNEProhibitionFrame * myProhibitionFrameParent
FOX needs this.
Selection(GNEProhibitionFrame *prohibitionFrameParent)
FOX-declaration.
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
long onCmdRequireConnection(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any prohibition modifications.
GNEProhibitionFrame::Selection * mySelectionModul
Selection.
GNEProhibitionFrame::Legend * myLegend
prohibition legend
void handleProhibitionClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
handle prohibitions and set the relative coloring
RelativeToConnection * myRelativeToConnection
Relative To Connection.
~GNEProhibitionFrame()
Destructor.
void hide()
hide prohibition frame
GNEProhibitionFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
GNEConnection * myCurrentConn
the connection which prohibits
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection module
void show()
show prohibition frame
void buildProhibition(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
FOX needs this.
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
GNEViewParent * getViewParent() const
get the net object
A single child window which contains a view of the simulation area.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIVisualizationColorSettings colorSettings
color settings
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
MFXGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
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