SUMO - Simulation of Urban MObility
GNECrossingFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The Widget for add Crossing elements
18 /****************************************************************************/
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #ifdef _MSC_VER
24 #include <windows_config.h>
25 #else
26 #include <config.h>
27 #endif
28 
29 #include <iostream>
33 #include <utils/common/ToString.h>
40 
41 #include "GNECrossingFrame.h"
42 #include "GNEViewNet.h"
43 #include "GNEViewParent.h"
44 #include "GNENet.h"
45 #include "GNEJunction.h"
46 #include "GNEEdge.h"
47 #include "GNELane.h"
48 #include "GNECrossing.h"
49 #include "GNEUndoList.h"
50 #include "GNEChange_Selection.h"
51 #include "GNEAttributeCarrier.h"
52 #include "GNEChange_Crossing.h"
53 #include "GNECrossing.h"
54 
55 
56 // ===========================================================================
57 // FOX callback mapping
58 // ===========================================================================
59 
60 FXDEFMAP(GNECrossingFrame) GNECrossingMap[] = {
62 };
63 
69 };
70 
71 FXDEFMAP(GNECrossingFrame::crossingParameters) GNECrossingParametersMap[] = {
74 };
75 
76 // Object implementation
77 FXIMPLEMENT(GNECrossingFrame, FXVerticalFrame, GNECrossingMap, ARRAYNUMBER(GNECrossingMap))
78 FXIMPLEMENT(GNECrossingFrame::edgesSelector, FXGroupBox, GNEEdgesMap, ARRAYNUMBER(GNEEdgesMap))
79 FXIMPLEMENT(GNECrossingFrame::crossingParameters, FXGroupBox, GNECrossingParametersMap, ARRAYNUMBER(GNECrossingParametersMap))
80 
81 // ===========================================================================
82 // static members
83 // ===========================================================================
86 
87 // ===========================================================================
88 // method definitions
89 // ===========================================================================
90 
91 // ---------------------------------------------------------------------------
92 // GNECrossingFrame::edgesSelector - methods
93 // ---------------------------------------------------------------------------
94 
95 GNECrossingFrame::edgesSelector::edgesSelector(FXComposite* parent, GNECrossingFrame* crossingFrameParent) :
96  FXGroupBox(parent, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame),
97  myCrossingFrameParent(crossingFrameParent),
98  myCurrentJunction(0) {
99 
100  // Create button for selected edges
101  myUseSelectedEdges = new FXButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_CROSSINGFRAME_USEONLYSELECTEDEDGES, GUIDesignButton);
102 
103  // Create button for clear selection
104  myClearEdgesSelection = new FXButton(this, ("Clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_ADDITIONALFRAME_CLEAREDGESELECTION, GUIDesignButton);
105 
106  // Create button for invert selection
107  myInvertEdgesSelection = new FXButton(this, ("Invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_ADDITIONALFRAME_INVERTEDGESELECTION, GUIDesignButton);
108 
109  // Create help button
110  helpEdges = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
111 }
112 
113 
115 
116 
119  return myCurrentJunction;
120 }
121 
122 
123 void
125  // restore color of all lanes of edge candidates
127  // Set current junction
128  myCurrentJunction = currentJunction;
129  // Update view net to show the new colors
130  myCrossingFrameParent->getViewNet()->update();
131  // check if use selected eges must be enabled
132  myUseSelectedEdges->disable();
133  for (auto i : myCurrentJunction->getGNEEdges()) {
134  if (gSelected.isSelected(i->getType(), i->getGlID())) {
135  myUseSelectedEdges->enable();
136  }
137  }
138  // Enable rest of elements
139  helpEdges->enable();
140  myClearEdgesSelection->enable();
141  myInvertEdgesSelection->enable();
142 }
143 
144 
145 void
147  // disable current junction
148  myCurrentJunction = NULL;
149  // disable all elements of the edgesSelector
150  myUseSelectedEdges->disable();
151  helpEdges->disable();
152  myClearEdgesSelection->disable();
153  myInvertEdgesSelection->disable();
154  // Disable crossing parameters
156 }
157 
158 
159 void
161  if (myCurrentJunction != NULL) {
162  // restore color of all lanes of edge candidates
163  for (auto i : myCurrentJunction->getGNEEdges()) {
164  for (auto j : i->getLanes()) {
165  j->setSpecialColor(0);
166  }
167  }
168  // Update view net to show the new colors
169  myCrossingFrameParent->getViewNet()->update();
170  myCurrentJunction = NULL;
171  }
172 }
173 
174 
175 long
178  return 1;
179 }
180 
181 
182 long
185  return 1;
186 }
187 
188 
189 long
192  return 1;
193 }
194 
195 
196 long
197 GNECrossingFrame::edgesSelector::onCmdHelp(FXObject*, FXSelector, void*) {
198  // @todo finish
199  return 0;
200 }
201 
202 
203 // ---------------------------------------------------------------------------
204 // GNECrossingFrame::NeteditAttributes- methods
205 // ---------------------------------------------------------------------------
206 
208  FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame),
209  myCrossingFrameParent(crossingFrameParent),
210  myEdgeSelector(es),
211  myCurrentParametersValid(true) {
212  FXHorizontalFrame* crossingParameter = NULL;
213  // create label and string textField for edges
214  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
215  myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), 0, GUIDesignLabelAttribute);
216  myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
217  myCrossingEdgesLabel->disable();
218  myCrossingEdges->disable();
219  // create label and checkbox for Priority
220  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
221  myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), 0, GUIDesignLabelAttribute);
222  myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
223  myCrossingPriorityLabel->disable();
225  // create label and textfield for width
226  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
227  myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), 0, GUIDesignLabelAttribute);
228  myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldReal);
229  myCrossingWidthLabel->disable();
230  myCrossingWidth->disable();
231  // Create help button
232  myHelpCrossingAttribute = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
233  myHelpCrossingAttribute->disable();
234  // set colors
235  myCandidateColor = RGBColor(0, 64, 0, 255);
237 }
238 
239 
241 
242 
243 void
245  // Enable all elements of the crossing frames
246  myCrossingEdgesLabel->enable();
247  myCrossingEdges->enable();
248  myCrossingPriorityLabel->enable();
250  myCrossingWidthLabel->enable();
251  myCrossingWidth->enable();
252  myHelpCrossingAttribute->enable();
253  // set values of parameters
254  onCmdSetAttribute(0, 0, 0);
255  myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::getDefaultValue<bool>(SUMO_TAG_CROSSING, SUMO_ATTR_PRIORITY));
256  myCrossingWidth->setText(GNEAttributeCarrier::getDefaultValue<std::string>(SUMO_TAG_CROSSING, SUMO_ATTR_WIDTH).c_str());
257  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
258 }
259 
260 
261 void
263  // clear all values of parameters
264  myCrossingEdges->setText("");
265  myCrossingPriorityCheckButton->setCheck(false);
266  myCrossingPriorityCheckButton->setText("false");
267  myCrossingWidth->setText("");
268  // Disable all elements of the crossing frames
269  myCrossingEdgesLabel->disable();
270  myCrossingEdges->disable();
271  myCrossingPriorityLabel->disable();
273  myCrossingWidthLabel->disable();
274  myCrossingWidth->disable();
275  myHelpCrossingAttribute->disable();
277 }
278 
279 
280 bool
282  return myCrossingEdgesLabel->isEnabled();
283 }
284 
285 
286 void
289  if (currentJunction != NULL) {
290  // Check if edge belongs to junction's edge
291  if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) != currentJunction->getGNEEdges().end()) {
292  // Update text field with the new edge
293  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
294  // Check if new edge must be added or removed
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());
298  } else {
299  crossingEdges.erase(itFinder);
300  }
301  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
302  }
303  // Update colors and attributes
304  onCmdSetAttribute(0, 0, 0);
305  }
306 }
307 
308 
309 void
311  myCrossingEdges->setText("");
312  // Update colors and attributes
313  onCmdSetAttribute(0, 0, 0);
314 }
315 
316 
317 void
319  std::vector<std::string> crossingEdges;
320  for (auto i : parentJunction->getGNEEdges()) {
321  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) == myCurrentSelectedEdges.end()) {
322  crossingEdges.push_back(i->getID());
323  }
324  }
325  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
326  // Update colors and attributes
327  onCmdSetAttribute(0, 0, 0);
328 }
329 
330 
331 void
333  std::vector<std::string> crossingEdges;
334  for (auto i : parentJunction->getGNEEdges()) {
335  if (gSelected.isSelected(i->getType(), i->getGlID())) {
336  crossingEdges.push_back(i->getID());
337  }
338  }
339  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
340  // Update colors and attributes
341  onCmdSetAttribute(0, 0, 0);
342 }
343 
344 
345 std::vector<NBEdge*>
347  std::vector<NBEdge*> NBEdgeVector;
348  // Iterate over myCurrentSelectedEdges
349  for (auto i : myCurrentSelectedEdges) {
350  NBEdgeVector.push_back(i->getNBEdge());
351  }
352  return NBEdgeVector;
353 }
354 
355 
356 bool
358  if (myCrossingPriorityCheckButton->getCheck()) {
359  return true;
360  } else {
361  return false;
362  }
363 }
364 
365 
366 bool
369 }
370 
371 
372 double
374  return GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text());
375 }
376 
377 
378 const RGBColor&
380  return myCandidateColor;
381 }
382 
383 
384 const RGBColor&
386  return mySelectedColor;
387 }
388 
389 
390 long
393  // get string vector with the edges
394  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
395  // Clear selected edges
396  myCurrentSelectedEdges.clear();
397  // iterate over vector of edge IDs
398  for (auto i : crossingEdges) {
401  // Check that edge exists and belongs to Junction
402  if (edge == 0) {
403  myCurrentParametersValid = false;
404  } else if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) == currentJunction->getGNEEdges().end()) {
405  myCurrentParametersValid = false;
406  } else {
407  // select or unselected edge
408  auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);
409  if (itFinder == myCurrentSelectedEdges.end()) {
410  myCurrentSelectedEdges.push_back(edge);
411  } else {
412  myCurrentSelectedEdges.erase(itFinder);
413  }
414  }
415  }
416 
417  // change color of textfield dependig of myCurrentParametersValid
419  myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
420  myCrossingEdges->killFocus();
421  } else {
422  myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
423  myCurrentParametersValid = false;
424  }
425 
426  // Update colors of edges
427  for (auto i : myEdgeSelector->getCurrentJunction()->getGNEEdges()) {
428  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) != myCurrentSelectedEdges.end()) {
429  for (auto j : i->getLanes()) {
430  j->setSpecialColor(&mySelectedColor);
431  }
432  } else {
433  for (auto j : i->getLanes()) {
434  j->setSpecialColor(&myCandidateColor);
435  }
436  }
437  }
438  // Update view net
439  myCrossingFrameParent->getViewNet()->update();
440 
441  // Check that at least there are a selected edge
442  if (crossingEdges.empty()) {
443  myCurrentParametersValid = false;
444  }
445 
446  // change label of crossing priority
447  if (myCrossingPriorityCheckButton->getCheck()) {
448  myCrossingPriorityCheckButton->setText("true");
449  } else {
450  myCrossingPriorityCheckButton->setText("false");
451  }
452 
453  // Check width
454  if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&
455  GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {
456  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
457  myCrossingWidth->killFocus();
458  } else {
459  myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
460  myCurrentParametersValid = false;
461  }
462 
463  // Enable or disable create crossing button depending of the current parameters
465  return 0;
466 }
467 
468 
469 long
470 GNECrossingFrame::crossingParameters::onCmdHelp(FXObject*, FXSelector, void*) {
471  // Create help dialog
472  FXDialogBox* helpDialog = new FXDialogBox(this, ("Parameters of " + toString(SUMO_TAG_CROSSING)).c_str(), GUIDesignDialogBox);
473  // Create FXTable
474  FXTable* myTable = new FXTable(helpDialog, this, MID_TABLE, TABLE_READONLY);
475  myTable->setVisibleRows((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()));
476  myTable->setVisibleColumns(3);
477  myTable->setTableSize((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()), 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;
489  // Iterate over vector of additional parameters
490  for (int i = 0; i < (int)GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size(); i++) {
492  // Set name of attribute
493  myTable->setItem(i, 0, new FXTableItem(toString(attr).c_str()));
494  // Set type
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");
506  }
507  type->setJustify(FXTableItem::CENTER_X);
508  myTable->setItem(i, 1, type);
509  // Set definition
510  FXTableItem* definition = new FXTableItem(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).c_str());
511  definition->setJustify(FXTableItem::LEFT);
512  myTable->setItem(i, 2, definition);
513  if ((int)GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size() > maxSizeColumnDefinitions) {
514  maxSizeColumnDefinitions = int(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size());
515  }
516  }
517  // Set size of column
518  header->setItemJustify(2, JUSTIFY_CENTER_X);
519  header->setItemSize(2, maxSizeColumnDefinitions * 6);
520  // Button Close
521  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
522  helpDialog->create();
523  helpDialog->show();
524  return 1;
525 }
526 
527 // ---------------------------------------------------------------------------
528 // GNECrossingFrame - methods
529 // ---------------------------------------------------------------------------
530 
531 GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
532  GNEFrame(horizontalFrameParent, viewNet, "Crossings") {
533  // Create Groupbox for labels
534  myGroupBoxLabel = new FXGroupBox(myContentFrame, "Junction", GUIDesignGroupBoxFrame);
535  myCurrentJunctionLabel = new FXLabel(myGroupBoxLabel, "No junction selected", 0, GUIDesignLabelLeft);
536 
537  // Create edge Selector
539 
540  // Create crossingParameters
542 
543  // Create groupbox for create crossings
544  myGroupBoxButtons = new FXGroupBox(myContentFrame, "Create", GUIDesignGroupBoxFrame);
546  myCreateCrossingButton->disable();
547 
548  // Create groupbox and labels for legends
549  myGroupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame);
550  myColorCandidateLabel = new FXLabel(myGroupBoxLegend, "Candidate", 0, GUIDesignLabelLeft);
552  myColorSelectedLabel = new FXLabel(myGroupBoxLegend, "Selected", 0, GUIDesignLabelLeft);
554 
555  // disable edge selector
557 }
558 
559 
562 }
563 
564 
565 void
567  // restore color of all lanes of edge candidates
569  // hide frame
570  GNEFrame::hide();
571 }
572 
573 
574 bool
576  // cast netElement
577  GNEJunction* currentJunction = dynamic_cast<GNEJunction*>(netElement);
578  GNEEdge* selectedEdge = dynamic_cast<GNEEdge*>(netElement);
579  GNELane* selectedLane = dynamic_cast<GNELane*>(netElement);
580 
581  // If current element is a junction
582  if (currentJunction != NULL) {
583  // change label
584  myCurrentJunctionLabel->setText((std::string("Current Junction: ") + currentJunction->getID()).c_str());
585  // Enable edge selector and crossing parameters
586  myEdgeSelector->enableEdgeSelector(currentJunction);
588  // clears selected edges
590  } else if (selectedEdge != NULL) {
591  myCrossingParameters->markEdge(selectedEdge);
592  } else if (selectedLane != NULL) {
593  myCrossingParameters->markEdge(&selectedLane->getParentEdge());
594  } else {
595  // set default label
596  myCurrentJunctionLabel->setText("No junction selected");
597  // restore color of all lanes of edge candidates
599  // Disable edge selector
601  }
602  return false;
603 }
604 
605 
606 long
607 GNECrossingFrame::onCmdCreateCrossing(FXObject*, FXSelector, void*) {
608  // First check that current parameters are valid
610  // iterate over junction's crossing to find duplicated crossings
612  // create new crossing
617  -1,
619  false, true), true);
620  // clear selected edges
622  } else {
623  WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
624  }
625  }
626  return 1;
627 }
628 
629 
630 void
632  if (value) {
633  myCreateCrossingButton->enable();
634  } else {
635  myCreateCrossingButton->disable();
636  }
637 }
638 
639 
642  return myEdgeSelector;
643 }
644 
645 
648  return myCrossingParameters;
649 }
650 
651 /****************************************************************************/
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
FXGroupBox * myGroupBoxLegend
groupbox for Legend
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:116
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:902
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 disableEdgeSelector()
disable edgeSelector
bool myCurrentParametersValid
flag to check if current parameters are valid
attribute edited
Definition: GUIAppEnum.h:526
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:53
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.
help button
Definition: GUIAppEnum.h:396
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
Definition: GNEFrame.cpp:571
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
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.
Definition: GNEFrame.h:337
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:179
#define GUIDesignTextField
Definition: GUIDesigns.h:40
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:340
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1121
FXLabel * myCrossingPriorityLabel
Label for Priority.
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:246
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:62
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:56
FXDEFMAP(GNECrossingFrame) GNECrossingMap[]
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:49
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:56
bool checkCrossingDuplicated(EdgeVector edges)
return true if already exist a crossing with the same edges as the input
Definition: NBNode.cpp:1987
#define GUIDesignDialogBox
Definition: GUIDesigns.h:395
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:221
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:555
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:46
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:120
#define GUIDesignButtonOK
Definition: GUIDesigns.h:97
FXLabel * myColorSelectedLabel
Label for color selected.
std::vector< GNEEdge * > myCurrentSelectedEdges
current selected edges
FXButton * myHelpCrossingAttribute
button for help
The Table.
Definition: GUIAppEnum.h:288
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:143
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
Definition: GUIDesigns.h:164
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:236