61 #ifdef CHECK_MEMORY_LEAKS 63 #endif // CHECK_MEMORY_LEAKS 87 FXIMPLEMENT(
GNECrossingFrame, FXVerticalFrame, GNECrossingMap, ARRAYNUMBER(GNECrossingMap))
88 FXIMPLEMENT(
GNECrossingFrame::edgesSelector, FXGroupBox, GNEEdgesMap, ARRAYNUMBER(GNEEdgesMap))
89 FXIMPLEMENT(
GNECrossingFrame::crossingParameters, FXGroupBox, GNECrossingParametersMap, ARRAYNUMBER(GNECrossingParametersMap))
107 myCrossingFrameParent(crossingFrameParent),
108 myCurrentJunction(0) {
172 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
173 (*j)->setSpecialColor(0);
206 std::cout <<
"finish" << std::endl;
219 myCurrentParametersValid(true) {
298 if (currentJunction != NULL) {
302 std::vector<std::string> crossingEdges;
305 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->
getID());
306 if (itFinder == crossingEdges.end()) {
307 crossingEdges.push_back(edge->
getID());
309 crossingEdges.erase(itFinder);
329 std::vector<std::string> crossingEdges;
330 for (std::vector<GNEEdge*>::const_iterator i = parentJunction->
getGNEEdges().begin(); i != parentJunction->
getGNEEdges().end(); i++) {
332 crossingEdges.push_back((*i)->getID());
343 std::vector<std::string> crossingEdges;
344 for (std::vector<GNEEdge*>::const_iterator i = parentJunction->
getGNEEdges().begin(); i != parentJunction->
getGNEEdges().end(); i++) {
346 crossingEdges.push_back((*i)->getID());
357 std::vector<NBEdge*> NBEdgeVector;
360 NBEdgeVector.push_back((*i)->getNBEdge());
384 return GNEAttributeCarrier::parse<SUMOReal>(
myCrossingWidth->getText().text());
404 std::vector<std::string> crossingEdges;
410 for (std::vector<std::string>::iterator i = crossingEdges.begin(); i != crossingEdges.end(); i++) {
441 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
445 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
454 if (crossingEdges.empty()) {
486 FXTable* myTable =
new FXTable(helpDialog,
this,
MID_TABLE, TABLE_READONLY);
488 myTable->setVisibleColumns(3);
490 myTable->setBackColor(FXRGB(255, 255, 255));
491 myTable->setColumnText(0,
"Name");
492 myTable->setColumnText(1,
"Value");
493 myTable->setColumnText(2,
"Definition");
494 myTable->getRowHeader()->setWidth(0);
495 FXHeader* header = myTable->getColumnHeader();
496 header->setItemJustify(0, JUSTIFY_CENTER_X);
497 header->setItemSize(0, 120);
498 header->setItemJustify(1, JUSTIFY_CENTER_X);
499 header->setItemSize(1, 80);
500 int maxSizeColumnDefinitions = 0;
505 myTable->setItem(i, 0,
new FXTableItem(
toString(attr).c_str()));
507 FXTableItem* type =
new FXTableItem(
"");
509 type->setText(
"int");
511 type->setText(
"float");
513 type->setText(
"time");
515 type->setText(
"bool");
517 type->setText(
"string");
519 type->setJustify(FXTableItem::CENTER_X);
520 myTable->setItem(i, 1, type);
523 definition->setJustify(FXTableItem::LEFT);
524 myTable->setItem(i, 2, definition);
530 header->setItemJustify(2, JUSTIFY_CENTER_X);
531 header->setItemSize(2, maxSizeColumnDefinitions * 6);
533 new FXButton(helpDialog,
"OK\t\tclose",
GUIIconSubSys::getIcon(
ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT,
GUIDesignButtonDialog, 0, 0, 0, 0, 4, 4, 3, 3);
534 helpDialog->create();
544 GNEFrame(horizontalFrameParent, viewNet,
"Crossings") {
583 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
584 (*j)->setSpecialColor(0);
602 if (currentJunction != NULL) {
608 }
else if (selectedEdge != NULL) {
610 }
else if (selectedLane != NULL) {
639 WRITE_WARNING(
"There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
FXMatrix * myAttributesMatrix
FXMatrix for place attributes.
void setCreateCrossingButton(bool value)
enable or disable button create edges
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
FXGroupBox * myGroupBoxLegend
groupbox for Legend
bool isCurrentParametersValid() const
check if current parameters are valid
long onCmdHelp(FXObject *, FXSelector, void *)
called when help button is pressed
static SUMOReal _str2SUMOReal(const std::string &sData)
converts a string into the SUMOReal value described by it by calling the char-type converter ...
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 & getCandidateColor() const
get candidate 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
#define GUIDesignTextFieldAttributeStr
text field extended over the matrix column with thick frame
void disableEdgeSelector()
disable edgeSelector
bool myCurrentParametersValid
flag to check if current parameters are valid
#define GUIDesignTextFieldAttributeReal
text field extended over the matrix column with thick frame and limited to real
GNEJunction * getCurrentJunction() const
get current junction
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
GNECrossingFrame::edgesSelector * getEdgeSelector() const
get edge selector
GNECrossingFrame::crossingParameters * myCrossingParameters
crossing parameters
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
bool isCrossingParametersEnabled() const
check if currently the crossingParameters is enabled
NBNode * getNBNode() const
Return net build node.
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.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
FXButton * myInvertEdgesSelection
button for invert selection
invert selection of edges
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
#define GUIDesignMatrixAttributes
Matrix design extended over Frame and used for represent attributes and their values.
#define WRITE_WARNING(msg)
FXGroupBox * myGroupBoxLabel
groupbox for the junction label
void hide()
hide crossing frame
GNEUndoList * getUndoList() const
get the undoList object
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
bool getCrossingPriority() const
get crossing priority
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
static const RGBColor GREEN
#define GUIDesignButtonDialog
button with size limited by text, centered over Frame with thick and raise frame
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.
~edgesSelector()
destructor
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
#define GUIDesignMenuCheckAttribute
MenuCheck button for attributes extended over the matrix column.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
GNECrossingFrame::edgesSelector * myEdgeSelector
edge selector
~GNECrossingFrame()
Destructor.
const std::string getID() const
function to support debugging
GNEViewNet * getViewNet() const
get view net
FXMenuCheck * myCrossingPriority
CheckBox for Priority.
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
FXTextField * myCrossingEdges
TextField for edges.
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
#define GUIDesignButtonHelp
little button for help in frames
bool checkCrossingDuplicated(EdgeVector edges)
return true if already exist a crossing with the same edges as the input
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
#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
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
FXTextField * myCrossingWidth
TextField for width.
std::vector< NBEdge * > getCrossingEdges() const
get crossing NBedges
GNECrossingFrame()
FOX needs this.
crossing between edges for pedestrians
static std::string getDefinition(SumoXMLTag tag, SumoXMLAttr attr)
return definition of a certain SumoXMLAttr
GNENet * getNet() const
get the net object
virtual void hide()
hide Frame
SUMOReal getCrossingWidth() const
get crossing width
FXButton * myUseSelectedEdges
CheckBox for selected edges.
void invertEdges(GNEJunction *parentJunction)
invert edges
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static bool _str2SUMOReal(const std::string &data)
check if a String can be parsed into a SUMOReal check overflows
FXLabel * myColorSelectedLabel
Label for color selected.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
const RGBColor & getSelectedColor() const
get selected color
FXButton * myHelpCrossingAttribute
button for help
#define GUIDesignLabelLeft
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
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
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)