66 FXIMPLEMENT(
GNECrossingFrame, FXVerticalFrame, GNECrossingMap, ARRAYNUMBER(GNECrossingMap))
86 myCrossingFrameParent(crossingFrameParent),
87 myCurrentJunction(0) {
120 if (i->isAttributeCarrierSelected()) {
148 for (
auto j : i->getLanes()) {
149 j->setSpecialColor(0);
186 myCurrentParametersValid(true) {
187 FXHorizontalFrame* crossingParameter = NULL;
271 if (currentJunction != NULL) {
275 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
277 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->
getID());
278 if (itFinder == crossingEdges.end()) {
279 crossingEdges.push_back(edge->
getID());
281 crossingEdges.erase(itFinder);
301 std::vector<std::string> crossingEdges;
304 crossingEdges.push_back(i->getID());
315 std::vector<std::string> crossingEdges;
317 if (i->isAttributeCarrierSelected()) {
318 crossingEdges.push_back(i->getID());
329 std::vector<NBEdge*> NBEdgeVector;
332 NBEdgeVector.push_back(i->getNBEdge());
356 return GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text());
376 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
380 for (
auto i : crossingEdges) {
411 for (
auto j : i->getLanes()) {
415 for (
auto j : i->getLanes()) {
424 if (crossingEdges.empty()) {
436 if (GNEAttributeCarrier::canParse<double>(
myCrossingWidth->getText().text()) &&
437 GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text()) > 0) {
462 GNEFrame(horizontalFrameParent, viewNet,
"Crossings") {
511 if (currentJunction != NULL) {
519 }
else if (selectedEdge != NULL) {
521 }
else if (selectedLane != NULL) {
552 WRITE_WARNING(
"There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
static const PositionVector EMPTY
empty Vector
void setCreateCrossingButton(bool value)
enable or disable button create edges
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
edgesSelector()
FOX needs this.
clear selection of elements
FXGroupBox * myGroupBoxLegend
groupbox for Legend
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
const RGBColor & getSelectedColor() const
get selected color
invert selection of eleents
FXGroupBox * myGroupBoxButtons
groupbox for buttons
FXLabel * myCurrentJunctionLabel
Label for current Junction.
FXLabel * myColorCandidateLabel
Label for color candidate.
FXLabel * myCrossingWidthLabel
Label for width.
void clearEdges()
clear edges
void disableEdgeSelector()
disable edgeSelector
bool myCurrentParametersValid
flag to check if current parameters are valid
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
const RGBColor & getCandidateColor() const
get candidate color
void enableCrossingParameters(bool hasTLS)
enable crossing parameters and set the default value of parameters
GNECrossingFrame::crossingParameters * myCrossingParameters
crossing parameters
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
void markEdge(GNEEdge *edge)
mark or dismark edge
void restoreEdgeColors()
restore colors of all edges
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEJunction * getCurrentJunction() const
get current junction
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
FXButton * myInvertEdgesSelection
button for invert selection
void openHelpAttributesDialog(SumoXMLTag tag) const
Open help attributes dialog.
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
GNEViewNet * getViewNet() const
get view net
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
#define WRITE_WARNING(msg)
FXGroupBox * myGroupBoxLabel
groupbox for the junction label
bool isCurrentParametersValid() const
check if current parameters are valid
void hide()
hide crossing frame
GNEViewNet * myViewNet
View Net for changes.
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
bool isTLControlled() const
Returns whether this node is controlled by any tls.
GNEUndoList * getUndoList() const
get the undoList object
static const RGBColor GREEN
#define GUIDesignTextField
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
GNEEdge & getParentEdge()
Returns underlying parent edge.
FXLabel * myCrossingPriorityLabel
Label for Priority.
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
~edgesSelector()
destructor
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
GNEJunction * myCurrentJunction
current Junction
crossingParameters()
FOX needs this.
static RGBColor myCandidateColor
color for candidate edges
bool addCrossing(GNENetElement *netElement)
add Crossing element
static RGBColor mySelectedColor
color for selected edges
long onCmdSetAttribute(FXObject *, FXSelector, void *)
const std::string getID() const
function to support debugging
GNECrossingFrame::edgesSelector * myEdgeSelector
edge selector
~GNECrossingFrame()
Destructor.
bool getCrossingPriority() const
get crossing priority
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
begin/end of the description of an edge
A road/street connecting two junctions (netedit-version)
FXDEFMAP(GNECrossingFrame) GNECrossingMap[]
#define GUIDesignTextFieldNCol
Num of column of text field.
GNECrossingFrame::edgesSelector * getEdgeSelector() const
get edge selector
FXTextField * myCrossingEdges
TextField for edges.
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
FXLabel * myCrossingEdgesLabel
Label for edges.
~crossingParameters()
destructor
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
void disableCrossingParameters()
disable crossing parameters and clear parameters
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
bool isCrossingParametersEnabled() const
check if currently the crossingParameters is enabled
FXTextField * myCrossingWidth
TextField for width.
GNECrossingFrame()
FOX needs this.
crossing between edges for pedestrians
virtual void hide()
hide Frame
FXButton * myUseSelectedEdges
CheckBox for selected edges.
GNENet * getNet() const
get the net object
void invertEdges(GNEJunction *parentJunction)
invert edges
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
FXLabel * myColorSelectedLabel
Label for color selected.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
FXButton * myHelpCrossingAttribute
button for help
static const TagValues & getTagProperties(SumoXMLTag tag)
get Tag Properties
#define GUIDesignLabelLeft
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
std::vector< NBEdge * > getCrossingEdges() const
get crossing NBedges
NBNode * getNBNode() const
Return net build node.
FXButton * myCreateCrossingButton
FXButton for create Crossing
FXButton * myClearEdgesSelection
button for clear selection
double getCrossingWidth() const
get crossing width
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)