Eclipse SUMO - Simulation of Urban MObility
GNEFrameModuls.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Auxiliar class for GNEFrame Moduls
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 
22 #include <config.h>
23 
25 #include <netedit/GNENet.h>
26 #include <netedit/GNEUndoList.h>
27 #include <netedit/GNEViewNet.h>
28 #include <netedit/GNEViewParent.h>
39 #include <utils/gui/div/GLHelper.h>
43 
44 #include "GNEFrameModuls.h"
45 #include "GNEInspectorFrame.h"
46 
47 
48 // ===========================================================================
49 // FOX callback mapping
50 // ===========================================================================
51 
52 FXDEFMAP(GNEFrameModuls::TagSelector) TagSelectorMap[] = {
55 };
56 
57 FXDEFMAP(GNEFrameModuls::DemandElementSelector) DemandElementSelectorMap[] = {
59 };
60 
61 FXDEFMAP(GNEFrameModuls::EdgePathCreator) EdgePathCreatorMap[] = {
65 };
66 
67 FXDEFMAP(GNEFrameModuls::AttributeCarrierHierarchy) AttributeCarrierHierarchyMap[] = {
74 };
75 
76 FXDEFMAP(GNEFrameModuls::DrawingShape) DrawingShapeMap[] = {
80 };
81 
82 // Object implementation
83 FXIMPLEMENT(GNEFrameModuls::TagSelector, FXGroupBox, TagSelectorMap, ARRAYNUMBER(TagSelectorMap))
84 FXIMPLEMENT(GNEFrameModuls::DemandElementSelector, FXGroupBox, DemandElementSelectorMap, ARRAYNUMBER(DemandElementSelectorMap))
85 FXIMPLEMENT(GNEFrameModuls::EdgePathCreator, FXGroupBox, EdgePathCreatorMap, ARRAYNUMBER(EdgePathCreatorMap))
86 FXIMPLEMENT(GNEFrameModuls::AttributeCarrierHierarchy, FXGroupBox, AttributeCarrierHierarchyMap, ARRAYNUMBER(AttributeCarrierHierarchyMap))
87 FXIMPLEMENT(GNEFrameModuls::DrawingShape, FXGroupBox, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap))
88 
89 
90 // ===========================================================================
91 // method definitions
92 // ===========================================================================
93 
94 // ---------------------------------------------------------------------------
95 // GNEFrameModuls::TagSelector - methods
96 // ---------------------------------------------------------------------------
97 
98 GNEFrameModuls::TagSelector::TagSelector(GNEFrame* frameParent, GNEAttributeCarrier::TagType type, bool onlyDrawables) :
99  FXGroupBox(frameParent->myContentFrame, "Element", GUIDesignGroupBoxFrame),
100  myFrameParent(frameParent) {
101  // first check that property is valid
102  switch (type) {
103  case GNEAttributeCarrier::TagType::TAGTYPE_NETELEMENT:
104  setText("Net elements");
105  break;
106  case GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL:
107  setText("Additional elements");
108  break;
109  case GNEAttributeCarrier::TagType::TAGTYPE_SHAPE:
110  setText("Shape elements");
111  break;
112  case GNEAttributeCarrier::TagType::TAGTYPE_TAZ:
113  setText("TAZ elements");
114  break;
115  case GNEAttributeCarrier::TagType::TAGTYPE_VEHICLE:
116  setText("Vehicles");
117  break;
118  case GNEAttributeCarrier::TagType::TAGTYPE_STOP:
119  setText("Stops");
120  break;
121  case GNEAttributeCarrier::TagType::TAGTYPE_PERSON:
122  setText("Persons");
123  break;
124  case GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN:
125  setText("Person plans");
126  // person plan type has four sub-groups
127  myListOfTagTypes.push_back(std::make_pair("person trips", GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP));
128  myListOfTagTypes.push_back(std::make_pair("walks", GNEAttributeCarrier::TagType::TAGTYPE_WALK));
129  myListOfTagTypes.push_back(std::make_pair("rides", GNEAttributeCarrier::TagType::TAGTYPE_RIDE));
130  myListOfTagTypes.push_back(std::make_pair("stops", GNEAttributeCarrier::TagType::TAGTYPE_PERSONSTOP));
131  break;
132  case GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP:
133  setText("Person trips");
134  break;
135  case GNEAttributeCarrier::TagType::TAGTYPE_WALK:
136  setText("Walks");
137  break;
138  case GNEAttributeCarrier::TagType::TAGTYPE_RIDE:
139  setText("Rides");
140  break;
141  case GNEAttributeCarrier::TagType::TAGTYPE_PERSONSTOP:
142  setText("Person stops");
143  break;
144  default:
145  throw ProcessError("invalid tag property");
146  }
147 
148  // Create FXComboBox
149  myTagTypesMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_TAGTYPE_SELECTED, GUIDesignComboBox);
150  // Create FXComboBox
151  myTagsMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_TAG_SELECTED, GUIDesignComboBox);
152  // Fill comboBox depending of TagTypes
153  if (myListOfTagTypes.size() > 0) {
154  // fill myTypeMatchBox with list of tags
155  for (const auto& i : myListOfTagTypes) {
156  myTagTypesMatchBox->appendItem(i.first.c_str());
157  }
158  // Set visible items
159  myTagTypesMatchBox->setNumVisible((int)myTagTypesMatchBox->getNumItems());
160  // fill myListOfTags with personTrips (the first Tag Type)
161  myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP, onlyDrawables);
162  } else {
163  myTagTypesMatchBox->hide();
164  // fill myListOfTags
165  myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(type, onlyDrawables);
166 
167  }
168  // fill myTypeMatchBox with list of tags
169  for (const auto& i : myListOfTags) {
170  myTagsMatchBox->appendItem(toString(i).c_str());
171  }
172  // Set visible items
173  myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems());
174  // TagSelector is always shown
175  show();
176 }
177 
178 
180 
181 
182 void
184  show();
185 }
186 
187 
188 void
190  hide();
191 }
192 
193 
196  return myCurrentTagProperties;
197 }
198 
199 
200 void
202  // set empty tag properties
203  myCurrentTagProperties = GNEAttributeCarrier::TagProperties();
204  // make sure that tag is in myTypeMatchBox
205  for (int i = 0; i < (int)myTagsMatchBox->getNumItems(); i++) {
206  if (myTagsMatchBox->getItem(i).text() == toString(tagType)) {
207  myTagsMatchBox->setCurrentItem(i);
208  // fill myListOfTags with personTrips (the first Tag Type)
209  myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP, true);
210  // clear myTagsMatchBox
211  myTagsMatchBox->clearItems();
212  // fill myTypeMatchBox with list of tags
213  for (const auto& j : myListOfTags) {
214  myTagsMatchBox->appendItem(toString(j).c_str());
215  }
216  // Set visible items
217  myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems());
218  }
219  }
220  // call tag selected function
221  myFrameParent->tagSelected();
222 }
223 
224 
225 void
227  // set empty tag properties
228  myCurrentTagProperties = GNEAttributeCarrier::TagProperties();
229  // make sure that tag is in myTypeMatchBox
230  for (int i = 0; i < (int)myTagsMatchBox->getNumItems(); i++) {
231  if (myTagsMatchBox->getItem(i).text() == toString(newTag)) {
232  myTagsMatchBox->setCurrentItem(i);
233  // Set new current type
234  myCurrentTagProperties = GNEAttributeCarrier::getTagProperties(newTag);
235  }
236  }
237  // call tag selected function
238  myFrameParent->tagSelected();
239 }
240 
241 
242 void
244  // simply call onCmdSelectItem (to avoid duplicated code)
245  onCmdSelectTag(0, 0, 0);
246 }
247 
248 
249 long GNEFrameModuls::TagSelector::onCmdSelectTagType(FXObject*, FXSelector, void*) {
250  // Check if value of myTypeMatchBox correspond of an allowed additional tags
251  for (const auto& i : myListOfTagTypes) {
252  if (i.first == myTagTypesMatchBox->getText().text()) {
253  // set color of myTagTypesMatchBox to black (valid)
254  myTagTypesMatchBox->setTextColor(FXRGB(0, 0, 0));
255  // fill myListOfTags with personTrips (the first Tag Type)
256  myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(i.second, true);
257  // show and clear myTagsMatchBox
258  myTagsMatchBox->show();
259  myTagsMatchBox->clearItems();
260  // fill myTypeMatchBox with list of tags
261  for (const auto& j : myListOfTags) {
262  myTagsMatchBox->appendItem(toString(j).c_str());
263  }
264  // Set visible items
265  myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems());
266  // Write Warning in console if we're in testing mode
267  WRITE_DEBUG(("Selected item '" + myTagsMatchBox->getText() + "' in TagTypeSelector").text());
268  // call onCmdSelectTag
269  return onCmdSelectTag(nullptr, 0, nullptr);
270  }
271  }
272  // if TagType isn't valid, hide myTagsMatchBox
273  myTagsMatchBox->hide();
274  // if additional name isn't correct, set SUMO_TAG_NOTHING as current type
275  myCurrentTagProperties = myInvalidTagProperty;
276  // call tag selected function
277  myFrameParent->tagSelected();
278  // set color of myTagTypesMatchBox to red (invalid)
279  myTagTypesMatchBox->setTextColor(FXRGB(255, 0, 0));
280  // Write Warning in console if we're in testing mode
281  WRITE_DEBUG("Selected invalid item in TagTypeSelector");
282  return 1;
283 }
284 
285 
286 long
287 GNEFrameModuls::TagSelector::onCmdSelectTag(FXObject*, FXSelector, void*) {
288  // Check if value of myTypeMatchBox correspond of an allowed additional tags
289  for (const auto& i : myListOfTags) {
290  if (toString(i) == myTagsMatchBox->getText().text()) {
291  // set color of myTypeMatchBox to black (valid)
292  myTagsMatchBox->setTextColor(FXRGB(0, 0, 0));
293  // Set new current type
294  myCurrentTagProperties = GNEAttributeCarrier::getTagProperties(i);
295  // call tag selected function
296  myFrameParent->tagSelected();
297  // Write Warning in console if we're in testing mode
298  WRITE_DEBUG(("Selected item '" + myTagsMatchBox->getText() + "' in TagSelector").text());
299  return 1;
300  }
301  }
302  // if additional name isn't correct, set SUMO_TAG_NOTHING as current type
303  myCurrentTagProperties = myInvalidTagProperty;
304  // call tag selected function
305  myFrameParent->tagSelected();
306  // set color of myTypeMatchBox to red (invalid)
307  myTagsMatchBox->setTextColor(FXRGB(255, 0, 0));
308  // Write Warning in console if we're in testing mode
309  WRITE_DEBUG("Selected invalid item in TagSelector");
310  return 1;
311 }
312 
313 // ---------------------------------------------------------------------------
314 // GNEFrameModuls::DemandElementSelector - methods
315 // ---------------------------------------------------------------------------
316 
318  FXGroupBox(frameParent->myContentFrame, ("Parent " + toString(demandElementTag)).c_str(), GUIDesignGroupBoxFrame),
319  myFrameParent(frameParent),
320  myCurrentDemandElement(nullptr),
321  myDemandElementTags({demandElementTag}) {
322  // Create FXComboBox
323  myDemandElementsMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox);
324  // refresh demand element MatchBox
325  refreshDemandElementSelector();
326  // shown after creation
327  show();
328 }
329 
330 
331 GNEFrameModuls::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, const std::vector<GNEAttributeCarrier::TagType>& tagTypes) :
332  FXGroupBox(frameParent->myContentFrame, "Parent element", GUIDesignGroupBoxFrame),
333  myFrameParent(frameParent),
334  myCurrentDemandElement(nullptr) {
335  // fill myDemandElementTags
336  for (const auto& i : tagTypes) {
337  auto tags = GNEAttributeCarrier::allowedTagsByCategory(i, false);
338  myDemandElementTags.insert(myDemandElementTags.end(), tags.begin(), tags.end());
339  }
340  // Create FXComboBox
342  // refresh demand element MatchBox
344  // shown after creation
345  show();
346 }
347 
348 
350 
351 
354  return myCurrentDemandElement;
355 }
356 
357 
358 const std::vector<SumoXMLTag>&
360  return myDemandElementTags;
361 }
362 
363 void
365  // first check that demandElement tag correspond to a tag of myDemandElementTags
366  if (std::find(myDemandElementTags.begin(), myDemandElementTags.end(), demandElement->getTagProperty().getTag()) != myDemandElementTags.end()) {
367  // update text of myDemandElementsMatchBox
368  myDemandElementsMatchBox->setText(demandElement->getID().c_str());
369  // Set new current demand element
370  myCurrentDemandElement = demandElement;
371  // call demandElementSelected function
372  myFrameParent->demandElementSelected();
373  }
374 }
375 
376 
377 void
379  // first refresh modul
380  refreshDemandElementSelector();
381  // if current selected item isn't valid, set DEFAULT_VTYPE_ID or DEFAULT_PEDTYPE_ID
382  if (myCurrentDemandElement) {
383  myDemandElementsMatchBox->setText(myCurrentDemandElement->getID().c_str());
384  } else if (myDemandElementTags.size() == 1) {
385  if (myDemandElementTags.at(0) == SUMO_TAG_VTYPE) {
386  myDemandElementsMatchBox->setText(DEFAULT_VTYPE_ID.c_str());
387  } else if (myDemandElementTags.at(0) == SUMO_TAG_PTYPE) {
388  myDemandElementsMatchBox->setText(DEFAULT_PEDTYPE_ID.c_str());
389  }
390  }
391  onCmdSelectDemandElement(nullptr, 0, nullptr);
392  show();
393 }
394 
395 
396 void
398  hide();
399 }
400 
401 
402 bool
404  return shown();
405 }
406 
407 
408 void
410  // clear demand elements comboBox
411  myDemandElementsMatchBox->clearItems();
412  // fill myTypeMatchBox with list of demand elements
413  for (const auto& i : myDemandElementTags) {
414  // special case for VTypes and PTypes
415  if (i == SUMO_TAG_VTYPE) {
416  // add default Vehicle an Bike types in the first and second positions
417  myDemandElementsMatchBox->appendItem(DEFAULT_VTYPE_ID.c_str());
418  myDemandElementsMatchBox->appendItem(DEFAULT_BIKETYPE_ID.c_str());
419  // add rest of vTypes
420  for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) {
421  // avoid insert duplicated default vType
422  if ((j.first != DEFAULT_VTYPE_ID) && (j.first != DEFAULT_BIKETYPE_ID)) {
423  myDemandElementsMatchBox->appendItem(j.first.c_str());
424  }
425  }
426  } else if (i == SUMO_TAG_PTYPE) {
427  // add default Person type in the firs
428  myDemandElementsMatchBox->appendItem(DEFAULT_PEDTYPE_ID.c_str());
429  // add rest of pTypes
430  for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) {
431  // avoid insert duplicated default pType
432  if (j.first != DEFAULT_PEDTYPE_ID) {
433  myDemandElementsMatchBox->appendItem(j.first.c_str());
434  }
435  }
436  } else {
437  // insert all Ids
438  for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) {
439  myDemandElementsMatchBox->appendItem(j.first.c_str());
440  }
441  }
442  }
443  // Set number of items (maximum 10)
444  if (myDemandElementsMatchBox->getNumItems() < 10) {
445  myDemandElementsMatchBox->setNumVisible((int)myDemandElementsMatchBox->getNumItems());
446  } else {
447  myDemandElementsMatchBox->setNumVisible(10);
448  }
449  // update myCurrentDemandElement
450  if (myDemandElementsMatchBox->getNumItems() == 0) {
451  myCurrentDemandElement = nullptr;
452  } else if (myCurrentDemandElement) {
453  for (int i = 0; i < myDemandElementsMatchBox->getNumItems(); i++) {
454  if (myDemandElementsMatchBox->getItem(i).text() == myCurrentDemandElement->getID()) {
455  myDemandElementsMatchBox->setCurrentItem(i, FALSE);
456  }
457  }
458  } else {
459  // set first element in the list as myCurrentDemandElement (Special case for default person and vehicle type)
460  if (myDemandElementsMatchBox->getItem(0).text() == DEFAULT_VTYPE_ID) {
461  myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE).at(DEFAULT_VTYPE_ID);
462  } else if (myDemandElementsMatchBox->getItem(0).text() == DEFAULT_PEDTYPE_ID) {
463  myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PTYPE).at(DEFAULT_PEDTYPE_ID);
464  } else {
465  // disable myCurrentDemandElement
466  myCurrentDemandElement = nullptr;
467  // update myCurrentDemandElement with the first allowed element
468  for (auto i = myDemandElementTags.begin(); (i != myDemandElementTags.end()) && (myCurrentDemandElement == nullptr); i++) {
469  if (myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(*i).size() > 0) {
470  myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(*i).begin()->second;
471  }
472  }
473  }
474  }
475 }
476 
477 
478 long
480  // Check if value of myTypeMatchBox correspond to a demand element
481  for (const auto& i : myDemandElementTags) {
482  for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) {
483  if (j.first == myDemandElementsMatchBox->getText().text()) {
484  // set color of myTypeMatchBox to black (valid)
485  myDemandElementsMatchBox->setTextColor(FXRGB(0, 0, 0));
486  // Set new current demand element
487  myCurrentDemandElement = j.second;
488  // call demandElementSelected function
489  myFrameParent->demandElementSelected();
490  // Write Warning in console if we're in testing mode
491  WRITE_DEBUG(("Selected item '" + myDemandElementsMatchBox->getText() + "' in DemandElementSelector").text());
492  return 1;
493  }
494  }
495  }
496  // if demand element selected is invalid, set demand element as null
497  myCurrentDemandElement = nullptr;
498  // call demandElementSelected function
499  myFrameParent->demandElementSelected();
500  // change color of myDemandElementsMatchBox to red (invalid)
501  myDemandElementsMatchBox->setTextColor(FXRGB(255, 0, 0));
502  // Write Warning in console if we're in testing mode
503  WRITE_DEBUG("Selected invalid item in DemandElementSelector");
504  return 1;
505 }
506 
507 // ---------------------------------------------------------------------------
508 // GNEFrameModuls::EdgePathCreator - methods
509 // ---------------------------------------------------------------------------
510 
511 GNEFrameModuls::EdgePathCreator::EdgePathCreator(GNEFrame* frameParent, int edgePathCreatorModes) :
512  FXGroupBox(frameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame),
513  myFrameParent(frameParent),
514  myVClass(SVC_PASSENGER),
515  mySelectedBusStop(nullptr),
516  myEdgePathCreatorModes(edgePathCreatorModes) {
517 
518  // create button for create GEO POIs
519  myFinishCreationButton = new FXButton(this, "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton);
520  myFinishCreationButton->disable();
521 
522  // create button for create GEO POIs
523  myAbortCreationButton = new FXButton(this, "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton);
524  myAbortCreationButton->disable();
525 
526  // create button for create GEO POIs
527  myRemoveLastInsertedEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton);
528  myRemoveLastInsertedEdge->disable();
529 }
530 
531 
533 
534 
535 void
537  // header needs the first capitalized letter
538  std::string nameWithFirstCapitalizedLetter = name;
539  nameWithFirstCapitalizedLetter[0] = (char)toupper(nameWithFirstCapitalizedLetter.at(0));
540  setText((nameWithFirstCapitalizedLetter + " creator").c_str());
541  myFinishCreationButton->setText(("Finish " + name + " creation").c_str());
542  myAbortCreationButton->setText(("Abort " + name + " creation").c_str());
543 }
544 
545 
546 void
548  // disable buttons
549  myFinishCreationButton->disable();
550  myAbortCreationButton->disable();
551  myRemoveLastInsertedEdge->disable();
552  // show modul
553  show();
554 }
555 
556 
557 void
559  // restore colors
560  for (const auto& i : myClickedEdges) {
561  restoreEdgeColor(i);
562  }
563  // clear edges
564  myClickedEdges.clear();
565  // clear myTemporalEdgePath
566  myTemporalRoute.clear();
567  // hide modul
568  hide();
569 }
570 
571 
572 void
574  myVClass = vClass;
575 }
576 
577 
578 void
580  myEdgePathCreatorModes = edgePathCreatorModes;
581 }
582 
583 
584 std::vector<GNEEdge*>
586  return myClickedEdges;
587 }
588 
589 
592  return mySelectedBusStop;
593 }
594 
595 
596 bool
598  bool addEdge = true;
599  // check if final busStop was selected
600  if (mySelectedBusStop != nullptr) {
601  addEdge = false;
602  // write status bar text
603  myFrameParent->getViewNet()->setStatusBarText("Final " + mySelectedBusStop->getTagProperty().getTagStr() + " selected");
604  // Write Warning in console if we're in testing mode
605  WRITE_DEBUG("Final " + mySelectedBusStop->getTagProperty().getTagStr() + " selected");
606  } else if ((myClickedEdges.size() > 0) && (myClickedEdges.back() == edge)) {
607  // avoid duplicated consecutive edges
608  addEdge = false;
609  // write status bar text
610  myFrameParent->getViewNet()->setStatusBarText("Duplicated consecutive edges aren't allowed");
611  // Write Warning in console if we're in testing mode
612  WRITE_DEBUG("Duplicated consecutive edges aren't allowed");
613  }
614  // check permissions
615  if (addEdge) {
616  addEdge = false;
617  for (const auto& i : edge->getNBEdge()->getLanes()) {
618  if ((i.permissions & myVClass) != 0) {
619  addEdge = true;
620  }
621  }
622  if (addEdge == false) {
623  // write status bar text
624  myFrameParent->getViewNet()->setStatusBarText("Invalid edge permissions");
625  // Write Warning in console if we're in testing mode
626  WRITE_DEBUG("Invalid edge permissions");
627  }
628  }
629  // check if edge can be added
630  if (addEdge) {
631  // insert edge in myClickedEdges
632  myClickedEdges.push_back(edge);
633  // enable abort route button
634  myAbortCreationButton->enable();
635  // disable undo/redo
636  myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("trip creation");
637  // set special color
638  for (auto i : edge->getLanes()) {
639  i->setSpecialColor(&myFrameParent->getEdgeCandidateSelectedColor());
640  }
641  // enable remove last edge button
642  myRemoveLastInsertedEdge->enable();
643  // enable finish button
644  myFinishCreationButton->enable();
645  // calculate route if there is more than two edges
646  if (myClickedEdges.size() > 1) {
647  // calculate temporal route
648  myTemporalRoute = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(myVClass, myClickedEdges);
649  } else {
650  // use single edge as temporal route
651  myTemporalRoute = myClickedEdges;
652  }
653  return true;
654  } else {
655  return false;
656  }
657 }
658 
659 
660 bool
662  // check that at least there is a selected edge
663  if (!myClickedEdges.empty() && (mySelectedBusStop == nullptr)) {
664  mySelectedBusStop = busStop;
665  mySelectedBusStop->setSpecialColor(&myFrameParent->getEdgeCandidateSelectedColor());
666  }
667  return false;
668 }
669 
670 
671 void
673  // restore colors
674  for (const auto& i : myClickedEdges) {
675  restoreEdgeColor(i);
676  }
677  // clear edges
678  myClickedEdges.clear();
679  myTemporalRoute.clear();
680  // clear busStop
681  if (mySelectedBusStop) {
682  mySelectedBusStop->setSpecialColor(nullptr);
683  mySelectedBusStop = nullptr;
684  }
685  // enable undo/redo
686  myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo();
687 }
688 
689 
690 void
692  // draw depending of number of edges
693  if (myClickedEdges.size() > 0) {
694  // Add a draw matrix
695  glPushMatrix();
696  // Start with the drawing of the area traslating matrix to origin
697  glTranslated(0, 0, GLO_MAX);
698  // set orange color
700  // set line width
701  glLineWidth(5);
702  // draw first line
703  GLHelper::drawLine(myTemporalRoute.at(0)->getNBEdge()->getLanes().front().shape.front(),
704  myTemporalRoute.at(0)->getNBEdge()->getLanes().front().shape.back());
705  // draw rest of lines
706  for (int i = 1; i < (int)myTemporalRoute.size(); i++) {
707  GLHelper::drawLine(myTemporalRoute.at(i - 1)->getNBEdge()->getLanes().front().shape.back(),
708  myTemporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front());
709  GLHelper::drawLine(myTemporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front(),
710  myTemporalRoute.at(i)->getNBEdge()->getLanes().front().shape.back());
711  }
712  // draw a line to center of selected bus
713  if (mySelectedBusStop) {
714  GLHelper::drawLine(myTemporalRoute.back()->getNBEdge()->getLanes().front().shape.back(),
715  mySelectedBusStop->getAdditionalGeometry().shape.getLineCenter());
716  }
717  // Pop last matrix
718  glPopMatrix();
719  }
720 }
721 
722 
723 void
725  if (myAbortCreationButton->isEnabled()) {
726  onCmdAbortRouteCreation(nullptr, 0, nullptr);
727  }
728 }
729 
730 
731 void
733  if (myFinishCreationButton->isEnabled()) {
734  onCmdFinishRouteCreation(nullptr, 0, nullptr);
735  }
736 }
737 
738 
739 void
741  if (myRemoveLastInsertedEdge->isEnabled()) {
742  onCmdRemoveLastInsertedElement(nullptr, 0, nullptr);
743  }
744 }
745 
746 
747 long
749  // clear edges
750  clearEdges();
751  // disable buttons
752  myAbortCreationButton->disable();
753  myFinishCreationButton->disable();
754  myRemoveLastInsertedEdge->disable();
755  return 1;
756 }
757 
758 
759 long
761  // only create route if there is more than two edges
762  if (myClickedEdges.size() > 0) {
763  // call edgePathCreated
764  myFrameParent->edgePathCreated();
765  // update view
766  myFrameParent->myViewNet->update();
767  // clear edges after creation
768  clearEdges();
769  // disable buttons
770  myFinishCreationButton->disable();
771  myAbortCreationButton->disable();
772  myRemoveLastInsertedEdge->disable();
773  }
774  return 1;
775 }
776 
777 
778 long
780  if (myClickedEdges.size() > 1) {
781  // restore color of last clicked edge
782  restoreEdgeColor(myClickedEdges.back());
783  // remove last edge
784  myClickedEdges.pop_back();
785  // calculate temporal route
786  myTemporalRoute = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(myVClass, myClickedEdges);
787  // update view (to see the new temporal route)
788  myFrameParent->myViewNet->update();
789  // check if after pop edge, there is more than one edge
790  if (myClickedEdges.size() == 1) {
791  // disable remove last edge button
792  myRemoveLastInsertedEdge->disable();
793  }
794  }
795  return 1;
796 }
797 
798 
799 void
801  // restore color of every lane
802  for (const auto& i : edge->getLanes()) {
803  i->setSpecialColor(nullptr);
804  }
805 }
806 
807 // ---------------------------------------------------------------------------
808 // GNEFrameModuls::AttributeCarrierHierarchy - methods
809 // ---------------------------------------------------------------------------
810 
812  FXGroupBox(frameParent->myContentFrame, "Hierarchy", GUIDesignGroupBoxFrame),
813  myFrameParent(frameParent),
814  myAC(nullptr),
815  myClickedAC(nullptr),
816  myClickedJunction(nullptr),
817  myClickedEdge(nullptr),
818  myClickedLane(nullptr),
819  myClickedCrossing(nullptr),
820  myClickedConnection(nullptr),
821  myClickedShape(nullptr),
822  myClickedAdditional(nullptr),
823  myClickedDemandElement(nullptr) {
824  // Create three list
826  hide();
827 }
828 
829 
831 
832 
833 void
835  myAC = AC;
836  // show AttributeCarrierHierarchy and refresh AttributeCarrierHierarchy
837  if (myAC) {
838  show();
839  refreshAttributeCarrierHierarchy();
840  }
841 }
842 
843 
844 void
846  // set all pointers null
847  myAC = nullptr;
848  myClickedAC = nullptr;
849  myClickedJunction = nullptr;
850  myClickedEdge = nullptr;
851  myClickedLane = nullptr;
852  myClickedCrossing = nullptr;
853  myClickedConnection = nullptr;
854  myClickedShape = nullptr;
855  myClickedAdditional = nullptr;
856  myClickedDemandElement = nullptr;
857  // hide modul
858  hide();
859 }
860 
861 
862 void
864  // clear items
865  myTreelist->clearItems();
866  myTreeItemToACMap.clear();
867  myTreeItemsConnections.clear();
868  // show ACChildren of myAC
869  if (myAC) {
870  showAttributeCarrierChildren(myAC, showAttributeCarrierParents());
871  }
872 }
873 
874 
875 long
876 GNEFrameModuls::AttributeCarrierHierarchy::onCmdShowChildMenu(FXObject*, FXSelector, void* eventData) {
877  // Obtain event
878  FXEvent* e = (FXEvent*)eventData;
879  // obtain FXTreeItem in the given position
880  FXTreeItem* item = myTreelist->getItemAt(e->win_x, e->win_y);
881  // open Pop-up if FXTreeItem has a Attribute Carrier vinculated
882  if (item && (myTreeItemsConnections.find(item) == myTreeItemsConnections.end())) {
883  createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[item]);
884  }
885  return 1;
886 }
887 
888 
889 long
891  // Center item
892  if (myClickedJunction) {
893  myFrameParent->myViewNet->centerTo(myClickedJunction->getGlID(), true, -1);
894  } else if (myClickedEdge) {
895  myFrameParent->myViewNet->centerTo(myClickedEdge->getGlID(), true, -1);
896  } else if (myClickedLane) {
897  myFrameParent->myViewNet->centerTo(myClickedLane->getGlID(), true, -1);
898  } else if (myClickedCrossing) {
899  myFrameParent->myViewNet->centerTo(myClickedCrossing->getGlID(), true, -1);
900  } else if (myClickedConnection) {
901  myFrameParent->myViewNet->centerTo(myClickedConnection->getGlID(), true, -1);
902  } else if (myClickedAdditional) {
903  myFrameParent->myViewNet->centerTo(myClickedAdditional->getGlID(), true, -1);
904  } else if (myClickedShape) {
905  myFrameParent->myViewNet->centerTo(myClickedShape->getGlID(), true, -1);
906  } else if (myClickedDemandElement) {
907  myFrameParent->myViewNet->centerTo(myClickedDemandElement->getGlID(), true, -1);
908  }
909  // update view after centering
910  myFrameParent->myViewNet->update();
911  return 1;
912 }
913 
914 
915 long
917  if ((myAC != nullptr) && (myClickedAC != nullptr)) {
918  myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectChild(myClickedAC, myAC);
919  }
920  return 1;
921 }
922 
923 
924 long
926  // check if Inspector frame was opened before removing
927  const std::vector<GNEAttributeCarrier*>& currentInspectedACs = myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->getAttributesEditor()->getEditedACs();
928  // Remove Attribute Carrier
929  if (myClickedJunction) {
930  myFrameParent->myViewNet->getNet()->deleteJunction(myClickedJunction, myFrameParent->myViewNet->getUndoList());
931  } else if (myClickedEdge) {
932  myFrameParent->myViewNet->getNet()->deleteEdge(myClickedEdge, myFrameParent->myViewNet->getUndoList(), false);
933  } else if (myClickedLane) {
934  myFrameParent->myViewNet->getNet()->deleteLane(myClickedLane, myFrameParent->myViewNet->getUndoList(), false);
935  } else if (myClickedCrossing) {
936  myFrameParent->myViewNet->getNet()->deleteCrossing(myClickedCrossing, myFrameParent->myViewNet->getUndoList());
937  } else if (myClickedConnection) {
938  myFrameParent->myViewNet->getNet()->deleteConnection(myClickedConnection, myFrameParent->myViewNet->getUndoList());
939  } else if (myClickedAdditional) {
940  myFrameParent->myViewNet->getNet()->deleteAdditional(myClickedAdditional, myFrameParent->myViewNet->getUndoList());
941  } else if (myClickedShape) {
942  myFrameParent->myViewNet->getNet()->deleteShape(myClickedShape, myFrameParent->myViewNet->getUndoList());
943  } else if (myClickedDemandElement) {
944  // check that default VTypes aren't removed
945  if ((myClickedDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && (GNEAttributeCarrier::parse<bool>(myClickedDemandElement->getAttribute(GNE_ATTR_DEFAULT_VTYPE)))) {
946  WRITE_WARNING("Default Vehicle Type '" + myClickedDemandElement->getAttribute(SUMO_ATTR_ID) + "' cannot be removed");
947  return 1;
948  } else {
949  myFrameParent->myViewNet->getNet()->deleteDemandElement(myClickedDemandElement, myFrameParent->myViewNet->getUndoList());
950  }
951  }
952  // update viewNet
953  myFrameParent->myViewNet->update();
954  // refresh AC Hierarchy
955  refreshAttributeCarrierHierarchy();
956  // check if inspector frame has to be shown again
957  if (currentInspectedACs.size() == 1) {
958  if (currentInspectedACs.front() != myClickedAC) {
959  myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(currentInspectedACs.front());
960  } else {
961  // inspect a nullprt element to reset inspector frame
962  myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(nullptr);
963  }
964  }
965  return 1;
966 }
967 
968 
969 long
971  // currently only children of demand elements can be moved
972  if (myClickedDemandElement) {
973  myFrameParent->myViewNet->getUndoList()->p_begin(("moving up " + myClickedDemandElement->getTagStr()).c_str());
974  // move element one position back
975  myFrameParent->myViewNet->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getDemandElementParents().at(0), myClickedDemandElement,
976  GNEChange_Children::Operation::MOVE_BACK), true);
977  myFrameParent->myViewNet->getUndoList()->p_end();
978  }
979  // refresh after moving child
980  refreshAttributeCarrierHierarchy();
981  return 1;
982 }
983 
984 
985 long
987  // currently only children of demand elements can be moved
988  if (myClickedDemandElement) {
989  myFrameParent->myViewNet->getUndoList()->p_begin(("moving down " + myClickedDemandElement->getTagStr()).c_str());
990  // move element one position front
991  myFrameParent->myViewNet->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getDemandElementParents().at(0), myClickedDemandElement,
992  GNEChange_Children::Operation::MOVE_FRONT), true);
993  myFrameParent->myViewNet->getUndoList()->p_end();
994  }
995  // refresh after moving child
996  refreshAttributeCarrierHierarchy();
997  return 1;
998 }
999 
1000 
1001 void
1003  // first check that AC exist
1004  if (clickedAC) {
1005  // set current clicked AC
1006  myClickedAC = clickedAC;
1007  // cast all elements
1008  myClickedJunction = dynamic_cast<GNEJunction*>(clickedAC);
1009  myClickedEdge = dynamic_cast<GNEEdge*>(clickedAC);
1010  myClickedLane = dynamic_cast<GNELane*>(clickedAC);
1011  myClickedCrossing = dynamic_cast<GNECrossing*>(clickedAC);
1012  myClickedConnection = dynamic_cast<GNEConnection*>(clickedAC);
1013  myClickedShape = dynamic_cast<GNEShape*>(clickedAC);
1014  myClickedAdditional = dynamic_cast<GNEAdditional*>(clickedAC);
1015  myClickedDemandElement = dynamic_cast<GNEDemandElement*>(clickedAC);
1016  // create FXMenuPane
1017  FXMenuPane* pane = new FXMenuPane(myTreelist);
1018  // set item name and icon
1019  new MFXMenuHeader(pane, myFrameParent->myViewNet->getViewParent()->getGUIMainWindow()->getBoldFont(), myClickedAC->getPopUpID().c_str(), myClickedAC->getIcon());
1020  // insert separator
1021  new FXMenuSeparator(pane);
1022  // create center menu command
1023  FXMenuCommand* centerMenuCommand = new FXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_GNE_CENTER);
1024  // disable Centering for Vehicle Types
1025  if (myClickedAC->getTagProperty().isVehicleType()) {
1026  centerMenuCommand->disable();
1027  }
1028  // create inspect and delete menu commands
1029  FXMenuCommand* inspectMenuCommand = new FXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(ICON_MODEINSPECT), this, MID_GNE_INSPECT);
1030  FXMenuCommand* deleteMenuCommand = new FXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(ICON_MODEDELETE), this, MID_GNE_DELETE);
1031  // check if inspect and delete menu commands has to be disabled
1032  if ((myClickedAC->getTagProperty().isNetElement() && (myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND)) ||
1033  (myClickedAC->getTagProperty().isDemandElement() && (myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK))) {
1034  inspectMenuCommand->disable();
1035  deleteMenuCommand->disable();
1036  }
1037  // now chec if given AC support manually moving of their item up and down (Currently only for demand elements
1038  if (myClickedDemandElement && myClickedAC->getTagProperty().canBeSortedManually()) {
1039  // insert separator
1040  new FXMenuSeparator(pane);
1041  // create both moving menu commands
1042  FXMenuCommand* moveUpMenuCommand = new FXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(ICON_ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP);
1043  FXMenuCommand* moveDownMenuCommand = new FXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(ICON_ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN);
1044  // check if both commands has to be disabled
1045  if (myClickedDemandElement->getTagProperty().isPersonStop()) {
1046  moveUpMenuCommand->setText("Move up (Stops cannot be moved)");
1047  moveDownMenuCommand->setText("Move diwb (Stops cannot be moved)");
1048  moveUpMenuCommand->disable();
1049  moveDownMenuCommand->disable();
1050  } else {
1051  // check if moveUpMenuCommand has to be disabled
1052  if (myClickedDemandElement->getDemandElementParents().front()->getDemandElementChildren().front() == myClickedDemandElement) {
1053  moveUpMenuCommand->setText("Move up (It's already the first element)");
1054  moveUpMenuCommand->disable();
1055  } else if (myClickedDemandElement->getDemandElementParents().front()->getPreviousemandElement(myClickedDemandElement)->getTagProperty().isPersonStop()) {
1056  moveUpMenuCommand->setText("Move up (Previous element is a Stop)");
1057  moveUpMenuCommand->disable();
1058  }
1059  // check if moveDownMenuCommand has to be disabled
1060  if (myClickedDemandElement->getDemandElementParents().front()->getDemandElementChildren().back() == myClickedDemandElement) {
1061  moveDownMenuCommand->setText("Move down (It's already the last element)");
1062  moveDownMenuCommand->disable();
1063  } else if (myClickedDemandElement->getDemandElementParents().front()->getNextDemandElement(myClickedDemandElement)->getTagProperty().isPersonStop()) {
1064  moveDownMenuCommand->setText("Move down (Next element is a Stop)");
1065  moveDownMenuCommand->disable();
1066  }
1067  }
1068  }
1069  // Center in the mouse position and create pane
1070  pane->setX(X);
1071  pane->setY(Y);
1072  pane->create();
1073  pane->show();
1074  } else {
1075  // set all clicked elements to null
1076  myClickedAC = nullptr;
1077  myClickedJunction = nullptr;
1078  myClickedEdge = nullptr;
1079  myClickedLane = nullptr;
1080  myClickedCrossing = nullptr;
1081  myClickedConnection = nullptr;
1082  myClickedShape = nullptr;
1083  myClickedAdditional = nullptr;
1084  myClickedDemandElement = nullptr;
1085  }
1086 }
1087 
1088 
1089 FXTreeItem*
1091  if (myAC->getTagProperty().isNetElement()) {
1092  // check demand element type
1093  switch (myAC->getTagProperty().getTag()) {
1094  case SUMO_TAG_EDGE: {
1095  // obtain Edge
1096  GNEEdge* edge = myFrameParent->myViewNet->getNet()->retrieveEdge(myAC->getID(), false);
1097  if (edge) {
1098  // insert Junctions of edge in tree (Pararell because a edge has always two Junctions)
1099  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
1100  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
1101  junctionDestinyItem->setExpanded(true);
1102  // Save items in myTreeItemToACMap
1103  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
1104  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
1105  // return junction destiny Item
1106  return junctionDestinyItem;
1107  } else {
1108  return nullptr;
1109  }
1110  }
1111  case SUMO_TAG_LANE: {
1112  // obtain lane
1113  GNELane* lane = myFrameParent->myViewNet->getNet()->retrieveLane(myAC->getID(), false);
1114  if (lane) {
1115  // obtain edge parent
1116  GNEEdge* edge = myFrameParent->myViewNet->getNet()->retrieveEdge(lane->getParentEdge().getID());
1117  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
1118  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
1119  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
1120  junctionDestinyItem->setExpanded(true);
1121  // Create edge item
1122  FXTreeItem* edgeItem = myTreelist->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
1123  edgeItem->setExpanded(true);
1124  // Save items in myTreeItemToACMap
1125  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
1126  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
1127  myTreeItemToACMap[edgeItem] = edge;
1128  // return edge item
1129  return edgeItem;
1130  } else {
1131  return nullptr;
1132  }
1133  }
1134  case SUMO_TAG_CROSSING: {
1135  // obtain Crossing
1136  GNECrossing* crossing = myFrameParent->myViewNet->getNet()->retrieveCrossing(myAC->getID(), false);
1137  if (crossing) {
1138  // obtain junction
1139  GNEJunction* junction = crossing->getParentJunction();
1140  // create junction item
1141  FXTreeItem* junctionItem = myTreelist->insertItem(nullptr, nullptr, junction->getHierarchyName().c_str(), junction->getIcon(), junction->getIcon());
1142  junctionItem->setExpanded(true);
1143  // Save items in myTreeItemToACMap
1144  myTreeItemToACMap[junctionItem] = junction;
1145  // return junction Item
1146  return junctionItem;
1147  } else {
1148  return nullptr;
1149  }
1150  }
1151  case SUMO_TAG_CONNECTION: {
1152  // obtain Connection
1153  GNEConnection* connection = myFrameParent->myViewNet->getNet()->retrieveConnection(myAC->getID(), false);
1154  if (connection) {
1155  // create edge from item
1156  FXTreeItem* edgeFromItem = myTreelist->insertItem(nullptr, nullptr, connection->getEdgeFrom()->getHierarchyName().c_str(), connection->getEdgeFrom()->getIcon(), connection->getEdgeFrom()->getIcon());
1157  edgeFromItem->setExpanded(true);
1158  // create edge to item
1159  FXTreeItem* edgeToItem = myTreelist->insertItem(nullptr, nullptr, connection->getEdgeTo()->getHierarchyName().c_str(), connection->getEdgeTo()->getIcon(), connection->getEdgeTo()->getIcon());
1160  edgeToItem->setExpanded(true);
1161  // create connection item
1162  FXTreeItem* connectionItem = myTreelist->insertItem(nullptr, edgeToItem, connection->getHierarchyName().c_str(), connection->getIcon(), connection->getIcon());
1163  connectionItem->setExpanded(true);
1164  // Save items in myTreeItemToACMap
1165  myTreeItemToACMap[edgeFromItem] = connection->getEdgeFrom();
1166  myTreeItemToACMap[edgeToItem] = connection->getEdgeTo();
1167  myTreeItemToACMap[connectionItem] = connection;
1168  // return connection item
1169  return connectionItem;
1170  } else {
1171  return nullptr;
1172  }
1173  }
1174  default:
1175  break;
1176  }
1177  } else if (myAC->getTagProperty().getTag() == SUMO_TAG_POILANE) {
1178  // Obtain POILane
1179  GNEPOI* POILane = myFrameParent->myViewNet->getNet()->retrievePOI(myAC->getID(), false);
1180  if (POILane) {
1181  // obtain lane parent
1182  GNELane* lane = myFrameParent->myViewNet->getNet()->retrieveLane(POILane->getLaneParents().at(0)->getID());
1183  // obtain edge parent
1184  GNEEdge* edge = myFrameParent->myViewNet->getNet()->retrieveEdge(lane->getParentEdge().getID());
1185  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
1186  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
1187  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
1188  junctionDestinyItem->setExpanded(true);
1189  // Create edge item
1190  FXTreeItem* edgeItem = myTreelist->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
1191  edgeItem->setExpanded(true);
1192  // Create lane item
1193  FXTreeItem* laneItem = myTreelist->insertItem(nullptr, edgeItem, lane->getHierarchyName().c_str(), lane->getIcon(), lane->getIcon());
1194  laneItem->setExpanded(true);
1195  // Save items in myTreeItemToACMap
1196  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
1197  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
1198  myTreeItemToACMap[edgeItem] = edge;
1199  myTreeItemToACMap[laneItem] = lane;
1200  // return Lane item
1201  return laneItem;
1202  } else {
1203  return nullptr;
1204  }
1205  } else if (myAC->getTagProperty().isAdditional() || myAC->getTagProperty().isTAZ()) {
1206  // Obtain Additional
1207  GNEAdditional* additional = myFrameParent->myViewNet->getNet()->retrieveAdditional(myAC->getTagProperty().getTag(), myAC->getID(), false);
1208  if (additional) {
1209  // declare auxiliar FXTreeItem, due a demand element can have multiple "roots"
1210  FXTreeItem* root = nullptr;
1211  // check if there is demand elements parents
1212  if (additional->getAdditionalParents().size() > 0) {
1213  // check if we have more than one edge
1214  if (additional->getAdditionalParents().size() > 1) {
1215  // insert first item
1216  addListItem(additional->getAdditionalParents().front());
1217  // insert "spacer"
1218  if (additional->getAdditionalParents().size() > 2) {
1219  addListItem(nullptr, ("..." + toString((int)additional->getAdditionalParents().size() - 2) + " additionals...").c_str(), 0, false);
1220  }
1221  }
1222  // return last inserted item
1223  root = addListItem(additional->getAdditionalParents().back());
1224  }
1225  // check if there is demand element parents
1226  if (additional->getDemandElementParents().size() > 0) {
1227  // check if we have more than one demand element
1228  if (additional->getDemandElementParents().size() > 1) {
1229  // insert first item
1230  addListItem(additional->getDemandElementParents().front());
1231  // insert "spacer"
1232  if (additional->getDemandElementParents().size() > 2) {
1233  addListItem(nullptr, ("..." + toString((int)additional->getDemandElementParents().size() - 2) + " demand elements...").c_str(), 0, false);
1234  }
1235  }
1236  // return last inserted item
1237  root = addListItem(additional->getDemandElementParents().back());
1238  }
1239  // check if there is edge parents
1240  if (additional->getEdgeParents().size() > 0) {
1241  // check if we have more than one edge
1242  if (additional->getEdgeParents().size() > 1) {
1243  // insert first item
1244  addListItem(additional->getEdgeParents().front());
1245  // insert "spacer"
1246  if (additional->getEdgeParents().size() > 2) {
1247  addListItem(nullptr, ("..." + toString((int)additional->getEdgeParents().size() - 2) + " edges...").c_str(), 0, false);
1248  }
1249  }
1250  // return last inserted item
1251  root = addListItem(additional->getEdgeParents().back());
1252  }
1253  // check if there is lane parents
1254  if (additional->getLaneParents().size() > 0) {
1255  // check if we have more than one lane parent
1256  if (additional->getLaneParents().size() > 1) {
1257  // insert first item
1258  addListItem(additional->getLaneParents().front());
1259  // insert "spacer"
1260  if (additional->getLaneParents().size() > 2) {
1261  addListItem(nullptr, ("..." + toString((int)additional->getLaneParents().size() - 2) + " lanes...").c_str(), 0, false);
1262  }
1263  }
1264  // return last inserted item
1265  root = addListItem(additional->getLaneParents().back());
1266  }
1267  // return last inserted list item
1268  return root;
1269  }
1270  } else if (myAC->getTagProperty().isDemandElement()) {
1271  // Obtain DemandElement
1272  GNEDemandElement* demandElement = myFrameParent->myViewNet->getNet()->retrieveDemandElement(myAC->getTagProperty().getTag(), myAC->getID(), false);
1273  if (demandElement) {
1274  // declare auxiliar FXTreeItem, due a demand element can have multiple "roots"
1275  FXTreeItem* root = nullptr;
1276  // check if there is demand elements parents
1277  if (demandElement->getAdditionalParents().size() > 0) {
1278  // check if we have more than one edge
1279  if (demandElement->getAdditionalParents().size() > 1) {
1280  // insert first item
1281  addListItem(demandElement->getAdditionalParents().front());
1282  // insert "spacer"
1283  if (demandElement->getAdditionalParents().size() > 2) {
1284  addListItem(nullptr, ("..." + toString((int)demandElement->getAdditionalParents().size() - 2) + " additionals...").c_str(), 0, false);
1285  }
1286  }
1287  // return last inserted item
1288  root = addListItem(demandElement->getAdditionalParents().back());
1289  }
1290  // check if there is demand element parents
1291  if (demandElement->getDemandElementParents().size() > 0) {
1292  // check if we have more than one demand element
1293  if (demandElement->getDemandElementParents().size() > 1) {
1294  // insert first item
1295  addListItem(demandElement->getDemandElementParents().front());
1296  // insert "spacer"
1297  if (demandElement->getDemandElementParents().size() > 2) {
1298  addListItem(nullptr, ("..." + toString((int)demandElement->getDemandElementParents().size() - 2) + " demand elements...").c_str(), 0, false);
1299  }
1300  }
1301  // return last inserted item
1302  root = addListItem(demandElement->getDemandElementParents().back());
1303  }
1304  // check if there is edge parents
1305  if (demandElement->getEdgeParents().size() > 0) {
1306  // check if we have more than one edge
1307  if (demandElement->getEdgeParents().size() > 1) {
1308  // insert first item
1309  addListItem(demandElement->getEdgeParents().front());
1310  // insert "spacer"
1311  if (demandElement->getEdgeParents().size() > 2) {
1312  addListItem(nullptr, ("..." + toString((int)demandElement->getEdgeParents().size() - 2) + " edges...").c_str(), 0, false);
1313  }
1314  }
1315  // return last inserted item
1316  root = addListItem(demandElement->getEdgeParents().back());
1317  }
1318  // check if there is lane parents
1319  if (demandElement->getLaneParents().size() > 0) {
1320  // check if we have more than one lane parent
1321  if (demandElement->getLaneParents().size() > 1) {
1322  // insert first item
1323  addListItem(demandElement->getLaneParents().front());
1324  // insert "spacer"
1325  if (demandElement->getLaneParents().size() > 2) {
1326  addListItem(nullptr, ("..." + toString((int)demandElement->getLaneParents().size() - 2) + " lanes...").c_str(), 0, false);
1327  }
1328  }
1329  // return last inserted item
1330  root = addListItem(demandElement->getLaneParents().back());
1331  }
1332  // return last inserted list item
1333  return root;
1334  }
1335  }
1336  // there aren't parents
1337  return nullptr;
1338 }
1339 
1340 
1341 void
1343  if (AC->getTagProperty().isNetElement()) {
1344  // Switch gl type of ac
1345  switch (AC->getTagProperty().getTag()) {
1346  case SUMO_TAG_JUNCTION: {
1347  // retrieve junction
1348  GNEJunction* junction = myFrameParent->myViewNet->getNet()->retrieveJunction(AC->getID(), false);
1349  if (junction) {
1350  // insert junction item
1351  FXTreeItem* junctionItem = addListItem(AC, itemParent);
1352  // insert edges
1353  for (auto i : junction->getGNEEdges()) {
1354  showAttributeCarrierChildren(i, junctionItem);
1355  }
1356  // insert crossings
1357  for (auto i : junction->getGNECrossings()) {
1358  showAttributeCarrierChildren(i, junctionItem);
1359  }
1360  }
1361  break;
1362  }
1363  case SUMO_TAG_EDGE: {
1364  // retrieve edge
1365  GNEEdge* edge = myFrameParent->myViewNet->getNet()->retrieveEdge(AC->getID(), false);
1366  if (edge) {
1367  // insert edge item
1368  FXTreeItem* edgeItem = addListItem(AC, itemParent);
1369  // insert lanes
1370  for (const auto& i : edge->getLanes()) {
1371  showAttributeCarrierChildren(i, edgeItem);
1372  }
1373  // insert shape children
1374  for (const auto& i : edge->getShapeChildren()) {
1375  showAttributeCarrierChildren(i, edgeItem);
1376  }
1377  // insert additional children
1378  for (const auto& i : edge->getAdditionalChildren()) {
1379  showAttributeCarrierChildren(i, edgeItem);
1380  }
1381  // insert demand elements children (note: use getSortedDemandElementChildrenByType to avoid duplicated elements)
1382  for (const auto& i : edge->getSortedDemandElementChildrenByType(SUMO_TAG_ROUTE)) {
1383  showAttributeCarrierChildren(i, edgeItem);
1384  }
1385  for (const auto& i : edge->getSortedDemandElementChildrenByType(SUMO_TAG_TRIP)) {
1386  showAttributeCarrierChildren(i, edgeItem);
1387  }
1388  for (const auto& i : edge->getSortedDemandElementChildrenByType(SUMO_TAG_FLOW)) {
1389  showAttributeCarrierChildren(i, edgeItem);
1390  }
1391  }
1392  break;
1393  }
1394  case SUMO_TAG_LANE: {
1395  // retrieve lane
1396  GNELane* lane = myFrameParent->myViewNet->getNet()->retrieveLane(AC->getID(), false);
1397  if (lane) {
1398  // insert lane item
1399  FXTreeItem* laneItem = addListItem(AC, itemParent);
1400  // insert shape children
1401  for (const auto& i : lane->getShapeChildren()) {
1402  showAttributeCarrierChildren(i, laneItem);
1403  }
1404  // insert additional children
1405  for (const auto& i : lane->getAdditionalChildren()) {
1406  showAttributeCarrierChildren(i, laneItem);
1407  }
1408  // insert demand elements children
1409  for (const auto& i : lane->getDemandElementChildren()) {
1410  showAttributeCarrierChildren(i, laneItem);
1411  }
1412  // insert incoming connections of lanes (by default isn't expanded)
1413  if (lane->getGNEIncomingConnections().size() > 0) {
1414  std::vector<GNEConnection*> incomingLaneConnections = lane->getGNEIncomingConnections();
1415  // insert intermediate list item
1416  FXTreeItem* incomingConnections = addListItem(laneItem, "Incomings", incomingLaneConnections.front()->getIcon(), false);
1417  // insert incoming connections
1418  for (auto i : incomingLaneConnections) {
1419  showAttributeCarrierChildren(i, incomingConnections);
1420  }
1421  }
1422  // insert outcoming connections of lanes (by default isn't expanded)
1423  if (lane->getGNEOutcomingConnections().size() > 0) {
1424  std::vector<GNEConnection*> outcomingLaneConnections = lane->getGNEOutcomingConnections();
1425  // insert intermediate list item
1426  FXTreeItem* outgoingConnections = addListItem(laneItem, "Outgoing", outcomingLaneConnections.front()->getIcon(), false);
1427  // insert outcoming connections
1428  for (auto i : outcomingLaneConnections) {
1429  showAttributeCarrierChildren(i, outgoingConnections);
1430  }
1431  }
1432  }
1433  break;
1434  }
1435  case SUMO_TAG_CROSSING:
1436  case SUMO_TAG_CONNECTION: {
1437  // insert connection item
1438  addListItem(AC, itemParent);
1439  break;
1440  }
1441  default:
1442  break;
1443  }
1444  } else if (AC->getTagProperty().isShape()) {
1445  // insert shape item
1446  addListItem(AC, itemParent);
1447  } else if (AC->getTagProperty().isAdditional() || AC->getTagProperty().isTAZ()) {
1448  // retrieve additional
1449  GNEAdditional* additional = myFrameParent->myViewNet->getNet()->retrieveAdditional(AC->getTagProperty().getTag(), AC->getID(), false);
1450  if (additional) {
1451  // insert additional item
1452  FXTreeItem* additionalItem = addListItem(AC, itemParent);
1453  // insert edge children
1454  for (const auto& i : additional->getEdgeChildren()) {
1455  showAttributeCarrierChildren(i, additionalItem);
1456  }
1457  // insert lane children
1458  for (const auto& i : additional->getLaneChildren()) {
1459  showAttributeCarrierChildren(i, additionalItem);
1460  }
1461  // insert shape children
1462  for (const auto& i : additional->getShapeChildren()) {
1463  showAttributeCarrierChildren(i, additionalItem);
1464  }
1465  // insert additionals children
1466  for (const auto& i : additional->getAdditionalChildren()) {
1467  showAttributeCarrierChildren(i, additionalItem);
1468  }
1469  // insert demand element children
1470  for (const auto& i : additional->getDemandElementChildren()) {
1471  showAttributeCarrierChildren(i, additionalItem);
1472  }
1473  }
1474  } else if (AC->getTagProperty().isDemandElement()) {
1475  // retrieve demandElement
1476  GNEDemandElement* demandElement = myFrameParent->myViewNet->getNet()->retrieveDemandElement(AC->getTagProperty().getTag(), AC->getID(), false);
1477  if (demandElement) {
1478  // insert demandElement item
1479  FXTreeItem* demandElementItem = addListItem(AC, itemParent);
1480  // insert edge children
1481  for (const auto& i : demandElement->getEdgeChildren()) {
1482  showAttributeCarrierChildren(i, demandElementItem);
1483  }
1484  // insert lane children
1485  for (const auto& i : demandElement->getLaneChildren()) {
1486  showAttributeCarrierChildren(i, demandElementItem);
1487  }
1488  // insert shape children
1489  for (const auto& i : demandElement->getShapeChildren()) {
1490  showAttributeCarrierChildren(i, demandElementItem);
1491  }
1492  // insert additionals children
1493  for (const auto& i : demandElement->getAdditionalChildren()) {
1494  showAttributeCarrierChildren(i, demandElementItem);
1495  }
1496  // insert demand element children
1497  for (const auto& i : demandElement->getDemandElementChildren()) {
1498  showAttributeCarrierChildren(i, demandElementItem);
1499  }
1500  }
1501  }
1502 }
1503 
1504 
1505 FXTreeItem*
1506 GNEFrameModuls::AttributeCarrierHierarchy::addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent, std::string prefix, std::string sufix) {
1507  // insert item in Tree list
1508  FXTreeItem* item = myTreelist->insertItem(nullptr, itemParent, (prefix + AC->getHierarchyName() + sufix).c_str(), AC->getIcon(), AC->getIcon());
1509  // insert item in map
1510  myTreeItemToACMap[item] = AC;
1511  // by default item is expanded
1512  item->setExpanded(true);
1513  // return created FXTreeItem
1514  return item;
1515 }
1516 
1517 
1518 FXTreeItem*
1519 GNEFrameModuls::AttributeCarrierHierarchy::addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded) {
1520  // insert item in Tree list
1521  FXTreeItem* item = myTreelist->insertItem(nullptr, itemParent, text.c_str(), icon, icon);
1522  // expand item depending of flag expanded
1523  item->setExpanded(expanded);
1524  // return created FXTreeItem
1525  return item;
1526 }
1527 
1528 // ---------------------------------------------------------------------------
1529 // GNEFrameModuls::DrawingShape - methods
1530 // ---------------------------------------------------------------------------
1531 
1533  FXGroupBox(frameParent->myContentFrame, "Drawing", GUIDesignGroupBoxFrame),
1534  myFrameParent(frameParent),
1535  myDeleteLastCreatedPoint(false) {
1536  // create start and stop buttons
1537  myStartDrawingButton = new FXButton(this, "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton);
1538  myStopDrawingButton = new FXButton(this, "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton);
1539  myAbortDrawingButton = new FXButton(this, "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton);
1540 
1541  // create information label
1542  std::ostringstream information;
1543  information
1544  << "- 'Start drawing' or ENTER\n"
1545  << " draws shape boundary.\n"
1546  << "- 'Stop drawing' or ENTER\n"
1547  << " creates shape.\n"
1548  << "- 'Shift + Click'\n"
1549  << " removes last created point.\n"
1550  << "- 'Abort drawing' or ESC\n"
1551  << " removes drawed shape.";
1552  myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation);
1553  // disable stop and abort functions as init
1554  myStopDrawingButton->disable();
1555  myAbortDrawingButton->disable();
1556 }
1557 
1558 
1560 
1561 
1563  // abort current drawing before show
1564  abortDrawing();
1565  // show FXGroupBox
1566  FXGroupBox::show();
1567 }
1568 
1569 
1571  // abort current drawing before hide
1572  abortDrawing();
1573  // show FXGroupBox
1574  FXGroupBox::hide();
1575 }
1576 
1577 
1578 void
1580  // Only start drawing if DrawingShape modul is shown
1581  if (shown()) {
1582  // change buttons
1583  myStartDrawingButton->disable();
1584  myStopDrawingButton->enable();
1585  myAbortDrawingButton->enable();
1586  }
1587 }
1588 
1589 
1590 void
1592  // try to build shape
1593  if (myFrameParent->shapeDrawed()) {
1594  // clear created points
1595  myTemporalShapeShape.clear();
1596  myFrameParent->myViewNet->update();
1597  // change buttons
1598  myStartDrawingButton->enable();
1599  myStopDrawingButton->disable();
1600  myAbortDrawingButton->disable();
1601  } else {
1602  // abort drawing if shape cannot be created
1603  abortDrawing();
1604  }
1605 }
1606 
1607 
1608 void
1610  // clear created points
1611  myTemporalShapeShape.clear();
1612  myFrameParent->myViewNet->update();
1613  // change buttons
1614  myStartDrawingButton->enable();
1615  myStopDrawingButton->disable();
1616  myAbortDrawingButton->disable();
1617 }
1618 
1619 
1620 void
1622  if (myStopDrawingButton->isEnabled()) {
1623  myTemporalShapeShape.push_back(P);
1624  } else {
1625  throw ProcessError("A new point cannot be added if drawing wasn't started");
1626  }
1627 }
1628 
1629 
1630 void
1632 
1633 }
1634 
1635 
1636 const PositionVector&
1638  return myTemporalShapeShape;
1639 }
1640 
1641 
1642 bool
1644  return myStopDrawingButton->isEnabled();
1645 }
1646 
1647 
1648 void
1650  myDeleteLastCreatedPoint = value;
1651 }
1652 
1653 
1654 bool
1656  return myDeleteLastCreatedPoint;
1657 }
1658 
1659 
1660 long
1662  startDrawing();
1663  return 0;
1664 }
1665 
1666 
1667 long
1668 GNEFrameModuls::DrawingShape::onCmdStopDrawing(FXObject*, FXSelector, void*) {
1669  stopDrawing();
1670  return 0;
1671 }
1672 
1673 
1674 long
1676  abortDrawing();
1677  return 0;
1678 }
1679 
1680 // ---------------------------------------------------------------------------
1681 // GNEFrameModuls::SelectorParent - methods
1682 // ---------------------------------------------------------------------------
1683 
1685  FXGroupBox(frameParent->myContentFrame, "Parent selector", GUIDesignGroupBoxFrame),
1686  myFrameParent(frameParent),
1687  myParentTag(SUMO_TAG_NOTHING) {
1688  // Create label with the type of SelectorParent
1689  myParentsLabel = new FXLabel(this, "No additional selected", nullptr, GUIDesignLabelLeftThick);
1690  // Create list
1692  // Hide List
1694 }
1695 
1696 
1698 
1699 
1700 std::string
1702  for (int i = 0; i < myParentsList->getNumItems(); i++) {
1703  if (myParentsList->isItemSelected(i)) {
1704  return myParentsList->getItem(i)->getText().text();
1705  }
1706  }
1707  return "";
1708 }
1709 
1710 
1711 void
1713  // first unselect all
1714  for (int i = 0; i < myParentsList->getNumItems(); i++) {
1715  myParentsList->getItem(i)->setSelected(false);
1716  }
1717  // select element if correspond to given ID
1718  for (int i = 0; i < myParentsList->getNumItems(); i++) {
1719  if (myParentsList->getItem(i)->getText().text() == id) {
1720  myParentsList->getItem(i)->setSelected(true);
1721  }
1722  }
1723  // recalc myFirstParentsList
1724  myParentsList->recalc();
1725 }
1726 
1727 
1728 bool
1730  // make sure that we're editing an additional tag
1731  auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL, false);
1732  for (auto i : listOfTags) {
1733  if (i == additionalType) {
1734  myParentTag = additionalType;
1735  myParentsLabel->setText(("Parent type: " + toString(additionalType)).c_str());
1736  refreshSelectorParentModul();
1737  show();
1738  return true;
1739  }
1740  }
1741  return false;
1742 }
1743 
1744 
1745 void
1747  myParentTag = SUMO_TAG_NOTHING;
1748  hide();
1749 }
1750 
1751 
1752 void
1754  myParentsList->clearItems();
1755  if (myParentTag != SUMO_TAG_NOTHING) {
1756  // fill list with IDs of additionals
1757  for (const auto& i : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().additionals.at(myParentTag)) {
1758  myParentsList->appendItem(i.first.c_str());
1759  }
1760  }
1761 }
1762 
1763 /****************************************************************************/
GNEFrameModuls::EdgePathCreator::myFinishCreationButton
FXButton * myFinishCreationButton
button for finish route creation
Definition: GNEFrameModuls.h:260
MID_GNE_TAG_SELECTED
tag selected in ComboBox
Definition: GUIAppEnum.h:639
GNEDemandElement::myViewNet
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
Definition: GNEDemandElement.h:469
GNEFrameModuls::SelectorParent::showSelectorParentModul
bool showSelectorParentModul(SumoXMLTag additionalTypeParent)
Show list of SelectorParent Modul.
Definition: GNEFrameModuls.cpp:1729
GNEFrameModuls::AttributeCarrierHierarchy::hideAttributeCarrierHierarchy
void hideAttributeCarrierHierarchy()
hide AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:845
GUIDesignTreeListFrame
#define GUIDesignTreeListFrame
Tree list used in frames to represent elements children.
Definition: GUIDesigns.h:523
GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:166
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
GNENet::retrieveAdditional
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2133
GNEAttributeCarrier::getIcon
FXIcon * getIcon() const
get FXIcon associated to this AC
Definition: GNEAttributeCarrier.cpp:1177
GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierHierarchy
void showAttributeCarrierHierarchy(GNEAttributeCarrier *AC)
show AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:834
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:54
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GNEFrameModuls::EdgePathCreator::~EdgePathCreator
~EdgePathCreator()
destructor
Definition: GNEFrameModuls.cpp:532
GNEFrameModuls::EdgePathCreator::finishEdgePathCreation
void finishEdgePathCreation()
finish edge path creation
Definition: GNEFrameModuls.cpp:732
GNEFrameModuls::AttributeCarrierHierarchy::addListItem
FXTreeItem * addListItem(GNEAttributeCarrier *AC, FXTreeItem *itemParent=nullptr, std::string prefix="", std::string sufix="")
add item into list
Definition: GNEFrameModuls.cpp:1506
MFXMenuHeader.h
GNEAttributeCarrier::TagProperties
struct with the attribute Properties
Definition: GNEAttributeCarrier.h:324
GNEFrameModuls::DrawingShape::showDrawingShape
void showDrawingShape()
show Drawing mode
Definition: GNEFrameModuls.cpp:1562
GNEAttributeCarrier::getID
const std::string getID() const
function to support debugging
Definition: GNEAttributeCarrier.cpp:1187
GNEFrameModuls::EdgePathCreator::setVClass
void setVClass(SUMOVehicleClass vClass)
set SUMOVehicleClass
Definition: GNEFrameModuls.cpp:573
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
GNEFrameModuls::TagSelector::~TagSelector
~TagSelector()
destructor
Definition: GNEFrameModuls.cpp:179
GNEAttributeCarrier::TagProperties::isAdditional
bool isAdditional() const
return true if tag correspond to an additional
Definition: GNEAttributeCarrier.cpp:696
GNEFrameModuls::DrawingShape::setDeleteLastCreatedPoint
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
Definition: GNEFrameModuls.cpp:1649
GNENet::retrievePOI
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:1066
GNEDemandElement::getRouteCalculatorInstance
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
Definition: GNEDemandElement.cpp:435
GNEFrameModuls::AttributeCarrierHierarchy::onCmdShowChildMenu
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
Definition: GNEFrameModuls.cpp:876
DEFAULT_PEDTYPE_ID
const std::string DEFAULT_PEDTYPE_ID
GNEAttributeCarrier::TagProperties::isTAZ
bool isTAZ() const
return true if tag correspond to a TAZ
Definition: GNEAttributeCarrier.cpp:707
GNEFrameModuls::EdgePathCreator::onCmdAbortRouteCreation
long onCmdAbortRouteCreation(FXObject *, FXSelector, void *)
Definition: GNEFrameModuls.cpp:748
MID_GNE_SET_TYPE
used to select a type of element in a combo box
Definition: GUIAppEnum.h:635
MID_GNE_ACHIERARCHY_SHOWCHILDMENU
In AttributeCarrierHierarchy list, show child menu.
Definition: GUIAppEnum.h:655
GNEFrameModuls::EdgePathCreator::EdgePathCreator
EdgePathCreator()
FOX needs this.
Definition: GNEFrameModuls.h:253
GNEFrameModuls::DrawingShape::stopDrawing
void stopDrawing()
stop drawing and check if shape can be created
Definition: GNEFrameModuls.cpp:1591
GNEFrameModuls::DemandElementSelector::setDemandElement
void setDemandElement(GNEDemandElement *demandElement)
set current demand element
Definition: GNEFrameModuls.cpp:364
GNEFrameModuls::DemandElementSelector::isDemandElementSelectorShown
bool isDemandElementSelectorShown() const
check if demand element selector is shown
Definition: GNEFrameModuls.cpp:403
GNEFrameModuls::EdgePathCreator::showEdgePathCreator
void showEdgePathCreator()
show EdgePathCreator
Definition: GNEFrameModuls.cpp:547
GNEPOI
Definition: GNEPOI.h:45
GNEFrameModuls::SelectorParent::setIDSelected
void setIDSelected(const std::string &id)
select manually a element of the list
Definition: GNEFrameModuls.cpp:1712
GNEFrameModuls::AttributeCarrierHierarchy::onCmdInspectItem
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user click over option "inspect" of child menu
Definition: GNEFrameModuls.cpp:916
GNEAttributeCarrier::TagProperties::isNetElement
bool isNetElement() const
return true if tag correspond to a netElement
Definition: GNEAttributeCarrier.cpp:690
GNEFrameModuls::DrawingShape::addNewPoint
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrameModuls.cpp:1621
GNEFrameModuls::DemandElementSelector::DemandElementSelector
DemandElementSelector()
FOX needs this.
Definition: GNEFrameModuls.h:157
GNEFrameModuls::DrawingShape::myStopDrawingButton
FXButton * myStopDrawingButton
button for stop drawing
Definition: GNEFrameModuls.h:472
GNEFrameModuls::AttributeCarrierHierarchy::AttributeCarrierHierarchy
AttributeCarrierHierarchy()
FOX needs this.
Definition: GNEFrameModuls.h:334
GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierChildren
void showAttributeCarrierChildren(GNEAttributeCarrier *AC, FXTreeItem *itemParent)
show child of current attributeCarrier
Definition: GNEFrameModuls.cpp:1342
GNEFrameModuls::DemandElementSelector::refreshDemandElementSelector
void refreshDemandElementSelector()
refresh demand element selector
Definition: GNEFrameModuls.cpp:409
GNEFrameModuls::DrawingShape::myInformationLabel
FXLabel * myInformationLabel
Label with information.
Definition: GNEFrameModuls.h:478
SUMO_TAG_LANE
begin/end of the description of a single lane
Definition: SUMOXMLDefinitions.h:50
GNEFrameModuls::DemandElementSelector::showDemandElementSelector
void showDemandElementSelector()
show demand element selector
Definition: GNEFrameModuls.cpp:378
GNEFrameModuls::EdgePathCreator::addBusStop
bool addBusStop(GNEAdditional *busStop)
add busStop to route
Definition: GNEFrameModuls.cpp:661
GUIDesignComboBoxNCol
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:233
GNENet::retrieveDemandElement
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2266
GNEFrame
Definition: GNEFrame.h:35
SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:124
GNEJunction::getGNECrossings
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
Definition: GNEJunction.cpp:547
MID_GNE_EDGEPATH_ABORT
abort edge path creation
Definition: GUIAppEnum.h:649
GNEAttributeCarrier::TagProperties::isShape
bool isShape() const
return true if tag correspond to a shape
Definition: GNEAttributeCarrier.cpp:701
GNEHierarchicalElementParents::getEdgeParents
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
Definition: GNEHierarchicalElementParents.cpp:150
GNEFrameModuls::DemandElementSelector::~DemandElementSelector
~DemandElementSelector()
destructor
Definition: GNEFrameModuls.cpp:349
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:379
GNEFrameModuls::DrawingShape::hideDrawingShape
void hideDrawingShape()
hide Drawing mode
Definition: GNEFrameModuls.cpp:1570
SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:44
GLHelper.h
GUIDesigns.h
SUMO_TAG_VTYPE
description of a vehicle type
Definition: SUMOXMLDefinitions.h:122
GNEFrameModuls::AttributeCarrierHierarchy::onCmdMoveItemUp
long onCmdMoveItemUp(FXObject *, FXSelector, void *)
called when user click over option "Move up" of child menu
Definition: GNEFrameModuls.cpp:970
GNEConnection::getEdgeTo
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
Definition: GNEConnection.cpp:167
PositionVector
A list of positions.
Definition: PositionVector.h:46
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:602
GNEFrameModuls::DrawingShape::removeLastPoint
void removeLastPoint()
remove last added point
Definition: GNEFrameModuls.cpp:1631
MID_GNE_CENTER
center element
Definition: GUIAppEnum.h:629
GNEFrameModuls::DrawingShape::getDeleteLastCreatedPoint
bool getDeleteLastCreatedPoint()
get flag delete last created point
Definition: GNEFrameModuls.cpp:1655
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
GNEFrameModuls::TagSelector::setCurrentTagType
void setCurrentTagType(GNEAttributeCarrier::TagType tagType)
set current type manually
Definition: GNEFrameModuls.cpp:201
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:42
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:66
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:521
GNEFrameModuls::EdgePathCreator::addEdge
bool addEdge(GNEEdge *edge)
add edge to route
Definition: GNEFrameModuls.cpp:597
GNEAdditional::myViewNet
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
Definition: GNEAdditional.h:365
GUIAppEnum.h
GNEJunction.h
GNEFrameModuls::DrawingShape::myStartDrawingButton
FXButton * myStartDrawingButton
button for start drawing
Definition: GNEFrameModuls.h:469
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:210
GNEChange_Children
Definition: GNEChange_Children.h:41
GNEFrameModuls::EdgePathCreator
Definition: GNEFrameModuls.h:177
GNENetElement::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNENetElement.cpp:201
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
GNEHierarchicalElementParents::getLaneParents
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
Definition: GNEHierarchicalElementParents.cpp:182
GNEAttributeCarrier::getHierarchyName
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
MID_GNE_TAGTYPE_SELECTED
tag type selected in ComboBox
Definition: GUIAppEnum.h:637
GNEFrameModuls::AttributeCarrierHierarchy::myTreelist
FXTreeList * myTreelist
tree list to show the children of the element to erase
Definition: GNEFrameModuls.h:385
ICON_MODEDELETE
Definition: GUIIcons.h:219
GNEHierarchicalElementChildren::getLaneChildren
const std::vector< GNELane * > & getLaneChildren() const
get lanes of VSS
Definition: GNEHierarchicalElementChildren.cpp:409
GNEFrameModuls::AttributeCarrierHierarchy::onCmdCenterItem
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user click over option "center" of child Menu
Definition: GNEFrameModuls.cpp:890
GNEHierarchicalElementChildren::getEdgeChildren
const std::vector< GNEEdge * > & getEdgeChildren() const
get edge chidls
Definition: GNEHierarchicalElementChildren.cpp:377
GNEFrameModuls::AttributeCarrierHierarchy::createPopUpMenu
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *clickedAC)
Definition: GNEFrameModuls.cpp:1002
SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
Definition: SUMOXMLDefinitions.h:150
GNECrossing
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:45
GNETAZ.h
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1171
GNEAttributeCarrier::allowedTagsByCategory
static std::vector< SumoXMLTag > allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables)
get tags of all editable element types using TagProperty Type (TAGTYPE_NETELEMENT,...
Definition: GNEAttributeCarrier.cpp:1231
SUMO_TAG_POILANE
begin/end of the description of a Point of interest over Lane (used by Netedit)
Definition: SUMOXMLDefinitions.h:56
RGBColor::ORANGE
static const RGBColor ORANGE
Definition: RGBColor.h:196
GNEFrameModuls::AttributeCarrierHierarchy::~AttributeCarrierHierarchy
~AttributeCarrierHierarchy()
destructor
Definition: GNEFrameModuls.cpp:830
GNEFrameModuls::EdgePathCreator::hideEdgePathCreator
void hideEdgePathCreator()
show EdgePathCreator
Definition: GNEFrameModuls.cpp:558
GNEConnection::getEdgeFrom
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
Definition: GNEConnection.cpp:161
GNEEdge::getNBEdge
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:625
GNEFrameModuls::DemandElementSelector
Definition: GNEFrameModuls.h:114
GNEFrameModuls::EdgePathCreator::edgePathCreatorName
void edgePathCreatorName(const std::string &name)
update EdgePathCreator name
Definition: GNEFrameModuls.cpp:536
FXDEFMAP
FXDEFMAP(GNEFrameModuls::TagSelector) TagSelectorMap[]
GNEFrameModuls::TagSelector
Definition: GNEFrameModuls.h:45
GNEDemandElement.h
GNEAttributeCarrier::TagProperties::isDemandElement
bool isDemandElement() const
return true if tag correspond to a demand element
Definition: GNEAttributeCarrier.cpp:713
DEFAULT_VTYPE_ID
const std::string DEFAULT_VTYPE_ID
GNEViewNet.h
SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:160
GNELane::getParentEdge
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1292
GNEFrameModuls::DemandElementSelector::getCurrentDemandElement
GNEDemandElement * getCurrentDemandElement() const
get current demand element
Definition: GNEFrameModuls.cpp:353
GNEFrameModuls::AttributeCarrierHierarchy::onCmdDeleteItem
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user click over option "delete" of child menu
Definition: GNEFrameModuls.cpp:925
GNEFrameModuls::EdgePathCreator::setEdgePathCreatorModes
void setEdgePathCreatorModes(int edgePathCreatorModes)
set EdgePathCreatorModes
Definition: GNEFrameModuls.cpp:579
SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:48
GNEFrameModuls::DrawingShape
Definition: GNEFrameModuls.h:398
GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:47
ProcessError
Definition: UtilExceptions.h:40
GNENet::retrieveJunction
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:1001
GNEFrameModuls::DrawingShape::startDrawing
void startDrawing()
start drawing
Definition: GNEFrameModuls.cpp:1579
MID_GNE_ACHIERARCHY_MOVEUP
In AttributeCarrierHierarchy list, move element to up.
Definition: GUIAppEnum.h:657
GNEFrameModuls::DemandElementSelector::getAllowedTags
const std::vector< SumoXMLTag > & getAllowedTags() const
Definition: GNEFrameModuls.cpp:359
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEApplicationWindow.h
GNEEdge.h
MID_GNE_ABORTDRAWING
abort drawing polygon
Definition: GUIAppEnum.h:669
GNEFrameModuls::DrawingShape::onCmdStartDrawing
long onCmdStartDrawing(FXObject *, FXSelector, void *)
Definition: GNEFrameModuls.cpp:1661
GNEFrameModuls::AttributeCarrierHierarchy
Definition: GNEFrameModuls.h:291
GLHelper::drawLine
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
GNEFrameModuls::TagSelector::getCurrentTagProperties
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
Definition: GNEFrameModuls.cpp:195
GNEShape::getNet
GNENet * getNet() const
get Net in which this element is placed
Definition: GNEShape.cpp:62
GNE_ATTR_DEFAULT_VTYPE
Flag to check if VType is a default VType.
Definition: SUMOXMLDefinitions.h:1002
GNEFrameModuls::EdgePathCreator::drawTemporalRoute
void drawTemporalRoute() const
draw temporal route
Definition: GNEFrameModuls.cpp:691
GNEFrameModuls::EdgePathCreator::restoreEdgeColor
void restoreEdgeColor(const GNEEdge *edge)
restore colors of given edge
Definition: GNEFrameModuls.cpp:800
GNEHierarchicalElementChildren::getShapeChildren
const std::vector< GNEShape * > & getShapeChildren() const
get shapes of VSS
Definition: GNEHierarchicalElementChildren.cpp:445
GNELane::getGNEIncomingConnections
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition: GNELane.cpp:1304
GNEEdge::getGNEJunctionDestiny
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:505
GNEFrameModuls::AttributeCarrierHierarchy::onCmdMoveItemDown
long onCmdMoveItemDown(FXObject *, FXSelector, void *)
called when user click over option "Move down" of child menu
Definition: GNEFrameModuls.cpp:986
GNECrossing.h
GNEEdge::getLanes
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:840
MID_GNE_STARTDRAWING
start drawing polygon
Definition: GUIAppEnum.h:665
GNELane.h
GNEFrameModuls::SelectorParent::getIdSelected
std::string getIdSelected() const
get currently additional parent selected
Definition: GNEFrameModuls.cpp:1701
GNEFrameModuls::DemandElementSelector::onCmdSelectDemandElement
long onCmdSelectDemandElement(FXObject *, FXSelector, void *)
Definition: GNEFrameModuls.cpp:479
GNEFrameModuls::EdgePathCreator::myRemoveLastInsertedEdge
FXButton * myRemoveLastInsertedEdge
button for removing last inserted edge
Definition: GNEFrameModuls.h:266
NBEdge::getLanes
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:644
GNEFrameModuls::DrawingShape::onCmdAbortDrawing
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
Definition: GNEFrameModuls.cpp:1675
GNEFrameModuls::EdgePathCreator::clearEdges
void clearEdges()
clear edges (and restore colors)
Definition: GNEFrameModuls.cpp:672
GNEFrameModuls::TagSelector::hideTagSelector
void hideTagSelector()
hide item selector
Definition: GNEFrameModuls.cpp:189
GNELane::getGNEOutcomingConnections
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
Definition: GNELane.cpp:1325
GNEFrameModuls::DrawingShape::~DrawingShape
~DrawingShape()
destructor
Definition: GNEFrameModuls.cpp:1559
GNEViewParent.h
MID_GNE_STOPDRAWING
stop drawing polygon
Definition: GUIAppEnum.h:667
GNEAdditional::setSpecialColor
void setSpecialColor(const RGBColor *color)
set special color
Definition: GNEAdditional.cpp:199
GLIncludes.h
GNEEdge::getGNEJunctionSource
GNEJunction * getGNEJunctionSource() const
returns the source-junction
Definition: GNEEdge.cpp:499
GNEFrameModuls::SelectorParent::SelectorParent
SelectorParent(GNEFrame *frameParent)
constructor
Definition: GNEFrameModuls.cpp:1684
GUIDesignListSingleElementFixedHeight
#define GUIDesignListSingleElementFixedHeight
design for FXLists that only allow a single selected elements selected and height fixed
Definition: GUIDesigns.h:535
GNENet::retrieveCrossing
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1115
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GNEAttributeCarrier::TagType
TagType
Definition: GNEAttributeCarrier.h:281
GNEFrameModuls::TagSelector::setCurrentTag
void setCurrentTag(SumoXMLTag newTag)
set current type manually
Definition: GNEFrameModuls.cpp:226
GNEFrameModuls::TagSelector::onCmdSelectTag
long onCmdSelectTag(FXObject *, FXSelector, void *)
Called when the user select an elementin ComboBox.
Definition: GNEFrameModuls.cpp:287
GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierParents
FXTreeItem * showAttributeCarrierParents()
show child of current attributeCarrier
Definition: GNEFrameModuls.cpp:1090
GNECrossing::getParentJunction
GNEJunction * getParentJunction() const
get parent Junction
Definition: GNECrossing.cpp:82
GNEHierarchicalElementParents::getDemandElementParents
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementParents.cpp:115
GUIDesignLabelLeftThick
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left and height of 23
Definition: GUIDesigns.h:177
MID_GNE_ACHIERARCHY_MOVEDOWN
In AttributeCarrierHierarchy list, move element to down.
Definition: GUIAppEnum.h:659
SUMO_TAG_CROSSING
crossing between edges for pedestrians
Definition: SUMOXMLDefinitions.h:227
GNEJunction::getGNEEdges
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
Definition: GNEJunction.cpp:529
GNEHierarchicalElementParents::getAdditionalParents
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementParents.cpp:86
GNEFrameModuls::DrawingShape::abortDrawing
void abortDrawing()
abort drawing
Definition: GNEFrameModuls.cpp:1609
GNENetElement::getNet
GNENet * getNet() const
get Net in which this element is placed
Definition: GNENetElement.cpp:107
GNE_SUPERMODE_DEMAND
Demanding mode (Routes, Vehicles etc..)
Definition: GNEViewNetHelper.h:49
GNEFrameModuls::TagSelector::refreshTagProperties
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show
Definition: GNEFrameModuls.cpp:243
GNEHierarchicalElementChildren::getAdditionalChildren
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementChildren.cpp:132
GNEFrameModuls::TagSelector::onCmdSelectTagType
long onCmdSelectTagType(FXObject *, FXSelector, void *)
Definition: GNEFrameModuls.cpp:249
GUIDesignComboBox
#define GUIDesignComboBox
Definition: GUIDesigns.h:221
ICON_ARROW_DOWN
Definition: GUIIcons.h:193
ICON_RECENTERVIEW
Definition: GUIIcons.h:69
SUMO_TAG_CONNECTION
connectio between two lanes
Definition: SUMOXMLDefinitions.h:203
GNEFrameModuls
Definition: GNEFrameModuls.h:38
GNENet::retrieveEdge
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1020
GNEConnection
Definition: GNEConnection.h:38
SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:126
GNEFrameModuls::DrawingShape::isDrawing
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrameModuls.cpp:1643
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
ICON_MODEINSPECT
Definition: GUIIcons.h:220
config.h
GNEAttributeCarrier::getTagProperties
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
Definition: GNEAttributeCarrier.cpp:1196
GNENet::retrieveConnection
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:1079
GNEFrameModuls::DemandElementSelector::hideDemandElementSelector
void hideDemandElementSelector()
hide demand element selector
Definition: GNEFrameModuls.cpp:397
GNEFrameModuls::EdgePathCreator::abortEdgePathCreation
void abortEdgePathCreation()
abort edge path creation
Definition: GNEFrameModuls.cpp:724
GNEFrameModuls::DrawingShape::onCmdStopDrawing
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
Definition: GNEFrameModuls.cpp:1668
GNEDemandElement::RouteCalculator::calculateDijkstraRoute
std::vector< GNEEdge * > calculateDijkstraRoute(SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra route between a list of partial edges
Definition: GNEDemandElement.cpp:225
GNEFrameModuls::EdgePathCreator::myAbortCreationButton
FXButton * myAbortCreationButton
button for abort route creation
Definition: GNEFrameModuls.h:263
GNEFrameModuls::SelectorParent::~SelectorParent
~SelectorParent()
destructor
Definition: GNEFrameModuls.cpp:1697
MID_GNE_DELETE
delete element
Definition: GUIAppEnum.h:623
GNEInspectorFrame.h
GNEFrameModuls::EdgePathCreator::getClickedEdges
std::vector< GNEEdge * > getClickedEdges() const
get current clicked edges
Definition: GNEFrameModuls.cpp:585
GNEPOI.h
GNEFrameModuls::AttributeCarrierHierarchy::refreshAttributeCarrierHierarchy
void refreshAttributeCarrierHierarchy()
refresh AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:863
GNEFrameModuls::TagSelector::showTagSelector
void showTagSelector()
show item selector
Definition: GNEFrameModuls.cpp:183
GNEFrameModuls.h
MID_GNE_EDGEPATH_FINISH
finish edge path creation
Definition: GUIAppEnum.h:651
GNEFrameModuls::SelectorParent::myParentsList
FXList * myParentsList
List of parents.
Definition: GNEFrameModuls.h:519
GNEHierarchicalElementChildren::getSortedDemandElementChildrenByType
const std::set< GNEDemandElement * > & getSortedDemandElementChildrenByType(SumoXMLTag tag) const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementChildren.cpp:303
GNEFrameModuls::SelectorParent::myParentsLabel
FXLabel * myParentsLabel
Label with parent name.
Definition: GNEFrameModuls.h:516
GNEJunction
Definition: GNEJunction.h:48
GNEHierarchicalElementChildren::getDemandElementChildren
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementChildren.cpp:297
DEFAULT_BIKETYPE_ID
const std::string DEFAULT_BIKETYPE_ID
GNEFrameModuls::DemandElementSelector::myDemandElementTags
std::vector< SumoXMLTag > myDemandElementTags
demand element tags
Definition: GNEFrameModuls.h:170
GNEFrameModuls::EdgePathCreator::onCmdFinishRouteCreation
long onCmdFinishRouteCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Finish route creation".
Definition: GNEFrameModuls.cpp:760
ICON_ARROW_UP
Definition: GUIIcons.h:192
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:246
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
GNEFrameModuls::EdgePathCreator::getClickedBusStop
GNEAdditional * getClickedBusStop() const
get current clicked edges
Definition: GNEFrameModuls.cpp:591
GNEFrameModuls::EdgePathCreator::onCmdRemoveLastInsertedElement
long onCmdRemoveLastInsertedElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge/busStop".
Definition: GNEFrameModuls.cpp:779
MFXMenuHeader
Definition: MFXMenuHeader.h:28
GNEFrameModuls::SelectorParent::refreshSelectorParentModul
void refreshSelectorParentModul()
Refresh list of Additional Parents Modul.
Definition: GNEFrameModuls.cpp:1753
GNENet.h
GNEFrameModuls::SelectorParent::hideSelectorParentModul
void hideSelectorParentModul()
hide SelectorParent Modul
Definition: GNEFrameModuls.cpp:1746
SUMO_TAG_TRIP
a single trip definition (used by router)
Definition: SUMOXMLDefinitions.h:146
GNEChange_Children.h
MID_GNE_EDGEPATH_REMOVELAST
remove last inserted element in path
Definition: GUIAppEnum.h:653
GNEFrameModuls::DrawingShape::getTemporalShape
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrameModuls.cpp:1637
SUMO_TAG_JUNCTION
begin/end of the description of a junction
Definition: SUMOXMLDefinitions.h:60
GNEUndoList.h
GNEFrameModuls::EdgePathCreator::removeLastInsertedElement
void removeLastInsertedElement()
remove last added element (either a BusStop or an edge)
Definition: GNEFrameModuls.cpp:740
MID_GNE_INSPECT
inspect element
Definition: GUIAppEnum.h:625
GNEFrameModuls::DrawingShape::myAbortDrawingButton
FXButton * myAbortDrawingButton
button for abort drawing
Definition: GNEFrameModuls.h:475
GNEFrameModuls::DrawingShape::DrawingShape
DrawingShape()
FOX needs this.
Definition: GNEFrameModuls.h:456
GNEFrameModuls::DemandElementSelector::myDemandElementsMatchBox
FXComboBox * myDemandElementsMatchBox
comboBox with the list of elements type
Definition: GNEFrameModuls.h:164
GNEConnection.h