44 FXIMPLEMENT(
GNEProhibitionFrame, FXVerticalFrame, GNEProhibitionFrameMap, ARRAYNUMBER(GNEProhibitionFrameMap))
61 GNEFrame(horizontalFrameParent, viewNet,
"Prohibits"), myCurrentConn(nullptr) {
98 myCancelButton =
new FXButton(
this,
"Cancel\t\tDiscard prohibition modifications (Esc)",
142 conn->setSpecialColor(
nullptr);
146 myConcernedConns.clear();
167 std::string currentFoesString = node->
getFoes(currentLinkIndex);
168 std::string currentResponseString = node->
getResponse(currentLinkIndex);
169 std::reverse(currentFoesString.begin(), currentFoesString.end());
170 std::reverse(currentResponseString.begin(), currentResponseString.end());
172 for (
auto i : allConns) {
174 NBEdge* otherConnFrom = i->getEdgeFrom()->getNBEdge();
175 const int linkIndex = node->
getConnectionIndex(otherConnFrom, i->getNBEdgeConnection());
176 std::string responseString = node->
getResponse(linkIndex);
177 std::reverse(responseString.begin(), responseString.end());
179 bool foes = (int)currentFoesString.size() > linkIndex && currentFoesString[linkIndex] ==
'1';
180 bool forbids = (int)responseString.size() > currentLinkIndex && responseString[currentLinkIndex] ==
'1';
181 bool forbidden = (int)currentResponseString.size() > linkIndex && currentResponseString[linkIndex] ==
'1';
188 if (forbids && forbidden) {
190 }
else if (forbids) {
192 }
else if (forbidden) {
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
const KeyPressed & getKeyPressed() const
get Key Pressed modul
RGBColor selectedConnectionColor
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
static const RGBColor WHITE
FXDEFMAP(GNEProhibitionFrame) GNEProhibitionFrameMap[]
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
The representation of a single edge during network building.
FXGroupBox * myGroupBoxDescription
Groupbox for description.
static const RGBColor ORANGE
static RGBColor undefinedColor
color for non-conflicting pairs of connections
static RGBColor mutualConflictColor
color for mutual conflicts
static RGBColor unregulatedConflictColor
color for unregulated conflicts
void setSpecialColor(const RGBColor *Color2)
GNELane * getLaneFrom() const
get lane of the incoming lane
GNEViewNet * myViewNet
View Net for changes.
void updateDescription() const
update description
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
std::set< GNEConnection * > myConcernedConns
the set of connections which
FXLabel * myProhibitingLabel
"prohibiting" label
static const RGBColor GREY
FXGroupBox * myGroupBoxLegend
group box for legend
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
static RGBColor prohibitingColor
color for connections with precedence
GNELane * getLaneTo() const
get lane of the outgoing lane
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
GNEConnection * myCurrentConn
"OK" button
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
bool controlKeyPressed() const
check if CONTROL key was pressed during click
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
FXLabel * myConnDescriptionLabel
the label that shows the currently selected connection
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
GNEProhibitionFrame()
FOX needs this.
FXButton * myCancelButton
"Cancel" button
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
FXLabel * mySelectedLabel
selected connection label
FXLabel * myUndefinedLabel
"undefined" yielding label
long onCmdOK(FXObject *, FXSelector, void *)
static const RGBColor RED
named colors
~GNEProhibitionFrame()
Destructor.
virtual void show()
show Frame
static const RGBColor CYAN
void handleProhibitionClick(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
const std::string getFoes(int linkIndex) const
virtual void hide()
hide Frame
static RGBColor selectedColor
color for selected connection whose prohibition shall be shown
static RGBColor prohibitedColor
color for waiting connections
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Represents a single node (junction) during network building.
const std::string getResponse(int linkIndex) const
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn't)
NBEdge * getNBEdge()
returns the internal NBEdge
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
NBNode * getNBNode() const
Return net build node.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXLabel * myProhibitedLabel
"prohibited" label
void hide()
hide prohibition frame
void buildProhibition(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
build prohibition