78 FXIMPLEMENT(
GNECrossingFrame, FXVerticalFrame, GNECrossingMap, ARRAYNUMBER(GNECrossingMap))
98 myCrossingFrameParent(crossingFrameParent),
99 myCurrentJunction(0) {
163 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
164 (*j)->setSpecialColor(0);
210 myCurrentParametersValid(true) {
211 FXHorizontalFrame* crossingParameter = NULL;
288 if (currentJunction != NULL) {
292 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
294 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->
getID());
295 if (itFinder == crossingEdges.end()) {
296 crossingEdges.push_back(edge->
getID());
298 crossingEdges.erase(itFinder);
318 std::vector<std::string> crossingEdges;
319 for (std::vector<GNEEdge*>::const_iterator i = parentJunction->
getGNEEdges().begin(); i != parentJunction->
getGNEEdges().end(); i++) {
321 crossingEdges.push_back((*i)->getID());
332 std::vector<std::string> crossingEdges;
333 for (std::vector<GNEEdge*>::const_iterator i = parentJunction->
getGNEEdges().begin(); i != parentJunction->
getGNEEdges().end(); i++) {
335 crossingEdges.push_back((*i)->getID());
346 std::vector<NBEdge*> NBEdgeVector;
349 NBEdgeVector.push_back((*i)->getNBEdge());
373 return GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text());
393 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (
myCrossingEdges->getText().text());
397 for (std::vector<std::string>::iterator i = crossingEdges.begin(); i != crossingEdges.end(); i++) {
428 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
432 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
441 if (crossingEdges.empty()) {
453 if (GNEAttributeCarrier::canParse<double>(
myCrossingWidth->getText().text()) &&
454 GNEAttributeCarrier::parse<double>(
myCrossingWidth->getText().text()) > 0) {
473 FXTable* myTable =
new FXTable(helpDialog,
this,
MID_TABLE, TABLE_READONLY);
475 myTable->setVisibleColumns(3);
477 myTable->setBackColor(FXRGB(255, 255, 255));
478 myTable->setColumnText(0,
"Name");
479 myTable->setColumnText(1,
"Value");
480 myTable->setColumnText(2,
"Definition");
481 myTable->getRowHeader()->setWidth(0);
482 FXHeader* header = myTable->getColumnHeader();
483 header->setItemJustify(0, JUSTIFY_CENTER_X);
484 header->setItemSize(0, 120);
485 header->setItemJustify(1, JUSTIFY_CENTER_X);
486 header->setItemSize(1, 80);
487 int maxSizeColumnDefinitions = 0;
492 myTable->setItem(i, 0,
new FXTableItem(
toString(attr).c_str()));
494 FXTableItem* type =
new FXTableItem(
"");
496 type->setText(
"int");
498 type->setText(
"float");
500 type->setText(
"time");
502 type->setText(
"bool");
504 type->setText(
"string");
506 type->setJustify(FXTableItem::CENTER_X);
507 myTable->setItem(i, 1, type);
510 definition->setJustify(FXTableItem::LEFT);
511 myTable->setItem(i, 2, definition);
517 header->setItemJustify(2, JUSTIFY_CENTER_X);
518 header->setItemSize(2, maxSizeColumnDefinitions * 6);
521 helpDialog->create();
531 GNEFrame(horizontalFrameParent, viewNet,
"Crossings") {
570 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
571 (*j)->setSpecialColor(0);
589 if (currentJunction != NULL) {
595 }
else if (selectedEdge != NULL) {
597 }
else if (selectedLane != NULL) {
626 WRITE_WARNING(
"There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
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
the window to inform when the tls is modfied
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
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
invert selection of edges
#define GUIDesignLabelLeft
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
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)