56 myProhibitionFrameParent(prohibitionFrameParent) {
70 if (myProhibitionFrameParent->myCurrentConn ==
nullptr) {
71 myConnDescriptionLabel->setText(
TL(
"No Connection selected\n"));
73 myConnDescriptionLabel->setText(
74 (
TL(
"- Junction: ") + myProhibitionFrameParent->myCurrentConn->getEdgeFrom()->getToJunction()->getID() +
"\n" +
75 TL(
"- From lane: ") + myProhibitionFrameParent->myCurrentConn->getLaneFrom()->getMicrosimID() +
"\n" +
76 TL(
"- To lane: ") + myProhibitionFrameParent->myCurrentConn->getLaneTo()->getMicrosimID()).c_str());
87 myProhibitedColor(
RGBColor(0, 179, 0)),
89 myUnregulatedConflictColor(
RGBColor::ORANGE),
90 myMutualConflictColor(
RGBColor::CYAN) {
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"));
136 return myUndefinedColor;
142 return myProhibitedColor;
148 return myProhibitingColor;
154 return myUnregulatedConflictColor;
160 return myMutualConflictColor;
169 myProhibitionFrameParent(prohibitionFrameParent) {
175 mySaveButton->setTipText(
TL(
"Save prohibition modifications (Enter)"));
179 TL(
"Unselect connection"),
198 if (myProhibitionFrameParent->myCurrentConn !=
nullptr) {
199 for (
const auto& conn : myProhibitionFrameParent->myConcernedConns) {
200 conn->setSpecialColor(
nullptr);
202 myProhibitionFrameParent->myCurrentConn->setSpecialColor(
nullptr);
203 myProhibitionFrameParent->myCurrentConn =
nullptr;
204 myProhibitionFrameParent->myConcernedConns.clear();
205 myProhibitionFrameParent->myRelativeToConnection->updateDescription();
206 myProhibitionFrameParent->myViewNet->updateViewNet();
214 if (myProhibitionFrameParent->myCurrentConn) {
215 mySaveButton->enable();
216 myCancelButton->enable();
218 mySaveButton->disable();
219 myCancelButton->disable();
229 GNEFrame(viewParent, viewNet,
TL(
"Prohibitions")),
279 if (conn !=
nullptr) {
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');
311 if (forbids && forbidden) {
313 }
else if (forbids) {
315 }
else if (forbidden) {
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...
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
GNEJunction * getToJunction() const
get from Junction (only used to increase readability)
GNEViewNet * getViewNet() const
get view net
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
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
void updateDescription() const
update description
~RelativeToConnection()
destructor
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.
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
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
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
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
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