SUMO - Simulation of Urban MObility
GNECrossingFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for add Crossing elements
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 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 // ===========================================================================
85 RGBColor GNECrossingFrame::crossingParameters::myCandidateColor;
86 RGBColor GNECrossingFrame::crossingParameters::mySelectedColor;
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  // restore color of all lanes of edge candidates
128  // Set current junction
129  myCurrentJunction = currentJunction;
130  // Update view net to show the new colors
131  myCrossingFrameParent->getViewNet()->update();
132  // check if use selected eges must be enabled
133  myUseSelectedEdges->disable();
134  for (auto i : myCurrentJunction->getGNEEdges()) {
135  if (gSelected.isSelected(i->getType(), i->getGlID())) {
136  myUseSelectedEdges->enable();
137  }
138  }
139  // Enable rest of elements
140  helpEdges->enable();
141  myClearEdgesSelection->enable();
142  myInvertEdgesSelection->enable();
143 }
144 
145 
146 void
148  // disable current junction
149  myCurrentJunction = NULL;
150  // disable all elements of the edgesSelector
151  myUseSelectedEdges->disable();
152  helpEdges->disable();
153  myClearEdgesSelection->disable();
154  myInvertEdgesSelection->disable();
155  // Disable crossing parameters
157 }
158 
159 
160 void
162  if (myCurrentJunction != NULL) {
163  // restore color of all lanes of edge candidates
164  for (auto i : myCurrentJunction->getGNEEdges()) {
165  for (auto j : i->getLanes()) {
166  j->setSpecialColor(0);
167  }
168  }
169  // Update view net to show the new colors
170  myCrossingFrameParent->getViewNet()->update();
171  myCurrentJunction = NULL;
172  }
173 }
174 
175 
176 long
179  return 1;
180 }
181 
182 
183 long
186  return 1;
187 }
188 
189 
190 long
193  return 1;
194 }
195 
196 
197 long
198 GNECrossingFrame::edgesSelector::onCmdHelp(FXObject*, FXSelector, void*) {
199  // @todo finish
200  return 0;
201 }
202 
203 
204 // ---------------------------------------------------------------------------
205 // GNECrossingFrame::NeteditAttributes- methods
206 // ---------------------------------------------------------------------------
207 
209  FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame),
210  myCrossingFrameParent(crossingFrameParent),
211  myEdgeSelector(es),
212  myCurrentParametersValid(true) {
213  FXHorizontalFrame* crossingParameter = NULL;
214  // create label and string textField for edges
215  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
216  myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), 0, GUIDesignLabelAttribute);
217  myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
218  myCrossingEdgesLabel->disable();
219  myCrossingEdges->disable();
220  // create label and checkbox for Priority
221  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
222  myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), 0, GUIDesignLabelAttribute);
223  myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
224  myCrossingPriorityLabel->disable();
226  // create label and textfield for width
227  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
228  myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), 0, GUIDesignLabelAttribute);
229  myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldReal);
230  myCrossingWidthLabel->disable();
231  myCrossingWidth->disable();
232  // Create help button
233  myHelpCrossingAttribute = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
234  myHelpCrossingAttribute->disable();
235  // set colors
236  myCandidateColor = RGBColor(0, 64, 0, 255);
238 }
239 
240 
242 
243 
244 void
246  // Enable all elements of the crossing frames
247  myCrossingEdgesLabel->enable();
248  myCrossingEdges->enable();
249  myCrossingPriorityLabel->enable();
251  myCrossingWidthLabel->enable();
252  myCrossingWidth->enable();
253  myHelpCrossingAttribute->enable();
254  // set values of parameters
255  onCmdSetAttribute(0, 0, 0);
256  myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::getDefaultValue<bool>(SUMO_TAG_CROSSING, SUMO_ATTR_PRIORITY));
257  myCrossingWidth->setText(GNEAttributeCarrier::getDefaultValue<std::string>(SUMO_TAG_CROSSING, SUMO_ATTR_WIDTH).c_str());
258  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
259 }
260 
261 
262 void
264  // clear all values of parameters
265  myCrossingEdges->setText("");
266  myCrossingPriorityCheckButton->setCheck(false);
267  myCrossingPriorityCheckButton->setText("false");
268  myCrossingWidth->setText("");
269  // Disable all elements of the crossing frames
270  myCrossingEdgesLabel->disable();
271  myCrossingEdges->disable();
272  myCrossingPriorityLabel->disable();
274  myCrossingWidthLabel->disable();
275  myCrossingWidth->disable();
276  myHelpCrossingAttribute->disable();
278 }
279 
280 
281 bool
283  return myCrossingEdgesLabel->isEnabled();
284 }
285 
286 
287 void
290  if (currentJunction != NULL) {
291  // Check if edge belongs to junction's edge
292  if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) != currentJunction->getGNEEdges().end()) {
293  // Update text field with the new edge
294  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
295  // Check if new edge must be added or removed
296  std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->getID());
297  if (itFinder == crossingEdges.end()) {
298  crossingEdges.push_back(edge->getID());
299  } else {
300  crossingEdges.erase(itFinder);
301  }
302  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
303  }
304  // Update colors and attributes
305  onCmdSetAttribute(0, 0, 0);
306  }
307 }
308 
309 
310 void
312  myCrossingEdges->setText("");
313  // Update colors and attributes
314  onCmdSetAttribute(0, 0, 0);
315 }
316 
317 
318 void
320  std::vector<std::string> crossingEdges;
321  for (auto i : parentJunction->getGNEEdges()) {
322  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) == myCurrentSelectedEdges.end()) {
323  crossingEdges.push_back(i->getID());
324  }
325  }
326  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
327  // Update colors and attributes
328  onCmdSetAttribute(0, 0, 0);
329 }
330 
331 
332 void
334  std::vector<std::string> crossingEdges;
335  for (auto i : parentJunction->getGNEEdges()) {
336  if (gSelected.isSelected(i->getType(), i->getGlID())) {
337  crossingEdges.push_back(i->getID());
338  }
339  }
340  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
341  // Update colors and attributes
342  onCmdSetAttribute(0, 0, 0);
343 }
344 
345 
346 std::vector<NBEdge*>
348  std::vector<NBEdge*> NBEdgeVector;
349  // Iterate over myCurrentSelectedEdges
350  for (auto i : myCurrentSelectedEdges) {
351  NBEdgeVector.push_back(i->getNBEdge());
352  }
353  return NBEdgeVector;
354 }
355 
356 
357 bool
359  if (myCrossingPriorityCheckButton->getCheck()) {
360  return true;
361  } else {
362  return false;
363  }
364 }
365 
366 
367 bool
370 }
371 
372 
373 double
375  return GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text());
376 }
377 
378 
379 const RGBColor&
381  return myCandidateColor;
382 }
383 
384 
385 const RGBColor&
387  return mySelectedColor;
388 }
389 
390 
391 long
394  // get string vector with the edges
395  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
396  // Clear selected edges
397  myCurrentSelectedEdges.clear();
398  // iterate over vector of edge IDs
399  for (auto i : crossingEdges) {
402  // Check that edge exists and belongs to Junction
403  if (edge == 0) {
404  myCurrentParametersValid = false;
405  } else if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) == currentJunction->getGNEEdges().end()) {
406  myCurrentParametersValid = false;
407  } else {
408  // select or unselected edge
409  auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);
410  if (itFinder == myCurrentSelectedEdges.end()) {
411  myCurrentSelectedEdges.push_back(edge);
412  } else {
413  myCurrentSelectedEdges.erase(itFinder);
414  }
415  }
416  }
417 
418  // change color of textfield dependig of myCurrentParametersValid
420  myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
421  myCrossingEdges->killFocus();
422  } else {
423  myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
424  myCurrentParametersValid = false;
425  }
426 
427  // Update colors of edges
428  for (auto i : myEdgeSelector->getCurrentJunction()->getGNEEdges()) {
429  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) != myCurrentSelectedEdges.end()) {
430  for (auto j : i->getLanes()) {
431  j->setSpecialColor(&mySelectedColor);
432  }
433  } else {
434  for (auto j : i->getLanes()) {
435  j->setSpecialColor(&myCandidateColor);
436  }
437  }
438  }
439  // Update view net
440  myCrossingFrameParent->getViewNet()->update();
441 
442  // Check that at least there are a selected edge
443  if (crossingEdges.empty()) {
444  myCurrentParametersValid = false;
445  }
446 
447  // change label of crossing priority
448  if (myCrossingPriorityCheckButton->getCheck()) {
449  myCrossingPriorityCheckButton->setText("true");
450  } else {
451  myCrossingPriorityCheckButton->setText("false");
452  }
453 
454  // Check width
455  if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&
456  GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {
457  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
458  myCrossingWidth->killFocus();
459  } else {
460  myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
461  myCurrentParametersValid = false;
462  }
463 
464  // Enable or disable create crossing button depending of the current parameters
466  return 0;
467 }
468 
469 
470 long
471 GNECrossingFrame::crossingParameters::onCmdHelp(FXObject*, FXSelector, void*) {
472  // Create help dialog
473  FXDialogBox* helpDialog = new FXDialogBox(this, ("Parameters of " + toString(SUMO_TAG_CROSSING)).c_str(), GUIDesignDialogBox);
474  // Create FXTable
475  FXTable* myTable = new FXTable(helpDialog, this, MID_TABLE, TABLE_READONLY);
476  myTable->setVisibleRows((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()));
477  myTable->setVisibleColumns(3);
478  myTable->setTableSize((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()), 3);
479  myTable->setBackColor(FXRGB(255, 255, 255));
480  myTable->setColumnText(0, "Name");
481  myTable->setColumnText(1, "Value");
482  myTable->setColumnText(2, "Definition");
483  myTable->getRowHeader()->setWidth(0);
484  FXHeader* header = myTable->getColumnHeader();
485  header->setItemJustify(0, JUSTIFY_CENTER_X);
486  header->setItemSize(0, 120);
487  header->setItemJustify(1, JUSTIFY_CENTER_X);
488  header->setItemSize(1, 80);
489  int maxSizeColumnDefinitions = 0;
490  // Iterate over vector of additional parameters
491  for (int i = 0; i < (int)GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size(); i++) {
493  // Set name of attribute
494  myTable->setItem(i, 0, new FXTableItem(toString(attr).c_str()));
495  // Set type
496  FXTableItem* type = new FXTableItem("");
498  type->setText("int");
500  type->setText("float");
502  type->setText("time");
504  type->setText("bool");
506  type->setText("string");
507  }
508  type->setJustify(FXTableItem::CENTER_X);
509  myTable->setItem(i, 1, type);
510  // Set definition
511  FXTableItem* definition = new FXTableItem(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).c_str());
512  definition->setJustify(FXTableItem::LEFT);
513  myTable->setItem(i, 2, definition);
514  if ((int)GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size() > maxSizeColumnDefinitions) {
515  maxSizeColumnDefinitions = int(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size());
516  }
517  }
518  // Set size of column
519  header->setItemJustify(2, JUSTIFY_CENTER_X);
520  header->setItemSize(2, maxSizeColumnDefinitions * 6);
521  // Button Close
522  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
523  helpDialog->create();
524  helpDialog->show();
525  return 1;
526 }
527 
528 // ---------------------------------------------------------------------------
529 // GNECrossingFrame - methods
530 // ---------------------------------------------------------------------------
531 
532 GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
533  GNEFrame(horizontalFrameParent, viewNet, "Crossings") {
534  // Create Groupbox for labels
535  myGroupBoxLabel = new FXGroupBox(myContentFrame, "Junction", GUIDesignGroupBoxFrame);
536  myCurrentJunctionLabel = new FXLabel(myGroupBoxLabel, "No junction selected", 0, GUIDesignLabelLeft);
537 
538  // Create edge Selector
540 
541  // Create crossingParameters
543 
544  // Create groupbox for create crossings
545  myGroupBoxButtons = new FXGroupBox(myContentFrame, "Create", GUIDesignGroupBoxFrame);
546  myCreateCrossingButton = new FXButton(myGroupBoxButtons, "Create crossing", 0, this, MID_GNE_CREATE_CROSSING, GUIDesignButton);
547  myCreateCrossingButton->disable();
548 
549  // Create groupbox and labels for legends
550  myGroupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame);
551  myColorCandidateLabel = new FXLabel(myGroupBoxLegend, "Candidate", 0, GUIDesignLabelLeft);
553  myColorSelectedLabel = new FXLabel(myGroupBoxLegend, "Selected", 0, GUIDesignLabelLeft);
555 
556  // disable edge selector
558 }
559 
560 
563 }
564 
565 
566 void
568  // restore color of all lanes of edge candidates
570  // hide frame
571  GNEFrame::hide();
572 }
573 
574 
575 bool
577  // cast netElement
578  GNEJunction* currentJunction = dynamic_cast<GNEJunction*>(netElement);
579  GNEEdge* selectedEdge = dynamic_cast<GNEEdge*>(netElement);
580  GNELane* selectedLane = dynamic_cast<GNELane*>(netElement);
581 
582  // If current element is a junction
583  if (currentJunction != NULL) {
584  // change label
585  myCurrentJunctionLabel->setText((std::string("Current Junction: ") + currentJunction->getID()).c_str());
586  // Enable edge selector and crossing parameters
587  myEdgeSelector->enableEdgeSelector(currentJunction);
589  // clears selected edges
591  } else if (selectedEdge != NULL) {
592  myCrossingParameters->markEdge(selectedEdge);
593  } else if (selectedLane != NULL) {
594  myCrossingParameters->markEdge(&selectedLane->getParentEdge());
595  } else {
596  // set default label
597  myCurrentJunctionLabel->setText("No junction selected");
598  // clear selected egdes
600  // restore color of all lanes of edge candidates
602  // Disable edge selector
604  }
605  return false;
606 }
607 
608 
609 long
610 GNECrossingFrame::onCmdCreateCrossing(FXObject*, FXSelector, void*) {
611  // First check that current parameters are valid
613  // iterate over junction's crossing to find duplicated crossings
615  // create new crossing
620  false, true), true);
621  // clear selected edges
623  } else {
624  WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
625  }
626  }
627  return 1;
628 }
629 
630 
631 void
633  if (value) {
634  myCreateCrossingButton->enable();
635  } else {
636  myCreateCrossingButton->disable();
637  }
638 }
639 
640 
643  return myEdgeSelector;
644 }
645 
646 
649  return myCrossingParameters;
650 }
651 
652 /****************************************************************************/
double getCrossingWidth() const
get crossing width
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:117
bool isCurrentParametersValid() const
check if current parameters are valid
long onCmdHelp(FXObject *, FXSelector, void *)
called when help button is pressed
invert selection of edges
Definition: GUIAppEnum.h:622
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:899
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 disableEdgeSelector()
disable edgeSelector
bool myCurrentParametersValid
flag to check if current parameters are valid
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.
Definition: GNELane.h:54
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Create crossing.
Definition: GUIAppEnum.h:704
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
clear selection of edges
Definition: GUIAppEnum.h:620
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
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
Definition: GNEFrame.h:95
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 const RGBColor GREEN
Definition: RGBColor.h:180
attribute edited
Definition: GUIAppEnum.h:586
use selected edges only
Definition: GUIAppEnum.h:616
#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
The Table.
Definition: GUIAppEnum.h:291
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1085
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 *)
GNECrossingFrame::edgesSelector * myEdgeSelector
edge selector
~GNECrossingFrame()
Destructor.
const std::string getID() const
function to support debugging
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
Definition: GUIDesigns.h:63
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:123
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:58
FXDEFMAP(GNECrossingFrame) GNECrossingMap[]
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:50
FXButton * helpEdges
button for help
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:1997
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
#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
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
Definition: GNEFrame.cpp:107
FXButton * myUseSelectedEdges
CheckBox for selected edges.
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
const RGBColor & getSelectedColor() const
get selected color
FXButton * myHelpCrossingAttribute
button for help
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:144
help button
Definition: GUIAppEnum.h:404
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:165
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)
Definition: ToString.h:237