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 #ifdef HAVE_VERSION_H
31 #include <version.h>
32 #endif
33 
34 #include <iostream>
38 #include <utils/common/TplCheck.h>
39 #include <utils/common/ToString.h>
46 
47 #include "GNECrossingFrame.h"
48 #include "GNEViewNet.h"
49 #include "GNEViewParent.h"
50 #include "GNENet.h"
51 #include "GNEJunction.h"
52 #include "GNEEdge.h"
53 #include "GNELane.h"
54 #include "GNECrossing.h"
55 #include "GNEUndoList.h"
56 #include "GNEChange_Selection.h"
57 #include "GNEAttributeCarrier.h"
58 #include "GNEChange_Crossing.h"
59 #include "GNECrossing.h"
60 
61 #ifdef CHECK_MEMORY_LEAKS
62 #include <foreign/nvwa/debug_new.h>
63 #endif // CHECK_MEMORY_LEAKS
64 
65 
66 // ===========================================================================
67 // FOX callback mapping
68 // ===========================================================================
69 
70 FXDEFMAP(GNECrossingFrame) GNECrossingMap[] = {
72 };
73 
79 };
80 
81 FXDEFMAP(GNECrossingFrame::crossingParameters) GNECrossingParametersMap[] = {
84 };
85 
86 // Object implementation
87 FXIMPLEMENT(GNECrossingFrame, FXVerticalFrame, GNECrossingMap, ARRAYNUMBER(GNECrossingMap))
88 FXIMPLEMENT(GNECrossingFrame::edgesSelector, FXGroupBox, GNEEdgesMap, ARRAYNUMBER(GNEEdgesMap))
89 FXIMPLEMENT(GNECrossingFrame::crossingParameters, FXGroupBox, GNECrossingParametersMap, ARRAYNUMBER(GNECrossingParametersMap))
90 
91 // ===========================================================================
92 // static members
93 // ===========================================================================
94 RGBColor GNECrossingFrame::crossingParameters::myCandidateColor;
95 RGBColor GNECrossingFrame::crossingParameters::mySelectedColor;
96 
97 // ===========================================================================
98 // method definitions
99 // ===========================================================================
100 
101 // ---------------------------------------------------------------------------
102 // GNECrossingFrame::edgesSelector - methods
103 // ---------------------------------------------------------------------------
104 
105 GNECrossingFrame::edgesSelector::edgesSelector(FXComposite* parent, GNECrossingFrame* crossingFrameParent) :
106  FXGroupBox(parent, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame),
107  myCrossingFrameParent(crossingFrameParent),
108  myCurrentJunction(0) {
109 
110  // Create button for selected edges
111  myUseSelectedEdges = new FXButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_USEONLYSELECTEDEDGES, GUIDesignButton);
112 
113  // Create button for clear selection
114  myClearEdgesSelection = new FXButton(this, ("clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_CLEAREDGESELECTION, GUIDesignButton);
115 
116  // Create button for invert selection
117  myInvertEdgesSelection = new FXButton(this, ("invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), 0, this, MID_GNE_INVERTEDGESELECTION, GUIDesignButton);
118 
119  // Create help button
120  helpEdges = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonHelp);
121 }
122 
123 
125 
126 
129  return myCurrentJunction;
130 }
131 
132 
133 void
135  // Set current junction
136  myCurrentJunction = currentJunction;
137  // Update view net to show the new colors
138  myCrossingFrameParent->getViewNet()->update();
139  // check if use selected eges must be enabled
140  myUseSelectedEdges->disable();
141  for (std::vector<GNEEdge*>::const_iterator i = myCurrentJunction->getGNEEdges().begin(); i != myCurrentJunction->getGNEEdges().end(); i++) {
142  if (gSelected.isSelected((*i)->getType(), (*i)->getGlID())) {
143  myUseSelectedEdges->enable();
144  }
145  }
146  // Enable rest of elements
147  helpEdges->enable();
148  myClearEdgesSelection->enable();
149  myInvertEdgesSelection->enable();
150 }
151 
152 
153 void
155  // disable current junction
156  myCurrentJunction = NULL;
157  // disable all elements of the edgesSelector
158  myUseSelectedEdges->disable();
159  helpEdges->disable();
160  myClearEdgesSelection->disable();
161  myInvertEdgesSelection->disable();
162  // Disable crossing parameters
164 }
165 
166 
167 void
169  if (myCurrentJunction != NULL) {
170  // restore color of all lanes of edge candidates
171  for (std::vector<GNEEdge*>::const_iterator i = myCurrentJunction->getGNEEdges().begin(); i != myCurrentJunction->getGNEEdges().end(); i++) {
172  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
173  (*j)->setSpecialColor(0);
174  }
175  }
176  // Update view net to show the new colors
177  myCrossingFrameParent->getViewNet()->update();
178  myCurrentJunction = NULL;
179  }
180 }
181 
182 
183 long
186  return 1;
187 }
188 
189 
190 long
193  return 1;
194 }
195 
196 
197 long
200  return 1;
201 }
202 
203 
204 long
205 GNECrossingFrame::edgesSelector::onCmdHelp(FXObject*, FXSelector, void*) {
206  std::cout << "finish" << std::endl; // @todo finish
207  return 0;
208 }
209 
210 
211 // ---------------------------------------------------------------------------
212 // GNECrossingFrame::editorParameters- methods
213 // ---------------------------------------------------------------------------
214 
216  FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame),
217  myCrossingFrameParent(crossingFrameParent),
218  myEdgeSelector(es),
219  myCurrentParametersValid(true) {
220  // Create a Matrix for parameters
221  myAttributesMatrix = new FXMatrix(this, 2, GUIDesignMatrixAttributes);
222  // create label for edges
224  myCrossingEdgesLabel->disable();
225  // create string textField for edges
227  myCrossingEdges->disable();
228  // create label for Priority
230  myCrossingPriorityLabel->disable();
231  // create CheckBox for Priority
233  myCrossingPriority->disable();
234  // create label for width
236  myCrossingWidthLabel->disable();
237  // create extField for width
239  myCrossingWidth->disable();
240  // Create help button
241  myHelpCrossingAttribute = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonHelp);
242  myHelpCrossingAttribute->disable();
243  // set colors
244  myCandidateColor = RGBColor(0, 64, 0, 255);
246 }
247 
248 
250 
251 
252 void
254  // Enable all elements of the crossing frames
255  myCrossingEdgesLabel->enable();
256  myCrossingEdges->enable();
257  myCrossingPriorityLabel->enable();
258  myCrossingPriority->enable();
259  myCrossingWidthLabel->enable();
260  myCrossingWidth->enable();
261  myHelpCrossingAttribute->enable();
262  // set values of parameters
263  onCmdSetAttribute(0, 0, 0);
264  myCrossingPriority->setCheck(GNEAttributeCarrier::getDefaultValue<bool>(SUMO_TAG_CROSSING, SUMO_ATTR_PRIORITY));
265  myCrossingWidth->setText(GNEAttributeCarrier::getDefaultValue<std::string>(SUMO_TAG_CROSSING, SUMO_ATTR_WIDTH).c_str());
266  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
267 }
268 
269 
270 void
272  // clear all values of parameters
273  myCrossingEdges->setText("");
274  myCrossingPriority->setCheck(false);
275  myCrossingPriority->setText("False");
276  myCrossingWidth->setText("");
277  // Disable all elements of the crossing frames
278  myCrossingEdgesLabel->disable();
279  myCrossingEdges->disable();
280  myCrossingPriorityLabel->disable();
281  myCrossingPriority->disable();
282  myCrossingWidthLabel->disable();
283  myCrossingWidth->disable();
284  myHelpCrossingAttribute->disable();
286 }
287 
288 
289 bool
291  return myCrossingEdgesLabel->isEnabled();
292 }
293 
294 
295 void
298  if (currentJunction != NULL) {
299  // Check if edge belongs to junction's edge
300  if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) != currentJunction->getGNEEdges().end()) {
301  // Update text field with the new edge
302  std::vector<std::string> crossingEdges;
303  SUMOSAXAttributes::parseStringVector(myCrossingEdges->getText().text(), crossingEdges);
304  // Check if new edge must be added or removed
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());
308  } else {
309  crossingEdges.erase(itFinder);
310  }
311  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
312  }
313  // Update colors and attributes
314  onCmdSetAttribute(0, 0, 0);
315  }
316 }
317 
318 
319 void
321  myCrossingEdges->setText("");
322  // Update colors and attributes
323  onCmdSetAttribute(0, 0, 0);
324 }
325 
326 
327 void
329  std::vector<std::string> crossingEdges;
330  for (std::vector<GNEEdge*>::const_iterator i = parentJunction->getGNEEdges().begin(); i != parentJunction->getGNEEdges().end(); i++) {
331  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), (*i)) == myCurrentSelectedEdges.end()) {
332  crossingEdges.push_back((*i)->getID());
333  }
334  }
335  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
336  // Update colors and attributes
337  onCmdSetAttribute(0, 0, 0);
338 }
339 
340 
341 void
343  std::vector<std::string> crossingEdges;
344  for (std::vector<GNEEdge*>::const_iterator i = parentJunction->getGNEEdges().begin(); i != parentJunction->getGNEEdges().end(); i++) {
345  if (gSelected.isSelected((*i)->getType(), (*i)->getGlID())) {
346  crossingEdges.push_back((*i)->getID());
347  }
348  }
349  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
350  // Update colors and attributes
351  onCmdSetAttribute(0, 0, 0);
352 }
353 
354 
355 std::vector<NBEdge*>
357  std::vector<NBEdge*> NBEdgeVector;
358  // Iterate over myCurrentSelectedEdges
359  for (std::vector<GNEEdge*>::const_iterator i = myCurrentSelectedEdges.begin(); i != myCurrentSelectedEdges.end(); i++) {
360  NBEdgeVector.push_back((*i)->getNBEdge());
361  }
362  return NBEdgeVector;
363 }
364 
365 
366 bool
368  if (myCrossingPriority->getCheck()) {
369  return true;
370  } else {
371  return false;
372  }
373 }
374 
375 
376 bool
379 }
380 
381 
382 SUMOReal
384  return GNEAttributeCarrier::parse<SUMOReal>(myCrossingWidth->getText().text());
385 }
386 
387 
388 const RGBColor&
390  return myCandidateColor;
391 }
392 
393 
394 const RGBColor&
396  return mySelectedColor;
397 }
398 
399 
400 long
403  // get string vector with the edges
404  std::vector<std::string> crossingEdges;
405  SUMOSAXAttributes::parseStringVector(myCrossingEdges->getText().text(), crossingEdges);
406 
407  // Clear selected edges
408  myCurrentSelectedEdges.clear();
409  // iterate over vector of edge IDs
410  for (std::vector<std::string>::iterator i = crossingEdges.begin(); i != crossingEdges.end(); i++) {
411  GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->retrieveEdge((*i), false);
413  // Check that edge exists and belongs to Junction
414  if (edge == 0) {
415  myCurrentParametersValid = false;
416  } else if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) == currentJunction->getGNEEdges().end()) {
417  myCurrentParametersValid = false;
418  } else {
419  // select or unselected edge
420  std::vector<GNEEdge*>::iterator itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);
421  if (itFinder == myCurrentSelectedEdges.end()) {
422  myCurrentSelectedEdges.push_back(edge);
423  } else {
424  myCurrentSelectedEdges.erase(itFinder);
425  }
426  }
427  }
428 
429  // change color of textfield dependig of myCurrentParametersValid
431  myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
432  myCrossingEdges->killFocus();
433  } else {
434  myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
435  myCurrentParametersValid = false;
436  }
437 
438  // Update colors of edges
439  for (std::vector<GNEEdge*>::const_iterator i = myEdgeSelector->getCurrentJunction()->getGNEEdges().begin(); i != myEdgeSelector->getCurrentJunction()->getGNEEdges().end(); i++) {
440  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), *i) != myCurrentSelectedEdges.end()) {
441  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
442  (*j)->setSpecialColor(&mySelectedColor);
443  }
444  } else {
445  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
446  (*j)->setSpecialColor(&myCandidateColor);
447  }
448  }
449  }
450  // Update view net
451  myCrossingFrameParent->getViewNet()->update();
452 
453  // Check that at least there are a selected edge
454  if (crossingEdges.empty()) {
455  myCurrentParametersValid = false;
456  }
457 
458  // change label of crossing priority
459  if (myCrossingPriority->getCheck()) {
460  myCrossingPriority->setText("True");
461  } else {
462  myCrossingPriority->setText("False");
463  }
464 
465  // Check width
466  if (TplCheck::_str2SUMOReal(myCrossingWidth->getText().text()) &&
467  TplConvert::_str2SUMOReal(myCrossingWidth->getText().text()) > 0) {
468  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
469  myCrossingWidth->killFocus();
470  } else {
471  myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
472  myCurrentParametersValid = false;
473  }
474 
475  // Enable or disable create crossing button depending of the current parameters
477  return 0;
478 }
479 
480 
481 long
482 GNECrossingFrame::crossingParameters::onCmdHelp(FXObject*, FXSelector, void*) {
483  // Create help dialog
484  FXDialogBox* helpDialog = new FXDialogBox(this, ("Parameters of " + toString(SUMO_TAG_CROSSING)).c_str(), GUIDesignDialogBox);
485  // Create FXTable
486  FXTable* myTable = new FXTable(helpDialog, this, MID_TABLE, TABLE_READONLY);
487  myTable->setVisibleRows((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()));
488  myTable->setVisibleColumns(3);
489  myTable->setTableSize((FXint)(GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size()), 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;
501  // Iterate over vector of additional parameters
502  for (int i = 0; i < (int)GNEAttributeCarrier::allowedAttributes(SUMO_TAG_CROSSING).size(); i++) {
504  // Set name of attribute
505  myTable->setItem(i, 0, new FXTableItem(toString(attr).c_str()));
506  // Set type
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");
518  }
519  type->setJustify(FXTableItem::CENTER_X);
520  myTable->setItem(i, 1, type);
521  // Set definition
522  FXTableItem* definition = new FXTableItem(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).c_str());
523  definition->setJustify(FXTableItem::LEFT);
524  myTable->setItem(i, 2, definition);
525  if ((int)GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size() > maxSizeColumnDefinitions) {
526  maxSizeColumnDefinitions = int(GNEAttributeCarrier::getDefinition(SUMO_TAG_CROSSING, attr).size());
527  }
528  }
529  // Set size of column
530  header->setItemJustify(2, JUSTIFY_CENTER_X);
531  header->setItemSize(2, maxSizeColumnDefinitions * 6);
532  // Button Close
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();
535  helpDialog->show();
536  return 1;
537 }
538 
539 // ---------------------------------------------------------------------------
540 // GNECrossingFrame - methods
541 // ---------------------------------------------------------------------------
542 
543 GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
544  GNEFrame(horizontalFrameParent, viewNet, "Crossings") {
545  // Create Groupbox for labels
546  myGroupBoxLabel = new FXGroupBox(myContentFrame, "Junction", GUIDesignGroupBoxFrame);
547  myCurrentJunctionLabel = new FXLabel(myGroupBoxLabel, "No junction selected", 0, GUIDesignLabelLeft);
548 
549  // Create edge Selector
551 
552  // Create crossingParameters
554 
555  // Create groupbox for create crossings
556  myGroupBoxButtons = new FXGroupBox(myContentFrame, "Create", GUIDesignGroupBoxFrame);
557  myCreateCrossingButton = new FXButton(myGroupBoxButtons, "Create crossing", 0, this, MID_GNE_CREATE_CROSSING, GUIDesignButton);
558  myCreateCrossingButton->disable();
559 
560  // Create groupbox and labels for legends
561  myGroupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame);
562  myColorCandidateLabel = new FXLabel(myGroupBoxLegend, "Candidate", 0, GUIDesignLabelLeft);
564  myColorSelectedLabel = new FXLabel(myGroupBoxLegend, "Selected", 0, GUIDesignLabelLeft);
566 
567  // disable edge selector
569 }
570 
571 
574 }
575 
576 
577 void
579  // Set default colors of edges (if a junction is yet selected)
580  if (myEdgeSelector->getCurrentJunction() != NULL) {
581  // remove color of edges
582  for (std::vector<GNEEdge*>::const_iterator i = myEdgeSelector->getCurrentJunction()->getGNEEdges().begin(); i != myEdgeSelector->getCurrentJunction()->getGNEEdges().end(); i++) {
583  for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
584  (*j)->setSpecialColor(0);
585  }
586  }
587  }
588 
589  // hide frame
590  GNEFrame::hide();
591 }
592 
593 
594 bool
596  // cast netElement
597  GNEJunction* currentJunction = dynamic_cast<GNEJunction*>(netElement);
598  GNEEdge* selectedEdge = dynamic_cast<GNEEdge*>(netElement);
599  GNELane* selectedLane = dynamic_cast<GNELane*>(netElement);
600 
601  // If current element is a junction
602  if (currentJunction != NULL) {
603  // change label
604  myCurrentJunctionLabel->setText((std::string("Current Junction: ") + currentJunction->getID()).c_str());
605  // Enable edge selector and crossing parameters
606  myEdgeSelector->enableEdgeSelector(currentJunction);
608  } else if (selectedEdge != NULL) {
609  myCrossingParameters->markEdge(selectedEdge);
610  } else if (selectedLane != NULL) {
611  myCrossingParameters->markEdge(&selectedLane->getParentEdge());
612  } else {
613  // set default label
614  myCurrentJunctionLabel->setText("No junction selected");
615  // restore color of all lanes of edge candidates
617  // Disable edge selector
619  }
620  return false;
621 }
622 
623 
624 long
625 GNECrossingFrame::onCmdCreateCrossing(FXObject*, FXSelector, void*) {
626  // First check that current parameters are valid
628  // iterate over junction's crossing to find duplicated crossings
630  // create new crossing
635  true), true);
636  // clear selected edges
638  } else {
639  WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
640  }
641  }
642  return 1;
643 }
644 
645 
646 void
648  if (value) {
649  myCreateCrossingButton->enable();
650  } else {
651  myCreateCrossingButton->disable();
652  }
653 }
654 
655 
658  return myEdgeSelector;
659 }
660 
661 
664  return myCrossingParameters;
665 }
666 
667 /****************************************************************************/
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 ...
Definition: TplConvert.h:348
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:732
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.
#define GUIDesignTextFieldAttributeStr
text field extended over the matrix column with thick frame
Definition: GUIDesigns.h:56
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
Definition: GUIDesigns.h:53
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.
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
Definition: GUIAppEnum.h:585
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.
Definition: GUIDesigns.h:201
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
FXGroupBox * myGroupBoxLabel
groupbox for the junction label
void hide()
hide crossing frame
clear selection of edges
Definition: GUIAppEnum.h:583
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:995
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:92
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
Create crossing.
Definition: GUIAppEnum.h:659
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
Definition: RGBColor.h:190
#define GUIDesignButtonDialog
button with size limited by text, centered over Frame with thick and raise frame
Definition: GUIDesigns.h:72
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:101
The Table.
Definition: GUIAppEnum.h:291
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1027
FXLabel * myCrossingPriorityLabel
Label for Priority.
GNEJunction * myCurrentJunction
current Junction
use selected edges only
Definition: GUIAppEnum.h:579
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.
Definition: GUIDesigns.h:132
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
Definition: GNEFrame.cpp:125
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)
Definition: GNEEdge.h:54
FXDEFMAP(GNECrossingFrame) GNECrossingMap[]
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:59
FXButton * helpEdges
button for help
FXTextField * myCrossingEdges
TextField for edges.
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
#define GUIDesignButton
Definition: GUIDesigns.h:66
#define GUIDesignButtonHelp
little button for help in frames
Definition: GUIDesigns.h:75
bool checkCrossingDuplicated(EdgeVector edges)
return true if already exist a crossing with the same edges as the input
Definition: NBNode.cpp:1984
GNECrossingFrame::crossingParameters * getCrossingParameters() const
get Crossing parameters
#define GUIDesignDialogBox
Definition: GUIDesigns.h:407
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:204
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
attribute edited
Definition: GUIAppEnum.h:553
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:989
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:109
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
Definition: MFXUtils.cpp:125
#define SUMOReal
Definition: config.h:208
help button
Definition: GUIAppEnum.h:404
static bool _str2SUMOReal(const std::string &data)
check if a String can be parsed into a SUMOReal check overflows
Definition: TplCheck.h:67
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:139
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:160
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:188