72 myCurrentJunctionLabel =
new FXLabel(
this,
"No junction selected", 0,
GUIDesignLabelLeft);
81 if (junctionID.empty()) {
94 myCrossingFrameParent(crossingFrameParent),
128 if (i->isAttributeCarrierSelected()) {
156 for (
auto j : i->getLanes()) {
157 j->setSpecialColor(
nullptr);
194 myCurrentParametersValid(true) {
195 FXHorizontalFrame* crossingParameter =
nullptr;
276 if (currentJunction !=
nullptr) {
280 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
282 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->
getID());
283 if (itFinder == crossingEdges.end()) {
284 crossingEdges.push_back(edge->
getID());
286 crossingEdges.erase(itFinder);
306 std::vector<std::string> crossingEdges;
309 crossingEdges.push_back(i->getID());
320 std::vector<std::string> crossingEdges;
322 if (i->isAttributeCarrierSelected()) {
323 crossingEdges.push_back(i->getID());
334 std::vector<NBEdge*> NBEdgeVector;
337 NBEdgeVector.push_back(i->getNBEdge());
361 return GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text());
369 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
373 for (
auto i : crossingEdges) {
377 if (edge ==
nullptr) {
404 for (
auto j : i->getLanes()) {
408 for (
auto j : i->getLanes()) {
417 if (crossingEdges.empty()) {
429 if (GNEAttributeCarrier::canParse<double>(
myCrossingWidth->getText().text()) &&
430 GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text()) > 0) {
483 WRITE_WARNING(
"There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
504 GNEFrame(horizontalFrameParent, viewNet,
"Crossings") {
519 FXLabel* colorCandidateLabel =
new FXLabel(groupBoxLegend,
"Candidate", 0,
GUIDesignLabelLeft);
521 FXLabel* colorSelectedLabel =
new FXLabel(groupBoxLegend,
"Selected", 0,
GUIDesignLabelLeft);
static const PositionVector EMPTY
empty Vector
~CurrentJunction()
destructor
const RGBColor & getEdgeCandidateColor() const
get edge candidate color
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
~EdgesSelector()
destructor
clear selection of elements
void invertEdges(GNEJunction *parentJunction)
invert edges
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
FXLabel * myCrossingPriorityLabel
Label for Priority.
invert selection of eleents
bool isCurrentParametersValid() const
check if current parameters are valid
void update() const
Mark the entire GNEViewNet to be repainted later.
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
bool isCrossingParametersEnabled() const
check if currently the CrossingParameters is enabled
void markEdge(GNEEdge *edge)
mark or dismark edge
void clearEdges()
clear edges
GNECrossingFrame::CurrentJunction * myCurrentJunction
current junction modul
FXLabel * myCurrentJunctionLabel
Label for current Junction.
FXLabel * myCrossingWidthLabel
Label for width.
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
FXButton * myCreateCrossingButton
FXButton for create Crossing
const RGBColor & getEdgeCandidateSelectedColor() const
get selected color
void updateCurrentJunctionLabel(const std::string &junctionID)
set current junction label
CrossingParameters()
FOX needs this.
std::vector< NBEdge * > getCrossingEdges() const
get crossing NBedges
FXButton * myHelpCrossingAttribute
button for help
GNEJunction * myCurrentJunction
current Junction
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
GNEViewNet * getViewNet() const
get view net
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
#define WRITE_WARNING(msg)
CreateCrossing()
FOX needs this.
void hide()
hide crossing frame
GNEJunction * getCurrentJunction() const
get current junction
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
GNEViewNet * myViewNet
View Net.
void enableCrossingParameters(bool hasTLS)
enable crossing parameters and set the default value of parameters
~CreateCrossing()
destructor
FXTextField * myCrossingEdges
TextField for edges.
bool isTLControlled() const
Returns whether this node is controlled by any tls.
GNEUndoList * getUndoList() const
get the undoList object
bool getCrossingPriority() const
get crossing priority
C++ TraCI client API implementation.
FXButton * myInvertEdgesSelection
button for invert selection
#define GUIDesignTextField
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
void disableEdgeSelector()
disable edgeSelector
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn't)
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
void setCreateCrossingButton(bool value)
enable or disable button create crossing
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
class used to group all variables related with objects under cursor after a click over view ...
FXButton * myClearEdgesSelection
button for clear selection
FXButton * myUseSelectedEdges
CheckBox for selected edges.
FXTextField * myCrossingWidth
TextField for width.
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
FXLabel * myCrossingEdgesLabel
Label for edges.
const std::string getID() const
function to support debugging
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
~GNECrossingFrame()
Destructor.
GNECrossingFrame::CrossingParameters * myCrossingParameters
crossing parameters modul
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
~CrossingParameters()
destructor
begin/end of the description of an edge
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
A road/street connecting two junctions (netedit-version)
#define GUIDesignTextFieldNCol
Num of column of text field.
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
void restoreEdgeColors()
restore colors of all edges
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
void disableCrossingParameters()
disable crossing parameters and clear parameters
GNECrossingFrame * myCrossingFrameParent
pointer to crossingFrame parent
GNECrossingFrame()
FOX needs this.
crossing between edges for pedestrians
virtual void hide()
hide Frame
GNENet * getNet() const
get the net object
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to doubles/floats
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
bool myCurrentParametersValid
flag to check if current parameters are valid
void openHelpAttributesDialog(const GNEAttributeCarrier::TagProperties &tagProperties) const
Open help attributes dialog.
#define GUIDesignLabelLeft
EdgesSelector()
FOX needs this.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
NBNode * getNBNode() const
Return net build node.
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
double getCrossingWidth() const
get crossing width
FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[]