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