SUMO - Simulation of Urban MObility
GNECrossingFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <iostream>
34 #include <utils/common/ToString.h>
41 
42 #include "GNECrossingFrame.h"
43 #include "GNEViewNet.h"
44 #include "GNEViewParent.h"
45 #include "GNENet.h"
46 #include "GNEJunction.h"
47 #include "GNEEdge.h"
48 #include "GNELane.h"
49 #include "GNECrossing.h"
50 #include "GNEUndoList.h"
51 #include "GNEChange_Selection.h"
52 #include "GNEAttributeCarrier.h"
53 #include "GNEChange_Crossing.h"
54 #include "GNECrossing.h"
55 
56 
57 // ===========================================================================
58 // FOX callback mapping
59 // ===========================================================================
60 
61 FXDEFMAP(GNECrossingFrame) GNECrossingMap[] = {
63 };
64 
70 };
71 
72 FXDEFMAP(GNECrossingFrame::crossingParameters) GNECrossingParametersMap[] = {
75 };
76 
77 // Object implementation
78 FXIMPLEMENT(GNECrossingFrame, FXVerticalFrame, GNECrossingMap, ARRAYNUMBER(GNECrossingMap))
79 FXIMPLEMENT(GNECrossingFrame::edgesSelector, FXGroupBox, GNEEdgesMap, ARRAYNUMBER(GNEEdgesMap))
80 FXIMPLEMENT(GNECrossingFrame::crossingParameters, FXGroupBox, GNECrossingParametersMap, ARRAYNUMBER(GNECrossingParametersMap))
81 
82 // ===========================================================================
83 // static members
84 // ===========================================================================
87 
88 // ===========================================================================
89 // method definitions
90 // ===========================================================================
91 
92 // ---------------------------------------------------------------------------
93 // GNECrossingFrame::edgesSelector - methods
94 // ---------------------------------------------------------------------------
95 
96 GNECrossingFrame::edgesSelector::edgesSelector(FXComposite* parent, GNECrossingFrame* crossingFrameParent) :
97  FXGroupBox(parent, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame),
98  myCrossingFrameParent(crossingFrameParent),
99  myCurrentJunction(0) {
100 
101  // Create button for selected edges
102  myUseSelectedEdges = new FXButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_USEONLYSELECTEDEDGES, GUIDesignButton);
103 
104  // Create button for clear selection
105  myClearEdgesSelection = new FXButton(this, ("clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_CLEAREDGESELECTION, GUIDesignButton);
106 
107  // Create button for invert selection
108  myInvertEdgesSelection = new FXButton(this, ("invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_INVERTEDGESELECTION, GUIDesignButton);
109 
110  // Create help button
111  helpEdges = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
112 }
113 
114 
116 
117 
120  return myCurrentJunction;
121 }
122 
123 
124 void
126  // Set current junction
127  myCurrentJunction = currentJunction;
128  // Update view net to show the new colors
129  myCrossingFrameParent->getViewNet()->update();
130  // check if use selected eges must be enabled
131  myUseSelectedEdges->disable();
132  for (std::vector<GNEEdge*>::const_iterator i = myCurrentJunction->getGNEEdges().begin(); i != myCurrentJunction->getGNEEdges().end(); i++) {
133  if (gSelected.isSelected((*i)->getType(), (*i)->getGlID())) {
134  myUseSelectedEdges->enable();
135  }
136  }
137  // Enable rest of elements
138  helpEdges->enable();
139  myClearEdgesSelection->enable();
140  myInvertEdgesSelection->enable();
141 }
142 
143 
144 void
146  // disable current junction
147  myCurrentJunction = NULL;
148  // disable all elements of the edgesSelector
149  myUseSelectedEdges->disable();
150  helpEdges->disable();
151  myClearEdgesSelection->disable();
152  myInvertEdgesSelection->disable();
153  // Disable crossing parameters
155 }
156 
157 
158 void
160  if (myCurrentJunction != NULL) {
161  // restore color of all lanes of edge candidates
162  for (std::vector<GNEEdge*>::const_iterator i = myCurrentJunction->getGNEEdges().begin(); i != myCurrentJunction->getGNEEdges().end(); i++) {
163  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
164  (*j)->setSpecialColor(0);
165  }
166  }
167  // Update view net to show the new colors
168  myCrossingFrameParent->getViewNet()->update();
169  myCurrentJunction = NULL;
170  }
171 }
172 
173 
174 long
177  return 1;
178 }
179 
180 
181 long
184  return 1;
185 }
186 
187 
188 long
191  return 1;
192 }
193 
194 
195 long
196 GNECrossingFrame::edgesSelector::onCmdHelp(FXObject*, FXSelector, void*) {
197  // @todo finish
198  return 0;
199 }
200 
201 
202 // ---------------------------------------------------------------------------
203 // GNECrossingFrame::NeteditAttributes- methods
204 // ---------------------------------------------------------------------------
205 
207  FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame),
208  myCrossingFrameParent(crossingFrameParent),
209  myEdgeSelector(es),
210  myCurrentParametersValid(true) {
211  FXHorizontalFrame* crossingParameter = NULL;
212  // create label and string textField for edges
213  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
214  myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), 0, GUIDesignLabelAttribute);
215  myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
216  myCrossingEdgesLabel->disable();
217  myCrossingEdges->disable();
218  // create label and checkbox for Priority
219  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
220  myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), 0, GUIDesignLabelAttribute);
221  myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
222  myCrossingPriorityLabel->disable();
224  // create label and textfield for width
225  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
226  myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), 0, GUIDesignLabelAttribute);
227  myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldReal);
228  myCrossingWidthLabel->disable();
229  myCrossingWidth->disable();
230  // Create help button
231  myHelpCrossingAttribute = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
232  myHelpCrossingAttribute->disable();
233  // set colors
234  myCandidateColor = RGBColor(0, 64, 0, 255);
236 }
237 
238 
240 
241 
242 void
244  // Enable all elements of the crossing frames
245  myCrossingEdgesLabel->enable();
246  myCrossingEdges->enable();
247  myCrossingPriorityLabel->enable();
249  myCrossingWidthLabel->enable();
250  myCrossingWidth->enable();
251  myHelpCrossingAttribute->enable();
252  // set values of parameters
253  onCmdSetAttribute(0, 0, 0);
254  myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::getDefaultValue<bool>(SUMO_TAG_CROSSING, SUMO_ATTR_PRIORITY));
255  myCrossingWidth->setText(GNEAttributeCarrier::getDefaultValue<std::string>(SUMO_TAG_CROSSING, SUMO_ATTR_WIDTH).c_str());
256  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
257 }
258 
259 
260 void
262  // clear all values of parameters
263  myCrossingEdges->setText("");
264  myCrossingPriorityCheckButton->setCheck(false);
265  myCrossingPriorityCheckButton->setText("false");
266  myCrossingWidth->setText("");
267  // Disable all elements of the crossing frames
268  myCrossingEdgesLabel->disable();
269  myCrossingEdges->disable();
270  myCrossingPriorityLabel->disable();
272  myCrossingWidthLabel->disable();
273  myCrossingWidth->disable();
274  myHelpCrossingAttribute->disable();
276 }
277 
278 
279 bool
281  return myCrossingEdgesLabel->isEnabled();
282 }
283 
284 
285 void
288  if (currentJunction != NULL) {
289  // Check if edge belongs to junction's edge
290  if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) != currentJunction->getGNEEdges().end()) {
291  // Update text field with the new edge
292  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
293  // Check if new edge must be added or removed
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());
297  } else {
298  crossingEdges.erase(itFinder);
299  }
300  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
301  }
302  // Update colors and attributes
303  onCmdSetAttribute(0, 0, 0);
304  }
305 }
306 
307 
308 void
310  myCrossingEdges->setText("");
311  // Update colors and attributes
312  onCmdSetAttribute(0, 0, 0);
313 }
314 
315 
316 void
318  std::vector<std::string> crossingEdges;
319  for (std::vector<GNEEdge*>::const_iterator i = parentJunction->getGNEEdges().begin(); i != parentJunction->getGNEEdges().end(); i++) {
320  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), (*i)) == myCurrentSelectedEdges.end()) {
321  crossingEdges.push_back((*i)->getID());
322  }
323  }
324  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
325  // Update colors and attributes
326  onCmdSetAttribute(0, 0, 0);
327 }
328 
329 
330 void
332  std::vector<std::string> crossingEdges;
333  for (std::vector<GNEEdge*>::const_iterator i = parentJunction->getGNEEdges().begin(); i != parentJunction->getGNEEdges().end(); i++) {
334  if (gSelected.isSelected((*i)->getType(), (*i)->getGlID())) {
335  crossingEdges.push_back((*i)->getID());
336  }
337  }
338  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
339  // Update colors and attributes
340  onCmdSetAttribute(0, 0, 0);
341 }
342 
343 
344 std::vector<NBEdge*>
346  std::vector<NBEdge*> NBEdgeVector;
347  // Iterate over myCurrentSelectedEdges
348  for (std::vector<GNEEdge*>::const_iterator i = myCurrentSelectedEdges.begin(); i != myCurrentSelectedEdges.end(); i++) {
349  NBEdgeVector.push_back((*i)->getNBEdge());
350  }
351  return NBEdgeVector;
352 }
353 
354 
355 bool
357  if (myCrossingPriorityCheckButton->getCheck()) {
358  return true;
359  } else {
360  return false;
361  }
362 }
363 
364 
365 bool
368 }
369 
370 
371 double
373  return GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text());
374 }
375 
376 
377 const RGBColor&
379  return myCandidateColor;
380 }
381 
382 
383 const RGBColor&
385  return mySelectedColor;
386 }
387 
388 
389 long
392  // get string vector with the edges
393  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
394  // Clear selected edges
395  myCurrentSelectedEdges.clear();
396  // iterate over vector of edge IDs
397  for (std::vector<std::string>::iterator i = crossingEdges.begin(); i != crossingEdges.end(); i++) {
398  GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->retrieveEdge((*i), false);
400  // Check that edge exists and belongs to Junction
401  if (edge == 0) {
402  myCurrentParametersValid = false;
403  } else if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) == currentJunction->getGNEEdges().end()) {
404  myCurrentParametersValid = false;
405  } else {
406  // select or unselected edge
407  std::vector<GNEEdge*>::iterator itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);
408  if (itFinder == myCurrentSelectedEdges.end()) {
409  myCurrentSelectedEdges.push_back(edge);
410  } else {
411  myCurrentSelectedEdges.erase(itFinder);
412  }
413  }
414  }
415 
416  // change color of textfield dependig of myCurrentParametersValid
418  myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
419  myCrossingEdges->killFocus();
420  } else {
421  myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
422  myCurrentParametersValid = false;
423  }
424 
425  // Update colors of edges
426  for (std::vector<GNEEdge*>::const_iterator i = myEdgeSelector->getCurrentJunction()->getGNEEdges().begin(); i != myEdgeSelector->getCurrentJunction()->getGNEEdges().end(); i++) {
427  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), *i) != myCurrentSelectedEdges.end()) {
428  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
429  (*j)->setSpecialColor(&mySelectedColor);
430  }
431  } else {
432  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
433  (*j)->setSpecialColor(&myCandidateColor);
434  }
435  }
436  }
437  // Update view net
438  myCrossingFrameParent->getViewNet()->update();
439 
440  // Check that at least there are a selected edge
441  if (crossingEdges.empty()) {
442  myCurrentParametersValid = false;
443  }
444 
445  // change label of crossing priority
446  if (myCrossingPriorityCheckButton->getCheck()) {
447  myCrossingPriorityCheckButton->setText("true");
448  } else {
449  myCrossingPriorityCheckButton->setText("false");
450  }
451 
452  // Check width
453  if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&
454  GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {
455  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
456  myCrossingWidth->killFocus();
457  } else {
458  myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
459  myCurrentParametersValid = false;
460  }
461 
462  // Enable or disable create crossing button depending of the current parameters
464  return 0;
465 }
466 
467 
468 long
469 GNECrossingFrame::crossingParameters::onCmdHelp(FXObject*, FXSelector, void*) {
470  // Create help dialog
471  FXDialogBox* helpDialog = new FXDialogBox(this, ("Parameters of " + toString(SUMO_TAG_CROSSING)).c_str(), GUIDesignDialogBox);
472  // Create FXTable
473  FXTable* myTable = new FXTable(helpDialog, this, MID_TABLE, TABLE_READONLY);
474  myTable->setVisibleRows((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()));
475  myTable->setVisibleColumns(3);
476  myTable->setTableSize((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()), 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;
488  // Iterate over vector of additional parameters
489  for (int i = 0; i < (int)GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size(); i++) {
491  // Set name of attribute
492  myTable->setItem(i, 0, new FXTableItem(toString(attr).c_str()));
493  // Set type
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");
505  }
506  type->setJustify(FXTableItem::CENTER_X);
507  myTable->setItem(i, 1, type);
508  // Set definition
509  FXTableItem* definition = new FXTableItem(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).c_str());
510  definition->setJustify(FXTableItem::LEFT);
511  myTable->setItem(i, 2, definition);
512  if ((int)GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size() > maxSizeColumnDefinitions) {
513  maxSizeColumnDefinitions = int(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size());
514  }
515  }
516  // Set size of column
517  header->setItemJustify(2, JUSTIFY_CENTER_X);
518  header->setItemSize(2, maxSizeColumnDefinitions * 6);
519  // Button Close
520  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
521  helpDialog->create();
522  helpDialog->show();
523  return 1;
524 }
525 
526 // ---------------------------------------------------------------------------
527 // GNECrossingFrame - methods
528 // ---------------------------------------------------------------------------
529 
530 GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
531  GNEFrame(horizontalFrameParent, viewNet, "Crossings") {
532  // Create Groupbox for labels
533  myGroupBoxLabel = new FXGroupBox(myContentFrame, "Junction", GUIDesignGroupBoxFrame);
534  myCurrentJunctionLabel = new FXLabel(myGroupBoxLabel, "No junction selected", 0, GUIDesignLabelLeft);
535 
536  // Create edge Selector
538 
539  // Create crossingParameters
541 
542  // Create groupbox for create crossings
543  myGroupBoxButtons = new FXGroupBox(myContentFrame, "Create", GUIDesignGroupBoxFrame);
544  myCreateCrossingButton = new FXButton(myGroupBoxButtons, "Create crossing", 0, this, MID_GNE_CREATE_CROSSING, GUIDesignButton);
545  myCreateCrossingButton->disable();
546 
547  // Create groupbox and labels for legends
548  myGroupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame);
549  myColorCandidateLabel = new FXLabel(myGroupBoxLegend, "Candidate", 0, GUIDesignLabelLeft);
551  myColorSelectedLabel = new FXLabel(myGroupBoxLegend, "Selected", 0, GUIDesignLabelLeft);
553 
554  // disable edge selector
556 }
557 
558 
561 }
562 
563 
564 void
566  // Set default colors of edges (if a junction is yet selected)
567  if (myEdgeSelector->getCurrentJunction() != NULL) {
568  // remove color of edges
569  for (std::vector<GNEEdge*>::const_iterator i = myEdgeSelector->getCurrentJunction()->getGNEEdges().begin(); i != myEdgeSelector->getCurrentJunction()->getGNEEdges().end(); i++) {
570  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
571  (*j)->setSpecialColor(0);
572  }
573  }
574  }
575 
576  // hide frame
577  GNEFrame::hide();
578 }
579 
580 
581 bool
583  // cast netElement
584  GNEJunction* currentJunction = dynamic_cast<GNEJunction*>(netElement);
585  GNEEdge* selectedEdge = dynamic_cast<GNEEdge*>(netElement);
586  GNELane* selectedLane = dynamic_cast<GNELane*>(netElement);
587 
588  // If current element is a junction
589  if (currentJunction != NULL) {
590  // change label
591  myCurrentJunctionLabel->setText((std::string("Current Junction: ") + currentJunction->getID()).c_str());
592  // Enable edge selector and crossing parameters
593  myEdgeSelector->enableEdgeSelector(currentJunction);
595  } else if (selectedEdge != NULL) {
596  myCrossingParameters->markEdge(selectedEdge);
597  } else if (selectedLane != NULL) {
598  myCrossingParameters->markEdge(&selectedLane->getParentEdge());
599  } else {
600  // set default label
601  myCurrentJunctionLabel->setText("No junction selected");
602  // restore color of all lanes of edge candidates
604  // Disable edge selector
606  }
607  return false;
608 }
609 
610 
611 long
612 GNECrossingFrame::onCmdCreateCrossing(FXObject*, FXSelector, void*) {
613  // First check that current parameters are valid
615  // iterate over junction's crossing to find duplicated crossings
617  // create new crossing
622  true), true);
623  // clear selected edges
625  } else {
626  WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
627  }
628  }
629  return 1;
630 }
631 
632 
633 void
635  if (value) {
636  myCreateCrossingButton->enable();
637  } else {
638  myCreateCrossingButton->disable();
639  }
640 }
641 
642 
645  return myEdgeSelector;
646 }
647 
648 
651  return myCrossingParameters;
652 }
653 
654 /****************************************************************************/
void setCreateCrossingButton(bool value)
enable or disable button create edges
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
attribute edited
Definition: GUIAppEnum.h:570
FXGroupBox * myGroupBoxLegend
groupbox for Legend
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:117
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
Definition: GNENet.cpp:743
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.
The Table.
Definition: GUIAppEnum.h:291
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.
Definition: GNELane.h:54
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
Create crossing.
Definition: GUIAppEnum.h:676
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.
use selected edges only
Definition: GUIAppEnum.h:596
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:123
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
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
help button
Definition: GUIAppEnum.h:404
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:95
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
Definition: RGBColor.h:190
#define GUIDesignTextField
Definition: GUIDesigns.h:41
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:104
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1078
FXLabel * myCrossingPriorityLabel
Label for Priority.
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:244
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
GNEJunction * myCurrentJunction
current Junction
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) ...
Definition: GUIDesigns.h:63
GNECrossingFrame::edgesSelector * myEdgeSelector
pointer to edge selector
begin/end of the description of an edge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:57
FXDEFMAP(GNECrossingFrame) GNECrossingMap[]
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:50
FXButton * helpEdges
button for help
GNECrossingFrame::edgesSelector * getEdgeSelector() const
get edge selector
FXTextField * myCrossingEdges
TextField for edges.
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
#define GUIDesignButton
Definition: GUIDesigns.h:57
bool checkCrossingDuplicated(EdgeVector edges)
return true if already exist a crossing with the same edges as the input
Definition: NBNode.cpp:1980
#define GUIDesignDialogBox
Definition: GUIDesigns.h:393
FXLabel * myCrossingEdgesLabel
Label for edges.
GNECrossingFrame * myCrossingFrameParent
pointer to GNECrossingFrame parent
void disableCrossingParameters()
disable crossing parameters and clear parameters
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:219
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
Definition: GNEFrame.cpp:107
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
Definition: GUIDesigns.h:47
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:121
#define GUIDesignButtonOK
Definition: GUIDesigns.h:98
FXLabel * myColorSelectedLabel
Label for color selected.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
FXButton * myHelpCrossingAttribute
button for help
clear selection of edges
Definition: GUIAppEnum.h:600
invert selection of edges
Definition: GUIAppEnum.h:602
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:144
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:165
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)
Definition: ToString.h:228