77 FXIMPLEMENT(
GNECrossingFrame, FXVerticalFrame, GNECrossingMap, ARRAYNUMBER(GNECrossingMap))
97 myCrossingFrameParent(crossingFrameParent),
98 myCurrentJunction(0) {
164 for (
auto j : i->getLanes()) {
165 j->setSpecialColor(0);
211 myCurrentParametersValid(true) {
212 FXHorizontalFrame* crossingParameter = NULL;
289 if (currentJunction != NULL) {
293 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
295 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->
getID());
296 if (itFinder == crossingEdges.end()) {
297 crossingEdges.push_back(edge->
getID());
299 crossingEdges.erase(itFinder);
319 std::vector<std::string> crossingEdges;
322 crossingEdges.push_back(i->getID());
333 std::vector<std::string> crossingEdges;
336 crossingEdges.push_back(i->getID());
347 std::vector<NBEdge*> NBEdgeVector;
350 NBEdgeVector.push_back(i->getNBEdge());
374 return GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text());
394 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
398 for (
auto i : crossingEdges) {
429 for (
auto j : i->getLanes()) {
433 for (
auto j : i->getLanes()) {
442 if (crossingEdges.empty()) {
454 if (GNEAttributeCarrier::canParse<double>(
myCrossingWidth->getText().text()) &&
455 GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text()) > 0) {
474 FXTable* myTable =
new FXTable(helpDialog,
this,
MID_TABLE, TABLE_READONLY);
476 myTable->setVisibleColumns(3);
478 myTable->setBackColor(FXRGB(255, 255, 255));
479 myTable->setColumnText(0,
"Name");
480 myTable->setColumnText(1,
"Value");
481 myTable->setColumnText(2,
"Definition");
482 myTable->getRowHeader()->setWidth(0);
483 FXHeader* header = myTable->getColumnHeader();
484 header->setItemJustify(0, JUSTIFY_CENTER_X);
485 header->setItemSize(0, 120);
486 header->setItemJustify(1, JUSTIFY_CENTER_X);
487 header->setItemSize(1, 80);
488 int maxSizeColumnDefinitions = 0;
493 myTable->setItem(i, 0,
new FXTableItem(
toString(attr).c_str()));
495 FXTableItem* type =
new FXTableItem(
"");
497 type->setText(
"int");
499 type->setText(
"float");
501 type->setText(
"time");
503 type->setText(
"bool");
505 type->setText(
"string");
507 type->setJustify(FXTableItem::CENTER_X);
508 myTable->setItem(i, 1, type);
511 definition->setJustify(FXTableItem::LEFT);
512 myTable->setItem(i, 2, definition);
518 header->setItemJustify(2, JUSTIFY_CENTER_X);
519 header->setItemSize(2, maxSizeColumnDefinitions * 6);
522 helpDialog->create();
532 GNEFrame(horizontalFrameParent, viewNet,
"Crossings") {
582 if (currentJunction != NULL) {
590 }
else if (selectedEdge != NULL) {
592 }
else if (selectedLane != NULL) {
623 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.
FXGroupBox * myGroupBoxLegend
groupbox for Legend
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
long onCmdHelp(FXObject *, FXSelector, void *)
called when help button is pressed
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
const RGBColor & getSelectedColor() const
get selected color
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
GNECrossingFrame::crossingParameters * myCrossingParameters
crossing parameters
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
void markEdge(GNEEdge *edge)
mark or dismark edge
void remove2Update()
Removes the dialog to be updated.
void restoreEdgeColors()
restore colors of all edges
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEJunction * getCurrentJunction() const
get current junction
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
FXButton * myInvertEdgesSelection
button for invert selection
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
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
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
GNEViewNet * myViewNet
View Net for changes.
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
invert selection of edges
GNEUndoList * getUndoList() const
get the undoList object
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
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) ...
GNECrossingFrame::edgesSelector * myEdgeSelector
pointer to edge selector
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.
FXButton * helpEdges
button for help
GNECrossingFrame::edgesSelector * getEdgeSelector() const
get edge selector
FXTextField * myCrossingEdges
TextField for edges.
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
bool checkCrossingDuplicated(EdgeVector edges)
return true if already exist a crossing with the same edges as the input
#define GUIDesignDialogBox
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.
void enableCrossingParameters()
enable crossing parameters and set the default value of parameters
bool isCrossingParametersEnabled() const
check if currently the crossingParameters is enabled
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
FXTextField * myCrossingWidth
TextField for width.
GNECrossingFrame()
FOX needs this.
crossing between edges for pedestrians
static std::string getDefinition(SumoXMLTag tag, SumoXMLAttr attr)
return definition of a certain SumoXMLAttr
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
#define GUIDesignButtonOK
FXLabel * myColorSelectedLabel
Label for color selected.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
FXButton * myHelpCrossingAttribute
button for help
#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.
GUISelectedStorage gSelected
A global holder of selected objects.
FXButton * myCreateCrossingButton
FXButton for create Crossing
FXButton * myClearEdgesSelection
button for clear selection
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
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)