Eclipse SUMO - Simulation of Urban MObility
GNEFrameModules.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-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Auxiliar class for GNEFrame Modules
19 /****************************************************************************/
20 #include <config.h>
21 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEUndoList.h>
25 #include <netedit/GNEViewNet.h>
26 #include <netedit/GNEViewParent.h>
75 #include <utils/gui/div/GLHelper.h>
79 
80 #include "GNEFrameModules.h"
81 
82 
83 // ===========================================================================
84 // FOX callback mapping
85 // ===========================================================================
86 
87 FXDEFMAP(GNEFrameModules::TagSelector) TagSelectorMap[] = {
89 };
90 
91 FXDEFMAP(GNEFrameModules::DemandElementSelector) DemandElementSelectorMap[] = {
93 };
94 
95 FXDEFMAP(GNEFrameModules::HierarchicalElementTree) HierarchicalElementTreeMap[] = {
102 };
103 
104 FXDEFMAP(GNEFrameModules::DrawingShape) DrawingShapeMap[] = {
108 };
109 
110 FXDEFMAP(GNEFrameModules::OverlappedInspection) OverlappedInspectionMap[] = {
116 };
117 
118 FXDEFMAP(GNEFrameModules::PathCreator) PathCreatorMap[] = {
123 };
124 
125 
126 // Object implementation
127 FXIMPLEMENT(GNEFrameModules::TagSelector, FXGroupBoxModule, TagSelectorMap, ARRAYNUMBER(TagSelectorMap))
128 FXIMPLEMENT(GNEFrameModules::DemandElementSelector, FXGroupBoxModule, DemandElementSelectorMap, ARRAYNUMBER(DemandElementSelectorMap))
129 FXIMPLEMENT(GNEFrameModules::HierarchicalElementTree, FXGroupBoxModule, HierarchicalElementTreeMap, ARRAYNUMBER(HierarchicalElementTreeMap))
130 FXIMPLEMENT(GNEFrameModules::DrawingShape, FXGroupBoxModule, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap))
131 FXIMPLEMENT(GNEFrameModules::OverlappedInspection, FXGroupBoxModule, OverlappedInspectionMap, ARRAYNUMBER(OverlappedInspectionMap))
132 FXIMPLEMENT(GNEFrameModules::PathCreator, FXGroupBoxModule, PathCreatorMap, ARRAYNUMBER(PathCreatorMap))
133 
134 
135 // ===========================================================================
136 // method definitions
137 // ===========================================================================
138 
139 // ---------------------------------------------------------------------------
140 // GNEFrameModules::TagSelector - methods
141 // ---------------------------------------------------------------------------
142 
143 GNEFrameModules::TagSelector::TagSelector(GNEFrame* frameParent, GNETagProperties::TagType type, SumoXMLTag tag, bool onlyDrawables) :
144  FXGroupBoxModule(frameParent->getContentFrame(), "Element"),
145  myFrameParent(frameParent),
146  myTagType(type),
147  myCurrentTemplateAC(nullptr) {
148  // Create MFXIconComboBox
149  myTagsMatchBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_TAG_SELECTED, GUIDesignComboBox);
150  // set current tag type without notifying
151  setCurrentTagType(myTagType, onlyDrawables, false);
152  // set current tag without notifying
153  setCurrentTag(tag, false);
154  // TagSelector is always shown
155  show();
156 }
157 
158 
160  // clear myACTemplates and myTagsMatchBox
161  for (const auto& ACTemplate : myACTemplates) {
162  delete ACTemplate;
163  }
164  myACTemplates.clear();
165 }
166 
167 
168 void
170  show();
171 }
172 
173 
174 void
176  hide();
177 }
178 
179 
182  // clear myACTemplates and myTagsMatchBox
183  for (const auto& ACTemplate : myACTemplates) {
184  if (ACTemplate->getAC()->getTagProperty().getTag() == ACTag) {
185  return ACTemplate->getAC();
186  }
187  }
188  return nullptr;
189 }
190 
191 
194  return myCurrentTemplateAC;
195 }
196 
197 
198 void
199 GNEFrameModules::TagSelector::setCurrentTagType(GNETagProperties::TagType tagType, const bool onlyDrawables, const bool notifyFrameParent) {
200  // check if net has proj
201  const bool proj = (GeoConvHelper::getFinal().getProjString() != "!");
202  // set new tagType
203  myTagType = tagType;
204  // change TagSelector text
205  switch (myTagType) {
206  case GNETagProperties::TagType::NETWORKELEMENT:
207  setText("network elements");
208  break;
209  case GNETagProperties::TagType::ADDITIONALELEMENT:
210  setText("Additional elements");
211  break;
212  case GNETagProperties::TagType::SHAPE:
213  setText("Shape elements");
214  break;
215  case GNETagProperties::TagType::TAZELEMENT:
216  setText("TAZ elements");
217  break;
218  case GNETagProperties::TagType::WIRE:
219  setText("Wire elements");
220  break;
221  case GNETagProperties::TagType::VEHICLE:
222  setText("Vehicles");
223  break;
224  case GNETagProperties::TagType::STOP:
225  setText("Stops");
226  break;
227  case GNETagProperties::TagType::PERSON:
228  setText("Persons");
229  break;
230  case GNETagProperties::TagType::PERSONPLAN:
231  setText("Person plans");
232  break;
233  case GNETagProperties::TagType::CONTAINER:
234  setText("Container");
235  break;
236  case GNETagProperties::TagType::CONTAINERPLAN:
237  setText("Container plans");
238  break;
239  case GNETagProperties::TagType::PERSONTRIP:
240  setText("Person trips");
241  break;
242  case GNETagProperties::TagType::WALK:
243  setText("Walks");
244  break;
245  case GNETagProperties::TagType::RIDE:
246  setText("Rides");
247  break;
248  case GNETagProperties::TagType::STOPPERSON:
249  setText("Person stops");
250  break;
251  default:
252  throw ProcessError("invalid tag property");
253  }
254  // clear myACTemplates and myTagsMatchBox
255  for (const auto& ACTemplate : myACTemplates) {
256  delete ACTemplate;
257  }
258  myACTemplates.clear();
259  myTagsMatchBox->clearItems();
260  // get tag properties
261  const auto tagProperties = GNEAttributeCarrier::getTagPropertiesByType(myTagType);
262  // fill myACTemplates and myTagsMatchBox
263  for (const auto& tagProperty : tagProperties) {
264  if ((!onlyDrawables || tagProperty.isDrawable()) && (!tagProperty.requireProj() || proj)) {
265  myACTemplates.push_back(new ACTemplate(myFrameParent->getViewNet()->getNet(), tagProperty));
266  myTagsMatchBox->appendIconItem(tagProperty.getFieldString().c_str(), GUIIconSubSys::getIcon(tagProperty.getGUIIcon()), tagProperty.getBackGroundColor());
267  }
268  }
269  // set color of myTypeMatchBox to black (valid)
270  myTagsMatchBox->setTextColor(FXRGB(0, 0, 0));
271  // Set visible items
272  myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems() + 1);
273  // set first myACTemplate as edited AC
274  myCurrentTemplateAC = myACTemplates.front()->getAC();
275  // call tag selected function
276  if (notifyFrameParent) {
277  myFrameParent->tagSelected();
278  }
279 }
280 
281 
282 void
283 GNEFrameModules::TagSelector::setCurrentTag(SumoXMLTag newTag, const bool notifyFrameParent) {
284  // first reset myCurrentTemplateAC
285  myCurrentTemplateAC = nullptr;
286  // iterate over all myTagsMatchBox
287  for (int i = 0; i < (int)myACTemplates.size(); i++) {
288  if (myACTemplates.at(i)->getAC() && (myACTemplates.at(i)->getAC()->getTagProperty().getTag() == newTag)) {
289  // set current template and currentItem
290  myCurrentTemplateAC = myACTemplates.at(i)->getAC();
291  myTagsMatchBox->setCurrentItem(i);
292  // set color of myTypeMatchBox to black (valid)
293  myTagsMatchBox->setTextColor(FXRGB(0, 0, 0));
294  }
295  }
296  // call tag selected function
297  if (notifyFrameParent) {
298  myFrameParent->tagSelected();
299  }
300 }
301 
302 
303 void
305  // call tag selected function
306  myFrameParent->tagSelected();
307 }
308 
309 
310 long
311 GNEFrameModules::TagSelector::onCmdSelectTag(FXObject*, FXSelector, void*) {
312  // iterate over all myTagsMatchBox
313  for (int i = 0; i < (int)myACTemplates.size(); i++) {
314  if (myACTemplates.at(i)->getAC() && myACTemplates.at(i)->getAC()->getTagProperty().getFieldString() == myTagsMatchBox->getText().text()) {
315  // set templateAC and currentItem
316  myCurrentTemplateAC = myACTemplates.at(i)->getAC();
317  myTagsMatchBox->setCurrentItem(i);
318  // set color of myTypeMatchBox to black (valid)
319  myTagsMatchBox->setTextColor(FXRGB(0, 0, 0));
320  // call tag selected function
321  myFrameParent->tagSelected();
322  // Write Warning in console if we're in testing mode
323  WRITE_DEBUG(("Selected item '" + myTagsMatchBox->getText() + "' in TagSelector").text());
324  return 1;
325  }
326  }
327  // reset templateAC
328  myCurrentTemplateAC = nullptr;
329  // set color of myTypeMatchBox to red (invalid)
330  myTagsMatchBox->setTextColor(FXRGB(255, 0, 0));
331  // Write Warning in console if we're in testing mode
332  WRITE_DEBUG("Selected invalid item in TagSelector");
333  // call tag selected function
334  myFrameParent->tagSelected();
335  return 1;
336 }
337 
338 
341  return myAC;
342 }
343 
344 
346  myAC(nullptr) {
347  // create attribute carrier depending of
348  switch (tagProperty.getTag()) {
349  // additional elements
350  case SUMO_TAG_BUS_STOP:
351  case SUMO_TAG_TRAIN_STOP:
352  myAC = new GNEBusStop(tagProperty.getTag(), net);
353  break;
354  case SUMO_TAG_ACCESS:
355  myAC = new GNEAccess(net);
356  break;
358  myAC = new GNEContainerStop(net);
359  break;
361  myAC = new GNEChargingStation(net);
362  break;
364  myAC = new GNEParkingArea(net);
365  break;
367  myAC = new GNEParkingSpace(net);
368  break;
369  case SUMO_TAG_E1DETECTOR:
370  myAC = new GNEDetectorE1(net);
371  break;
372  case SUMO_TAG_E2DETECTOR:
374  myAC = new GNEDetectorE2(tagProperty.getTag(), net);
375  break;
376  case SUMO_TAG_E3DETECTOR:
377  myAC = new GNEDetectorE3(net);
378  break;
379  case SUMO_TAG_DET_ENTRY:
380  case SUMO_TAG_DET_EXIT:
381  myAC = new GNEDetectorEntryExit(tagProperty.getTag(), net);
382  break;
384  myAC = new GNEDetectorE1Instant(net);
385  break;
386  case SUMO_TAG_VSS:
387  myAC = new GNEVariableSpeedSign(net);
388  break;
389  case SUMO_TAG_STEP:
390  myAC = new GNEVariableSpeedSignStep(net);
391  break;
392  case SUMO_TAG_CALIBRATOR:
394  myAC = new GNECalibrator(tagProperty.getTag(), net);
395  break;
397  myAC = new GNECalibratorFlow(net);
398  break;
399  case SUMO_TAG_REROUTER:
400  myAC = new GNERerouter(net);
401  break;
402  case SUMO_TAG_INTERVAL:
403  myAC = new GNERerouterInterval(net);
404  break;
406  myAC = new GNEClosingReroute(net);
407  break;
409  myAC = new GNEClosingLaneReroute(net);
410  break;
412  myAC = new GNEDestProbReroute(net);
413  break;
415  myAC = new GNEParkingAreaReroute(net);
416  break;
418  myAC = new GNERouteProbReroute(net);
419  break;
420  case SUMO_TAG_ROUTEPROBE:
421  myAC = new GNERouteProbe(net);
422  break;
423  case SUMO_TAG_VAPORIZER:
424  myAC = new GNEVaporizer(net);
425  break;
426  // shapes
427  case SUMO_TAG_POLY:
428  myAC = new GNEPoly(net);
429  break;
430  case SUMO_TAG_POI:
431  case GNE_TAG_POILANE:
432  case GNE_TAG_POIGEO:
433  myAC = new GNEPOI(tagProperty.getTag(), net);
434  break;
435  // TAZs
436  case SUMO_TAG_TAZ:
437  myAC = new GNETAZ(net);
438  break;
439  case SUMO_TAG_TAZSOURCE:
440  case SUMO_TAG_TAZSINK:
441  myAC = new GNETAZSourceSink(tagProperty.getTag(), net);
442  break;
443  // wires
445  myAC = new GNETractionSubstation(net);
446  break;
448  myAC = new GNEOverheadWire(net);
449  break;
451  myAC = nullptr; // TMP
452  break;
453  // Demand elements
454  case SUMO_TAG_ROUTE:
456  myAC = new GNERoute(tagProperty.getTag(), net);
457  break;
458  case SUMO_TAG_VTYPE:
459  myAC = new GNEVType(net);
460  break;
462  myAC = new GNEVTypeDistribution(net);
463  break;
464  case SUMO_TAG_VEHICLE:
466  case GNE_TAG_FLOW_ROUTE:
468  case SUMO_TAG_TRIP:
470  case SUMO_TAG_FLOW:
472  myAC = new GNEVehicle(tagProperty.getTag(), net);
473  break;
474  // stops
475  case SUMO_TAG_STOP_LANE:
484  // waypoints
490  myAC = new GNEStop(tagProperty.getTag(), net);
491  break;
492  case SUMO_TAG_PERSON:
493  case SUMO_TAG_PERSONFLOW:
494  myAC = new GNEPerson(tagProperty.getTag(), net);
495  break;
496  case SUMO_TAG_CONTAINER:
498  myAC = new GNEContainer(tagProperty.getTag(), net);
499  break;
502  myAC = new GNETransport(tagProperty.getTag(), net);
503  break;
507  myAC = new GNETranship(tagProperty.getTag(), net);
508  break;
512  myAC = new GNEPersonTrip(tagProperty.getTag(), net);
513  break;
514  case GNE_TAG_WALK_EDGE:
516  case GNE_TAG_WALK_EDGES:
517  case GNE_TAG_WALK_ROUTE:
519  myAC = new GNEWalk(tagProperty.getTag(), net);
520  break;
521  case GNE_TAG_RIDE_EDGE:
523  myAC = new GNERide(tagProperty.getTag(), net);
524  break;
525  default:
526  throw ProcessError("Non-supported tagProperty in ACTemplate");
527  break;
528  }
529 }
530 
531 
533  delete myAC;
534 }
535 
536 // ---------------------------------------------------------------------------
537 // GNEFrameModules::DemandElementSelector - methods
538 // ---------------------------------------------------------------------------
539 
541  FXGroupBoxModule(frameParent->getContentFrame(), ("Parent " + toString(demandElementTag)).c_str()),
542  myFrameParent(frameParent),
543  myCurrentDemandElement(defaultElement),
544  myDemandElementTags({demandElementTag}) {
545  // Create MFXIconComboBox
546  myDemandElementsMatchBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox);
547  // refresh demand element MatchBox
548  refreshDemandElementSelector();
549  // shown after creation
550  show();
551 }
552 
553 
554 GNEFrameModules::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, const std::vector<GNETagProperties::TagType>& tagTypes) :
555  FXGroupBoxModule(frameParent->getContentFrame(), "Parent element"),
556  myFrameParent(frameParent),
557  myCurrentDemandElement(nullptr) {
558  // fill myDemandElementTags
559  for (const auto& tagType : tagTypes) {
560  const auto tagProperties = GNEAttributeCarrier::getTagPropertiesByType(tagType);
561  for (const auto& tagProperty : tagProperties) {
562  myDemandElementTags.push_back(tagProperty.getTag());
563  }
564  }
565  // Create MFXIconComboBox
567  // refresh demand element MatchBox
569  // shown after creation
570  show();
571 }
572 
573 
575 
576 
579  return myCurrentDemandElement;
580 }
581 
582 
583 const std::vector<SumoXMLTag>&
585  return myDemandElementTags;
586 }
587 
588 
589 void
591  // first check that demandElement tag correspond to a tag of myDemandElementTags
592  if (std::find(myDemandElementTags.begin(), myDemandElementTags.end(), demandElement->getTagProperty().getTag()) != myDemandElementTags.end()) {
593  // update text of myDemandElementsMatchBox
594  myDemandElementsMatchBox->setItem(demandElement->getID().c_str(), demandElement->getIcon());
595  // Set new current demand element
596  myCurrentDemandElement = demandElement;
597  // call demandElementSelected function
598  myFrameParent->demandElementSelected();
599  }
600 }
601 
602 
603 void
605  // first refresh modul
606  refreshDemandElementSelector();
607  // if current selected item isn't valid, set DEFAULT_VTYPE_ID or DEFAULT_PEDTYPE_ID
608  if (myCurrentDemandElement) {
609  myDemandElementsMatchBox->setItem(myCurrentDemandElement->getID().c_str(), myCurrentDemandElement->getIcon());
610  } else if (myDemandElementTags.size() == 1) {
611  if (myDemandElementTags.at(0) == SUMO_TAG_VTYPE) {
612  const auto defaultVType = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID);
613  myDemandElementsMatchBox->setItem(defaultVType->getID().c_str(), defaultVType->getIcon());
614  }
615  }
616  onCmdSelectDemandElement(nullptr, 0, nullptr);
617  show();
618 }
619 
620 
621 void
623  hide();
624 }
625 
626 
627 bool
629  return shown();
630 }
631 
632 
633 void
635  // get demand elemenst container
636  const auto& demandElements = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements();
637  // clear demand elements comboBox
638  myDemandElementsMatchBox->clearItems();
639  // fill myTypeMatchBox with list of demand elements
640  for (const auto& demandElementTag : myDemandElementTags) {
641  // special case for VTypes
642  if (demandElementTag == SUMO_TAG_VTYPE) {
643  // add default types in the first positions
644  myDemandElementsMatchBox->appendIconItem(DEFAULT_VTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE));
645  myDemandElementsMatchBox->appendIconItem(DEFAULT_BIKETYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE));
646  myDemandElementsMatchBox->appendIconItem(DEFAULT_TAXITYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE));
647  myDemandElementsMatchBox->appendIconItem(DEFAULT_PEDTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE));
648  myDemandElementsMatchBox->appendIconItem(DEFAULT_CONTAINERTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE));
649  // add rest of vTypes
650  for (const auto& vType : demandElements.at(demandElementTag)) {
651  // avoid insert duplicated default vType
652  if (DEFAULT_VTYPES.count(vType->getID()) == 0) {
653  myDemandElementsMatchBox->appendIconItem(vType->getID().c_str(), vType->getIcon());
654  }
655  }
656  } else {
657  // insert all Ids
658  for (const auto& demandElement : demandElements.at(demandElementTag)) {
659  myDemandElementsMatchBox->appendIconItem(demandElement->getID().c_str(), demandElement->getIcon());
660  }
661  }
662  }
663  // Set number of items (maximum 10)
664  if (myDemandElementsMatchBox->getNumItems() < 10) {
665  myDemandElementsMatchBox->setNumVisible((int)myDemandElementsMatchBox->getNumItems() + 1);
666  } else {
667  myDemandElementsMatchBox->setNumVisible(10);
668  }
669  // update myCurrentDemandElement
670  if (myDemandElementsMatchBox->getNumItems() == 0) {
671  myCurrentDemandElement = nullptr;
672  } else if (myCurrentDemandElement) {
673  for (int i = 0; i < myDemandElementsMatchBox->getNumItems(); i++) {
674  if (myDemandElementsMatchBox->getItem(i).text() == myCurrentDemandElement->getID()) {
675  myDemandElementsMatchBox->setCurrentItem(i, FALSE);
676  }
677  }
678  } else {
679  // set first element in the list as myCurrentDemandElement (Special case for default person and vehicle type)
680  if (myDemandElementsMatchBox->getItem(0).text() == DEFAULT_VTYPE_ID) {
681  myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDefaultType();
682  } else {
683  // disable myCurrentDemandElement
684  myCurrentDemandElement = nullptr;
685  // update myCurrentDemandElement with the first allowed element
686  for (auto i = myDemandElementTags.begin(); (i != myDemandElementTags.end()) && (myCurrentDemandElement == nullptr); i++) {
687  if (demandElements.at(*i).size() > 0) {
688  myCurrentDemandElement = *demandElements.at(*i).begin();
689  }
690  }
691  }
692  }
693 }
694 
695 
696 GNEEdge*
698  if (myCurrentDemandElement == nullptr) {
699  return nullptr;
700  }
701  if (!myCurrentDemandElement->getTagProperty().isPerson()) {
702  return nullptr;
703  }
704  if (myCurrentDemandElement->getChildDemandElements().empty()) {
705  return nullptr;
706  }
707  // get last person plan
708  const GNEDemandElement* lastPersonPlan = myCurrentDemandElement->getChildDemandElements().back();
709  // check tag
710  switch (lastPersonPlan->getTagProperty().getTag()) {
711  // person trips
713  // rides
714  case GNE_TAG_RIDE_EDGE:
715  // walks
716  case GNE_TAG_WALK_EDGE:
717  case GNE_TAG_WALK_EDGES:
718  // stops
720  return lastPersonPlan->getParentEdges().back();
721  // person trips
723  // person trips
725  // walks
727  // stops
729  return lastPersonPlan->getParentAdditionals().back()->getParentLanes().front()->getParentEdge();
730  // route walks
731  case GNE_TAG_WALK_ROUTE:
732  return lastPersonPlan->getParentDemandElements().back()->getParentEdges().back();
733  default:
734  return nullptr;
735  }
736 }
737 
738 
739 GNEEdge*
741  if (myCurrentDemandElement == nullptr) {
742  return nullptr;
743  }
744  if (!myCurrentDemandElement->getTagProperty().isContainer()) {
745  return nullptr;
746  }
747  if (myCurrentDemandElement->getChildDemandElements().empty()) {
748  return nullptr;
749  }
750  // get last container plan
751  const GNEDemandElement* lastContainerPlan = myCurrentDemandElement->getChildDemandElements().back();
752  // check tag
753  switch (lastContainerPlan->getTagProperty().getTag()) {
754  // transport
756  // tranship
759  // stop
761  return lastContainerPlan->getParentEdges().back();
762  // transport
764  // tranship
766  // stop
768  return lastContainerPlan->getParentAdditionals().back()->getParentLanes().front()->getParentEdge();
769  default:
770  return nullptr;
771  }
772 }
773 
774 
775 long
777  // Check if value of myTypeMatchBox correspond to a demand element
778  for (const auto& demandElementTag : myDemandElementTags) {
779  for (const auto& demandElement : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(demandElementTag)) {
780  if (demandElement->getID() == myDemandElementsMatchBox->getText().text()) {
781  // set color of myTypeMatchBox to black (valid)
782  myDemandElementsMatchBox->setTextColor(FXRGB(0, 0, 0));
783  // Set new current demand element
784  myCurrentDemandElement = demandElement;
785  // call demandElementSelected function
786  myFrameParent->demandElementSelected();
787  // Write Warning in console if we're in testing mode
788  WRITE_DEBUG(("Selected item '" + myDemandElementsMatchBox->getText() + "' in DemandElementSelector").text());
789  return 1;
790  }
791  }
792  }
793  // if demand element selected is invalid, set demand element as null
794  myCurrentDemandElement = nullptr;
795  // call demandElementSelected function
796  myFrameParent->demandElementSelected();
797  // change color of myDemandElementsMatchBox to red (invalid)
798  myDemandElementsMatchBox->setTextColor(FXRGB(255, 0, 0));
799  // Write Warning in console if we're in testing mode
800  WRITE_DEBUG("Selected invalid item in DemandElementSelector");
801  return 1;
802 }
803 
804 // ---------------------------------------------------------------------------
805 // GNEFrameModules::HierarchicalElementTree - methods
806 // ---------------------------------------------------------------------------
807 
809  FXGroupBoxModule(frameParent->getContentFrame(), "Hierarchy"),
810  myFrameParent(frameParent),
811  myHE(nullptr),
812  myClickedAC(nullptr),
813  myClickedJunction(nullptr),
814  myClickedEdge(nullptr),
815  myClickedLane(nullptr),
816  myClickedCrossing(nullptr),
817  myClickedConnection(nullptr),
818  myClickedAdditional(nullptr),
819  myClickedDemandElement(nullptr),
820  myClickedDataSet(nullptr),
821  myClickedDataInterval(nullptr),
822  myClickedGenericData(nullptr) {
823  // Create three list
825  hide();
826 }
827 
828 
830 
831 
832 void
834  myHE = dynamic_cast<GNEHierarchicalElement*>(AC);
835  // show HierarchicalElementTree and refresh HierarchicalElementTree
836  if (myHE) {
837  // refresh HierarchicalElementTree
838  refreshHierarchicalElementTree();
839  // show myTreeListDinamic
840  myTreeListDinamic->show();
841  //show modul
842  show();
843  }
844 }
845 
846 
847 void
849  // set all pointers null
850  myHE = nullptr;
851  myClickedAC = nullptr;
852  myClickedJunction = nullptr;
853  myClickedEdge = nullptr;
854  myClickedLane = nullptr;
855  myClickedCrossing = nullptr;
856  myClickedConnection = nullptr;
857  myClickedAdditional = nullptr;
858  myClickedDemandElement = nullptr;
859  myClickedDataSet = nullptr;
860  myClickedDataInterval = nullptr;
861  myClickedGenericData = nullptr;
862  // hide myTreeListDinamic
863  myTreeListDinamic->hide();
864  // hide modul
865  hide();
866 }
867 
868 
869 void
871  // clear items
872  myTreeListDinamic->clearItems();
873  myTreeItemToACMap.clear();
874  myTreeItemsConnections.clear();
875  // show children of myHE
876  if (myHE) {
877  showHierarchicalElementChildren(myHE, showAttributeCarrierParents());
878  }
879 }
880 
881 
882 void
884  // simply check if AC is the same of myHE
885  if (AC == myHE) {
886  myHE = nullptr;
887  }
888 }
889 
890 
891 long
892 GNEFrameModules::HierarchicalElementTree::onCmdShowChildMenu(FXObject*, FXSelector, void* eventData) {
893  // Obtain event
894  FXEvent* e = (FXEvent*)eventData;
895  // obtain FXTreeItem in the given position
896  FXTreeItem* item = myTreeListDinamic->getItemAt(e->win_x, e->win_y);
897  // open Pop-up if FXTreeItem has a Attribute Carrier vinculated
898  if (item && (myTreeItemsConnections.find(item) == myTreeItemsConnections.end())) {
899  createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[item]);
900  }
901  return 1;
902 }
903 
904 
905 long
907  // Center item
908  if (myClickedJunction) {
909  myFrameParent->getViewNet()->centerTo(myClickedJunction->getGlID(), true, -1);
910  } else if (myClickedEdge) {
911  myFrameParent->getViewNet()->centerTo(myClickedEdge->getGlID(), true, -1);
912  } else if (myClickedLane) {
913  myFrameParent->getViewNet()->centerTo(myClickedLane->getGlID(), true, -1);
914  } else if (myClickedCrossing) {
915  myFrameParent->getViewNet()->centerTo(myClickedCrossing->getGlID(), true, -1);
916  } else if (myClickedConnection) {
917  myFrameParent->getViewNet()->centerTo(myClickedConnection->getGlID(), true, -1);
918  } else if (myClickedAdditional) {
919  myFrameParent->getViewNet()->centerTo(myClickedAdditional->getGlID(), true, -1);
920  } else if (myClickedDemandElement) {
921  myFrameParent->getViewNet()->centerTo(myClickedDemandElement->getGlID(), true, -1);
922  } else if (myClickedGenericData) {
923  myFrameParent->getViewNet()->centerTo(myClickedGenericData->getGlID(), true, -1);
924  }
925  // update view after centering
926  myFrameParent->getViewNet()->updateViewNet();
927  return 1;
928 }
929 
930 
931 long
933  if ((myHE != nullptr) && (myClickedAC != nullptr)) {
934  myFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->inspectChild(myClickedAC, myHE);
935  }
936  return 1;
937 }
938 
939 
940 long
942  // Remove Attribute Carrier
943  if (myClickedJunction) {
944  myFrameParent->getViewNet()->getNet()->deleteJunction(myClickedJunction, myFrameParent->getViewNet()->getUndoList());
945  } else if (myClickedEdge) {
946  myFrameParent->getViewNet()->getNet()->deleteEdge(myClickedEdge, myFrameParent->getViewNet()->getUndoList(), false);
947  } else if (myClickedLane) {
948  myFrameParent->getViewNet()->getNet()->deleteLane(myClickedLane, myFrameParent->getViewNet()->getUndoList(), false);
949  } else if (myClickedCrossing) {
950  myFrameParent->getViewNet()->getNet()->deleteCrossing(myClickedCrossing, myFrameParent->getViewNet()->getUndoList());
951  } else if (myClickedConnection) {
952  myFrameParent->getViewNet()->getNet()->deleteConnection(myClickedConnection, myFrameParent->getViewNet()->getUndoList());
953  } else if (myClickedAdditional) {
954  myFrameParent->getViewNet()->getNet()->deleteAdditional(myClickedAdditional, myFrameParent->getViewNet()->getUndoList());
955  } else if (myClickedDemandElement) {
956  // check that default VTypes aren't removed
957  if ((myClickedDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && (GNEAttributeCarrier::parse<bool>(myClickedDemandElement->getAttribute(GNE_ATTR_DEFAULT_VTYPE)))) {
958  WRITE_WARNING("Default Vehicle Type '" + myClickedDemandElement->getAttribute(SUMO_ATTR_ID) + "' cannot be removed");
959  return 1;
960  } else if (myClickedDemandElement->getTagProperty().isPersonPlan() && (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().size() == 1)) {
961  // we need to check if we're removing the last person plan of a person.
962  myFrameParent->getViewNet()->getNet()->deleteDemandElement(myClickedDemandElement->getParentDemandElements().front(), myFrameParent->getViewNet()->getUndoList());
963  } else {
964  myFrameParent->getViewNet()->getNet()->deleteDemandElement(myClickedDemandElement, myFrameParent->getViewNet()->getUndoList());
965  }
966  } else if (myClickedDataSet) {
967  myFrameParent->getViewNet()->getNet()->deleteDataSet(myClickedDataSet, myFrameParent->getViewNet()->getUndoList());
968  } else if (myClickedDataInterval) {
969  // check if we have to remove data Set
970  if (myClickedDataInterval->getDataSetParent()->getDataIntervalChildren().size() == 1) {
971  myFrameParent->getViewNet()->getNet()->deleteDataSet(myClickedDataInterval->getDataSetParent(), myFrameParent->getViewNet()->getUndoList());
972  } else {
973  myFrameParent->getViewNet()->getNet()->deleteDataInterval(myClickedDataInterval, myFrameParent->getViewNet()->getUndoList());
974  }
975  } else if (myClickedGenericData) {
976  // check if we have to remove interval
977  if (myClickedGenericData->getDataIntervalParent()->getGenericDataChildren().size() == 1) {
978  // check if we have to remove data Set
979  if (myClickedGenericData->getDataIntervalParent()->getDataSetParent()->getDataIntervalChildren().size() == 1) {
980  myFrameParent->getViewNet()->getNet()->deleteDataSet(myClickedGenericData->getDataIntervalParent()->getDataSetParent(), myFrameParent->getViewNet()->getUndoList());
981  } else {
982  myFrameParent->getViewNet()->getNet()->deleteDataInterval(myClickedGenericData->getDataIntervalParent(), myFrameParent->getViewNet()->getUndoList());
983  }
984  } else {
985  myFrameParent->getViewNet()->getNet()->deleteGenericData(myClickedGenericData, myFrameParent->getViewNet()->getUndoList());
986  }
987  }
988  // update net
989  myFrameParent->getViewNet()->updateViewNet();
990  // refresh AC Hierarchy
991  refreshHierarchicalElementTree();
992  // check if inspector frame has to be shown again
993  if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
994  if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().front() != myClickedAC) {
995  myFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->inspectSingleElement(myFrameParent->getViewNet()->getInspectedAttributeCarriers().front());
996  } else {
997  // inspect a nullprt element to reset inspector frame
998  myFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->inspectSingleElement(nullptr);
999  }
1000  }
1001  return 1;
1002 }
1003 
1004 
1005 long
1007  // currently only children of demand elements can be moved
1008  if (myClickedDemandElement) {
1009  myFrameParent->getViewNet()->getUndoList()->begin(myClickedDemandElement->getTagProperty().getGUIIcon(), ("moving up " + myClickedDemandElement->getTagStr()).c_str());
1010  // move element one position back
1011  myFrameParent->getViewNet()->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement,
1012  GNEChange_Children::Operation::MOVE_BACK), true);
1013  myFrameParent->getViewNet()->getUndoList()->end();
1014  }
1015  // refresh after moving child
1016  refreshHierarchicalElementTree();
1017  return 1;
1018 }
1019 
1020 
1021 long
1023  // currently only children of demand elements can be moved
1024  if (myClickedDemandElement) {
1025  myFrameParent->getViewNet()->getUndoList()->begin(myClickedDemandElement->getTagProperty().getGUIIcon(), ("moving down " + myClickedDemandElement->getTagStr()).c_str());
1026  // move element one position front
1027  myFrameParent->getViewNet()->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement,
1028  GNEChange_Children::Operation::MOVE_FRONT), true);
1029  myFrameParent->getViewNet()->getUndoList()->end();
1030  }
1031  // refresh after moving child
1032  refreshHierarchicalElementTree();
1033  return 1;
1034 }
1035 
1036 
1037 void
1039  // get attributeCarrirs
1040  const auto& attributeCarriers = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
1041  // first check that AC exist
1042  if (clickedAC) {
1043  // set current clicked AC
1044  myClickedAC = clickedAC;
1045  // cast all elements
1046  myClickedJunction = attributeCarriers->retrieveJunction(clickedAC->getID(), false);
1047  myClickedEdge = attributeCarriers->retrieveEdge(clickedAC->getID(), false);
1048  myClickedLane = attributeCarriers->retrieveLane(clickedAC, false);
1049  myClickedCrossing = attributeCarriers->retrieveCrossing(clickedAC, false);
1050  myClickedConnection = attributeCarriers->retrieveConnection(clickedAC, false);
1051  myClickedAdditional = attributeCarriers->retrieveAdditional(clickedAC, false);
1052  myClickedDemandElement = attributeCarriers->retrieveDemandElement(clickedAC, false);
1053  myClickedDataSet = attributeCarriers->retrieveDataSet(clickedAC, false);
1054  myClickedDataInterval = attributeCarriers->retrieveDataInterval(clickedAC, false);
1055  myClickedGenericData = attributeCarriers->retrieveGenericData(clickedAC, false);
1056  // create FXMenuPane
1057  FXMenuPane* pane = new FXMenuPane(myTreeListDinamic);
1058  // set item name and icon
1059  new MFXMenuHeader(pane, myFrameParent->getViewNet()->getViewParent()->getGUIMainWindow()->getBoldFont(), myClickedAC->getPopUpID().c_str(), myClickedAC->getIcon());
1060  // insert separator
1061  new FXMenuSeparator(pane);
1062  // create center menu command
1063  FXMenuCommand* centerMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_GNE_CENTER);
1064  // disable Centering for Vehicle Types, data sets and data intervals
1065  if (myClickedAC->getTagProperty().isVehicleType() || (myClickedAC->getTagProperty().getTag() == SUMO_TAG_DATASET) ||
1066  (myClickedAC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL)) {
1067  centerMenuCommand->disable();
1068  }
1069  // create inspect and delete menu commands
1070  FXMenuCommand* inspectMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), this, MID_GNE_INSPECT);
1071  FXMenuCommand* deleteMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), this, MID_GNE_DELETE);
1072  // check if inspect and delete menu commands has to be disabled
1073  if (GNEFrameAttributeModules::isSupermodeValid(myFrameParent->getViewNet(), myClickedAC) == false) {
1074  inspectMenuCommand->disable();
1075  deleteMenuCommand->disable();
1076  }
1077  // now chec if given AC support manually moving of their item up and down (Currently only for certain demand elements)
1078  /* if (myClickedDemandElement && myClickedAC->getTagProperty().canBeSortedManually()) {
1079  // insert separator
1080  new FXMenuSeparator(pane);
1081  // create both moving menu commands
1082  FXMenuCommand* moveUpMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(GUIIcon::ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP);
1083  FXMenuCommand* moveDownMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(GUIIcon::ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN);
1084  // check if both commands has to be disabled
1085  if (myClickedDemandElement->getTagProperty().isStopPerson()) {
1086  moveUpMenuCommand->setText("Move up (Stops cannot be moved)");
1087  moveDownMenuCommand->setText("Move down (Stops cannot be moved)");
1088  moveUpMenuCommand->disable();
1089  moveDownMenuCommand->disable();
1090  } else {
1091  // check if moveUpMenuCommand has to be disabled
1092  if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().front() == myClickedDemandElement) {
1093  moveUpMenuCommand->setText("Move up (It's already the first element)");
1094  moveUpMenuCommand->disable();
1095  } else if (myClickedDemandElement->getParentDemandElements().front()->getPreviousChildDemandElement(myClickedDemandElement)->getTagProperty().isStopPerson()) {
1096  moveUpMenuCommand->setText("Move up (Previous element is a Stop)");
1097  moveUpMenuCommand->disable();
1098  }
1099  // check if moveDownMenuCommand has to be disabled
1100  if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().back() == myClickedDemandElement) {
1101  moveDownMenuCommand->setText("Move down (It's already the last element)");
1102  moveDownMenuCommand->disable();
1103  } else if (myClickedDemandElement->getParentDemandElements().front()->getNextChildDemandElement(myClickedDemandElement)->getTagProperty().isStopPerson()) {
1104  moveDownMenuCommand->setText("Move down (Next element is a Stop)");
1105  moveDownMenuCommand->disable();
1106  }
1107  }
1108  } */
1109  // Center in the mouse position and create pane
1110  pane->setX(X);
1111  pane->setY(Y);
1112  pane->create();
1113  pane->show();
1114  } else {
1115  // set all clicked elements to null
1116  myClickedAC = nullptr;
1117  myClickedJunction = nullptr;
1118  myClickedEdge = nullptr;
1119  myClickedLane = nullptr;
1120  myClickedCrossing = nullptr;
1121  myClickedConnection = nullptr;
1122  myClickedAdditional = nullptr;
1123  myClickedDemandElement = nullptr;
1124  myClickedDataSet = nullptr;
1125  myClickedDataInterval = nullptr;
1126  myClickedGenericData = nullptr;
1127  }
1128 }
1129 
1130 
1131 FXTreeItem*
1133  // get attributeCarrirs
1134  const auto& attributeCarriers = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
1135  // check tags
1136  if (myHE->getTagProperty().isNetworkElement()) {
1137  // check demand element type
1138  switch (myHE->getTagProperty().getTag()) {
1139  case SUMO_TAG_EDGE: {
1140  // obtain Edge
1141  GNEEdge* edge = attributeCarriers->retrieveEdge(myHE->getID(), false);
1142  if (edge) {
1143  // insert Junctions of edge in tree (Pararell because a edge has always two Junctions)
1144  FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon());
1145  FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon());
1146  junctionDestinyItem->setExpanded(true);
1147  // Save items in myTreeItemToACMap
1148  myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
1149  myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction();
1150  // return junction destiny Item
1151  return junctionDestinyItem;
1152  } else {
1153  return nullptr;
1154  }
1155  }
1156  case SUMO_TAG_LANE: {
1157  // obtain lane
1158  GNELane* lane = attributeCarriers->retrieveLane(myHE->getID(), false);
1159  if (lane) {
1160  // obtain parent edge
1161  GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID());
1162  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
1163  FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon());
1164  FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon());
1165  junctionDestinyItem->setExpanded(true);
1166  // Create edge item
1167  FXTreeItem* edgeItem = myTreeListDinamic->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
1168  edgeItem->setExpanded(true);
1169  // Save items in myTreeItemToACMap
1170  myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
1171  myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction();
1172  myTreeItemToACMap[edgeItem] = edge;
1173  // return edge item
1174  return edgeItem;
1175  } else {
1176  return nullptr;
1177  }
1178  }
1179  case SUMO_TAG_CROSSING: {
1180  // obtain crossing parent junction
1181  GNEJunction* junction = attributeCarriers->retrieveCrossing(myHE)->getParentJunction();
1182  // create junction item
1183  FXTreeItem* junctionItem = myTreeListDinamic->insertItem(nullptr, nullptr, junction->getHierarchyName().c_str(), junction->getIcon(), junction->getIcon());
1184  junctionItem->setExpanded(true);
1185  // Save items in myTreeItemToACMap
1186  myTreeItemToACMap[junctionItem] = junction;
1187  // return junction Item
1188  return junctionItem;
1189  }
1190  case SUMO_TAG_CONNECTION: {
1191  // obtain Connection
1192  GNEConnection* connection = attributeCarriers->retrieveConnection(myHE->getID(), false);
1193  if (connection) {
1194  // create edge from item
1195  FXTreeItem* edgeFromItem = myTreeListDinamic->insertItem(nullptr, nullptr, connection->getEdgeFrom()->getHierarchyName().c_str(), connection->getEdgeFrom()->getIcon(), connection->getEdgeFrom()->getIcon());
1196  edgeFromItem->setExpanded(true);
1197  // create edge to item
1198  FXTreeItem* edgeToItem = myTreeListDinamic->insertItem(nullptr, nullptr, connection->getEdgeTo()->getHierarchyName().c_str(), connection->getEdgeTo()->getIcon(), connection->getEdgeTo()->getIcon());
1199  edgeToItem->setExpanded(true);
1200  // create connection item
1201  FXTreeItem* connectionItem = myTreeListDinamic->insertItem(nullptr, edgeToItem, connection->getHierarchyName().c_str(), connection->getIcon(), connection->getIcon());
1202  connectionItem->setExpanded(true);
1203  // Save items in myTreeItemToACMap
1204  myTreeItemToACMap[edgeFromItem] = connection->getEdgeFrom();
1205  myTreeItemToACMap[edgeToItem] = connection->getEdgeTo();
1206  myTreeItemToACMap[connectionItem] = connection;
1207  // return connection item
1208  return connectionItem;
1209  } else {
1210  return nullptr;
1211  }
1212  }
1213  default:
1214  break;
1215  }
1216  } else if (myHE->getTagProperty().getTag() == GNE_TAG_POILANE) {
1217  // Obtain POILane
1218  const auto* POILane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveAdditional(myHE);
1219  // obtain parent lane
1220  GNELane* lane = attributeCarriers->retrieveLane(POILane->getParentLanes().at(0)->getID());
1221  // obtain parent edge
1222  GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID());
1223  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
1224  FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon());
1225  FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon());
1226  junctionDestinyItem->setExpanded(true);
1227  // Create edge item
1228  FXTreeItem* edgeItem = myTreeListDinamic->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
1229  edgeItem->setExpanded(true);
1230  // Create lane item
1231  FXTreeItem* laneItem = myTreeListDinamic->insertItem(nullptr, edgeItem, lane->getHierarchyName().c_str(), lane->getIcon(), lane->getIcon());
1232  laneItem->setExpanded(true);
1233  // Save items in myTreeItemToACMap
1234  myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
1235  myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction();
1236  myTreeItemToACMap[edgeItem] = edge;
1237  myTreeItemToACMap[laneItem] = lane;
1238  // return Lane item
1239  return laneItem;
1240  } else if (myHE->getTagProperty().isAdditionalElement()) {
1241  // Obtain Additional
1242  const GNEAdditional* additional = attributeCarriers->retrieveAdditional(myHE);
1243  // declare auxiliar FXTreeItem, due a demand element can have multiple "roots"
1244  FXTreeItem* root = nullptr;
1245  // check if there is demand elements parents
1246  if (additional->getParentAdditionals().size() > 0) {
1247  // check if we have more than one edge
1248  if (additional->getParentAdditionals().size() > 1) {
1249  // insert first item
1250  addListItem(additional->getParentAdditionals().front());
1251  // insert "spacer"
1252  if (additional->getParentAdditionals().size() > 2) {
1253  addListItem(nullptr, ("..." + toString((int)additional->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false);
1254  }
1255  }
1256  // return last inserted item
1257  root = addListItem(additional->getParentAdditionals().back());
1258  }
1259  // check if there is parent demand elements
1260  if (additional->getParentDemandElements().size() > 0) {
1261  // check if we have more than one demand element
1262  if (additional->getParentDemandElements().size() > 1) {
1263  // insert first item
1264  addListItem(additional->getParentDemandElements().front());
1265  // insert "spacer"
1266  if (additional->getParentDemandElements().size() > 2) {
1267  addListItem(nullptr, ("..." + toString((int)additional->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false);
1268  }
1269  }
1270  // return last inserted item
1271  root = addListItem(additional->getParentDemandElements().back());
1272  }
1273  // check if there is parent edges
1274  if (additional->getParentEdges().size() > 0) {
1275  // check if we have more than one edge
1276  if (additional->getParentEdges().size() > 1) {
1277  // insert first item
1278  addListItem(additional->getParentEdges().front());
1279  // insert "spacer"
1280  if (additional->getParentEdges().size() > 2) {
1281  addListItem(nullptr, ("..." + toString((int)additional->getParentEdges().size() - 2) + " edges...").c_str(), 0, false);
1282  }
1283  }
1284  // return last inserted item
1285  root = addListItem(additional->getParentEdges().back());
1286  }
1287  // check if there is parent lanes
1288  if (additional->getParentLanes().size() > 0) {
1289  // check if we have more than one parent lane
1290  if (additional->getParentLanes().size() > 1) {
1291  // insert first item
1292  addListItem(additional->getParentLanes().front());
1293  // insert "spacer"
1294  if (additional->getParentLanes().size() > 2) {
1295  addListItem(nullptr, ("..." + toString((int)additional->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false);
1296  }
1297  }
1298  // return last inserted item
1299  root = addListItem(additional->getParentLanes().back());
1300  }
1301  // return last inserted list item
1302  return root;
1303  } else if (myHE->getTagProperty().isTAZElement()) {
1304  // Obtain TAZElement
1305  const GNEAdditional* TAZElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveAdditional(myHE);
1306  // declare auxiliar FXTreeItem, due a demand element can have multiple "roots"
1307  FXTreeItem* root = nullptr;
1308  // check if there is demand elements parents
1309  if (TAZElement->getParentAdditionals().size() > 0) {
1310  // check if we have more than one edge
1311  if (TAZElement->getParentAdditionals().size() > 1) {
1312  // insert first item
1313  addListItem(TAZElement->getParentAdditionals().front());
1314  // insert "spacer"
1315  if (TAZElement->getParentAdditionals().size() > 2) {
1316  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentAdditionals().size() - 2) + " TAZElements...").c_str(), 0, false);
1317  }
1318  }
1319  // return last inserted item
1320  root = addListItem(TAZElement->getParentAdditionals().back());
1321  }
1322  // check if there is parent demand elements
1323  if (TAZElement->getParentDemandElements().size() > 0) {
1324  // check if we have more than one demand element
1325  if (TAZElement->getParentDemandElements().size() > 1) {
1326  // insert first item
1327  addListItem(TAZElement->getParentDemandElements().front());
1328  // insert "spacer"
1329  if (TAZElement->getParentDemandElements().size() > 2) {
1330  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false);
1331  }
1332  }
1333  // return last inserted item
1334  root = addListItem(TAZElement->getParentDemandElements().back());
1335  }
1336  // check if there is parent edges
1337  if (TAZElement->getParentEdges().size() > 0) {
1338  // check if we have more than one edge
1339  if (TAZElement->getParentEdges().size() > 1) {
1340  // insert first item
1341  addListItem(TAZElement->getParentEdges().front());
1342  // insert "spacer"
1343  if (TAZElement->getParentEdges().size() > 2) {
1344  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false);
1345  }
1346  }
1347  // return last inserted item
1348  root = addListItem(TAZElement->getParentEdges().back());
1349  }
1350  // check if there is parent lanes
1351  if (TAZElement->getParentLanes().size() > 0) {
1352  // check if we have more than one parent lane
1353  if (TAZElement->getParentLanes().size() > 1) {
1354  // insert first item
1355  addListItem(TAZElement->getParentLanes().front());
1356  // insert "spacer"
1357  if (TAZElement->getParentLanes().size() > 2) {
1358  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false);
1359  }
1360  }
1361  // return last inserted item
1362  root = addListItem(TAZElement->getParentLanes().back());
1363  }
1364  // return last inserted list item
1365  return root;
1366  } else if (myHE->getTagProperty().isDemandElement()) {
1367  // Obtain DemandElement
1368  GNEDemandElement* demandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(myHE);
1369  // declare auxiliar FXTreeItem, due a demand element can have multiple "roots"
1370  FXTreeItem* root = nullptr;
1371  // check if there are demand element parents
1372  if (demandElement->getParentAdditionals().size() > 0) {
1373  // check if we have more than one edge
1374  if (demandElement->getParentAdditionals().size() > 1) {
1375  // insert first item
1376  addListItem(demandElement->getParentAdditionals().front());
1377  // insert "spacer"
1378  if (demandElement->getParentAdditionals().size() > 2) {
1379  addListItem(nullptr, ("..." + toString((int)demandElement->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false);
1380  }
1381  }
1382  // return last inserted item
1383  root = addListItem(demandElement->getParentAdditionals().back());
1384  }
1385  // check if there is parent demand elements
1386  if (demandElement->getParentDemandElements().size() > 0) {
1387  // check if we have more than one demand element
1388  if (demandElement->getParentDemandElements().size() > 1) {
1389  // insert first item
1390  addListItem(demandElement->getParentDemandElements().front());
1391  // insert "spacer"
1392  if (demandElement->getParentDemandElements().size() > 2) {
1393  addListItem(nullptr, ("..." + toString((int)demandElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false);
1394  }
1395  }
1396  // return last inserted item
1397  root = addListItem(demandElement->getParentDemandElements().back());
1398  }
1399  // check if there is parent edges
1400  if (demandElement->getParentEdges().size() > 0) {
1401  // check if we have more than one edge
1402  if (demandElement->getParentEdges().size() > 1) {
1403  // insert first item
1404  addListItem(demandElement->getParentEdges().front());
1405  // insert "spacer"
1406  if (demandElement->getParentEdges().size() > 2) {
1407  addListItem(nullptr, ("..." + toString((int)demandElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false);
1408  }
1409  }
1410  // return last inserted item
1411  root = addListItem(demandElement->getParentEdges().back());
1412  }
1413  // check if there is parent lanes
1414  if (demandElement->getParentLanes().size() > 0) {
1415  // check if we have more than one parent lane
1416  if (demandElement->getParentLanes().size() > 1) {
1417  // insert first item
1418  addListItem(demandElement->getParentLanes().front());
1419  // insert "spacer"
1420  if (demandElement->getParentLanes().size() > 2) {
1421  addListItem(nullptr, ("..." + toString((int)demandElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false);
1422  }
1423  }
1424  // return last inserted item
1425  root = addListItem(demandElement->getParentLanes().back());
1426  }
1427  // return last inserted list item
1428  return root;
1429  } else if (myHE->getTagProperty().isDataElement()) {
1430  // check if is a GNEDataInterval or a GNEGenericData
1431  if (myHE->getTagProperty().getTag() == SUMO_TAG_DATASET) {
1432  return nullptr;
1433  } else if (myHE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
1434  return addListItem(myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDataSet(myHE->getID()));
1435  } else {
1436  // Obtain DataElement
1437  GNEGenericData* dataElement = dynamic_cast<GNEGenericData*>(myHE);
1438  if (dataElement) {
1439  // declare auxiliar FXTreeItem, due a data element can have multiple "roots"
1440  FXTreeItem* root = nullptr;
1441  // set dataset
1442  addListItem(dataElement->getDataIntervalParent()->getDataSetParent());
1443  // set data interval
1444  addListItem(dataElement->getDataIntervalParent());
1445  // check if there is data elements parents
1446  if (dataElement->getParentAdditionals().size() > 0) {
1447  // check if we have more than one edge
1448  if (dataElement->getParentAdditionals().size() > 1) {
1449  // insert first item
1450  addListItem(dataElement->getParentAdditionals().front());
1451  // insert "spacer"
1452  if (dataElement->getParentAdditionals().size() > 2) {
1453  addListItem(nullptr, ("..." + toString((int)dataElement->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false);
1454  }
1455  }
1456  // return last inserted item
1457  root = addListItem(dataElement->getParentAdditionals().back());
1458  }
1459  // check if there is parent demand elements
1460  if (dataElement->getParentDemandElements().size() > 0) {
1461  // check if we have more than one demand element
1462  if (dataElement->getParentDemandElements().size() > 1) {
1463  // insert first item
1464  addListItem(dataElement->getParentDemandElements().front());
1465  // insert "spacer"
1466  if (dataElement->getParentDemandElements().size() > 2) {
1467  addListItem(nullptr, ("..." + toString((int)dataElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false);
1468  }
1469  }
1470  // return last inserted item
1471  root = addListItem(dataElement->getParentDemandElements().back());
1472  }
1473  // check if there is parent edges
1474  if (dataElement->getParentEdges().size() > 0) {
1475  // check if we have more than one edge
1476  if (dataElement->getParentEdges().size() > 1) {
1477  // insert first ege
1478  if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) {
1479  addListItem(dataElement->getParentEdges().front(), nullptr, "from ");
1480  } else {
1481  addListItem(dataElement->getParentEdges().front());
1482  }
1483  // insert "spacer"
1484  if (dataElement->getParentEdges().size() > 2) {
1485  addListItem(nullptr, ("..." + toString((int)dataElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false);
1486  }
1487  }
1488  // insert last ege
1489  if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) {
1490  addListItem(dataElement->getParentEdges().back(), nullptr, "to ");
1491  } else {
1492  addListItem(dataElement->getParentEdges().back());
1493  }
1494  }
1495  // check if there is parent lanes
1496  if (dataElement->getParentLanes().size() > 0) {
1497  // check if we have more than one parent lane
1498  if (dataElement->getParentLanes().size() > 1) {
1499  // insert first item
1500  addListItem(dataElement->getParentLanes().front());
1501  // insert "spacer"
1502  if (dataElement->getParentLanes().size() > 2) {
1503  addListItem(nullptr, ("..." + toString((int)dataElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false);
1504  }
1505  }
1506  // return last inserted item
1507  root = addListItem(dataElement->getParentLanes().back());
1508  }
1509  // return last inserted list item
1510  return root;
1511  }
1512  }
1513  }
1514  // there aren't parents
1515  return nullptr;
1516 }
1517 
1518 
1519 void
1521  if (HE->getTagProperty().isNetworkElement()) {
1522  // Switch gl type of ac
1523  switch (HE->getTagProperty().getTag()) {
1524  case SUMO_TAG_JUNCTION: {
1525  // retrieve junction
1526  GNEJunction* junction = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveJunction(HE->getID(), false);
1527  if (junction) {
1528  // insert junction item
1529  FXTreeItem* junctionItem = addListItem(HE, itemParent);
1530  // insert edges
1531  for (const auto& edge : junction->getChildEdges()) {
1532  showHierarchicalElementChildren(edge, junctionItem);
1533  }
1534  // insert crossings
1535  for (const auto& crossing : junction->getGNECrossings()) {
1536  showHierarchicalElementChildren(crossing, junctionItem);
1537  }
1538  }
1539  break;
1540  }
1541  case SUMO_TAG_EDGE: {
1542  // retrieve edge
1543  GNEEdge* edge = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveEdge(HE->getID(), false);
1544  if (edge) {
1545  // insert edge item
1546  FXTreeItem* edgeItem = addListItem(HE, itemParent);
1547  // insert lanes
1548  for (const auto& lane : edge->getLanes()) {
1549  showHierarchicalElementChildren(lane, edgeItem);
1550  }
1551  // insert child additional
1552  for (const auto& additional : edge->getChildAdditionals()) {
1553  showHierarchicalElementChildren(additional, edgeItem);
1554  }
1555  // insert child demand elements
1556  for (const auto& demandElement : edge->getChildDemandElements()) {
1557  showHierarchicalElementChildren(demandElement, edgeItem);
1558  }
1559  /*
1560  CHECK THIS
1561 
1562  // insert demand elements children (note: use getChildDemandElementsSortedByType to avoid duplicated elements)
1563  for (const auto& route : edge->getChildDemandElementsByType(SUMO_TAG_ROUTE)) {
1564  showHierarchicalElementChildren(route, edgeItem);
1565  }
1566  for (const auto& trip : edge->getChildDemandElementsByType(SUMO_TAG_TRIP)) {
1567  showHierarchicalElementChildren(trip, edgeItem);
1568  }
1569  for (const auto& flow : edge->getChildDemandElementsByType(SUMO_TAG_FLOW)) {
1570  showHierarchicalElementChildren(flow, edgeItem);
1571  }
1572  */
1573  // show data elements
1574  for (const auto& genericDatas : edge->getChildGenericDatas()) {
1575  showHierarchicalElementChildren(genericDatas, edgeItem);
1576  }
1577  }
1578  break;
1579  }
1580  case SUMO_TAG_LANE: {
1581  // retrieve lane
1582  GNELane* lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(HE->getID(), false);
1583  if (lane) {
1584  // insert lane item
1585  FXTreeItem* laneItem = addListItem(HE, itemParent);
1586  // insert child additional
1587  for (const auto& additional : lane->getChildAdditionals()) {
1588  showHierarchicalElementChildren(additional, laneItem);
1589  }
1590  // insert demand elements children
1591  for (const auto& demandElement : lane->getChildDemandElements()) {
1592  showHierarchicalElementChildren(demandElement, laneItem);
1593  }
1594  // insert incoming connections of lanes (by default isn't expanded)
1595  if (lane->getGNEIncomingConnections().size() > 0) {
1596  std::vector<GNEConnection*> incomingLaneConnections = lane->getGNEIncomingConnections();
1597  // insert intermediate list item
1598  FXTreeItem* incomingConnections = addListItem(laneItem, "Incomings", incomingLaneConnections.front()->getIcon(), false);
1599  // insert incoming connections
1600  for (const auto& connection : incomingLaneConnections) {
1601  showHierarchicalElementChildren(connection, incomingConnections);
1602  }
1603  }
1604  // insert outcoming connections of lanes (by default isn't expanded)
1605  if (lane->getGNEOutcomingConnections().size() > 0) {
1606  std::vector<GNEConnection*> outcomingLaneConnections = lane->getGNEOutcomingConnections();
1607  // insert intermediate list item
1608  FXTreeItem* outgoingConnections = addListItem(laneItem, "Outgoing", outcomingLaneConnections.front()->getIcon(), false);
1609  // insert outcoming connections
1610  for (const auto& connection : outcomingLaneConnections) {
1611  showHierarchicalElementChildren(connection, outgoingConnections);
1612  }
1613  }
1614  }
1615  break;
1616  }
1617  case SUMO_TAG_CROSSING:
1618  case SUMO_TAG_CONNECTION: {
1619  // insert connection item
1620  addListItem(HE, itemParent);
1621  break;
1622  }
1623  default:
1624  break;
1625  }
1626  } else if (HE->getTagProperty().isAdditionalElement() || HE->getTagProperty().isDemandElement()) {
1627  // insert additional item
1628  FXTreeItem* treeItem = addListItem(HE, itemParent);
1629  // insert child edges
1630  for (const auto& edge : HE->getChildEdges()) {
1631  showHierarchicalElementChildren(edge, treeItem);
1632  }
1633  // insert child lanes
1634  for (const auto& lane : HE->getChildLanes()) {
1635  showHierarchicalElementChildren(lane, treeItem);
1636  }
1637  // insert additional symbols
1638  std::vector<GNEAdditional*> symbols;
1639  for (const auto& additional : HE->getChildAdditionals()) {
1640  if (additional->getTagProperty().isSymbol()) {
1641  symbols.push_back(additional);
1642  }
1643  }
1644  if (symbols.size() > 0) {
1645  // insert intermediate list item
1646  const auto additionalParent = symbols.front()->getParentAdditionals().front();
1647  const std::string symbolType = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? "Edges" : "Lanes";
1648  GUIIcon symbolIcon = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? GUIIcon::EDGE : GUIIcon::LANE;
1649  FXTreeItem* symbolListItem = addListItem(treeItem, symbolType, GUIIconSubSys::getIcon(symbolIcon), false);
1650  // insert symbols
1651  for (const auto& symbol : symbols) {
1652  showHierarchicalElementChildren(symbol, symbolListItem);
1653  }
1654  }
1655  // insert additional children
1656  for (const auto& additional : HE->getChildAdditionals()) {
1657  if (!additional->getTagProperty().isSymbol()) {
1658  showHierarchicalElementChildren(additional, treeItem);
1659  }
1660  }
1661  // insert child demand elements
1662  for (const auto& demandElement : HE->getChildDemandElements()) {
1663  showHierarchicalElementChildren(demandElement, treeItem);
1664  }
1665  } else if (HE->getTagProperty().isDataElement()) {
1666  // insert data item
1667  FXTreeItem* dataElementItem = addListItem(HE, itemParent);
1668  // insert intervals
1669  if (HE->getTagProperty().getTag() == SUMO_TAG_DATASET) {
1670  GNEDataSet* dataSet = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDataSet(HE->getID());
1671  // iterate over intevals
1672  for (const auto& interval : dataSet->getDataIntervalChildren()) {
1673  showHierarchicalElementChildren(interval.second, dataElementItem);
1674  }
1675  } else if (HE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
1676  GNEDataInterval* dataInterval = dynamic_cast<GNEDataInterval*>(HE);
1677  // iterate over generic datas
1678  for (const auto& genericData : dataInterval->getGenericDataChildren()) {
1679  showHierarchicalElementChildren(genericData, dataElementItem);
1680  }
1681  }
1682  }
1683 }
1684 
1685 
1686 FXTreeItem*
1687 GNEFrameModules::HierarchicalElementTree::addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent, std::string prefix, std::string sufix) {
1688  // insert item in Tree list
1689  FXTreeItem* item = myTreeListDinamic->insertItem(nullptr, itemParent, (prefix + AC->getHierarchyName() + sufix).c_str(), AC->getIcon(), AC->getIcon());
1690  // insert item in map
1691  myTreeItemToACMap[item] = AC;
1692  // by default item is expanded
1693  item->setExpanded(true);
1694  // return created FXTreeItem
1695  return item;
1696 }
1697 
1698 
1699 FXTreeItem*
1700 GNEFrameModules::HierarchicalElementTree::addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded) {
1701  // insert item in Tree list
1702  FXTreeItem* item = myTreeListDinamic->insertItem(nullptr, itemParent, text.c_str(), icon, icon);
1703  // expand item depending of flag expanded
1704  item->setExpanded(expanded);
1705  // return created FXTreeItem
1706  return item;
1707 }
1708 
1709 // ---------------------------------------------------------------------------
1710 // GNEFrameModules::DrawingShape - methods
1711 // ---------------------------------------------------------------------------
1712 
1714  FXGroupBoxModule(frameParent->getContentFrame(), "Drawing"),
1715  myFrameParent(frameParent),
1716  myDeleteLastCreatedPoint(false) {
1717  // create start and stop buttons
1718  myStartDrawingButton = new FXButton(getCollapsableFrame(), "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton);
1719  myStopDrawingButton = new FXButton(getCollapsableFrame(), "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton);
1720  myAbortDrawingButton = new FXButton(getCollapsableFrame(), "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton);
1721  // create information label
1722  std::ostringstream information;
1723  information
1724  << "- 'Start drawing' or ENTER\n"
1725  << " to create shape.\n"
1726  << "- 'Stop drawing' or ENTER to\n"
1727  << " finish shape creation.\n"
1728  << "- 'Abort drawing' or ESC to\n"
1729  << " abort shape creation.\n"
1730  << "- 'Shift + Click' to remove\n"
1731  << " last inserted point.";
1732  myInformationLabel = new FXLabel(getCollapsableFrame(), information.str().c_str(), 0, GUIDesignLabelFrameInformation);
1733  // disable stop and abort functions as init
1734  myStopDrawingButton->disable();
1735  myAbortDrawingButton->disable();
1736 }
1737 
1738 
1740 
1741 
1743  // abort current drawing before show
1744  abortDrawing();
1745  // show FXGroupBoxModule
1746  FXGroupBoxModule::show();
1747 }
1748 
1749 
1751  // abort current drawing before hide
1752  abortDrawing();
1753  // show FXGroupBoxModule
1754  FXGroupBoxModule::hide();
1755 }
1756 
1757 
1758 void
1760  // Only start drawing if DrawingShape modul is shown
1761  if (shown()) {
1762  // change buttons
1763  myStartDrawingButton->disable();
1764  myStopDrawingButton->enable();
1765  myAbortDrawingButton->enable();
1766  }
1767 }
1768 
1769 
1770 void
1772  // try to build shape
1773  if (myFrameParent->shapeDrawed()) {
1774  // clear created points
1775  myTemporalShape.clear();
1776  // change buttons
1777  myStartDrawingButton->enable();
1778  myStopDrawingButton->disable();
1779  myAbortDrawingButton->disable();
1780  } else {
1781  // abort drawing if shape cannot be created
1782  abortDrawing();
1783  }
1784 }
1785 
1786 
1787 void
1789  // clear created points
1790  myTemporalShape.clear();
1791  // change buttons
1792  myStartDrawingButton->enable();
1793  myStopDrawingButton->disable();
1794  myAbortDrawingButton->disable();
1795 }
1796 
1797 
1798 void
1800  if (myStopDrawingButton->isEnabled()) {
1801  myTemporalShape.push_back(P);
1802  } else {
1803  throw ProcessError("A new point cannot be added if drawing wasn't started");
1804  }
1805 }
1806 
1807 
1808 void
1810  if (myTemporalShape.size() > 1) {
1811  myTemporalShape.pop_back();
1812  }
1813 }
1814 
1815 
1816 const PositionVector&
1818  return myTemporalShape;
1819 }
1820 
1821 
1822 bool
1824  return myStopDrawingButton->isEnabled();
1825 }
1826 
1827 
1828 void
1830  myDeleteLastCreatedPoint = value;
1831 }
1832 
1833 
1834 bool
1836  return myDeleteLastCreatedPoint;
1837 }
1838 
1839 
1840 long
1842  startDrawing();
1843  return 0;
1844 }
1845 
1846 
1847 long
1849  stopDrawing();
1850  return 0;
1851 }
1852 
1853 
1854 long
1856  abortDrawing();
1857  return 0;
1858 }
1859 
1860 // ---------------------------------------------------------------------------
1861 // GNEFrameModules::SelectorParent - methods
1862 // ---------------------------------------------------------------------------
1863 
1865  FXGroupBoxModule(frameParent->getContentFrame(), "Parent selector"),
1866  myFrameParent(frameParent) {
1867  // Create label with the type of SelectorParent
1868  myParentsLabel = new FXLabel(getCollapsableFrame(), "No element selected", nullptr, GUIDesignLabelLeftThick);
1869  // Create list
1871  // Hide List
1873 }
1874 
1875 
1877 
1878 
1879 std::string
1881  for (int i = 0; i < myParentsList->getNumItems(); i++) {
1882  if (myParentsList->isItemSelected(i)) {
1883  return myParentsList->getItem(i)->getText().text();
1884  }
1885  }
1886  return "";
1887 }
1888 
1889 
1890 void
1892  // first unselect all
1893  for (int i = 0; i < myParentsList->getNumItems(); i++) {
1894  myParentsList->getItem(i)->setSelected(false);
1895  }
1896  // select element if correspond to given ID
1897  for (int i = 0; i < myParentsList->getNumItems(); i++) {
1898  if (myParentsList->getItem(i)->getText().text() == id) {
1899  myParentsList->getItem(i)->setSelected(true);
1900  }
1901  }
1902  // recalc myFirstParentsList
1903  myParentsList->recalc();
1904 }
1905 
1906 
1907 void
1908 GNEFrameModules::SelectorParent::showSelectorParentModule(const std::vector<SumoXMLTag>& parentTags) {
1909  if (parentTags.size() > 0) {
1910  myParentTags = parentTags;
1911  myParentsLabel->setText(("Parent type: " + toString(parentTags.front())).c_str());
1912  refreshSelectorParentModule();
1913  show();
1914  } else {
1915  myParentTags.clear();
1916  hide();
1917  }
1918 }
1919 
1920 
1921 void
1923  myParentTags.clear();
1924  hide();
1925 }
1926 
1927 
1928 void
1930  // save current edited elements
1931  std::set<std::string> selectedItems;
1932  for (int i = 0; i < myParentsList->getNumItems(); i++) {
1933  if (myParentsList->isItemSelected(i)) {
1934  selectedItems.insert(myParentsList->getItem(i)->getText().text());
1935  }
1936  }
1937  myParentsList->clearItems();
1938  if (myParentTags.size() > 0) {
1939  // insert additionals sorted
1940  std::set<std::string> IDs;
1941  // fill list with IDs
1942  for (const auto& parentTag : myParentTags) {
1943  // check type
1944  const auto tagProperty = GNEAttributeCarrier::getTagProperty(parentTag);
1945  // additionals
1946  if (tagProperty.isAdditionalElement()) {
1947  for (const auto& additional : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getAdditionals().at(parentTag)) {
1948  IDs.insert(additional->getID().c_str());
1949  }
1950  }
1951  }
1952  // fill list with IDs
1953  for (const auto& ID : IDs) {
1954  const int item = myParentsList->appendItem(ID.c_str());
1955  if (selectedItems.find(ID) != selectedItems.end()) {
1956  myParentsList->selectItem(item);
1957  }
1958  }
1959  }
1960 }
1961 
1962 // ---------------------------------------------------------------------------
1963 // GNEFrameModules::OverlappedInspection - methods
1964 // ---------------------------------------------------------------------------
1965 
1967  FXGroupBoxModule(frameParent->getContentFrame(), "Overlapped elements"),
1968  myFrameParent(frameParent),
1969  myFilteredTag(SUMO_TAG_NOTHING),
1970  myItemIndex(0) {
1971  // build elements
1972  buildFXElements();
1973 }
1974 
1975 
1977  FXGroupBoxModule(frameParent->getContentFrame(), ("Overlapped " + toString(filteredTag) + "s").c_str()),
1978  myFrameParent(frameParent),
1979  myFilteredTag(filteredTag),
1980  myItemIndex(0) {
1981  // build elements
1982  buildFXElements();
1983 }
1984 
1985 
1987 
1988 
1989 void
1991  // first clear myOverlappedACs
1992  myOverlappedACs.clear();
1993  // reserve
1994  myOverlappedACs.reserve(objectsUnderCursor.getClickedAttributeCarriers().size());
1995  // iterate over objects under cursor
1996  for (const auto& AC : objectsUnderCursor.getClickedAttributeCarriers()) {
1997  bool insert = true;
1998  // check supermode demand
1999  if (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand() &&
2000  !AC->getTagProperty().isDemandElement()) {
2001  insert = false;
2002  }
2003  // check supermode data
2004  if (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData() &&
2005  !AC->getTagProperty().isGenericData()) {
2006  insert = false;
2007  }
2008  // check filter
2009  if ((myFilteredTag != SUMO_TAG_NOTHING) && (AC->getTagProperty().getTag() != myFilteredTag)) {
2010  insert = false;
2011  }
2012  if (insert) {
2013  myOverlappedACs.push_back(AC);
2014  }
2015  }
2016  // continue depending of number of myOverlappedACs
2017  if (myOverlappedACs.size() > 1) {
2018  mySavedClickedPosition = clickedPosition;
2019  // by default we inspect first element
2020  myItemIndex = 0;
2021  // update text of current index button
2022  myCurrentIndexButton->setText(("1 / " + toString(myOverlappedACs.size())).c_str());
2023  // clear and fill list again
2024  myOverlappedElementList->clearItems();
2025  for (int i = 0; i < (int)myOverlappedACs.size(); i++) {
2026  myOverlappedElementList->insertItem(i, myOverlappedACs.at(i)->getID().c_str(), myOverlappedACs.at(i)->getIcon());
2027  }
2028  // set first element as selected element
2029  myOverlappedElementList->getItem(0)->setSelected(TRUE);
2030  // by default list hidden
2031  myOverlappedElementList->hide();
2032  // show OverlappedInspection modul
2033  show();
2034  } else {
2035  // hide OverlappedInspection modul
2036  hide();
2037  }
2038 }
2039 
2040 
2041 void
2043  // hide OverlappedInspection modul
2044  hide();
2045 }
2046 
2047 
2048 bool
2050  // show OverlappedInspection modul
2051  return shown();
2052 }
2053 
2054 
2055 int
2057  return (int)myOverlappedACs.size();
2058 }
2059 
2060 
2061 bool
2063  return (mySavedClickedPosition.distanceSquaredTo2D(clickedPosition) < 0.25);
2064 }
2065 
2066 
2067 bool
2069  // first check if OverlappedInspection is shown
2070  if (shown()) {
2071  // check if given position is near saved position
2072  if (checkSavedPosition(clickedPosition)) {
2073  // inspect next element
2074  onCmdNextElement(0, 0, 0);
2075  return true;
2076  } else {
2077  return false;
2078  }
2079  } else {
2080  return false;
2081  }
2082 }
2083 
2084 
2085 bool
2087  // first check if OverlappedInspection is shown
2088  if (shown()) {
2089  // check if given position is near saved position
2090  if (checkSavedPosition(clickedPosition)) {
2091  // inspect previousElement
2092  onCmdPreviousElement(0, 0, 0);
2093  return true;
2094  } else {
2095  return false;
2096  }
2097  } else {
2098  return false;
2099  }
2100 }
2101 
2102 
2103 long
2105  // check if there is items
2106  if (myOverlappedElementList->getNumItems() > 0) {
2107  // unselect current list element
2108  myOverlappedElementList->getItem((int)myItemIndex)->setSelected(FALSE);
2109  // set index (it works as a ring)
2110  if (myItemIndex > 0) {
2111  myItemIndex--;
2112  } else {
2113  myItemIndex = (myOverlappedACs.size() - 1);
2114  }
2115  // selected current list element
2116  myOverlappedElementList->getItem((int)myItemIndex)->setSelected(TRUE);
2117  myOverlappedElementList->update();
2118  // update current index button
2119  myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str());
2120  // inspect overlapped attribute carrier
2121  myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex));
2122  // show OverlappedInspection again (because it's hidden in inspectSingleElement)
2123  show();
2124  }
2125  return 1;
2126 }
2127 
2128 
2129 long
2131  // check if there is items
2132  if (myOverlappedElementList->getNumItems() > 0) {
2133  // unselect current list element
2134  myOverlappedElementList->getItem((int)myItemIndex)->setSelected(FALSE);
2135  // set index (it works as a ring)
2136  myItemIndex = (myItemIndex + 1) % myOverlappedACs.size();
2137  // selected current list element
2138  myOverlappedElementList->getItem((int)myItemIndex)->setSelected(TRUE);
2139  myOverlappedElementList->update();
2140  // update current index button
2141  myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str());
2142  // inspect overlapped attribute carrier
2143  myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex));
2144  // show OverlappedInspection again (because it's hidden in inspectSingleElement)
2145  show();
2146  }
2147  return 1;
2148 }
2149 
2150 
2151 long
2153  // show or hidde element list
2154  if (myOverlappedElementList->shown()) {
2155  myOverlappedElementList->hide();
2156  } else {
2157  myOverlappedElementList->show();
2158  }
2159  if (myOverlappedElementList->getNumItems() <= 10) {
2160  myOverlappedElementList->setHeight(23 * myOverlappedElementList->getNumItems());
2161  } else {
2162  myOverlappedElementList->setHeight(230);
2163  }
2164  myOverlappedElementList->recalc();
2165  // recalc and update frame
2166  recalc();
2167  return 1;
2168 }
2169 
2170 long
2172  for (int i = 0; i < myOverlappedElementList->getNumItems(); i++) {
2173  if (myOverlappedElementList->getItem(i)->isSelected()) {
2174  myItemIndex = i;
2175  // update current index button
2176  myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str());
2177  // inspect overlapped attribute carrier
2178  myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex));
2179  // show OverlappedInspection again (because it's hidden in inspectSingleElement)
2180  show();
2181  return 1;
2182  }
2183  }
2184  return 0;
2185 }
2186 
2187 
2188 long
2190  FXDialogBox* helpDialog = new FXDialogBox(getCollapsableFrame(), "GEO attributes Help", GUIDesignDialogBox);
2191  std::ostringstream help;
2192  help
2193  << " - Click in the same position\n"
2194  << " for inspect next element\n"
2195  << " - Shift + Click in the same\n"
2196  << " position for inspect\n"
2197  << " previous element";
2198  new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
2199  // "OK"
2200  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
2201  helpDialog->create();
2202  helpDialog->show();
2203  return 1;
2204 }
2205 
2206 
2208  myFrameParent(nullptr),
2209  myPreviousElement(nullptr),
2210  myCurrentIndexButton(nullptr),
2211  myNextElement(nullptr),
2212  myOverlappedElementList(nullptr),
2213  myHelpButton(nullptr),
2214  myFilteredTag(SUMO_TAG_NOTHING),
2215  myItemIndex(0) {
2216 }
2217 
2218 
2219 void
2221  FXHorizontalFrame* frameButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
2222  // Create previous Item Button
2223  myPreviousElement = new FXButton(frameButtons, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWLEFT), this, MID_GNE_OVERLAPPED_PREVIOUS, GUIDesignButtonIconRectangular);
2224  // create current index button
2225  myCurrentIndexButton = new FXButton(frameButtons, "", nullptr, this, MID_GNE_OVERLAPPED_SHOWLIST, GUIDesignButton);
2226  // Create next Item Button
2227  myNextElement = new FXButton(frameButtons, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWRIGHT), this, MID_GNE_OVERLAPPED_NEXT, GUIDesignButtonIconRectangular);
2228  // Create list of overlapped elements (by default hidden)
2229  myOverlappedElementList = new FXList(getCollapsableFrame(), this, MID_GNE_OVERLAPPED_ITEMSELECTED, GUIDesignListFixedHeight);
2230  // by default list of overlapped elements is hidden)
2231  myOverlappedElementList->hide();
2232  // Create help button
2233  myHelpButton = new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
2234 }
2235 
2236 // ---------------------------------------------------------------------------
2237 // GNEFrameModules::PathCreator - methods
2238 // ---------------------------------------------------------------------------
2239 
2241  mySubPath({edge}),
2242  myFromBusStop(nullptr),
2243  myToBusStop(nullptr),
2244  myConflictVClass(false),
2245 myConflictDisconnected(false) {
2246  // check if we have to change vClass flag
2247  if (edge->getNBEdge()->getNumLanesThatAllow(vClass) == 0) {
2248  myConflictVClass = true;
2249  }
2250 }
2251 
2252 
2254  myFromBusStop(nullptr),
2255  myToBusStop(nullptr),
2256  myConflictVClass(false),
2257  myConflictDisconnected(false) {
2258  // calculate subpath
2259  mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(vClass, {edgeFrom, edgeTo});
2260  // if subPath is empty, try it with pedestrian (i.e. ignoring vCass)
2261  if (mySubPath.empty()) {
2262  mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, {edgeFrom, edgeTo});
2263  if (mySubPath.empty()) {
2264  mySubPath = { edgeFrom, edgeTo };
2265  myConflictDisconnected = true;
2266  } else {
2267  myConflictVClass = true;
2268  }
2269  }
2270 }
2271 
2272 
2273 const std::vector<GNEEdge*>&
2275  return mySubPath;
2276 }
2277 
2278 
2280  return myFromBusStop;
2281 }
2282 
2283 
2285  return myToBusStop;
2286 }
2287 
2288 
2289 bool
2291  return myConflictVClass;
2292 }
2293 
2294 
2295 bool
2297  return myConflictDisconnected;
2298 }
2299 
2300 
2302  myFromBusStop(nullptr),
2303  myToBusStop(nullptr),
2304  myConflictVClass(false),
2305  myConflictDisconnected(false) {
2306 }
2307 
2308 
2310  FXGroupBoxModule(frameParent->getContentFrame(), "Route creator"),
2311  myFrameParent(frameParent),
2313  myCreationMode(0),
2314  myToStoppingPlace(nullptr),
2315  myRoute(nullptr) {
2316  // create label for route info
2317  myInfoRouteLabel = new FXLabel(getCollapsableFrame(), "No edges selected", 0, GUIDesignLabelFrameThicked);
2318  // create button for finish route creation
2319  myFinishCreationButton = new FXButton(getCollapsableFrame(), "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton);
2320  myFinishCreationButton->disable();
2321  // create button for abort route creation
2322  myAbortCreationButton = new FXButton(getCollapsableFrame(), "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton);
2323  myAbortCreationButton->disable();
2324  // create button for remove last inserted edge
2325  myRemoveLastInsertedElement = new FXButton(getCollapsableFrame(), "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton);
2326  myRemoveLastInsertedElement->disable();
2327  // create check button
2328  myShowCandidateEdges = new FXCheckButton(getCollapsableFrame(), "Show candidate edges", this, MID_GNE_EDGEPATH_SHOWCANDIDATES, GUIDesignCheckButton);
2329  myShowCandidateEdges->setCheck(TRUE);
2330  // create shift label
2331  myShiftLabel = new FXLabel(this,
2332  "SHIFT-click: ignore vClass",
2334  // create control label
2335  myControlLabel = new FXLabel(this,
2336  "CTRL-click: add disconnected",
2338  // create backspace label (always shown)
2339  new FXLabel(this,
2340  "BACKSPACE: undo click",
2342 }
2343 
2344 
2346 
2347 
2348 void
2349 GNEFrameModules::PathCreator::showPathCreatorModule(SumoXMLTag element, const bool firstElement, const bool consecutives) {
2350  // declare flag
2351  bool showPathCreator = true;
2352  // first abort creation
2353  abortPathCreation();
2354  // disable buttons
2355  myFinishCreationButton->disable();
2356  myAbortCreationButton->disable();
2357  myRemoveLastInsertedElement->disable();
2358  // reset creation mode
2359  myCreationMode = 0;
2360  // set first element
2361  if (firstElement) {
2362  myCreationMode |= REQUIRE_FIRSTELEMENT;
2363  }
2364  // set consecutive or non consecuives
2365  if (consecutives) {
2366  myCreationMode |= CONSECUTIVE_EDGES;
2367  } else {
2368  myCreationMode |= NONCONSECUTIVE_EDGES;
2369  }
2370  // set specific mode depending of tag
2371  switch (element) {
2372  // routes
2373  case SUMO_TAG_ROUTE:
2375  myCreationMode |= SHOW_CANDIDATE_EDGES;
2376  myCreationMode |= START_EDGE;
2377  myCreationMode |= END_EDGE;
2378  break;
2379  // vehicles
2380  case SUMO_TAG_VEHICLE:
2381  case GNE_TAG_FLOW_ROUTE:
2382  case GNE_TAG_WALK_ROUTE:
2383  myCreationMode |= SINGLE_ELEMENT;
2384  myCreationMode |= ROUTE;
2385  break;
2386  case SUMO_TAG_TRIP:
2387  case SUMO_TAG_FLOW:
2390  myCreationMode |= SHOW_CANDIDATE_EDGES;
2391  myCreationMode |= START_EDGE;
2392  myCreationMode |= END_EDGE;
2393  break;
2396  myCreationMode |= SHOW_CANDIDATE_JUNCTIONS;
2397  myCreationMode |= START_JUNCTION;
2398  myCreationMode |= END_JUNCTION;
2399  myCreationMode |= ONLY_FROMTO;
2400  break;
2401  // walk edges
2402  case GNE_TAG_WALK_EDGES:
2403  myCreationMode |= SHOW_CANDIDATE_EDGES;
2404  myCreationMode |= START_EDGE;
2405  myCreationMode |= END_EDGE;
2406  break;
2407  // edge->edge
2409  case GNE_TAG_RIDE_EDGE:
2410  case GNE_TAG_WALK_EDGE:
2411  myCreationMode |= SHOW_CANDIDATE_EDGES;
2412  myCreationMode |= ONLY_FROMTO;
2413  myCreationMode |= START_EDGE;
2414  myCreationMode |= END_EDGE;
2415  break;
2416  // edge->busStop
2418  case GNE_TAG_RIDE_BUSSTOP:
2419  case GNE_TAG_WALK_BUSSTOP:
2420  myCreationMode |= SHOW_CANDIDATE_EDGES;
2421  myCreationMode |= ONLY_FROMTO;
2422  myCreationMode |= END_BUSSTOP;
2423  break;
2424  // junction->junction
2427  myCreationMode |= SHOW_CANDIDATE_JUNCTIONS;
2428  myCreationMode |= START_JUNCTION;
2429  myCreationMode |= END_JUNCTION;
2430  myCreationMode |= ONLY_FROMTO;
2431  break;
2432  // stops
2434  myCreationMode |= SINGLE_ELEMENT;
2435  myCreationMode |= END_BUSSTOP;
2436  break;
2438  myCreationMode |= SINGLE_ELEMENT;
2439  myCreationMode |= START_EDGE;
2440  break;
2441  // generic datas
2442  case SUMO_TAG_EDGEREL:
2443  myCreationMode |= ONLY_FROMTO;
2444  myCreationMode |= START_EDGE;
2445  myCreationMode |= END_EDGE;
2446  break;
2447  default:
2448  showPathCreator = false;
2449  break;
2450  }
2451  // update colors
2452  updateEdgeColors();
2453  updateJunctionColors();
2454  // check if show path creator
2455  if (showPathCreator) {
2456  // recalc before show (to avoid graphic problems)
2457  recalc();
2458  // show modul
2459  show();
2460  } else {
2461  // hide modul
2462  hide();
2463  }
2464 }
2465 
2466 
2467 void
2469  // clear path
2470  clearPath();
2471  // hide modul
2472  hide();
2473 }
2474 
2475 
2478  return myVClass;
2479 }
2480 
2481 
2482 void
2484  myVClass = vClass;
2485  // update edge colors
2486  updateEdgeColors();
2487 }
2488 
2489 
2490 bool
2491 GNEFrameModules::PathCreator::addJunction(GNEJunction* junction, const bool /* shiftKeyPressed */, const bool /* controlKeyPressed */) {
2492  // check if junctions are allowed
2493  if (((myCreationMode & START_JUNCTION) + (myCreationMode & END_JUNCTION)) == 0) {
2494  return false;
2495  }
2496  // check if only an junction is allowed
2497  if ((myCreationMode & SINGLE_ELEMENT) && (mySelectedJunctions.size() == 1)) {
2498  return false;
2499  }
2500  // continue depending of number of selected edge
2501  if (mySelectedJunctions.size() > 0) {
2502  // check double junctions
2503  if (mySelectedJunctions.back() == junction) {
2504  // Write warning
2505  WRITE_WARNING("Double junctions aren't allowed");
2506  // abort add junction
2507  return false;
2508  }
2509  }
2510  // check number of junctions
2511  if (mySelectedJunctions.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) {
2512  // Write warning
2513  WRITE_WARNING("Only two junctions are allowed");
2514  // abort add junction
2515  return false;
2516  }
2517  // All checks ok, then add it in selected elements
2518  mySelectedJunctions.push_back(junction);
2519  // enable abort route button
2520  myAbortCreationButton->enable();
2521  // enable finish button
2522  myFinishCreationButton->enable();
2523  // disable undo/redo
2524  myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation");
2525  // enable or disable remove last junction button
2526  if (mySelectedJunctions.size() > 1) {
2527  myRemoveLastInsertedElement->enable();
2528  } else {
2529  myRemoveLastInsertedElement->disable();
2530  }
2531  // recalculate path
2532  recalculatePath();
2533  // update info route label
2534  updateInfoRouteLabel();
2535  // update junction colors
2536  updateJunctionColors();
2537  return true;
2538 }
2539 
2540 
2541 bool
2542 GNEFrameModules::PathCreator::addEdge(GNEEdge* edge, const bool shiftKeyPressed, const bool controlKeyPressed) {
2543  // check if edges are allowed
2544  if (((myCreationMode & CONSECUTIVE_EDGES) + (myCreationMode & NONCONSECUTIVE_EDGES) +
2545  (myCreationMode & START_EDGE) + (myCreationMode & END_EDGE)) == 0) {
2546  return false;
2547  }
2548  // check if only an edge is allowed
2549  if ((myCreationMode & SINGLE_ELEMENT) && (mySelectedEdges.size() == 1)) {
2550  return false;
2551  }
2552  // continue depending of number of selected eges
2553  if (mySelectedEdges.size() > 0) {
2554  // check double edges
2555  if (mySelectedEdges.back() == edge) {
2556  // Write warning
2557  WRITE_WARNING("Double edges aren't allowed");
2558  // abort add edge
2559  return false;
2560  }
2561  // check consecutive edges
2562  if (myCreationMode & Mode::CONSECUTIVE_EDGES) {
2563  // check that new edge is consecutive
2564  const auto& outgoingEdges = mySelectedEdges.back()->getToJunction()->getGNEOutgoingEdges();
2565  if (std::find(outgoingEdges.begin(), outgoingEdges.end(), edge) == outgoingEdges.end()) {
2566  // Write warning
2567  WRITE_WARNING("Only consecutives edges are allowed");
2568  // abort add edge
2569  return false;
2570  }
2571  }
2572  }
2573  // check number of edges
2574  if (mySelectedEdges.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) {
2575  // Write warning
2576  WRITE_WARNING("Only two edges are allowed");
2577  // abort add edge
2578  return false;
2579  }
2580  // check candidate edge
2581  if ((myShowCandidateEdges->getCheck() == TRUE) && !edge->isPossibleCandidate()) {
2582  if (edge->isSpecialCandidate()) {
2583  if (!shiftKeyPressed) {
2584  // Write warning
2585  WRITE_WARNING("Invalid edge (SHIFT + click to add an invalid vClass edge)");
2586  // abort add edge
2587  return false;
2588  }
2589  } else if (edge->isConflictedCandidate()) {
2590  if (!controlKeyPressed) {
2591  // Write warning
2592  WRITE_WARNING("Invalid edge (CONTROL + click to add a disconnected edge)");
2593  // abort add edge
2594  return false;
2595  }
2596  }
2597  }
2598  // All checks ok, then add it in selected elements
2599  mySelectedEdges.push_back(edge);
2600  // enable abort route button
2601  myAbortCreationButton->enable();
2602  // enable finish button
2603  myFinishCreationButton->enable();
2604  // disable undo/redo
2605  myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation");
2606  // enable or disable remove last edge button
2607  if (mySelectedEdges.size() > 1) {
2608  myRemoveLastInsertedElement->enable();
2609  } else {
2610  myRemoveLastInsertedElement->disable();
2611  }
2612  // recalculate path
2613  recalculatePath();
2614  // update info route label
2615  updateInfoRouteLabel();
2616  // update edge colors
2617  updateEdgeColors();
2618  return true;
2619 }
2620 
2621 
2622 const std::vector<GNEEdge*>&
2624  return mySelectedEdges;
2625 }
2626 
2627 
2628 const std::vector<GNEJunction*>&
2630  return mySelectedJunctions;
2631 }
2632 
2633 
2634 bool
2635 GNEFrameModules::PathCreator::addStoppingPlace(GNEAdditional* stoppingPlace, const bool /*shiftKeyPressed*/, const bool /*controlKeyPressed*/) {
2636  // check if stoppingPlaces aren allowed
2637  if ((myCreationMode & END_BUSSTOP) == 0) {
2638  return false;
2639  }
2640  // check if previously stopping place from was set
2641  if (myToStoppingPlace) {
2642  return false;
2643  } else {
2644  myToStoppingPlace = stoppingPlace;
2645  }
2646  // enable abort route button
2647  myAbortCreationButton->enable();
2648  // enable finish button
2649  myFinishCreationButton->enable();
2650  // disable undo/redo
2651  myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation");
2652  // enable or disable remove last stoppingPlace button
2653  if (myToStoppingPlace) {
2654  myRemoveLastInsertedElement->enable();
2655  } else {
2656  myRemoveLastInsertedElement->disable();
2657  }
2658  // recalculate path
2659  recalculatePath();
2660  // update info route label
2661  updateInfoRouteLabel();
2662  // update stoppingPlace colors
2663  updateEdgeColors();
2664  return true;
2665 }
2666 
2667 
2670  if (myToStoppingPlace && (myToStoppingPlace->getTagProperty().getTag() == expectedTag)) {
2671  return myToStoppingPlace;
2672  } else {
2673  return nullptr;
2674  }
2675 }
2676 
2677 
2678 bool
2679 GNEFrameModules::PathCreator::addRoute(GNEDemandElement* route, const bool /*shiftKeyPressed*/, const bool /*controlKeyPressed*/) {
2680  // check if routes aren allowed
2681  if ((myCreationMode & ROUTE) == 0) {
2682  return false;
2683  }
2684  // check if previously a route was added
2685  if (myRoute) {
2686  return false;
2687  }
2688  // set route
2689  myRoute = route;
2690  // recalculate path
2691  recalculatePath();
2692  updateInfoRouteLabel();
2693  updateEdgeColors();
2694  return true;
2695 }
2696 
2697 
2698 void
2700  // set route
2701  myRoute = nullptr;
2702  // recalculate path
2703  recalculatePath();
2704  updateInfoRouteLabel();
2705  updateEdgeColors();
2706 }
2707 
2708 
2711  return myRoute;
2712 }
2713 
2714 
2715 const std::vector<GNEFrameModules::PathCreator::Path>&
2717  return myPath;
2718 }
2719 
2720 
2721 bool
2723  return (myShowCandidateEdges->getCheck() == TRUE);
2724 }
2725 
2726 
2727 void
2729  // clear junction colors
2730  clearJunctionColors();
2731  // check if show possible candidates
2732  if (myCreationMode & SHOW_CANDIDATE_JUNCTIONS) {
2733  // set candidate flags
2734  for (const auto& junction : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) {
2735  junction.second->resetCandidateFlags();
2736  junction.second->setPossibleCandidate(true);
2737  }
2738  }
2739  // set selected junctions
2740  if (mySelectedJunctions.size() > 0) {
2741  // mark selected eges
2742  for (const auto& junction : mySelectedJunctions) {
2743  junction->resetCandidateFlags();
2744  junction->setSourceCandidate(true);
2745  }
2746  // finally mark last selected element as target
2747  mySelectedJunctions.back()->resetCandidateFlags();
2748  mySelectedJunctions.back()->setTargetCandidate(true);
2749  }
2750  // update view net
2751  myFrameParent->getViewNet()->updateViewNet();
2752 }
2753 
2754 
2755 void
2757  // clear edge colors
2758  clearEdgeColors();
2759  // first check if show candidate edges
2760  if (myShowCandidateEdges->getCheck() == TRUE && (myCreationMode & SHOW_CANDIDATE_EDGES)) {
2761  // mark all edges that have at least one lane that allow given vClass
2762  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
2763  if (edge.second->getNBEdge()->getNumLanesThatAllow(myVClass) > 0) {
2764  edge.second->setPossibleCandidate(true);
2765  } else {
2766  edge.second->setSpecialCandidate(true);
2767  }
2768  }
2769  }
2770  // set reachability
2771  if (mySelectedEdges.size() > 0) {
2772  // only coloring edges if checkbox "show candidate edges" is enabled
2773  if ((myShowCandidateEdges->getCheck() == TRUE) && (myCreationMode & SHOW_CANDIDATE_EDGES)) {
2774  // mark all edges as conflicted (to mark special candidates)
2775  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
2776  edge.second->resetCandidateFlags();
2777  edge.second->setConflictedCandidate(true);
2778  }
2779  // set special candidates (Edges that are connected but aren't compatibles with current vClass
2780  setSpecialCandidates(mySelectedEdges.back());
2781  // mark again all edges as conflicted (to mark possible candidates)
2782  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
2783  edge.second->setConflictedCandidate(true);
2784  }
2785  // set possible candidates (Edges that are connected AND are compatibles with current vClass
2786  setPossibleCandidates(mySelectedEdges.back(), myVClass);
2787  }
2788  // now mark selected eges
2789  for (const auto& edge : mySelectedEdges) {
2790  edge->resetCandidateFlags();
2791  edge->setSourceCandidate(true);
2792  }
2793  // finally mark last selected element as target
2794  mySelectedEdges.back()->resetCandidateFlags();
2795  mySelectedEdges.back()->setTargetCandidate(true);
2796  }
2797  // update view net
2798  myFrameParent->getViewNet()->updateViewNet();
2799 }
2800 
2801 
2802 void
2804  // reset all junction flags
2805  for (const auto& junction : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) {
2806  junction.second->resetCandidateFlags();
2807  }
2808 }
2809 
2810 
2811 void
2813  // reset all junction flags
2814  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
2815  edge.second->resetCandidateFlags();
2816  }
2817 }
2818 
2819 
2820 void
2822  const double lineWidth = 0.35;
2823  const double lineWidthin = 0.25;
2824  // Add a draw matrix
2826  // Start with the drawing of the area traslating matrix to origin
2827  glTranslated(0, 0, GLO_MAX - 0.1);
2828  // check if draw bewteen junction or edges
2829  if (myPath.size() > 0) {
2830  // set first color
2832  // iterate over path
2833  for (int i = 0; i < (int)myPath.size(); i++) {
2834  // get path
2835  const GNEFrameModules::PathCreator::Path& path = myPath.at(i);
2836  // draw line over
2837  for (int j = 0; j < (int)path.getSubPath().size(); j++) {
2838  const GNELane* lane = path.getSubPath().at(j)->getLanes().back();
2839  if (((i == 0) && (j == 0)) || (j > 0)) {
2840  GLHelper::drawBoxLines(lane->getLaneShape(), lineWidth);
2841  }
2842  // draw connection between lanes
2843  if ((j + 1) < (int)path.getSubPath().size()) {
2844  const GNELane* nextLane = path.getSubPath().at(j + 1)->getLanes().back();
2845  if (lane->getLane2laneConnections().exist(nextLane)) {
2847  } else {
2848  GLHelper::drawBoxLines({lane->getLaneShape().back(), nextLane->getLaneShape().front()}, lineWidth);
2849  }
2850  }
2851  }
2852  }
2853  glTranslated(0, 0, 0.1);
2854  // iterate over path again
2855  for (int i = 0; i < (int)myPath.size(); i++) {
2856  // get path
2857  const GNEFrameModules::PathCreator::Path& path = myPath.at(i);
2858  // set path color color
2859  if ((myCreationMode & SHOW_CANDIDATE_EDGES) == 0) {
2861  } else if (path.isConflictDisconnected()) {
2863  } else if (path.isConflictVClass()) {
2865  } else {
2867  }
2868  // draw line over
2869  for (int j = 0; j < (int)path.getSubPath().size(); j++) {
2870  const GNELane* lane = path.getSubPath().at(j)->getLanes().back();
2871  if (((i == 0) && (j == 0)) || (j > 0)) {
2872  GLHelper::drawBoxLines(lane->getLaneShape(), lineWidthin);
2873  }
2874  // draw connection between lanes
2875  if ((j + 1) < (int)path.getSubPath().size()) {
2876  const GNELane* nextLane = path.getSubPath().at(j + 1)->getLanes().back();
2877  if (lane->getLane2laneConnections().exist(nextLane)) {
2879  } else {
2880  GLHelper::drawBoxLines({ lane->getLaneShape().back(), nextLane->getLaneShape().front() }, lineWidthin);
2881  }
2882  }
2883  }
2884  }
2885  } else if (mySelectedJunctions.size() > 0) {
2886  // set color
2888  // draw line between junctions
2889  for (int i = 0; i < (int)mySelectedJunctions.size() - 1; i++) {
2890  // get two points
2891  const Position posA = mySelectedJunctions.at(i)->getPositionInView();
2892  const Position posB = mySelectedJunctions.at(i + 1)->getPositionInView();
2893  const double rot = ((double)atan2((posB.x() - posA.x()), (posA.y() - posB.y())) * (double) 180.0 / (double)M_PI);
2894  const double len = posA.distanceTo2D(posB);
2895  // draw line
2896  GLHelper::drawBoxLine(posA, rot, len, 0.25);
2897  }
2898  }
2899  // Pop last matrix
2901 }
2902 
2903 
2904 void
2906  // call create path implemented in frame parent
2907  myFrameParent->createPath();
2908 }
2909 
2910 
2911 void
2913  // first check that there is elements
2914  if ((mySelectedJunctions.size() > 0) || (mySelectedEdges.size() > 0) || myToStoppingPlace || myRoute) {
2915  // unblock undo/redo
2916  myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->enableUndoRedo();
2917  // clear edges
2918  clearPath();
2919  // disable buttons
2920  myFinishCreationButton->disable();
2921  myAbortCreationButton->disable();
2922  myRemoveLastInsertedElement->disable();
2923  // update info route label
2924  updateInfoRouteLabel();
2925  // update junction colors
2926  updateJunctionColors();
2927  // update edge colors
2928  updateEdgeColors();
2929  // update view (to see the new route)
2930  myFrameParent->getViewNet()->updateViewNet();
2931  }
2932 }
2933 
2934 
2935 void
2937  if (mySelectedEdges.size() > 1) {
2938  // remove special color of last selected edge
2939  mySelectedEdges.back()->resetCandidateFlags();
2940  // remove last edge
2941  mySelectedEdges.pop_back();
2942  // change last edge flag
2943  if ((mySelectedEdges.size() > 0) && mySelectedEdges.back()->isSourceCandidate()) {
2944  mySelectedEdges.back()->setSourceCandidate(false);
2945  mySelectedEdges.back()->setTargetCandidate(true);
2946  }
2947  // enable or disable remove last edge button
2948  if (mySelectedEdges.size() > 1) {
2949  myRemoveLastInsertedElement->enable();
2950  } else {
2951  myRemoveLastInsertedElement->disable();
2952  }
2953  // recalculate path
2954  recalculatePath();
2955  // update info route label
2956  updateInfoRouteLabel();
2957  // update junction colors
2958  updateJunctionColors();
2959  // update edge colors
2960  updateEdgeColors();
2961  // update view
2962  myFrameParent->getViewNet()->updateViewNet();
2963  }
2964 }
2965 
2966 
2967 long
2968 GNEFrameModules::PathCreator::onCmdCreatePath(FXObject*, FXSelector, void*) {
2969  // just call create path
2970  createPath();
2971  return 1;
2972 }
2973 
2974 
2975 long
2977  // just call abort path creation
2978  abortPathCreation();
2979  return 1;
2980 }
2981 
2982 
2983 long
2985  // just call remove last element
2986  removeLastElement();
2987  return 1;
2988 }
2989 
2990 
2991 long
2993  // update labels
2994  if (myShowCandidateEdges->getCheck() == TRUE) {
2995  myShiftLabel->show();
2996  myControlLabel->show();
2997  } else {
2998  myShiftLabel->hide();
2999  myControlLabel->hide();
3000  }
3001  // recalc frame
3002  recalc();
3003  // update edge colors (view will be updated within function)
3004  updateEdgeColors();
3005  return 1;
3006 }
3007 
3008 
3009 void
3011  if (myPath.size() > 0) {
3012  // declare variables for route info
3013  double length = 0;
3014  double speed = 0;
3015  int pathSize = 0;
3016  for (const auto& path : myPath) {
3017  for (const auto& edge : path.getSubPath()) {
3018  length += edge->getNBEdge()->getLength();
3019  speed += edge->getNBEdge()->getSpeed();
3020  }
3021  pathSize += (int)path.getSubPath().size();
3022  }
3023  // declare ostringstream for label and fill it
3024  std::ostringstream information;
3025  information
3026  << "- Selected edges: " << toString(mySelectedEdges.size()) << "\n"
3027  << "- Path edges: " << toString(pathSize) << "\n"
3028  << "- Length: " << toString(length) << "\n"
3029  << "- Average speed: " << toString(speed / pathSize);
3030  // set new label
3031  myInfoRouteLabel->setText(information.str().c_str());
3032  } else {
3033  myInfoRouteLabel->setText("No edges selected");
3034  }
3035 }
3036 
3037 
3038 void
3041  clearJunctionColors();
3042  clearEdgeColors();
3043  // clear junction, edges, additionals and route
3044  mySelectedJunctions.clear();
3045  mySelectedEdges.clear();
3046  myToStoppingPlace = nullptr;
3047  myRoute = nullptr;
3048  // clear path
3049  myPath.clear();
3050  // update info route label
3051  updateInfoRouteLabel();
3052 }
3053 
3054 
3055 void
3057  // first clear path
3058  myPath.clear();
3059  // set edges
3060  std::vector<GNEEdge*> edges;
3061  // add route edges
3062  if (myRoute) {
3063  edges = myRoute->getParentEdges();
3064  } else {
3065  // add selected edges
3066  for (const auto& edge : mySelectedEdges) {
3067  edges.push_back(edge);
3068  }
3069  // add to stopping place edge
3070  if (myToStoppingPlace) {
3071  edges.push_back(myToStoppingPlace->getParentLanes().front()->getParentEdge());
3072  }
3073  }
3074  // fill paths
3075  if (edges.size() == 1) {
3076  myPath.push_back(Path(myVClass, edges.front()));
3077  } else {
3078  // add every segment
3079  for (int i = 1; i < (int)edges.size(); i++) {
3080  myPath.push_back(Path(myFrameParent->getViewNet(), myVClass, edges.at(i - 1), edges.at(i)));
3081  }
3082  }
3083 }
3084 
3085 
3086 void
3088  // first calculate reachability for pedestrians (we use it, because pedestran can walk in almost all edges)
3089  myFrameParent->getViewNet()->getNet()->getPathManager()->getPathCalculator()->calculateReachability(SVC_PEDESTRIAN, originEdge);
3090  // change flags
3091  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
3092  for (const auto& lane : edge.second->getLanes()) {
3093  if (lane->getReachability() > 0) {
3094  lane->getParentEdge()->resetCandidateFlags();
3095  lane->getParentEdge()->setSpecialCandidate(true);
3096  }
3097  }
3098  }
3099 }
3100 
3101 void
3103  // first calculate reachability for pedestrians
3104  myFrameParent->getViewNet()->getNet()->getPathManager()->getPathCalculator()->calculateReachability(vClass, originEdge);
3105  // change flags
3106  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
3107  for (const auto& lane : edge.second->getLanes()) {
3108  if (lane->getReachability() > 0) {
3109  lane->getParentEdge()->resetCandidateFlags();
3110  lane->getParentEdge()->setPossibleCandidate(true);
3111  }
3112  }
3113  }
3114 }
3115 
3116 // ---------------------------------------------------------------------------
3117 // GNERouteFrame::Legend - methods
3118 // ---------------------------------------------------------------------------
3119 
3121  FXGroupBoxModule(frameParent->getContentFrame(), "Information") {
3122  // declare label
3123  FXLabel* legendLabel = nullptr;
3124  // edge candidate
3125  legendLabel = new FXLabel(getCollapsableFrame(), " edge candidate", 0, GUIDesignLabelLeft);
3126  legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible));
3127  legendLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));
3128  // last edge selected
3129  legendLabel = new FXLabel(getCollapsableFrame(), " last edge selected", 0, GUIDesignLabelLeft);
3130  legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target));
3131  // edge selected
3132  legendLabel = new FXLabel(getCollapsableFrame(), " edge selected", 0, GUIDesignLabelLeft);
3133  legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.source));
3134  // edge conflict (vClass)
3135  legendLabel = new FXLabel(getCollapsableFrame(), " edge conflict (vClass)", 0, GUIDesignLabelLeft);
3136  legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.special));
3137  // edge disconnected
3138  legendLabel = new FXLabel(getCollapsableFrame(), " edge disconnected", 0, GUIDesignLabelLeft);
3139  legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.conflict));
3140 }
3141 
3142 
3144 
3145 
3146 void
3148  show();
3149 }
3150 
3151 void
3153  hide();
3154 }
3155 
3156 // ---------------------------------------------------------------------------
3157 // GNEFrameModules - methods
3158 // ---------------------------------------------------------------------------
3159 
3160 FXLabel*
3161 GNEFrameModules::buildRainbow(FXComposite* parent) {
3162  // create label for color information
3163  FXLabel* label = new FXLabel(parent, "Scale: Min -> Max", nullptr, GUIDesignLabelCenterThick);
3164  // create frame for color scale
3165  FXHorizontalFrame* horizontalFrameColors = new FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame);
3166  for (const auto& color : GNEViewNetHelper::getRainbowScaledColors()) {
3167  FXLabel* colorLabel = new FXLabel(horizontalFrameColors, "", nullptr, GUIDesignLabelLeft);
3168  colorLabel->setBackColor(MFXUtils::getFXColor(color));
3169  }
3170  // return label
3171  return label;
3172 }
3173 
3174 /****************************************************************************/
GNEFrameModules::PathCreator::onCmdCreatePath
long onCmdCreatePath(FXObject *, FXSelector, void *)
Definition: GNEFrameModules.cpp:2968
GNEAttributeCarrier::getTagPropertiesByType
static const std::vector< GNETagProperties > getTagPropertiesByType(const int tagPropertyCategory)
get tagProperties associated to the given GNETagProperties::TagType (NETWORKELEMENT,...
Definition: GNEAttributeCarrier.cpp:624
SUMO_TAG_TRAIN_STOP
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
Definition: SUMOXMLDefinitions.h:65
GNEFrameModules::DemandElementSelector
Definition: GNEFrameModules.h:134
RGBColor::GREY
static const RGBColor GREY
Definition: RGBColor.h:194
SUMO_TAG_OVERHEAD_WIRE_SECTION
@ SUMO_TAG_OVERHEAD_WIRE_SECTION
An overhead wire section.
Definition: SUMOXMLDefinitions.h:137
GNE_TAG_STOPCONTAINER_EDGE
@ GNE_TAG_STOPCONTAINER_EDGE
Definition: SUMOXMLDefinitions.h:452
GNEFrameModules::DrawingShape::hideDrawingShape
void hideDrawingShape()
hide Drawing mode
Definition: GNEFrameModules.cpp:1750
GNEAccess
Definition: GNEAccess.h:36
GNE_TAG_CALIBRATOR_LANE
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
Definition: SUMOXMLDefinitions.h:107
GNEOverheadWire
Definition: GNEOverheadWire.h:32
GUIDesignLabelFrameThicked
#define GUIDesignLabelFrameThicked
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:247
GNEFrameModules::PathCreator::Path::Path
Path()
default constructor
Definition: GNEFrameModules.cpp:2301
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:340
GLO_MAX
@ GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:266
SVC_PEDESTRIAN
@ SVC_PEDESTRIAN
pedestrian
Definition: SUMOVehicleClass.h:156
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
GNEFrameModules::PathCreator
Definition: GNEFrameModules.h:542
GNEVariableSpeedSign.h
GNE_TAG_VEHICLE_WITHROUTE
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:151
GNEAttributeCarrier::getIcon
FXIcon * getIcon() const
get FXIcon associated to this AC
Definition: GNEAttributeCarrier.cpp:579
GNEDetectorEntryExit.h
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:53
GNEHierarchicalElement::getParentAdditionals
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
Definition: GNEHierarchicalElement.cpp:130
GUIVisualizationCandidateColorSettings::possible
static const RGBColor possible
color for possible candidate element
Definition: GUIVisualizationSettings.h:268
GNE_TAG_TRANSHIP_EDGES
@ GNE_TAG_TRANSHIP_EDGES
Definition: SUMOXMLDefinitions.h:449
GNEDetectorE2
Definition: GNEDetectorE2.h:32
GUIIconSubSys::getIcon
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:863
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNETransport.h
SUMO_TAG_STOP_PARKINGAREA
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
Definition: SUMOXMLDefinitions.h:222
GNEParkingAreaReroute.h
MFXMenuHeader.h
GNEOverheadWire.h
GNEFrameModules::OverlappedInspection::~OverlappedInspection
~OverlappedInspection()
destructor
Definition: GNEFrameModules.cpp:1986
MID_GNE_INSPECT
@ MID_GNE_INSPECT
inspect element
Definition: GUIAppEnum.h:815
MID_GNE_ACHIERARCHY_MOVEUP
@ MID_GNE_ACHIERARCHY_MOVEUP
In HierarchicalElementTree list, move element to up.
Definition: GUIAppEnum.h:867
GNEFrameModules::SelectorParent::hideSelectorParentModule
void hideSelectorParentModule()
hide SelectorParent Module
Definition: GNEFrameModules.cpp:1922
GNEFrameModules::TagSelector::myACTemplates
std::vector< ACTemplate * > myACTemplates
list with ACTemplates
Definition: GNEFrameModules.h:127
GNEFrameModules::HierarchicalElementTree
Definition: GNEFrameModules.h:202
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:280
GNEFrameModules::OverlappedInspection::hideOverlappedInspection
void hideOverlappedInspection()
hide template editor
Definition: GNEFrameModules.cpp:2042
GNEFrameModules::HierarchicalElementTree::showHierarchicalElementTree
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show HierarchicalElementTree
Definition: GNEFrameModules.cpp:833
GNEFrameModules::DrawingShape::addNewPoint
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrameModules.cpp:1799
SUMO_TAG_POLY
@ SUMO_TAG_POLY
begin/end of the description of a polygon
Definition: SUMOXMLDefinitions.h:53
GNEFrameModules::SelectorParent::showSelectorParentModule
void showSelectorParentModule(const std::vector< SumoXMLTag > &parentTags)
Show list of SelectorParent Module.
Definition: GNEFrameModules.cpp:1908
GNERerouterInterval
Definition: GNERerouterInterval.h:43
GNEAttributeCarrier::getTagProperty
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
Definition: GNEAttributeCarrier.cpp:600
DEFAULT_PEDTYPE_ID
const std::string DEFAULT_PEDTYPE_ID
GNE_TAG_STOPPERSON_BUSSTOP
@ GNE_TAG_STOPPERSON_BUSSTOP
Definition: SUMOXMLDefinitions.h:441
SUMO_TAG_STOP_LANE
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
Definition: SUMOXMLDefinitions.h:214
GNEFrameModules::DrawingShape::abortDrawing
void abortDrawing()
abort drawing
Definition: GNEFrameModules.cpp:1788
GNEFrameModules::HierarchicalElementTree::onCmdMoveItemDown
long onCmdMoveItemDown(FXObject *, FXSelector, void *)
called when user click over option "Move down" of child menu
Definition: GNEFrameModules.cpp:1022
MID_GNE_CENTER
@ MID_GNE_CENTER
center element
Definition: GUIAppEnum.h:821
GNEFrameModules::PathLegend::showPathLegendModule
void showPathLegendModule()
show Legend modul
Definition: GNEFrameModules.cpp:3147
GNE_TAG_WAYPOINT_CONTAINERSTOP
@ GNE_TAG_WAYPOINT_CONTAINERSTOP
waypoint placed over a containerStop (used in netedit)
Definition: SUMOXMLDefinitions.h:426
GNENetHelper::AttributeCarriers::retrieveEdge
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
Definition: GNENetHelper.cpp:581
GNEVariableSpeedSignStep
Definition: GNEVariableSpeedSignStep.h:38
GNE_TAG_FLOW_ROUTE
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:412
GNEHierarchicalElement::getChildLanes
const std::vector< GNELane * > & getChildLanes() const
get child lanes
Definition: GNEHierarchicalElement.cpp:160
GNELane::getParentEdge
GNEEdge * getParentEdge() const
get arent edge
Definition: GNELane.cpp:114
GLHelper::drawBoxLines
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:279
GNEFrameModules::PathCreator::onCmdShowCandidateEdges
long onCmdShowCandidateEdges(FXObject *, FXSelector, void *)
Called when the user click over check button "show candidate edges".
Definition: GNEFrameModules.cpp:2992
GNENetHelper::AttributeCarriers::retrieveJunction
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
Definition: GNENetHelper.cpp:361
MID_GNE_ACHIERARCHY_MOVEDOWN
@ MID_GNE_ACHIERARCHY_MOVEDOWN
In HierarchicalElementTree list, move element to down.
Definition: GUIAppEnum.h:869
GNERouteProbe.h
GNEPOI
Definition: GNEPOI.h:43
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
GNEPersonTrip.h
GNEFrameModules::PathCreator::myShiftLabel
FXLabel * myShiftLabel
label for shift information
Definition: GNEFrameModules.h:764
GNEHierarchicalElement::getChildGenericDatas
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
Definition: GNEHierarchicalElement.cpp:178
GNEFrameModules::SelectorParent::refreshSelectorParentModule
void refreshSelectorParentModule()
Refresh list of Additional Parents Module.
Definition: GNEFrameModules.cpp:1929
GNETagProperties::TagType
TagType
Definition: GNETagProperties.h:42
GUIIcon::RECENTERVIEW
@ RECENTERVIEW
GUIGeometry::getShape
const PositionVector & getShape() const
The shape of the additional element.
Definition: GUIGeometry.cpp:202
GNEFrameModules::OverlappedInspection::previousElement
bool previousElement(const Position &clickedPosition)
try to go to previous element if clicked position is near to saved position
Definition: GNEFrameModules.cpp:2086
GNEFrameModules::PathCreator::Path::getSubPath
const std::vector< GNEEdge * > & getSubPath() const
get sub path
Definition: GNEFrameModules.cpp:2274
GNEFrameModules::DemandElementSelector::getAllowedTags
const std::vector< SumoXMLTag > & getAllowedTags() const
Definition: GNEFrameModules.cpp:584
SUMO_TAG_TAZSOURCE
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
Definition: SUMOXMLDefinitions.h:165
SUMO_TAG_CONTAINER_STOP
@ SUMO_TAG_CONTAINER_STOP
A container stop.
Definition: SUMOXMLDefinitions.h:71
MID_GNE_SET_TYPE
@ MID_GNE_SET_TYPE
used to select a type of element in a combo box
Definition: GUIAppEnum.h:827
GNEVTypeDistribution
Definition: GNEVTypeDistribution.h:30
GNETagProperties::isAdditionalElement
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
Definition: GNETagProperties.cpp:269
GNEFrame::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:133
GNEFrameModules::PathCreator::myControlLabel
FXLabel * myControlLabel
label for control information
Definition: GNEFrameModules.h:767
GNEFrameModules::TagSelector::showTagSelector
void showTagSelector()
show item selector
Definition: GNEFrameModules.cpp:169
GNEPoly
Definition: GNEPoly.h:43
GNEFrameModules::PathCreator::myShowCandidateEdges
FXCheckButton * myShowCandidateEdges
CheckBox for show candidate edges.
Definition: GNEFrameModules.h:761
GNECandidateElement::isConflictedCandidate
bool isConflictedCandidate() const
check if this element is a conflicted candidate
Definition: GNECandidateElement.cpp:81
SUMO_TAG_PERSON
@ SUMO_TAG_PERSON
Definition: SUMOXMLDefinitions.h:332
GNEFrameModules::HierarchicalElementTree::~HierarchicalElementTree
~HierarchicalElementTree()
destructor
Definition: GNEFrameModules.cpp:829
SUMO_TAG_LANE
@ SUMO_TAG_LANE
begin/end of the description of a single lane
Definition: SUMOXMLDefinitions.h:49
GNEWalk
Definition: GNEWalk.h:36
GUIDesignButtonOK
#define GUIDesignButtonOK
Definition: GUIDesigns.h:124
GNEFrameModules::PathCreator::showPathCreatorModule
void showPathCreatorModule(SumoXMLTag element, const bool firstElement, const bool consecutives)
show PathCreator for the given tag
Definition: GNEFrameModules.cpp:2349
GNEFrameModules::PathCreator::Path::getToBusStop
GNEAdditional * getToBusStop() const
to additional
Definition: GNEFrameModules.cpp:2284
GNEViewNetHelper::getRainbowScaledColors
static const std::vector< RGBColor > & getRainbowScaledColors()
get scaled rainbow colors
Definition: GNEViewNetHelper.cpp:3653
GNERoute
Definition: GNERoute.h:39
GNEHierarchicalElement::getParentLanes
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
Definition: GNEHierarchicalElement.cpp:124
GNEPerson.h
GUIDesignComboBoxNCol
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:282
GNEVariableSpeedSign
Definition: GNEVariableSpeedSign.h:37
GUIVisualizationCandidateColorSettings::target
static const RGBColor target
color for selected candidate target
Definition: GUIVisualizationSettings.h:274
GNETractionSubstation.h
GUIDesignListFixedHeight
#define GUIDesignListFixedHeight
design for FXLists with height fixed
Definition: GUIDesigns.h:615
GNEFrame
Definition: GNEFrame.h:33
GNEGenericData
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEGenericData.h:54
GNEJunction::getGNECrossings
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
Definition: GNEJunction.cpp:624
GNEFrameModules::DemandElementSelector::getContainerPlanPreviousEdge
GNEEdge * getContainerPlanPreviousEdge() const
get previous edge for the current container plan
Definition: GNEFrameModules.cpp:740
MID_GNE_TAG_SELECTED
@ MID_GNE_TAG_SELECTED
tag selected in ComboBox
Definition: GUIAppEnum.h:831
GNERide.h
GNEFrameModules::PathCreator::PathCreator
PathCreator(GNEFrame *frameParent)
default constructor
Definition: GNEFrameModules.cpp:2309
SUMO_TAG_POI
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
Definition: SUMOXMLDefinitions.h:55
GNEViewNet
Definition: GNEViewNet.h:43
MID_GNE_STOPDRAWING
@ MID_GNE_STOPDRAWING
stop drawing polygon
Definition: GUIAppEnum.h:873
GUIIcon::ACCEPT
@ ACCEPT
GNEFrameModules::OverlappedInspection::onCmdOverlappingHelp
long onCmdOverlappingHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEFrameModules.cpp:2189
GNETractionSubstation
Definition: GNETractionSubstation.h:29
GNEFrameModules::PathCreator::removeRoute
void removeRoute()
remove route
Definition: GNEFrameModules.cpp:2699
GNEFrameModules::DrawingShape::myStopDrawingButton
FXButton * myStopDrawingButton
button for stop drawing
Definition: GNEFrameModules.h:391
GNEFrameModules::PathCreator::myInfoRouteLabel
FXLabel * myInfoRouteLabel
label with route info
Definition: GNEFrameModules.h:749
GUIIcon::MODEINSPECT
@ MODEINSPECT
GNEFrameModules::PathCreator::myFrameParent
GNEFrame * myFrameParent
current frame parent
Definition: GNEFrameModules.h:725
GNELane::getLane2laneConnections
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition: GNELane.cpp:831
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:540
GNE_TAG_RIDE_EDGE
@ GNE_TAG_RIDE_EDGE
Definition: SUMOXMLDefinitions.h:438
SUMO_TAG_DET_ENTRY
@ SUMO_TAG_DET_ENTRY
an e3 entry point
Definition: SUMOXMLDefinitions.h:97
SUMO_TAG_NOTHING
@ SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:41
GLHelper.h
GNEDetectorE1
Definition: GNEDetectorE1.h:32
GNE_TAG_WALK_EDGES
@ GNE_TAG_WALK_EDGES
Definition: SUMOXMLDefinitions.h:434
GUIDesigns.h
GNEFrameModules::OverlappedInspection::getNumberOfOverlappedACs
int getNumberOfOverlappedACs() const
get number of overlapped ACSs
Definition: GNEFrameModules.cpp:2056
GNEFrameModules::TagSelector::refreshTagSelector
void refreshTagSelector()
refresh tagSelector (used when frameParent is show)
Definition: GNEFrameModules.cpp:304
GNEFrameModules::DrawingShape::showDrawingShape
void showDrawingShape()
show Drawing mode
Definition: GNEFrameModules.cpp:1742
GNEFrameModules::PathCreator::drawCandidateEdgesWithSpecialColor
bool drawCandidateEdgesWithSpecialColor() const
draw candidate edges with special color (Only for candidates, special and conflicted)
Definition: GNEFrameModules.cpp:2722
GNE_TAG_TRIP_JUNCTIONS
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:147
SUMO_TAG_VTYPE
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
Definition: SUMOXMLDefinitions.h:153
GNEVTypeDistribution.h
GNEFrameModules::HierarchicalElementTree::showHierarchicalElementChildren
void showHierarchicalElementChildren(GNEHierarchicalElement *HE, FXTreeItem *itemParent)
show children of given hierarchical element
Definition: GNEFrameModules.cpp:1520
GNERerouter
Definition: GNERerouter.h:37
GNENet::getAttributeCarriers
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
GNEHierarchicalElement::getChildDemandElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Definition: GNEHierarchicalElement.cpp:172
MID_GNE_OVERLAPPED_ITEMSELECTED
@ MID_GNE_OVERLAPPED_ITEMSELECTED
list item selected in overlapped modul
Definition: GUIAppEnum.h:883
SUMO_TAG_CONTAINER
@ SUMO_TAG_CONTAINER
Definition: SUMOXMLDefinitions.h:347
GNEConnection::getEdgeTo
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
Definition: GNEConnection.cpp:203
PositionVector
A list of positions.
Definition: PositionVector.h:43
GNE_TAG_POILANE
@ GNE_TAG_POILANE
Point of interest over Lane.
Definition: SUMOXMLDefinitions.h:404
SUMO_TAG_PARKING_SPACE
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
Definition: SUMOXMLDefinitions.h:77
GNEClosingLaneReroute.h
GNE_TAG_WALK_JUNCTIONS
@ GNE_TAG_WALK_JUNCTIONS
Definition: SUMOXMLDefinitions.h:436
GNERide
Definition: GNERide.h:36
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:509
GNEDataInterval::getGenericDataChildren
const std::vector< GNEGenericData * > & getGenericDataChildren() const
get generic data children
Definition: GNEDataInterval.cpp:217
GNEFrameModules::DemandElementSelector::DemandElementSelector
DemandElementSelector(GNEFrame *frameParent, SumoXMLTag demandElementTag, GNEDemandElement *defaultElement=nullptr)
FOX-declaration.
Definition: GNEFrameModules.cpp:540
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:39
GNEFrameModules::PathCreator::updateEdgeColors
void updateEdgeColors()
update edge colors
Definition: GNEFrameModules.cpp:2756
GNEFrameModules::PathCreator::getVClass
SUMOVehicleClass getVClass() const
get vClass
Definition: GNEFrameModules.cpp:2477
GNEFrameModules::PathCreator::Path::getFromBusStop
GNEAdditional * getFromBusStop() const
get from additional
Definition: GNEFrameModules.cpp:2279
GeoConvHelper::getProjString
const std::string & getProjString() const
Returns the original projection definition.
Definition: GeoConvHelper.cpp:520
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:68
GNEFrameModules::DrawingShape::removeLastPoint
void removeLastPoint()
remove last added point
Definition: GNEFrameModules.cpp:1809
SUMO_TAG_DATASET
@ SUMO_TAG_DATASET
Definition: SUMOXMLDefinitions.h:341
GNEFrameModules::DemandElementSelector::~DemandElementSelector
~DemandElementSelector()
destructor
Definition: GNEFrameModules.cpp:574
GNERouteProbe
Representation of a RouteProbe in netedit.
Definition: GNERouteProbe.h:32
GNEFrameModules::PathCreator::clearJunctionColors
void clearJunctionColors()
clear junction colors
Definition: GNEFrameModules.cpp:2803
GUIAppEnum.h
GNEFrameModules::PathCreator::updateJunctionColors
void updateJunctionColors()
update junction colors
Definition: GNEFrameModules.cpp:2728
GLHelper::pushMatrix
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:114
GNELane2laneConnection::getLane2laneGeometry
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
Definition: GNELane2laneConnection.cpp:80
GNEFrameModules::SelectorParent::~SelectorParent
~SelectorParent()
destructor
Definition: GNEFrameModules.cpp:1876
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:244
GNEFrameModules::TagSelector::setCurrentTag
void setCurrentTag(SumoXMLTag newTag, const bool notifyFrameParent=true)
set current type manually
Definition: GNEFrameModules.cpp:283
GNEChange_Children
Definition: GNEChange_Children.h:32
SUMO_TAG_OVERHEAD_WIRE_CLAMP
@ SUMO_TAG_OVERHEAD_WIRE_CLAMP
An overhead wire clamp (connection of wires in opposite directions)
Definition: SUMOXMLDefinitions.h:139
GNECalibratorFlow.h
GUIDesignButtonRectangular
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:74
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
GNEFrameModules::PathCreator::setVClass
void setVClass(SUMOVehicleClass vClass)
set vClass
Definition: GNEFrameModules.cpp:2483
GNEFrameModules::PathCreator::onCmdAbortPathCreation
long onCmdAbortPathCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
Definition: GNEFrameModules.cpp:2976
GUIIcon::MODEDELETE
@ MODEDELETE
GNEAttributeCarrier::getHierarchyName
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
GNEFrameModules::DemandElementSelector::myDemandElementTags
std::vector< SumoXMLTag > myDemandElementTags
demand element tags
Definition: GNEFrameModules.h:195
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1360
GNEChargingStation
Definition: GNEChargingStation.h:29
GNEFrameModules::PathCreator::removeLastElement
void removeLastElement()
remove path element
Definition: GNEFrameModules.cpp:2936
GNERoute.h
GNEFrameModules::SelectorParent::SelectorParent
SelectorParent(GNEFrame *frameParent)
constructor
Definition: GNEFrameModules.cpp:1864
GNETransport
Definition: GNETransport.h:36
GNEFrameModules::DemandElementSelector::refreshDemandElementSelector
void refreshDemandElementSelector()
refresh demand element selector
Definition: GNEFrameModules.cpp:634
GNEFrameModules::PathCreator::clearEdgeColors
void clearEdgeColors()
clear edge colors
Definition: GNEFrameModules.cpp:2812
GNEFrameModules::HierarchicalElementTree::addListItem
FXTreeItem * addListItem(GNEAttributeCarrier *AC, FXTreeItem *itemParent=nullptr, std::string prefix="", std::string sufix="")
add item into list
Definition: GNEFrameModules.cpp:1687
SUMO_TAG_DEST_PROB_REROUTE
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
Definition: SUMOXMLDefinitions.h:115
MID_GNE_EDGEPATH_SHOWCANDIDATES
@ MID_GNE_EDGEPATH_SHOWCANDIDATES
enable or disable show path candidates
Definition: GUIAppEnum.h:855
GNEParkingArea
A lane area vehicles can park at (netedit-version)
Definition: GNEParkingArea.h:33
GNERerouterInterval.h
GNEDataSet
Definition: GNEDataSet.h:43
GNEFrameModules::PathCreator::Path
FOX-declaration.
Definition: GNEFrameModules.h:548
GNEFrameModules::DemandElementSelector::hideDemandElementSelector
void hideDemandElementSelector()
hide demand element selector
Definition: GNEFrameModules.cpp:622
SUMO_TAG_TRACTION_SUBSTATION
@ SUMO_TAG_TRACTION_SUBSTATION
A traction substation.
Definition: SUMOXMLDefinitions.h:133
GNEFrameModules::TagSelector::ACTemplate::ACTemplate
ACTemplate(GNENet *net, const GNETagProperties tagProperty)
constructor
Definition: GNEFrameModules.cpp:345
GNEFrameModules::TagSelector::ACTemplate
FOX need this.
Definition: GNEFrameModules.h:91
GNEVType.h
GNEFrameModules::PathCreator::getRoute
GNEDemandElement * getRoute() const
get route
Definition: GNEFrameModules.cpp:2710
GNE_TAG_E2DETECTOR_MULTILANE
@ GNE_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (placed here due create Additional Frame)
Definition: SUMOXMLDefinitions.h:85
GNEFrameModules::PathCreator::addRoute
bool addRoute(GNEDemandElement *route, const bool shiftKeyPressed, const bool controlKeyPressed)
add route
Definition: GNEFrameModules.cpp:2679
GNEFrameModules::TagSelector
Definition: GNEFrameModules.h:48
GNEDetectorE3.h
GNEFrameModules::PathCreator::myCreationMode
int myCreationMode
current creation mode
Definition: GNEFrameModules.h:731
SUMO_TAG_FLOW
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
Definition: SUMOXMLDefinitions.h:183
GNEFrameModules::OverlappedInspection::showOverlappedInspection
void showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
show template editor
Definition: GNEFrameModules.cpp:1990
GNEFrameModules::PathLegend::hidePathLegendModule
void hidePathLegendModule()
hide Legend modul
Definition: GNEFrameModules.cpp:3152
GNETAZ.h
GNEFrameModules::TagSelector::onCmdSelectTag
long onCmdSelectTag(FXObject *, FXSelector, void *)
Definition: GNEFrameModules.cpp:311
GNE_TAG_STOPCONTAINER_CONTAINERSTOP
@ GNE_TAG_STOPCONTAINER_CONTAINERSTOP
Definition: SUMOXMLDefinitions.h:451
SUMO_TAG_CHARGING_STATION
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
Definition: SUMOXMLDefinitions.h:73
SUMO_TAG_STOP_CHARGINGSTATION
@ SUMO_TAG_STOP_CHARGINGSTATION
stop placed over a charging station (used in netedit)
Definition: SUMOXMLDefinitions.h:220
GNEFrameModules::PathCreator::onCmdRemoveLastElement
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge".
Definition: GNEFrameModules.cpp:2984
GNEFrameModules::PathCreator::Path::mySubPath
std::vector< GNEEdge * > mySubPath
sub path
Definition: GNEFrameModules.h:574
MID_GNE_ABORTDRAWING
@ MID_GNE_ABORTDRAWING
abort drawing polygon
Definition: GUIAppEnum.h:875
GeoConvHelper::getFinal
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
Definition: GeoConvHelper.h:103
GUIVisualizationSettings::candidateColorSettings
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
Definition: GUIVisualizationSettings.h:981
GNETranship
Definition: GNETranship.h:37
GNE_TAG_ROUTE_EMBEDDED
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:157
GNELane::getLaneShape
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:132
RGBColor::ORANGE
static const RGBColor ORANGE
Definition: RGBColor.h:191
GNEFrameModules::PathCreator::setPossibleCandidates
void setPossibleCandidates(GNEEdge *originEdge, const SUMOVehicleClass vClass)
set edgereachability (This function will be called recursively)
Definition: GNEFrameModules.cpp:3102
SUMO_TAG_VSS
@ SUMO_TAG_VSS
A variable speed sign.
Definition: SUMOXMLDefinitions.h:125
GNEAccess.h
GNEDataSet::getDataIntervalChildren
const std::map< const double, GNEDataInterval * > & getDataIntervalChildren() const
get data interval children
Definition: GNEDataSet.cpp:298
GNEConnection::getEdgeFrom
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
Definition: GNEConnection.cpp:197
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:157
GNEParkingSpace.h
GNEDetectorE1.h
GNEEdge::getFromJunction
GNEJunction * getFromJunction() const
get from Junction (only used to increase readability)
Definition: GNEEdge.h:77
GNEFrameModules::OverlappedInspection::buildFXElements
void buildFXElements()
build Fox Toolkit elemements
Definition: GNEFrameModules.cpp:2220
GNEFrameModules::PathCreator::clearPath
void clearPath()
clear edges (and restore colors)
Definition: GNEFrameModules.cpp:3039
GNEFrameModules::HierarchicalElementTree::showAttributeCarrierParents
FXTreeItem * showAttributeCarrierParents()
show child of current attributeCarrier
Definition: GNEFrameModules.cpp:1132
GNEStop
Definition: GNEStop.h:31
GNEFrameModules::PathCreator::hidePathCreatorModule
void hidePathCreatorModule()
show PathCreator
Definition: GNEFrameModules.cpp:2468
GNEFrameModules::PathCreator::myRemoveLastInsertedElement
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
Definition: GNEFrameModules.h:758
GNEFrameModules::PathCreator::addJunction
bool addJunction(GNEJunction *junction, const bool shiftKeyPressed, const bool controlKeyPressed)
add junction
Definition: GNEFrameModules.cpp:2491
GNEClosingReroute
Definition: GNEClosingReroute.h:38
DEFAULT_VTYPE_ID
const std::string DEFAULT_VTYPE_ID
GNEFrameModules::OverlappedInspection::overlappedInspectionShown
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
Definition: GNEFrameModules.cpp:2049
GNEFrameModules::PathCreator::getPath
const std::vector< Path > & getPath() const
get path route
Definition: GNEFrameModules.cpp:2716
GNEFrameModules::DemandElementSelector::showDemandElementSelector
void showDemandElementSelector()
show demand element selector
Definition: GNEFrameModules.cpp:604
GNEFrameModules::HierarchicalElementTree::refreshHierarchicalElementTree
void refreshHierarchicalElementTree()
refresh HierarchicalElementTree
Definition: GNEFrameModules.cpp:870
GNERouteProbReroute
Definition: GNERouteProbReroute.h:40
GNETagProperties::isDataElement
bool isDataElement() const
return true if tag correspond to a data element
Definition: GNETagProperties.cpp:287
GNEViewNet.h
SVC_PASSENGER
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
GNEFrameModules.h
SUMO_ATTR_EDGES
@ SUMO_ATTR_EDGES
the edges of a route
Definition: SUMOXMLDefinitions.h:585
GNEFrameModules::PathCreator::setSpecialCandidates
void setSpecialCandidates(GNEEdge *originEdge)
set special candidates (This function will be called recursively)
Definition: GNEFrameModules.cpp:3087
SUMO_TAG_PARKING_AREA
@ SUMO_TAG_PARKING_AREA
A parking area.
Definition: SUMOXMLDefinitions.h:75
MID_GNE_STARTDRAWING
@ MID_GNE_STARTDRAWING
start drawing polygon
Definition: GUIAppEnum.h:871
GNECandidateElement::isSpecialCandidate
bool isSpecialCandidate() const
check if this element is a special candidate
Definition: GNECandidateElement.cpp:75
DEFAULT_CONTAINERTYPE_ID
const std::string DEFAULT_CONTAINERTYPE_ID
SUMO_TAG_EDGE
@ SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:47
GNEFrameModules::HierarchicalElementTree::myTreeListDinamic
FXTreeListDinamic * myTreeListDinamic
tree list dinamic to show the children of the element to erase
Definition: GNEFrameModules.h:305
GNEDetectorE1Instant.h
GNEFrameModules::PathCreator::~PathCreator
~PathCreator()
destructor
Definition: GNEFrameModules.cpp:2345
GNEFrameModules::OverlappedInspection::OverlappedInspection
OverlappedInspection()
FOX needs this.
Definition: GNEFrameModules.cpp:2207
GUIDesignLabelLeft
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:193
ProcessError
Definition: UtilExceptions.h:37
SUMO_TAG_STEP
@ SUMO_TAG_STEP
trigger: a step description
Definition: SUMOXMLDefinitions.h:127
GNECalibrator
Definition: GNECalibrator.h:39
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:145
GNEFrameModules::HierarchicalElementTree::onCmdMoveItemUp
long onCmdMoveItemUp(FXObject *, FXSelector, void *)
called when user click over option "Move up" of child menu
Definition: GNEFrameModules.cpp:1006
GNE_TAG_FLOW_JUNCTIONS
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:185
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
GNEApplicationWindow.h
DEFAULT_VTYPES
const std::set< std::string > DEFAULT_VTYPES
Position::x
double x() const
Returns the x-position.
Definition: Position.h:55
SUMO_TAG_ROUTE_PROB_REROUTE
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
Definition: SUMOXMLDefinitions.h:121
GUIDesignButtonIconRectangular
#define GUIDesignButtonIconRectangular
button only with icon
Definition: GUIDesigns.h:80
GNEFrameModules::PathLegend::~PathLegend
~PathLegend()
destructor
Definition: GNEFrameModules.cpp:3143
GNEAttributeCarrier::getID
virtual const std::string & getID() const =0
return ID of object
GNEFrameModules::DemandElementSelector::myDemandElementsMatchBox
MFXIconComboBox * myDemandElementsMatchBox
comboBox with the list of elements type
Definition: GNEFrameModules.h:189
GNE_TAG_POIGEO
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
Definition: SUMOXMLDefinitions.h:406
GNETAZ
Definition: GNETAZ.h:34
GNEGenericData::getDataIntervalParent
GNEDataInterval * getDataIntervalParent() const
get data interval parent
Definition: GNEGenericData.cpp:77
GNE_TAG_WAYPOINT_LANE
@ GNE_TAG_WAYPOINT_LANE
waypoint placed over a lane (used in netedit)
Definition: SUMOXMLDefinitions.h:422
GNEFrameAttributeModules::isSupermodeValid
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
Definition: GNEFrameAttributeModules.cpp:2602
GNEFrameModules::SelectorParent::myParentsLabel
FXLabel * myParentsLabel
Label with parent name.
Definition: GNEFrameModules.h:435
GNEVariableSpeedSignStep.h
SUMO_TAG_REROUTER
@ SUMO_TAG_REROUTER
A rerouter.
Definition: SUMOXMLDefinitions.h:111
GNEFrameModules::DrawingShape
Definition: GNEFrameModules.h:318
GNEFrameModules::HierarchicalElementTree::onCmdInspectItem
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user click over option "inspect" of child menu
Definition: GNEFrameModules.cpp:932
GNEDetectorE3
Definition: GNEDetectorE3.h:32
GNEFrameModules::DrawingShape::startDrawing
void startDrawing()
start drawing
Definition: GNEFrameModules.cpp:1759
GNE_ATTR_DEFAULT_VTYPE
@ GNE_ATTR_DEFAULT_VTYPE
Flag to check if VType is a default VType.
Definition: SUMOXMLDefinitions.h:1330
GUIIcon::ROUTE
@ ROUTE
GUIIcon::EDGE
@ EDGE
MID_GNE_EDGEPATH_FINISH
@ MID_GNE_EDGEPATH_FINISH
finish edge path creation
Definition: GUIAppEnum.h:851
GNEFrameModules::OverlappedInspection::checkSavedPosition
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
Definition: GNEFrameModules.cpp:2062
GNEFrameModules::DrawingShape::onCmdAbortDrawing
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
Definition: GNEFrameModules.cpp:1855
GNELane::getGNEIncomingConnections
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition: GNELane.cpp:1655
GNEPerson
Definition: GNEPerson.h:33
GNE_TAG_PERSONTRIP_EDGE
@ GNE_TAG_PERSONTRIP_EDGE
Definition: SUMOXMLDefinitions.h:416
GNEDetectorE2.h
GUIIcon
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
GNEFrameModules::PathCreator::Path::myConflictVClass
bool myConflictVClass
flag to mark this path as conflicted
Definition: GNEFrameModules.h:583
GNECrossing.h
GNEFrameModules::PathCreator::Path::myConflictDisconnected
bool myConflictDisconnected
flag to mark this path as disconnected
Definition: GNEFrameModules.h:586
GNEFrameModules::PathCreator::myVClass
SUMOVehicleClass myVClass
current vClass
Definition: GNEFrameModules.h:728
GNE_TAG_STOPPERSON_EDGE
@ GNE_TAG_STOPPERSON_EDGE
Definition: SUMOXMLDefinitions.h:442
GNENetHelper::AttributeCarriers::retrieveDemandElement
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENetHelper.cpp:1119
GNEFrameModules::DrawingShape::onCmdStartDrawing
long onCmdStartDrawing(FXObject *, FXSelector, void *)
Definition: GNEFrameModules.cpp:1841
GNEEdge::getLanes
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:785
SUMO_TAG_CLOSING_REROUTE
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
Definition: SUMOXMLDefinitions.h:117
GNE_TAG_WAYPOINT_CHARGINGSTATION
@ GNE_TAG_WAYPOINT_CHARGINGSTATION
waypoint placed over a charging station (used in netedit)
Definition: SUMOXMLDefinitions.h:428
SUMO_TAG_VEHICLE
@ SUMO_TAG_VEHICLE
description of a vehicle
Definition: SUMOXMLDefinitions.h:149
GNEParkingSpace
vehicle space used by GNEParkingAreas
Definition: GNEParkingSpace.h:37
GNEContainer.h
Element
Definition: Element.h:50
GNEBusStop
A lane area vehicles can halt at (netedit-version)
Definition: GNEBusStop.h:33
GNEFrameModules::DrawingShape::~DrawingShape
~DrawingShape()
destructor
Definition: GNEFrameModules.cpp:1739
GUIDesignTreeListDinamic
#define GUIDesignTreeListDinamic
Definition: GUIDesigns.h:599
GNEFrameModules::PathCreator::getSelectedJunctions
const std::vector< GNEJunction * > & getSelectedJunctions() const
get current selected junctions
Definition: GNEFrameModules.cpp:2629
GUIIcon::BIGARROWRIGHT
@ BIGARROWRIGHT
GNEFrameModules::TagSelector::~TagSelector
~TagSelector()
destructor
Definition: GNEFrameModules.cpp:159
GNETagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNETagProperties.cpp:67
GNE_TAG_WAYPOINT_BUSSTOP
@ GNE_TAG_WAYPOINT_BUSSTOP
waypoint placed over a busStop (used in netedit)
Definition: SUMOXMLDefinitions.h:424
GNEDataInterval
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDataInterval.h:48
GUIIcon::BIGARROWLEFT
@ BIGARROWLEFT
GNECalibratorFlow
Definition: GNECalibratorFlow.h:40
GNEContainerStop.h
GNEFrameModules::TagSelector::ACTemplate::~ACTemplate
~ACTemplate()
destructor
Definition: GNEFrameModules.cpp:532
GNEWalk.h
GNEFrameModules::PathCreator::getToStoppingPlace
GNEAdditional * getToStoppingPlace(SumoXMLTag expectedTag) const
get to stoppingPlace
Definition: GNEFrameModules.cpp:2669
GUIDesignLabelCenterThick
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center
Definition: GUIDesigns.h:211
GNEPathManager::PathCalculator::calculateDijkstraPath
std::vector< GNEEdge * > calculateDijkstraPath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
Definition: GNEPathManager.cpp:269
GNEClosingLaneReroute
Definition: GNEClosingLaneReroute.h:39
GNEFrameModules::PathCreator::updateInfoRouteLabel
void updateInfoRouteLabel()
update InfoRouteLabel
Definition: GNEFrameModules.cpp:3010
GNEFrameModules::PathCreator::drawTemporalRoute
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
Definition: GNEFrameModules.cpp:2821
GNEFrameModules::DemandElementSelector::onCmdSelectDemandElement
long onCmdSelectDemandElement(FXObject *, FXSelector, void *)
Definition: GNEFrameModules.cpp:776
FXTreeListDinamic
FXTreeListDinamic.
Definition: FXTreeListDinamic.h:28
SUMO_TAG_TAZ
@ SUMO_TAG_TAZ
a traffic assignment zone
Definition: SUMOXMLDefinitions.h:163
GNENetworkElement::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNENetworkElement.cpp:119
Position::distanceTo2D
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:252
GNELane::getGNEOutcomingConnections
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
Definition: GNELane.cpp:1676
GNEHierarchicalElement::getParentEdges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
Definition: GNEHierarchicalElement.cpp:118
GNEViewParent.h
GNEHierarchicalElement::getChildEdges
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
Definition: GNEHierarchicalElement.cpp:154
GUIVisualizationCandidateColorSettings::source
static const RGBColor source
color for selected candidate source
Definition: GUIVisualizationSettings.h:271
GNEVType
Definition: GNEVType.h:31
GLIncludes.h
GUIDesignListSingleElementFixedHeight
#define GUIDesignListSingleElementFixedHeight
design for FXLists that only allow a single selected elements selected and height fixed
Definition: GUIDesigns.h:618
GNETagProperties::isDemandElement
bool isDemandElement() const
return true if tag correspond to a demand element
Definition: GNETagProperties.cpp:281
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
GNEPoly.h
GNENetworkElement::getID
const std::string & getID() const
get ID
Definition: GNENetworkElement.cpp:48
GNEFrameModules::PathCreator::myToStoppingPlace
GNEAdditional * myToStoppingPlace
to additional (usually a busStop)
Definition: GNEFrameModules.h:740
GNEFrameModules::DrawingShape::myInformationLabel
FXLabel * myInformationLabel
Label with information.
Definition: GNEFrameModules.h:397
SUMO_TAG_BUS_STOP
@ SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:63
SUMO_TAG_TAZSINK
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
Definition: SUMOXMLDefinitions.h:167
SUMO_TAG_STOP_CONTAINERSTOP
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
Definition: SUMOXMLDefinitions.h:218
GNEFrameModules::DrawingShape::DrawingShape
DrawingShape(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameModules.cpp:1713
MID_GNE_EDGEPATH_REMOVELAST
@ MID_GNE_EDGEPATH_REMOVELAST
remove last inserted element in path
Definition: GUIAppEnum.h:853
GNEDataInterval::getDataSetParent
GNEDataSet * getDataSetParent() const
Returns a pointer to GNEDataSet parent.
Definition: GNEDataInterval.cpp:153
GNEFrameModules::HierarchicalElementTree::onCmdCenterItem
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user click over option "center" of child Menu
Definition: GNEFrameModules.cpp:906
GNE_TAG_RIDE_BUSSTOP
@ GNE_TAG_RIDE_BUSSTOP
Definition: SUMOXMLDefinitions.h:439
GNEFrameModules::PathCreator::createPath
void createPath()
create path
Definition: GNEFrameModules.cpp:2905
GUIDesignLabelLeftThick
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left
Definition: GUIDesigns.h:205
Position::y
double y() const
Returns the y-position.
Definition: Position.h:60
SUMO_TAG_CROSSING
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
Definition: SUMOXMLDefinitions.h:250
GNEDemandElement::getID
const std::string & getID() const
get ID
Definition: GNEDemandElement.cpp:86
GNEFrameModules::PathCreator::abortPathCreation
void abortPathCreation()
abort path creation
Definition: GNEFrameModules.cpp:2912
GNEFrameModules::DrawingShape::getDeleteLastCreatedPoint
bool getDeleteLastCreatedPoint()
get flag delete last created point
Definition: GNEFrameModules.cpp:1835
GNEFrameModules::TagSelector::getTemplateAC
GNEAttributeCarrier * getTemplateAC(SumoXMLTag ACTag) const
get templateAC
Definition: GNEFrameModules.cpp:181
GNEFrameModules::DrawingShape::myStartDrawingButton
FXButton * myStartDrawingButton
button for start drawing
Definition: GNEFrameModules.h:388
GNEHierarchicalElement::getParentDemandElements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
Definition: GNEHierarchicalElement.cpp:136
GNEDestProbReroute
Definition: GNEDestProbReroute.h:39
GNEFrameModules::DrawingShape::isDrawing
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrameModules.cpp:1823
GNEFrameModules::PathLegend::PathLegend
PathLegend(GNEFrame *frameParent)
constructor
Definition: GNEFrameModules.cpp:3120
GNEContainer
Definition: GNEContainer.h:33
M_PI
#define M_PI
Definition: odrSpiral.cpp:40
GNEVaporizer.h
MID_GNE_ACHIERARCHY_SHOWCHILDMENU
@ MID_GNE_ACHIERARCHY_SHOWCHILDMENU
In HierarchicalElementTree list, show child menu.
Definition: GUIAppEnum.h:865
GNEClosingReroute.h
GNEFrameModules::TagSelector::hideTagSelector
void hideTagSelector()
hide item selector
Definition: GNEFrameModules.cpp:175
GNEFrameModules::DrawingShape::onCmdStopDrawing
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
Definition: GNEFrameModules.cpp:1848
GNEFrameModules::PathCreator::myFinishCreationButton
FXButton * myFinishCreationButton
button for finish route creation
Definition: GNEFrameModules.h:752
GNEFrameModules::PathCreator::addStoppingPlace
bool addStoppingPlace(GNEAdditional *stoppingPlace, const bool shiftKeyPressed, const bool controlKeyPressed)
add stoppingPlace
Definition: GNEFrameModules.cpp:2635
GUIIcon::LANE
@ LANE
GLHelper::drawBoxLine
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition: GLHelper.cpp:233
GNEFrameModules::PathCreator::recalculatePath
void recalculatePath()
recalculate path
Definition: GNEFrameModules.cpp:3056
GNEFrameModules::PathCreator::myRoute
GNEDemandElement * myRoute
route (usually a busStop)
Definition: GNEFrameModules.h:743
SUMO_TAG_VAPORIZER
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
Definition: SUMOXMLDefinitions.h:131
GNEParkingArea.h
GNEDestProbReroute.h
GNEFrameModules::TagSelector::ACTemplate::myAC
GNEAttributeCarrier * myAC
editedAC
Definition: GNEFrameModules.h:105
GNEHierarchicalElement::getChildAdditionals
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
Definition: GNEHierarchicalElement.cpp:166
MID_GNE_DELETE
@ MID_GNE_DELETE
delete element
Definition: GUIAppEnum.h:813
GUIIcon::VTYPE
@ VTYPE
GNEFrameModules::SelectorParent::getIdSelected
std::string getIdSelected() const
get currently parent additional selected
Definition: GNEFrameModules.cpp:1880
GNE_TAG_FLOW_WITHROUTE
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:414
GNEFrameModules::HierarchicalElementTree::HierarchicalElementTree
HierarchicalElementTree(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameModules.cpp:808
GUIDesignComboBox
#define GUIDesignComboBox
Definition: GUIDesigns.h:267
GNEFrameModules::TagSelector::myFrameParent
GNEFrame * myFrameParent
pointer to Frame Parent
Definition: GNEFrameModules.h:115
GNEPathManager::getPathCalculator
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
Definition: GNEPathManager.cpp:561
FXGroupBoxModule
FXGroupBoxModule (based on FXGroupBox)
Definition: FXGroupBoxModule.h:27
GNETAZSourceSink.h
MID_GNE_EDGEPATH_ABORT
@ MID_GNE_EDGEPATH_ABORT
abort edge path creation
Definition: GUIAppEnum.h:849
GNEFrameModules::PathCreator::getSelectedEdges
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
Definition: GNEFrameModules.cpp:2623
GNEFrameModules::DrawingShape::myAbortDrawingButton
FXButton * myAbortDrawingButton
button for abort drawing
Definition: GNEFrameModules.h:394
GNEDetectorEntryExit
Definition: GNEDetectorEntryExit.h:36
GNERerouter.h
GNEBusStop.h
SUMO_TAG_CONNECTION
@ SUMO_TAG_CONNECTION
connectio between two lanes
Definition: SUMOXMLDefinitions.h:226
GNEFrameModules::OverlappedInspection::onCmdShowList
long onCmdShowList(FXObject *, FXSelector, void *)
show list of overlapped elements
Definition: GNEFrameModules.cpp:2152
GNECalibrator.h
MID_GNE_OVERLAPPED_NEXT
@ MID_GNE_OVERLAPPED_NEXT
inspect next element in overlapped modul
Definition: GUIAppEnum.h:877
GNEVaporizer
Representation of a vaporizer in netedit.
Definition: GNEVaporizer.h:33
GNEVehicle
Definition: GNEVehicle.h:32
DEFAULT_TAXITYPE_ID
const std::string DEFAULT_TAXITYPE_ID
GNE_TAG_TRANSPORT_EDGE
@ GNE_TAG_TRANSPORT_EDGE
Definition: SUMOXMLDefinitions.h:444
GNEFrameModules::TagSelector::ACTemplate::getAC
GNEAttributeCarrier * getAC() const
get template AC
Definition: GNEFrameModules.cpp:340
SUMO_TAG_ROUTEPROBE
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
Definition: SUMOXMLDefinitions.h:129
GNEFrameModules::DemandElementSelector::isDemandElementSelectorShown
bool isDemandElementSelectorShown() const
check if demand element selector is shown
Definition: GNEFrameModules.cpp:628
GNEFrameModules::PathCreator::Path::isConflictDisconnected
bool isConflictDisconnected() const
check if current path is conflict due is disconnected
Definition: GNEFrameModules.cpp:2296
GNE_TAG_WALK_BUSSTOP
@ GNE_TAG_WALK_BUSSTOP
Definition: SUMOXMLDefinitions.h:433
GNEFrameModules::OverlappedInspection::onCmdNextElement
long onCmdNextElement(FXObject *, FXSelector, void *)
Inspect next Element (from top to bot)
Definition: GNEFrameModules.cpp:2130
GNEConnection
Definition: GNEConnection.h:36
GLHelper::popMatrix
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:123
GNEAttributeCarrier::getNet
GNENet * getNet() const
get pointer to net
Definition: GNEAttributeCarrier.cpp:62
FXGroupBoxModule::getCollapsableFrame
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
Definition: FXGroupBoxModule.cpp:82
SUMO_TAG_ROUTE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:155
GNEFrameModules::TagSelector::setCurrentTagType
void setCurrentTagType(GNETagProperties::TagType tagType, const bool onlyDrawables, const bool notifyFrameParent=true)
set current type manually
Definition: GNEFrameModules.cpp:199
GNE_TAG_TRANSHIP_EDGE
@ GNE_TAG_TRANSHIP_EDGE
Definition: SUMOXMLDefinitions.h:447
GNEHierarchicalElement
Definition: GNEHierarchicalElement.h:37
GNETagProperties::isNetworkElement
bool isNetworkElement() const
return true if tag correspond to a network element
Definition: GNETagProperties.cpp:263
GNENetHelper::AttributeCarriers::retrieveAdditional
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENetHelper.cpp:875
SUMO_TAG_E3DETECTOR
@ SUMO_TAG_E3DETECTOR
an e3 detector
Definition: SUMOXMLDefinitions.h:89
SUMO_TAG_PARKING_AREA_REROUTE
@ SUMO_TAG_PARKING_AREA_REROUTE
entry for an alternative parking zone
Definition: SUMOXMLDefinitions.h:123
config.h
SUMO_TAG_CONTAINERFLOW
@ SUMO_TAG_CONTAINERFLOW
Definition: SUMOXMLDefinitions.h:350
GNEFrameModules::OverlappedInspection
Definition: GNEFrameModules.h:445
GNEFrameModules::DemandElementSelector::getPersonPlanPreviousEdge
GNEEdge * getPersonPlanPreviousEdge() const
get previous edge for the current person plan
Definition: GNEFrameModules.cpp:697
GUISUMOAbstractView::getVisualisationSettings
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Definition: GUISUMOAbstractView.cpp:1429
SUMO_TAG_PERSONFLOW
@ SUMO_TAG_PERSONFLOW
Definition: SUMOXMLDefinitions.h:336
SUMO_TAG_CLOSING_LANE_REROUTE
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
Definition: SUMOXMLDefinitions.h:119
GNEVehicle.h
MID_HELP
@ MID_HELP
help button
Definition: GUIAppEnum.h:610
GNE_TAG_TRANSHIP_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_CONTAINERSTOP
Definition: SUMOXMLDefinitions.h:448
GUIVisualizationCandidateColorSettings::conflict
static const RGBColor conflict
color for selected conflict candidate element (Usually selected using ctrl+click)
Definition: GUIVisualizationSettings.h:280
GNEFrameModules::HierarchicalElementTree::onCmdShowChildMenu
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
Definition: GNEFrameModules.cpp:892
GNEViewNetHelper::ObjectsUnderCursor::getClickedAttributeCarriers
const std::vector< GNEAttributeCarrier * > & getClickedAttributeCarriers() const
get vector with clicked ACs
Definition: GNEViewNetHelper.cpp:491
GNEFrameModules::SelectorParent::myParentsList
FXList * myParentsList
List of parents.
Definition: GNEFrameModules.h:438
GUIVisualizationCandidateColorSettings::special
static const RGBColor special
color for selected special candidate element (Usually selected using shift+click)
Definition: GUIVisualizationSettings.h:277
GNEFrameModules::SelectorParent::setIDSelected
void setIDSelected(const std::string &id)
select manually a element of the list
Definition: GNEFrameModules.cpp:1891
GNEFrameModules::DrawingShape::setDeleteLastCreatedPoint
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
Definition: GNEFrameModules.cpp:1829
GNEStop.h
SUMO_TAG_STOP_BUSSTOP
@ SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
Definition: SUMOXMLDefinitions.h:216
GNEFrameModules::HierarchicalElementTree::removeCurrentEditedAttributeCarrier
void removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier *HE)
if given AttributeCarrier is the same of myHE, set it as nullptr
Definition: GNEFrameModules.cpp:883
GNEFrameModules::PathCreator::Path::isConflictVClass
bool isConflictVClass() const
check if current path is conflict due vClass
Definition: GNEFrameModules.cpp:2290
GNE_TAG_WAYPOINT_PARKINGAREA
@ GNE_TAG_WAYPOINT_PARKINGAREA
waypoint placed over a parking area (used in netedit)
Definition: SUMOXMLDefinitions.h:430
GNEContainerStop
A lane area vehicles can halt at (netedit-version)
Definition: GNEContainerStop.h:33
SUMO_TAG_INTERVAL
@ SUMO_TAG_INTERVAL
an aggreagated-output interval
Definition: SUMOXMLDefinitions.h:113
GNEInspectorFrame.h
GNEPOI.h
MFXUtils::getFXColor
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:112
GNEFrameModules::DemandElementSelector::setDemandElement
void setDemandElement(GNEDemandElement *demandElement)
set current demand element
Definition: GNEFrameModules.cpp:590
GNEDetectorE1Instant
Definition: GNEDetectorE1Instant.h:32
GNEFrameModules::OverlappedInspection::onCmdPreviousElement
long onCmdPreviousElement(FXObject *, FXSelector, void *)
Inspect previous element (from top to bot)
Definition: GNEFrameModules.cpp:2104
GNEFrameModules::HierarchicalElementTree::createPopUpMenu
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *clickedAC)
Definition: GNEFrameModules.cpp:1038
GNE_TAG_PERSONTRIP_JUNCTIONS
@ GNE_TAG_PERSONTRIP_JUNCTIONS
Definition: SUMOXMLDefinitions.h:418
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:583
MID_GNE_OVERLAPPED_PREVIOUS
@ MID_GNE_OVERLAPPED_PREVIOUS
inspect previous element in overlapped modul
Definition: GUIAppEnum.h:879
SUMO_TAG_ACCESS
@ SUMO_TAG_ACCESS
An access point for a train stop.
Definition: SUMOXMLDefinitions.h:69
SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_DATAINTERVAL
Definition: SUMOXMLDefinitions.h:342
GNEFrameModules::PathCreator::addEdge
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
Definition: GNEFrameModules.cpp:2542
GNEJunction
Definition: GNEJunction.h:48
GNENet::getPathManager
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:131
GNECandidateElement::isPossibleCandidate
bool isPossibleCandidate() const
check if this element is a possible candidate
Definition: GNECandidateElement.cpp:56
GNENetHelper::AttributeCarriers::retrieveLane
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
Definition: GNENetHelper.cpp:696
SUMO_TAG_CALIBRATOR
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
Definition: SUMOXMLDefinitions.h:105
GNEFrameModules::TagSelector::getCurrentTemplateAC
GNEAttributeCarrier * getCurrentTemplateAC() const
get current templateAC
Definition: GNEFrameModules.cpp:193
SUMO_TAG_EDGEREL
@ SUMO_TAG_EDGEREL
a relation between two edges
Definition: SUMOXMLDefinitions.h:191
GNENetHelper::AttributeCarriers::retrieveDataSet
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
Definition: GNENetHelper.cpp:1593
GNERouteProbReroute.h
DEFAULT_BIKETYPE_ID
const std::string DEFAULT_BIKETYPE_ID
GNE_TAG_WALK_ROUTE
@ GNE_TAG_WALK_ROUTE
Definition: SUMOXMLDefinitions.h:435
GNE_TAG_PERSONTRIP_BUSSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP
Definition: SUMOXMLDefinitions.h:417
SUMO_TAG_E1DETECTOR
@ SUMO_TAG_E1DETECTOR
an e1 detector
Definition: SUMOXMLDefinitions.h:79
GNE_TAG_TRANSPORT_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP
Definition: SUMOXMLDefinitions.h:445
GNETranship.h
GNEChargingStation.h
SUMO_TAG_E2DETECTOR
@ SUMO_TAG_E2DETECTOR
an e2 detector
Definition: SUMOXMLDefinitions.h:83
GNEFrameModules::OverlappedInspection::onCmdListItemSelected
long onCmdListItemSelected(FXObject *, FXSelector, void *)
called when a list item is selected
Definition: GNEFrameModules.cpp:2171
GNEDataInterval.h
GUIDesigns::buildFXMenuCommand
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
Definition: GUIDesigns.cpp:42
GNEParkingAreaReroute
Definition: GNEParkingAreaReroute.h:40
SUMO_TAG_DET_EXIT
@ SUMO_TAG_DET_EXIT
an e3 exit point
Definition: SUMOXMLDefinitions.h:99
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNE_TAG_CALIBRATOR_FLOW
@ GNE_TAG_CALIBRATOR_FLOW
a flow definition within in Calibrator
Definition: SUMOXMLDefinitions.h:109
SUMO_TAG_VTYPE_DISTRIBUTION
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
Definition: SUMOXMLDefinitions.h:242
GNEFrameModules::OverlappedInspection::nextElement
bool nextElement(const Position &clickedPosition)
try to go to next element if clicked position is near to saved position
Definition: GNEFrameModules.cpp:2068
GNEFrameModules
Definition: GNEFrameModules.h:41
GNEFrameModules::HierarchicalElementTree::hideHierarchicalElementTree
void hideHierarchicalElementTree()
hide HierarchicalElementTree
Definition: GNEFrameModules.cpp:848
GNELane2laneConnection::exist
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given tolane
Definition: GNELane2laneConnection.cpp:74
GNEEdge::getToJunction
GNEJunction * getToJunction() const
get from Junction (only used to increase readability)
Definition: GNEEdge.h:82
MFXIconComboBox
ComboBox with icon.
Definition: MFXIconComboBox.h:53
GNEFrameModules::HierarchicalElementTree::onCmdDeleteItem
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user click over option "delete" of child menu
Definition: GNEFrameModules.cpp:941
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:290
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:48
MFXMenuHeader
Definition: MFXMenuHeader.h:26
GNEFrameModules::DrawingShape::getTemporalShape
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrameModules.cpp:1817
GNENet.h
SUMO_TAG_TRIP
@ SUMO_TAG_TRIP
a single trip definition (used by router)
Definition: SUMOXMLDefinitions.h:145
GNEChange_Children.h
SUMO_TAG_INSTANT_INDUCTION_LOOP
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
Definition: SUMOXMLDefinitions.h:103
MID_GNE_OVERLAPPED_SHOWLIST
@ MID_GNE_OVERLAPPED_SHOWLIST
show list of overlapped elements
Definition: GUIAppEnum.h:881
SUMO_TAG_JUNCTION
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
Definition: SUMOXMLDefinitions.h:57
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:192
GNEUndoList.h
FXDEFMAP
FXDEFMAP(GNEFrameModules::TagSelector) TagSelectorMap[]
GNEFrameModules::PathCreator::myAbortCreationButton
FXButton * myAbortCreationButton
button for abort route creation
Definition: GNEFrameModules.h:755
GUIDesignDialogBox
#define GUIDesignDialogBox
Definition: GUIDesigns.h:524
GNETagProperties
Definition: GNETagProperties.h:38
GNETAZSourceSink
Definition: GNETAZSourceSink.h:32
GNE_TAG_WALK_EDGE
@ GNE_TAG_WALK_EDGE
Definition: SUMOXMLDefinitions.h:432
GNEPersonTrip
Definition: GNEPersonTrip.h:36
GNEFrameModules::buildRainbow
static FXLabel * buildRainbow(FXComposite *parent)
build rainbow in frame modul
Definition: GNEFrameModules.cpp:3161
GNEConnection.h
GNEFrameModules::DemandElementSelector::getCurrentDemandElement
GNEDemandElement * getCurrentDemandElement() const
get current demand element
Definition: GNEFrameModules.cpp:578
GNEFrameModules::DrawingShape::stopDrawing
void stopDrawing()
stop drawing and check if shape can be created
Definition: GNEFrameModules.cpp:1771