83 if (junctionID.empty()) {
127 if (edge->isAttributeCarrierSelected()) {
155 edge->resetCandidateFlags();
185 FXHorizontalFrame* crossingParameter =
nullptr;
272 if (currentJunction !=
nullptr) {
278 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->
getID());
279 if (itFinder == crossingEdges.end()) {
280 crossingEdges.push_back(edge->
getID());
282 crossingEdges.erase(itFinder);
302 std::vector<std::string> crossingEdges;
304 if (edge->isAttributeCarrierSelected()) {
305 crossingEdges.push_back(edge->getID());
316 std::vector<NBEdge*> NBEdgeVector;
319 NBEdgeVector.push_back(edge->getNBEdge());
356 for (
const auto& crossingEdgeID : crossingEdgeIDs) {
359 if (edge ==
nullptr) {
382 if (currentJunction) {
384 for (
const auto& edge :
myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {
386 edge->resetCandidateFlags();
388 edge->setPossibleCandidate(
true);
393 selected.push_back(e->getNBEdge());
395 for (
const auto& edge :
myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {
397 edge->resetCandidateFlags();
400 edge->setTargetCandidate(
true);
403 newCandidates.push_back(edge->getNBEdge());
405 edge->setInvalidCandidate(
true);
407 edge->setPossibleCandidate(
true);
416 if (crossingEdgeIDs.empty()) {
480 myCrossingFrameParent->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->enableCheckBoxDisablePedestrians();
482 WRITE_WARNING(
TL(
"There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed."));
528 GNEFrame(viewParent, viewNet,
TL(
"Crossings")) {
FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_CLEARSELECTION
clear selection of elements
@ MID_GNE_USESELECTED
use selected elements
@ MID_GNE_CREATE
create element
@ MID_GNE_SELECT
select element
#define GUIDesignTextColorRed
red color (for invalid text)
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
#define GUIDesignLabel(justify)
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignTextColorBlack
black color (for correct text)
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
#define WRITE_WARNING(msg)
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const std::string invalid_return< std::string >::value
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_ATTR_EDGES
the edges of a route
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string getID() const override
get ID (all Attribute Carriers have one)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
bool isInvalidCandidate() const
check if this element is a invalid candidate
void setCreateCrossingButton(bool value)
enable or disable button create crossing
CreateCrossing(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
~CreateCrossing()
destructor
FXButton * myCreateCrossingButton
@field FXButton for create Crossing
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
GNECrossingFrame * myCrossingFrameParent
FOX needs this.
void enableCrossingParameters(bool hasTLS)
enable crossing parameters and set the default value of parameters
std::vector< NBEdge * > getCrossingEdges() const
get crossing NBedges
double getCrossingWidth() const
get crossing width
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
FXLabel * myCrossingWidthLabel
Label for width.
void markEdge(GNEEdge *edge)
mark or dismark edge
bool getCrossingPriority() const
get crossing priority
CrossingParameters(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
void disableCrossingParameters()
disable crossing parameters and clear parameters
FXTextField * myCrossingWidth
TextField for width.
bool myCurrentParametersValid
flag to check if current parameters are valid
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
bool isCrossingParametersEnabled() const
check if currently the CrossingParameters is enabled
FXButton * myHelpCrossingAttribute
button for help
FXTextField * myCrossingEdges
TextField for edges.
GNECrossingFrame * myCrossingFrameParent
FOX needs this.
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
void clearEdges()
clear edges
FXLabel * myCrossingEdgesLabel
Label for edges.
bool isCurrentParametersValid() const
check if current parameters are valid
FXLabel * myCrossingPriorityLabel
Label for Priority.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
~CrossingParameters()
destructor
GNECrossingFrame * myCrossingFrameParent
FOX needs this.
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
EdgesSelector(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
~EdgesSelector()
destructor
GNEJunction * getCurrentJunction() const
get current junction
FXButton * myClearEdgesSelection
button for clear selection
void restoreEdgeColors()
restore colors of all edges
GNEJunction * myCurrentJunction
current Junction
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
void disableEdgeSelector()
disable edgeSelector
FXButton * myUseSelectedEdges
CheckBox for selected edges.
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
GNECrossingFrame::Information * myInformation
information modul
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
~GNECrossingFrame()
Destructor.
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
GNECrossingFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void hide()
hide crossing frame
GNECrossingFrame::CrossingParameters * myCrossingParameters
crossing parameters modul
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
GNECrossingFrame::EdgesSelector * getEdgesSelector() const
get edge selector modul
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
GNECrossingFrame::JunctionInformation * myJunctionInformation
FOX need this.
GNEViewNet * getViewNet() const
get view net
GNEViewNet * myViewNet
FOX need this.
virtual void hide()
hide Frame
GNEFrame(GNEViewParent *viewParent, GNEViewNet *viewNet, const std::string &frameLabel)
Constructor.
const GNEHierarchicalContainerChildren< GNEEdge * > & getChildEdges() const
get child edges
NBNode * getNBNode() const
Return net build node.
class used to group all variables related with objects under cursor after a click over view
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
A single child window which contains a view of the simulation area.
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
A list item which allows for custom coloring.
MFXGroupBoxModule (based on FXGroupBox).
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
int checkCrossing(EdgeVector candidates, bool checkOnly=false)
bool isTLControlled() const
Returns whether this node is controlled by any tls.
static const PositionVector EMPTY
empty Vector
static const RGBColor WHITE
static const RGBColor invalid
color for invalid elements
static const RGBColor target
color for selected candidate target
static const RGBColor possible
color for possible candidate element