Eclipse SUMO - Simulation of Urban MObility
GNEElementTree.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 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 // Frame for show hierarchical elements
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>
35 
36 #include "GNEElementTree.h"
37 
38 
39 // ===========================================================================
40 // FOX callback mapping
41 // ===========================================================================
42 
43 FXDEFMAP(GNEElementTree) HierarchicalElementTreeMap[] = {
44  FXMAPFUNC(SEL_COMMAND, MID_GNE_CENTER, GNEElementTree::onCmdCenterItem),
45  FXMAPFUNC(SEL_COMMAND, MID_GNE_INSPECT, GNEElementTree::onCmdInspectItem),
46  FXMAPFUNC(SEL_COMMAND, MID_GNE_DELETE, GNEElementTree::onCmdDeleteItem),
50 };
51 
52 
53 // Object implementation
54 FXIMPLEMENT(GNEElementTree, MFXGroupBoxModule, HierarchicalElementTreeMap, ARRAYNUMBER(HierarchicalElementTreeMap))
55 
56 
57 // ===========================================================================
58 // method definitions
59 // ===========================================================================
60 
62  MFXGroupBoxModule(frameParent, TL("Hierarchy")),
63  myFrameParent(frameParent),
64  myHE(nullptr),
65  myClickedAC(nullptr),
66  myClickedJunction(nullptr),
67  myClickedEdge(nullptr),
68  myClickedLane(nullptr),
69  myClickedCrossing(nullptr),
70  myClickedConnection(nullptr),
71  myClickedAdditional(nullptr),
72  myClickedDemandElement(nullptr),
73  myClickedDataSet(nullptr),
74  myClickedDataInterval(nullptr),
75  myClickedGenericData(nullptr) {
76  // Create tree list with fixed height
77  myTreeListDynamic = new MFXTreeListDynamic(getCollapsableFrame(), this, MID_GNE_ACHIERARCHY_SHOWCHILDMENU, GUIDesignTreeListFixedHeight);
78  hide();
79 }
80 
81 
83 
84 
85 void
87  myHE = dynamic_cast<GNEHierarchicalElement*>(AC);
88  // show GNEElementTree and refresh GNEElementTree
89  if (myHE) {
90  // refresh GNEElementTree
92  // show myTreeListDynamic
94  // show module
95  show();
96  }
97 }
98 
99 
100 void
102  // set all pointers null
103  myHE = nullptr;
104  myClickedAC = nullptr;
105  myClickedJunction = nullptr;
106  myClickedEdge = nullptr;
107  myClickedLane = nullptr;
108  myClickedCrossing = nullptr;
109  myClickedConnection = nullptr;
110  myClickedAdditional = nullptr;
111  myClickedDemandElement = nullptr;
112  myClickedDataSet = nullptr;
113  myClickedDataInterval = nullptr;
114  myClickedGenericData = nullptr;
115  // hide myTreeListDynamic
117  // hide module
118  hide();
119 }
120 
121 
122 void
124  // clear items
126  myTreeItemToACMap.clear();
127  myTreeItemsConnections.clear();
128  // show children of myHE
129  if (myHE) {
131  }
132 }
133 
134 
135 void
137  // simply check if AC is the same of myHE
138  if (AC == myHE) {
139  myHE = nullptr;
140  }
141 }
142 
143 
144 long
145 GNEElementTree::onCmdShowChildMenu(FXObject*, FXSelector, void* eventData) {
146  // obtain event
147  FXEvent* e = (FXEvent*)eventData;
148  // obtain FXTreeItem in the given position
149  FXTreeItem* item = myTreeListDynamic->getItemAt(e->win_x, e->win_y);
150  // open Pop-up if FXTreeItem has a Attribute Carrier vinculated
151  if (item && (myTreeItemsConnections.find(item) == myTreeItemsConnections.end())) {
152  createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[item]);
153  }
154  return 1;
155 }
156 
157 
158 long
159 GNEElementTree::onCmdCenterItem(FXObject*, FXSelector, void*) {
160  // Center item
161  if (myClickedJunction) {
163  } else if (myClickedEdge) {
165  } else if (myClickedLane) {
167  } else if (myClickedCrossing) {
169  } else if (myClickedConnection) {
171  } else if (myClickedAdditional) {
173  } else if (myClickedDemandElement) {
175  } else if (myClickedGenericData) {
177  }
178  // update view after centering
180  return 1;
181 }
182 
183 
184 long
185 GNEElementTree::onCmdInspectItem(FXObject*, FXSelector, void*) {
186  if ((myHE != nullptr) && (myClickedAC != nullptr)) {
188  }
189  return 1;
190 }
191 
192 
193 long
194 GNEElementTree::onCmdDeleteItem(FXObject*, FXSelector, void*) {
195  // Remove Attribute Carrier
196  if (myClickedJunction) {
198  } else if (myClickedEdge) {
200  } else if (myClickedLane) {
202  } else if (myClickedCrossing) {
204  } else if (myClickedConnection) {
206  } else if (myClickedAdditional) {
208  } else if (myClickedDemandElement) {
209  // check that default VTypes aren't removed
211  WRITE_WARNINGF(TL("Default Vehicle Type '%' cannot be removed"), myClickedDemandElement->getAttribute(SUMO_ATTR_ID));
212  return 1;
213  } else if (myClickedDemandElement->getTagProperty().isPlan()) {
214  // we need to check if we're removing the last person plan of a person.
215  auto planParent = myClickedDemandElement->getParentDemandElements().front();
216  if (planParent->getChildDemandElements().size() == 1) {
218  } else {
220  }
221  }
222  } else if (myClickedDataSet) {
224  } else if (myClickedDataInterval) {
225  // check if we have to remove data Set
228  } else {
230  }
231  } else if (myClickedGenericData) {
232  // check if we have to remove interval
234  // check if we have to remove data Set
237  } else {
239  }
240  } else {
242  }
243  }
244  // update net
246  // refresh AC Hierarchy
248  // check if inspector frame has to be shown again
252  } else {
253  // inspect a nullptr element to reset inspector frame
255  }
256  }
257  return 1;
258 }
259 
260 
261 long
262 GNEElementTree::onCmdMoveItemUp(FXObject*, FXSelector, void*) {
263  // currently only children of demand elements can be moved
266  // move element one position back
268  GNEChange_Children::Operation::MOVE_BACK), true);
270  }
271  // refresh after moving child
273  return 1;
274 }
275 
276 
277 long
278 GNEElementTree::onCmdMoveItemDown(FXObject*, FXSelector, void*) {
279  // currently only children of demand elements can be moved
282  // move element one position front
284  GNEChange_Children::Operation::MOVE_FRONT), true);
286  }
287  // refresh after moving child
289  return 1;
290 }
291 
292 
293 void
295  // get attributeCarriers
296  const auto& attributeCarriers = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
297  // first check that AC exist
298  if (clickedAC) {
299  // set current clicked AC
300  myClickedAC = clickedAC;
301  // cast all elements
302  myClickedJunction = attributeCarriers->retrieveJunction(clickedAC->getID(), false);
303  myClickedEdge = attributeCarriers->retrieveEdge(clickedAC->getID(), false);
304  myClickedLane = attributeCarriers->retrieveLane(clickedAC->getGUIGlObject(), false);
305  myClickedCrossing = attributeCarriers->retrieveCrossing(clickedAC->getGUIGlObject(), false);
306  myClickedConnection = attributeCarriers->retrieveConnection(clickedAC->getGUIGlObject(), false);
307  myClickedAdditional = attributeCarriers->retrieveAdditional(clickedAC->getGUIGlObject(), false);
308  myClickedDemandElement = attributeCarriers->retrieveDemandElement(clickedAC->getGUIGlObject(), false);
309  myClickedDataSet = attributeCarriers->retrieveDataSet(clickedAC->getID(), false);
310  myClickedDataInterval = attributeCarriers->retrieveDataInterval(clickedAC, false);
311  myClickedGenericData = attributeCarriers->retrieveGenericData(clickedAC->getGUIGlObject(), false);
312  // create FXMenuPane
313  FXMenuPane* pane = new FXMenuPane(myTreeListDynamic->getFXWindow());
314  // set item name and icon
316  // insert separator
317  new FXMenuSeparator(pane);
318  // create center menu command
319  FXMenuCommand* centerMenuCommand = GUIDesigns::buildFXMenuCommand(pane, TL("Center"), GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_GNE_CENTER);
320  // disable Centering for Vehicle Types, data sets and data intervals
323  centerMenuCommand->disable();
324  }
325  // create inspect and delete menu commands
326  FXMenuCommand* inspectMenuCommand = GUIDesigns::buildFXMenuCommand(pane, TL("Inspect"), GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), this, MID_GNE_INSPECT);
327  FXMenuCommand* deleteMenuCommand = GUIDesigns::buildFXMenuCommand(pane, TL("Delete"), GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), this, MID_GNE_DELETE);
328  // check if inspect and delete menu commands has to be disabled
330  inspectMenuCommand->disable();
331  deleteMenuCommand->disable();
332  }
333  // now check if given AC support manually moving of their item up and down (Currently only for certain demand elements)
334  /* if (myClickedDemandElement && myClickedAC->getTagProperty().canBeSortedManually()) {
335  // insert separator
336  new FXMenuSeparator(pane);
337  // create both moving menu commands
338  FXMenuCommand* moveUpMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(GUIIcon::ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP);
339  FXMenuCommand* moveDownMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(GUIIcon::ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN);
340  // check if both commands has to be disabled
341  if (myClickedDemandElement->getTagProperty().isPlanStopPerson()) {
342  moveUpMenuCommand->setText(TL("Move up (Stops cannot be moved)"));
343  moveDownMenuCommand->setText(TL("Move down (Stops cannot be moved)"));
344  moveUpMenuCommand->disable();
345  moveDownMenuCommand->disable();
346  } else {
347  // check if moveUpMenuCommand has to be disabled
348  if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().front() == myClickedDemandElement) {
349  moveUpMenuCommand->setText(TL("Move up (It's already the first element)"));
350  moveUpMenuCommand->disable();
351  } else if (myClickedDemandElement->getParentDemandElements().front()->getPreviousChildDemandElement(myClickedDemandElement)->getTagProperty().isPlanStopPerson()) {
352  moveUpMenuCommand->setText(TL("Move up (Previous element is a Stop)"));
353  moveUpMenuCommand->disable();
354  }
355  // check if moveDownMenuCommand has to be disabled
356  if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().back() == myClickedDemandElement) {
357  moveDownMenuCommand->setText(TL("Move down (It's already the last element)"));
358  moveDownMenuCommand->disable();
359  } else if (myClickedDemandElement->getParentDemandElements().front()->getNextChildDemandElement(myClickedDemandElement)->getTagProperty().isPlanStopPerson()) {
360  moveDownMenuCommand->setText(TL("Move down (Next element is a Stop)"));
361  moveDownMenuCommand->disable();
362  }
363  }
364  } */
365  // Center in the mouse position and create pane
366  pane->setX(X);
367  pane->setY(Y);
368  pane->create();
369  pane->show();
370  } else {
371  // set all clicked elements to null
372  myClickedAC = nullptr;
373  myClickedJunction = nullptr;
374  myClickedEdge = nullptr;
375  myClickedLane = nullptr;
376  myClickedCrossing = nullptr;
377  myClickedConnection = nullptr;
378  myClickedAdditional = nullptr;
379  myClickedDemandElement = nullptr;
380  myClickedDataSet = nullptr;
381  myClickedDataInterval = nullptr;
382  myClickedGenericData = nullptr;
383  }
384 }
385 
386 
387 FXTreeItem*
389  // get attributeCarriers
390  const auto& attributeCarriers = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
391  // check tags
393  // check demand element type
394  switch (myHE->getTagProperty().getTag()) {
395  case SUMO_TAG_EDGE: {
396  // obtain Edge
397  GNEEdge* edge = attributeCarriers->retrieveEdge(myHE->getID(), false);
398  if (edge) {
399  // insert Junctions of edge in tree (Parallel because an edge has always two Junctions)
400  FXTreeItem* junctionSourceItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" origin")).c_str(), edge->getFromJunction()->getACIcon());
401  FXTreeItem* junctionDestinationItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" destination")).c_str(), edge->getFromJunction()->getACIcon());
402  junctionDestinationItem->setExpanded(true);
403  // Save items in myTreeItemToACMap
404  myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
405  myTreeItemToACMap[junctionDestinationItem] = edge->getToJunction();
406  // return junction destination Item
407  return junctionDestinationItem;
408  } else {
409  return nullptr;
410  }
411  }
412  case SUMO_TAG_LANE: {
413  // obtain lane
414  GNELane* lane = attributeCarriers->retrieveLane(myHE->getID(), false);
415  if (lane) {
416  // obtain parent edge
417  GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID());
418  //insert Junctions of lane of edge in tree (Parallel because an edge has always two Junctions)
419  FXTreeItem* junctionSourceItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" origin")).c_str(), edge->getFromJunction()->getACIcon());
420  FXTreeItem* junctionDestinationItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" destination")).c_str(), edge->getFromJunction()->getACIcon());
421  junctionDestinationItem->setExpanded(true);
422  // Create edge item
423  FXTreeItem* edgeItem = myTreeListDynamic->appendItem(junctionDestinationItem, edge->getHierarchyName().c_str(), edge->getACIcon());
424  edgeItem->setExpanded(true);
425  // Save items in myTreeItemToACMap
426  myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
427  myTreeItemToACMap[junctionDestinationItem] = edge->getToJunction();
428  myTreeItemToACMap[edgeItem] = edge;
429  // return edge item
430  return edgeItem;
431  } else {
432  return nullptr;
433  }
434  }
435  case SUMO_TAG_CROSSING: {
436  // obtain crossing parent junction
437  GNEJunction* junction = attributeCarriers->retrieveCrossing(myHE->getGUIGlObject())->getParentJunction();
438  // create junction item
439  FXTreeItem* junctionItem = myTreeListDynamic->appendItem(nullptr, junction->getHierarchyName().c_str(), junction->getACIcon());
440  junctionItem->setExpanded(true);
441  // Save items in myTreeItemToACMap
442  myTreeItemToACMap[junctionItem] = junction;
443  // return junction Item
444  return junctionItem;
445  }
446  case SUMO_TAG_CONNECTION: {
447  // obtain Connection
448  GNEConnection* connection = attributeCarriers->retrieveConnection(myHE->getID(), false);
449  if (connection) {
450  // create edge from item
451  FXTreeItem* edgeFromItem = myTreeListDynamic->appendItem(nullptr, connection->getEdgeFrom()->getHierarchyName().c_str(), connection->getEdgeFrom()->getACIcon());
452  edgeFromItem->setExpanded(true);
453  // create edge to item
454  FXTreeItem* edgeToItem = myTreeListDynamic->appendItem(nullptr, connection->getEdgeTo()->getHierarchyName().c_str(), connection->getEdgeTo()->getACIcon());
455  edgeToItem->setExpanded(true);
456  // create connection item
457  FXTreeItem* connectionItem = myTreeListDynamic->appendItem(edgeToItem, connection->getHierarchyName().c_str(), connection->getACIcon());
458  connectionItem->setExpanded(true);
459  // Save items in myTreeItemToACMap
460  myTreeItemToACMap[edgeFromItem] = connection->getEdgeFrom();
461  myTreeItemToACMap[edgeToItem] = connection->getEdgeTo();
462  myTreeItemToACMap[connectionItem] = connection;
463  // return connection item
464  return connectionItem;
465  } else {
466  return nullptr;
467  }
468  }
469  default:
470  break;
471  }
472  } else if (myHE->getTagProperty().getTag() == GNE_TAG_POILANE) {
473  // Obtain POILane
475  // obtain parent lane
476  GNELane* lane = attributeCarriers->retrieveLane(POILane->getParentLanes().at(0)->getID());
477  // obtain parent edge
478  GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID());
479  //insert Junctions of lane of edge in tree (Parallel because an edge has always two Junctions)
480  FXTreeItem* junctionSourceItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" origin")).c_str(), edge->getFromJunction()->getACIcon());
481  FXTreeItem* junctionDestinationItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" destination")).c_str(), edge->getFromJunction()->getACIcon());
482  junctionDestinationItem->setExpanded(true);
483  // Create edge item
484  FXTreeItem* edgeItem = myTreeListDynamic->appendItem(junctionDestinationItem, edge->getHierarchyName().c_str(), edge->getACIcon());
485  edgeItem->setExpanded(true);
486  // Create lane item
487  FXTreeItem* laneItem = myTreeListDynamic->appendItem(edgeItem, lane->getHierarchyName().c_str(), lane->getACIcon());
488  laneItem->setExpanded(true);
489  // Save items in myTreeItemToACMap
490  myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
491  myTreeItemToACMap[junctionDestinationItem] = edge->getToJunction();
492  myTreeItemToACMap[edgeItem] = edge;
493  myTreeItemToACMap[laneItem] = lane;
494  // return Lane item
495  return laneItem;
496  } else if (myHE->getTagProperty().isAdditionalElement()) {
497  // Obtain Additional
498  const GNEAdditional* additional = attributeCarriers->retrieveAdditional(myHE->getGUIGlObject());
499  // declare auxiliary FXTreeItem, due a demand element can have multiple "roots"
500  FXTreeItem* root = nullptr;
501  // check if there is demand elements parents
502  if (additional->getParentAdditionals().size() > 0) {
503  // check if we have more than one edge
504  if (additional->getParentAdditionals().size() > 1) {
505  // insert first item
506  addListItem(additional->getParentAdditionals().front());
507  // insert "spacer"
508  if (additional->getParentAdditionals().size() > 2) {
509  addListItem(nullptr, ("..." + toString((int)additional->getParentAdditionals().size() - 2) + TL(" additionals...")).c_str(), 0, false);
510  }
511  }
512  // return last inserted item
513  root = addListItem(additional->getParentAdditionals().back());
514  }
515  // check if there is parent demand elements
516  if (additional->getParentDemandElements().size() > 0) {
517  // check if we have more than one demand element
518  if (additional->getParentDemandElements().size() > 1) {
519  // insert first item
520  addListItem(additional->getParentDemandElements().front());
521  // insert "spacer"
522  if (additional->getParentDemandElements().size() > 2) {
523  addListItem(nullptr, ("..." + toString((int)additional->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
524  }
525  }
526  // return last inserted item
527  root = addListItem(additional->getParentDemandElements().back());
528  }
529  // check if there is parent edges
530  if (additional->getParentEdges().size() > 0) {
531  // check if we have more than one edge
532  if (additional->getParentEdges().size() > 1) {
533  // insert first item
534  addListItem(additional->getParentEdges().front());
535  // insert "spacer"
536  if (additional->getParentEdges().size() > 2) {
537  addListItem(nullptr, ("..." + toString((int)additional->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
538  }
539  }
540  // return last inserted item
541  root = addListItem(additional->getParentEdges().back());
542  }
543  // check if there is parent lanes
544  if (additional->getParentLanes().size() > 0) {
545  // check if we have more than one parent lane
546  if (additional->getParentLanes().size() > 1) {
547  // insert first item
548  addListItem(additional->getParentLanes().front());
549  // insert "spacer"
550  if (additional->getParentLanes().size() > 2) {
551  addListItem(nullptr, ("..." + toString((int)additional->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
552  }
553  }
554  // return last inserted item
555  root = addListItem(additional->getParentLanes().back());
556  }
557  // return last inserted list item
558  return root;
559  } else if (myHE->getTagProperty().isTAZElement()) {
560  // Obtain TAZElement
562  // declare auxiliary FXTreeItem, due a demand element can have multiple "roots"
563  FXTreeItem* root = nullptr;
564  // check if there is demand elements parents
565  if (TAZElement->getParentAdditionals().size() > 0) {
566  // check if we have more than one edge
567  if (TAZElement->getParentAdditionals().size() > 1) {
568  // insert first item
569  addListItem(TAZElement->getParentAdditionals().front());
570  // insert "spacer"
571  if (TAZElement->getParentAdditionals().size() > 2) {
572  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentAdditionals().size() - 2) + TL(" TAZElements...")).c_str(), 0, false);
573  }
574  }
575  // return last inserted item
576  root = addListItem(TAZElement->getParentAdditionals().back());
577  }
578  // check if there is parent demand elements
579  if (TAZElement->getParentDemandElements().size() > 0) {
580  // check if we have more than one demand element
581  if (TAZElement->getParentDemandElements().size() > 1) {
582  // insert first item
583  addListItem(TAZElement->getParentDemandElements().front());
584  // insert "spacer"
585  if (TAZElement->getParentDemandElements().size() > 2) {
586  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
587  }
588  }
589  // return last inserted item
590  root = addListItem(TAZElement->getParentDemandElements().back());
591  }
592  // check if there is parent edges
593  if (TAZElement->getParentEdges().size() > 0) {
594  // check if we have more than one edge
595  if (TAZElement->getParentEdges().size() > 1) {
596  // insert first item
597  addListItem(TAZElement->getParentEdges().front());
598  // insert "spacer"
599  if (TAZElement->getParentEdges().size() > 2) {
600  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
601  }
602  }
603  // return last inserted item
604  root = addListItem(TAZElement->getParentEdges().back());
605  }
606  // check if there is parent lanes
607  if (TAZElement->getParentLanes().size() > 0) {
608  // check if we have more than one parent lane
609  if (TAZElement->getParentLanes().size() > 1) {
610  // insert first item
611  addListItem(TAZElement->getParentLanes().front());
612  // insert "spacer"
613  if (TAZElement->getParentLanes().size() > 2) {
614  addListItem(nullptr, ("..." + toString((int)TAZElement->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
615  }
616  }
617  // return last inserted item
618  root = addListItem(TAZElement->getParentLanes().back());
619  }
620  // return last inserted list item
621  return root;
622  } else if (myHE->getTagProperty().isDemandElement()) {
623  // Obtain DemandElement
625  // declare auxiliar FXTreeItem, due a demand element can have multiple "roots"
626  FXTreeItem* root = nullptr;
627  // check if there are demand element parents
628  if (demandElement->getParentAdditionals().size() > 0) {
629  // check if we have more than one edge
630  if (demandElement->getParentAdditionals().size() > 1) {
631  // insert first item
632  addListItem(demandElement->getParentAdditionals().front());
633  // insert "spacer"
634  if (demandElement->getParentAdditionals().size() > 2) {
635  addListItem(nullptr, ("..." + toString((int)demandElement->getParentAdditionals().size() - 2) + TL(" additionals...")).c_str(), 0, false);
636  }
637  }
638  // return last inserted item
639  root = addListItem(demandElement->getParentAdditionals().back());
640  }
641  // check if there is parent demand elements
642  if (demandElement->getParentDemandElements().size() > 0) {
643  // check if we have more than one demand element
644  if (demandElement->getParentDemandElements().size() > 1) {
645  // insert first item
646  addListItem(demandElement->getParentDemandElements().front());
647  // insert "spacer"
648  if (demandElement->getParentDemandElements().size() > 2) {
649  addListItem(nullptr, ("..." + toString((int)demandElement->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
650  }
651  }
652  // return last inserted item
653  root = addListItem(demandElement->getParentDemandElements().back());
654  }
655  // check if there is parent edges
656  if (demandElement->getParentEdges().size() > 0) {
657  // check if we have more than one edge
658  if (demandElement->getParentEdges().size() > 1) {
659  // insert first item
660  addListItem(demandElement->getParentEdges().front());
661  // insert "spacer"
662  if (demandElement->getParentEdges().size() > 2) {
663  addListItem(nullptr, ("..." + toString((int)demandElement->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
664  }
665  }
666  // return last inserted item
667  root = addListItem(demandElement->getParentEdges().back());
668  }
669  // check if there is parent lanes
670  if (demandElement->getParentLanes().size() > 0) {
671  // check if we have more than one parent lane
672  if (demandElement->getParentLanes().size() > 1) {
673  // insert first item
674  addListItem(demandElement->getParentLanes().front());
675  // insert "spacer"
676  if (demandElement->getParentLanes().size() > 2) {
677  addListItem(nullptr, ("..." + toString((int)demandElement->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
678  }
679  }
680  // return last inserted item
681  root = addListItem(demandElement->getParentLanes().back());
682  }
683  // return last inserted list item
684  return root;
685  } else if (myHE->getTagProperty().isDataElement()) {
686  // check if is a GNEDataInterval or a GNEGenericData
688  return nullptr;
689  } else if (myHE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
691  } else {
692  // Obtain DataElement
693  GNEGenericData* dataElement = dynamic_cast<GNEGenericData*>(myHE);
694  if (dataElement) {
695  // declare auxiliary FXTreeItem, due a data element can have multiple "roots"
696  FXTreeItem* root = nullptr;
697  // set dataset
699  // set data interval
700  addListItem(dataElement->getDataIntervalParent());
701  // check if there is data elements parents
702  if (dataElement->getParentAdditionals().size() > 0) {
703  // check if we have more than one edge
704  if (dataElement->getParentAdditionals().size() > 1) {
705  // insert first item
706  addListItem(dataElement->getParentAdditionals().front());
707  // insert "spacer"
708  if (dataElement->getParentAdditionals().size() > 2) {
709  addListItem(nullptr, ("..." + toString((int)dataElement->getParentAdditionals().size() - 2) + TL(" additionals...")).c_str(), 0, false);
710  }
711  }
712  // return last inserted item
713  root = addListItem(dataElement->getParentAdditionals().back());
714  }
715  // check if there is parent demand elements
716  if (dataElement->getParentDemandElements().size() > 0) {
717  // check if we have more than one demand element
718  if (dataElement->getParentDemandElements().size() > 1) {
719  // insert first item
720  addListItem(dataElement->getParentDemandElements().front());
721  // insert "spacer"
722  if (dataElement->getParentDemandElements().size() > 2) {
723  addListItem(nullptr, ("..." + toString((int)dataElement->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
724  }
725  }
726  // return last inserted item
727  root = addListItem(dataElement->getParentDemandElements().back());
728  }
729  // check if there is parent edges
730  if (dataElement->getParentEdges().size() > 0) {
731  // check if we have more than one edge
732  if (dataElement->getParentEdges().size() > 1) {
733  // insert first ege
734  if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) {
735  addListItem(dataElement->getParentEdges().front(), nullptr, "from ");
736  } else {
737  addListItem(dataElement->getParentEdges().front());
738  }
739  // insert "spacer"
740  if (dataElement->getParentEdges().size() > 2) {
741  addListItem(nullptr, ("..." + toString((int)dataElement->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
742  }
743  }
744  // insert last ege
745  if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) {
746  addListItem(dataElement->getParentEdges().back(), nullptr, "to ");
747  } else {
748  addListItem(dataElement->getParentEdges().back());
749  }
750  }
751  // check if there is parent lanes
752  if (dataElement->getParentLanes().size() > 0) {
753  // check if we have more than one parent lane
754  if (dataElement->getParentLanes().size() > 1) {
755  // insert first item
756  addListItem(dataElement->getParentLanes().front());
757  // insert "spacer"
758  if (dataElement->getParentLanes().size() > 2) {
759  addListItem(nullptr, ("..." + toString((int)dataElement->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
760  }
761  }
762  // return last inserted item
763  root = addListItem(dataElement->getParentLanes().back());
764  }
765  // return last inserted list item
766  return root;
767  }
768  }
769  }
770  // there aren't parents
771  return nullptr;
772 }
773 
774 
775 void
777  if (HE->getTagProperty().isNetworkElement()) {
778  // Switch gl type of ac
779  switch (HE->getTagProperty().getTag()) {
780  case SUMO_TAG_JUNCTION: {
781  // retrieve junction
783  if (junction) {
784  // insert junction item
785  FXTreeItem* junctionItem = addListItem(HE, itemParent);
786  // insert edges
787  for (const auto& edge : junction->getChildEdges()) {
788  showHierarchicalElementChildren(edge, junctionItem);
789  }
790  // insert crossings
791  for (const auto& crossing : junction->getGNECrossings()) {
792  showHierarchicalElementChildren(crossing, junctionItem);
793  }
794  }
795  break;
796  }
797  case SUMO_TAG_EDGE: {
798  // retrieve edge
800  if (edge) {
801  // insert edge item
802  FXTreeItem* edgeItem = addListItem(HE, itemParent);
803  // insert lanes
804  for (const auto& lane : edge->getLanes()) {
805  showHierarchicalElementChildren(lane, edgeItem);
806  }
807  // insert child additional
808  for (const auto& additional : edge->getChildAdditionals()) {
809  showHierarchicalElementChildren(additional, edgeItem);
810  }
811  // insert child demand elements
812  for (const auto& demandElement : edge->getChildDemandElements()) {
813  showHierarchicalElementChildren(demandElement, edgeItem);
814  }
815  // insert child data elements
816  if (edge->getChildGenericDatas().size() > 0) {
817  // insert intermediate list item
818  FXTreeItem* dataElements = addListItem(edgeItem, TL("Data elements"), GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), false);
819  for (const auto& genericDatas : edge->getChildGenericDatas()) {
820  showHierarchicalElementChildren(genericDatas, dataElements);
821  }
822  }
823  }
824  break;
825  }
826  case SUMO_TAG_LANE: {
827  // retrieve lane
829  if (lane) {
830  // insert lane item
831  FXTreeItem* laneItem = addListItem(HE, itemParent);
832  // insert child additional
833  for (const auto& additional : lane->getChildAdditionals()) {
834  showHierarchicalElementChildren(additional, laneItem);
835  }
836  // insert demand elements children
837  for (const auto& demandElement : lane->getChildDemandElements()) {
838  showHierarchicalElementChildren(demandElement, laneItem);
839  }
840  // insert incoming connections of lanes (by default isn't expanded)
841  if (lane->getGNEIncomingConnections().size() > 0) {
842  std::vector<GNEConnection*> incomingLaneConnections = lane->getGNEIncomingConnections();
843  // insert intermediate list item
844  FXTreeItem* incomingConnections = addListItem(laneItem, TL("Incomings"), incomingLaneConnections.front()->getACIcon(), false);
845  // insert incoming connections
846  for (const auto& connection : incomingLaneConnections) {
847  showHierarchicalElementChildren(connection, incomingConnections);
848  }
849  }
850  // insert outcoming connections of lanes (by default isn't expanded)
851  if (lane->getGNEOutcomingConnections().size() > 0) {
852  std::vector<GNEConnection*> outcomingLaneConnections = lane->getGNEOutcomingConnections();
853  // insert intermediate list item
854  FXTreeItem* outgoingConnections = addListItem(laneItem, TL("Outgoing"), outcomingLaneConnections.front()->getACIcon(), false);
855  // insert outcoming connections
856  for (const auto& connection : outcomingLaneConnections) {
857  showHierarchicalElementChildren(connection, outgoingConnections);
858  }
859  }
860  }
861  break;
862  }
863  case SUMO_TAG_CROSSING:
864  case SUMO_TAG_CONNECTION: {
865  // insert connection item
866  addListItem(HE, itemParent);
867  break;
868  }
869  default:
870  break;
871  }
872  } else if (HE->getTagProperty().isAdditionalElement() || HE->getTagProperty().isDemandElement()) {
873  // insert additional item
874  FXTreeItem* treeItem = addListItem(HE, itemParent);
875  // insert child edges
876  for (const auto& edge : HE->getChildEdges()) {
877  showHierarchicalElementChildren(edge, treeItem);
878  }
879  // insert child lanes
880  for (const auto& lane : HE->getChildLanes()) {
881  showHierarchicalElementChildren(lane, treeItem);
882  }
883  // insert additional symbols
884  std::vector<GNEAdditional*> symbols;
885  for (const auto& additional : HE->getChildAdditionals()) {
886  if (additional->getTagProperty().isSymbol()) {
887  symbols.push_back(additional);
888  }
889  }
890  if (symbols.size() > 0) {
891  // insert intermediate list item
892  const auto additionalParent = symbols.front()->getParentAdditionals().front();
893  const std::string symbolType = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? TL("Edges") : TL("Lanes");
894  GUIIcon symbolIcon = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? GUIIcon::EDGE : GUIIcon::LANE;
895  FXTreeItem* symbolListItem = addListItem(treeItem, symbolType, GUIIconSubSys::getIcon(symbolIcon), false);
896  // insert symbols
897  for (const auto& symbol : symbols) {
898  showHierarchicalElementChildren(symbol, symbolListItem);
899  }
900  }
901  // insert additional children
902  for (const auto& additional : HE->getChildAdditionals()) {
903  if (!additional->getTagProperty().isSymbol()) {
904  showHierarchicalElementChildren(additional, treeItem);
905  }
906  }
907  // insert child demand elements
908  for (const auto& demandElement : HE->getChildDemandElements()) {
909  showHierarchicalElementChildren(demandElement, treeItem);
910  }
911  // insert child data elements
912  if (HE->getChildGenericDatas().size() > 0) {
913  // insert intermediate list item
914  FXTreeItem* dataElements = addListItem(treeItem, TL("Data elements"), GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), false);
915  for (const auto& genericDatas : HE->getChildGenericDatas()) {
916  showHierarchicalElementChildren(genericDatas, dataElements);
917  }
918  }
919  } else if (HE->getTagProperty().isDataElement()) {
920  // insert data item
921  FXTreeItem* dataElementItem = addListItem(HE, itemParent);
922  // insert intervals
923  if (HE->getTagProperty().getTag() == SUMO_TAG_DATASET) {
925  // iterate over intervals
926  for (const auto& interval : dataSet->getDataIntervalChildren()) {
927  showHierarchicalElementChildren(interval.second, dataElementItem);
928  }
929  } else if (HE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
930  GNEDataInterval* dataInterval = dynamic_cast<GNEDataInterval*>(HE);
931  // iterate over generic datas
932  for (const auto& genericData : dataInterval->getGenericDataChildren()) {
933  showHierarchicalElementChildren(genericData, dataElementItem);
934  }
935  }
936  }
937 }
938 
939 
940 FXTreeItem*
941 GNEElementTree::addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent, std::string prefix, std::string sufix) {
942  // insert item in Tree list
943  FXTreeItem* item = myTreeListDynamic->appendItem(itemParent, (prefix + AC->getHierarchyName() + sufix).c_str(), AC->getACIcon());
944  // insert item in map
945  myTreeItemToACMap[item] = AC;
946  // by default item is expanded
947  item->setExpanded(true);
948  // return created FXTreeItem
949  return item;
950 }
951 
952 
953 FXTreeItem*
954 GNEElementTree::addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded) {
955  // insert item in Tree list
956  FXTreeItem* item = myTreeListDynamic->appendItem(itemParent, text.c_str(), icon);
957  // expand item depending of flag expanded
958  item->setExpanded(expanded);
959  // return created FXTreeItem
960  return item;
961 }
962 
963 /****************************************************************************/
FXDEFMAP(GNEElementTree) HierarchicalElementTreeMap[]
@ MID_GNE_DELETE
delete element
Definition: GUIAppEnum.h:934
@ MID_GNE_CENTER
center element
Definition: GUIAppEnum.h:942
@ MID_GNE_ACHIERARCHY_SHOWCHILDMENU
In GNEElementTree list, show child menu.
Definition: GUIAppEnum.h:996
@ MID_GNE_ACHIERARCHY_MOVEUP
In GNEElementTree list, move element to up.
Definition: GUIAppEnum.h:998
@ MID_GNE_INSPECT
inspect element
Definition: GUIAppEnum.h:936
@ MID_GNE_ACHIERARCHY_MOVEDOWN
In GNEElementTree list, move element to down.
Definition: GUIAppEnum.h:1000
#define GUIDesignTreeListFixedHeight
tree list with fixed height
Definition: GUIDesigns.h:683
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
@ SUPERMODEDATA
@ RECENTERVIEW
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:296
#define TL(string)
Definition: MsgHandler.h:315
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_POILANE
Point of interest over Lane.
@ SUMO_TAG_DATASET
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_DEFAULT_VTYPE
Flag to check if VType is a default VType.
@ SUMO_ATTR_ID
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
const std::string getID() const
get ID (all Attribute Carriers have one)
FXIcon * getACIcon() const
get FXIcon associated to this AC
virtual std::string getPopUpID() const =0
get PopPup ID (Used in AC Hierarchy)
const std::string & getTagStr() const
get tag assigned to this object in string format
virtual GUIGlObject * getGUIGlObject()=0
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
An Element which don't belong to GNENet but has influence in the simulation.
GNEDataSet * getDataSetParent() const
Returns a pointer to GNEDataSet parent.
const std::vector< GNEGenericData * > & getGenericDataChildren() const
get generic data children
const std::map< const double, GNEDataInterval * > & getDataIntervalChildren() const
get data interval children
Definition: GNEDataSet.cpp:340
virtual std::string getAttribute(SumoXMLAttr key) const =0
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
GNEJunction * getFromJunction() const
get from Junction (only used to increase readability)
Definition: GNEEdge.h:77
GNEJunction * getToJunction() const
get from Junction (only used to increase readability)
Definition: GNEEdge.h:82
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:1047
std::set< FXTreeItem * > myTreeItemsConnections
set used to save tree items without AC assigned, the Incoming/Outcoming connections
GNEAttributeCarrier * myClickedAC
pointer to current clicked Attribute Carrier
FXTreeItem * showAttributeCarrierParents()
show child of current attributeCarrier
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *clickedAC)
GNEDataInterval * myClickedDataInterval
data interval element (casted from myClickedAC)
GNEConnection * myClickedConnection
junction (casted from myClickedAC)
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user click over option "center" of child Menu
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the FXTreeItems items with their vinculated AC
GNEDataSet * myClickedDataSet
data set element (casted from myClickedAC)
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user click over option "inspect" of child menu
GNECrossing * myClickedCrossing
crossing (casted from myClickedAC)
void showHierarchicalElementChildren(GNEHierarchicalElement *HE, FXTreeItem *itemParent)
show children of given hierarchical element
GNEFrame * myFrameParent
frame Parent
GNEHierarchicalElement * myHE
hierarchical element
GNEGenericData * myClickedGenericData
generic data element (casted from myClickedAC)
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
long onCmdMoveItemUp(FXObject *, FXSelector, void *)
called when user click over option "Move up" of child menu
void hideHierarchicalElementTree()
hide GNEElementTree
GNEAdditional * myClickedAdditional
additional (casted from myClickedAC)
MFXTreeListDynamic * myTreeListDynamic
tree list dynamic to show the children of the element to erase
GNEDemandElement * myClickedDemandElement
demand element (casted from myClickedAC)
GNEJunction * myClickedJunction
junction (casted from myClickedAC)
FXTreeItem * addListItem(GNEAttributeCarrier *AC, FXTreeItem *itemParent=nullptr, std::string prefix="", std::string sufix="")
add item into list
long onCmdMoveItemDown(FXObject *, FXSelector, void *)
called when user click over option "Move down" of child menu
void refreshHierarchicalElementTree()
refresh GNEElementTree
GNEEdge * myClickedEdge
edge (casted from myClickedAC)
GNELane * myClickedLane
lane (casted from myClickedAC)
void removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier *HE)
if given AttributeCarrier is the same of myHE, set it as nullptr
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user click over option "delete" of child menu
~GNEElementTree()
destructor
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show GNEElementTree
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:150
An Element which don't belong to GNENet but has influence in the simulation.
GNEDataInterval * getDataIntervalParent() const
get data interval parent
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNELane * > & getChildLanes() const
get child lanes
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
Definition: GNELane.cpp:1934
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition: GNELane.cpp:1913
GNEEdge * getParentEdge() const
get parent edge
Definition: GNELane.cpp:196
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:413
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:577
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:632
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:650
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:671
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition: GNENet.cpp:714
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:617
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:727
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:121
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition: GNENet.cpp:701
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:368
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool isPlan() const
plans
bool isTAZElement() const
return true if tag correspond to a TAZ element
bool isNetworkElement() const
element sets
bool isDataElement() const
return true if tag correspond to a data element
bool isType() const
demand elements
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNENet * getNet() const
get the net object
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:410
GUIMainWindow * getGUIMainWindow() const
get GUIMainWindow App
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
Definition: GUIDesigns.cpp:42
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:104
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXFont * getBoldFont()
get bold front
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
MFXGroupBoxModule (based on FXGroupBox)
MFXTreeListDynamic.
void show()
Show MFXTreeListDynamic.
void clearItems()
clear items
void hide()
Hide MFXTreeListDynamic.
FXWindow * getFXWindow()
get FXWindows associated with this MFXTreeListDynamic
FXTreeItem * getItemAt(FXint x, FXint y) const
Get item at x,y, if any.
FXTreeItem * appendItem(FXTreeItem *father, const FXString &text, FXIcon *oi, FXColor tColor=FXRGB(0, 0, 0))
append item with given text and icon