Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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>
35
36#include "GNEElementTree.h"
37
38
39// ===========================================================================
40// FOX callback mapping
41// ===========================================================================
42
43FXDEFMAP(GNEElementTree) HierarchicalElementTreeMap[] = {
44 FXMAPFUNC(SEL_COMMAND, MID_GNE_CENTER, GNEElementTree::onCmdCenterItem),
46 FXMAPFUNC(SEL_COMMAND, MID_GNE_DELETE, GNEElementTree::onCmdDeleteItem),
50};
51
52
53// Object implementation
54FXIMPLEMENT(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
85void
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
100void
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
122void
124 // clear items
126 myTreeItemToACMap.clear();
128 // show children of myHE
129 if (myHE) {
131 }
132}
133
134
135void
137 // simply check if AC is the same of myHE
138 if (AC == myHE) {
139 myHE = nullptr;
140 }
141}
142
143
144long
145GNEElementTree::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
158long
159GNEElementTree::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
184long
185GNEElementTree::onCmdInspectItem(FXObject*, FXSelector, void*) {
186 if ((myHE != nullptr) && (myClickedAC != nullptr)) {
188 }
189 return 1;
190}
191
192
193long
194GNEElementTree::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;
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 // refresh AC Hierarchy
246 // check if inspector frame has to be shown again
250 } else {
251 // inspect a nullptr element to reset inspector frame
253 }
254 }
255 return 1;
256}
257
258
259long
260GNEElementTree::onCmdMoveItemUp(FXObject*, FXSelector, void*) {
261 // currently only children of demand elements can be moved
264 // move element one position back
268 }
269 // refresh after moving child
271 return 1;
272}
273
274
275long
276GNEElementTree::onCmdMoveItemDown(FXObject*, FXSelector, void*) {
277 // currently only children of demand elements can be moved
280 // move element one position front
284 }
285 // refresh after moving child
287 return 1;
288}
289
290
291void
293 // get attributeCarriers
294 const auto& attributeCarriers = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
295 // first check that AC exist
296 if (clickedAC) {
297 // set current clicked AC
298 myClickedAC = clickedAC;
299 // cast all elements
300 myClickedJunction = attributeCarriers->retrieveJunction(clickedAC->getID(), false);
301 myClickedEdge = attributeCarriers->retrieveEdge(clickedAC->getID(), false);
302 myClickedLane = attributeCarriers->retrieveLane(clickedAC->getGUIGlObject(), false);
303 myClickedCrossing = attributeCarriers->retrieveCrossing(clickedAC->getGUIGlObject(), false);
304 myClickedConnection = attributeCarriers->retrieveConnection(clickedAC->getGUIGlObject(), false);
305 myClickedAdditional = attributeCarriers->retrieveAdditional(clickedAC->getGUIGlObject(), false);
306 myClickedDemandElement = attributeCarriers->retrieveDemandElement(clickedAC->getGUIGlObject(), false);
307 myClickedDataSet = attributeCarriers->retrieveDataSet(clickedAC->getID(), false);
308 myClickedDataInterval = attributeCarriers->retrieveDataInterval(clickedAC, false);
309 myClickedGenericData = attributeCarriers->retrieveGenericData(clickedAC->getGUIGlObject(), false);
310 // create FXMenuPane
311 FXMenuPane* pane = new FXMenuPane(myTreeListDynamic->getFXWindow());
312 // set item name and icon
314 // insert separator
315 new FXMenuSeparator(pane);
316 // create center menu command
317 FXMenuCommand* centerMenuCommand = GUIDesigns::buildFXMenuCommand(pane, TL("Center"), GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_GNE_CENTER);
318 // disable Centering for Vehicle Types, data sets and data intervals
321 centerMenuCommand->disable();
322 }
323 // create inspect and delete menu commands
324 FXMenuCommand* inspectMenuCommand = GUIDesigns::buildFXMenuCommand(pane, TL("Inspect"), GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), this, MID_GNE_INSPECT);
325 FXMenuCommand* deleteMenuCommand = GUIDesigns::buildFXMenuCommand(pane, TL("Delete"), GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), this, MID_GNE_DELETE);
326 // check if inspect and delete menu commands has to be disabled
328 inspectMenuCommand->disable();
329 deleteMenuCommand->disable();
330 }
331 // now check if given AC support manually moving of their item up and down (Currently only for certain demand elements)
332 /* if (myClickedDemandElement && myClickedAC->getTagProperty().canBeSortedManually()) {
333 // insert separator
334 new FXMenuSeparator(pane);
335 // create both moving menu commands
336 FXMenuCommand* moveUpMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(GUIIcon::ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP);
337 FXMenuCommand* moveDownMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(GUIIcon::ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN);
338 // check if both commands has to be disabled
339 if (myClickedDemandElement->getTagProperty().isPlanStopPerson()) {
340 moveUpMenuCommand->setText(TL("Move up (Stops cannot be moved)"));
341 moveDownMenuCommand->setText(TL("Move down (Stops cannot be moved)"));
342 moveUpMenuCommand->disable();
343 moveDownMenuCommand->disable();
344 } else {
345 // check if moveUpMenuCommand has to be disabled
346 if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().front() == myClickedDemandElement) {
347 moveUpMenuCommand->setText(TL("Move up (It's already the first element)"));
348 moveUpMenuCommand->disable();
349 } else if (myClickedDemandElement->getParentDemandElements().front()->getPreviousChildDemandElement(myClickedDemandElement)->getTagProperty().isPlanStopPerson()) {
350 moveUpMenuCommand->setText(TL("Move up (Previous element is a Stop)"));
351 moveUpMenuCommand->disable();
352 }
353 // check if moveDownMenuCommand has to be disabled
354 if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().back() == myClickedDemandElement) {
355 moveDownMenuCommand->setText(TL("Move down (It's already the last element)"));
356 moveDownMenuCommand->disable();
357 } else if (myClickedDemandElement->getParentDemandElements().front()->getNextChildDemandElement(myClickedDemandElement)->getTagProperty().isPlanStopPerson()) {
358 moveDownMenuCommand->setText(TL("Move down (Next element is a Stop)"));
359 moveDownMenuCommand->disable();
360 }
361 }
362 } */
363 // Center in the mouse position and create pane
364 pane->setX(X);
365 pane->setY(Y);
366 pane->create();
367 pane->show();
368 } else {
369 // set all clicked elements to null
370 myClickedAC = nullptr;
371 myClickedJunction = nullptr;
372 myClickedEdge = nullptr;
373 myClickedLane = nullptr;
374 myClickedCrossing = nullptr;
375 myClickedConnection = nullptr;
376 myClickedAdditional = nullptr;
377 myClickedDemandElement = nullptr;
378 myClickedDataSet = nullptr;
379 myClickedDataInterval = nullptr;
380 myClickedGenericData = nullptr;
381 }
382}
383
384
385FXTreeItem*
387 // get attributeCarriers
388 const auto& attributeCarriers = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
389 // check tags
391 // check demand element type
392 switch (myHE->getTagProperty().getTag()) {
393 case SUMO_TAG_EDGE: {
394 // obtain Edge
395 GNEEdge* edge = attributeCarriers->retrieveEdge(myHE->getID(), false);
396 if (edge) {
397 // insert Junctions of edge in tree (Parallel because an edge has always two Junctions)
398 FXTreeItem* junctionSourceItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" origin")).c_str(), edge->getFromJunction()->getACIcon());
399 FXTreeItem* junctionDestinationItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" destination")).c_str(), edge->getFromJunction()->getACIcon());
400 junctionDestinationItem->setExpanded(true);
401 // Save items in myTreeItemToACMap
402 myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
403 myTreeItemToACMap[junctionDestinationItem] = edge->getToJunction();
404 // return junction destination Item
405 return junctionDestinationItem;
406 } else {
407 return nullptr;
408 }
409 }
410 case SUMO_TAG_LANE: {
411 // obtain lane
412 GNELane* lane = attributeCarriers->retrieveLane(myHE->getID(), false);
413 if (lane) {
414 // obtain parent edge
415 GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID());
416 //insert Junctions of lane of edge in tree (Parallel because an edge has always two Junctions)
417 FXTreeItem* junctionSourceItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" origin")).c_str(), edge->getFromJunction()->getACIcon());
418 FXTreeItem* junctionDestinationItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" destination")).c_str(), edge->getFromJunction()->getACIcon());
419 junctionDestinationItem->setExpanded(true);
420 // Create edge item
421 FXTreeItem* edgeItem = myTreeListDynamic->appendItem(junctionDestinationItem, edge->getHierarchyName().c_str(), edge->getACIcon());
422 edgeItem->setExpanded(true);
423 // Save items in myTreeItemToACMap
424 myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
425 myTreeItemToACMap[junctionDestinationItem] = edge->getToJunction();
426 myTreeItemToACMap[edgeItem] = edge;
427 // return edge item
428 return edgeItem;
429 } else {
430 return nullptr;
431 }
432 }
433 case SUMO_TAG_CROSSING: {
434 // obtain crossing parent junction
435 GNEJunction* junction = attributeCarriers->retrieveCrossing(myHE->getGUIGlObject())->getParentJunction();
436 // create junction item
437 FXTreeItem* junctionItem = myTreeListDynamic->appendItem(nullptr, junction->getHierarchyName().c_str(), junction->getACIcon());
438 junctionItem->setExpanded(true);
439 // Save items in myTreeItemToACMap
440 myTreeItemToACMap[junctionItem] = junction;
441 // return junction Item
442 return junctionItem;
443 }
444 case SUMO_TAG_CONNECTION: {
445 // obtain Connection
446 GNEConnection* connection = attributeCarriers->retrieveConnection(myHE->getID(), false);
447 if (connection) {
448 // create edge from item
449 FXTreeItem* edgeFromItem = myTreeListDynamic->appendItem(nullptr, connection->getEdgeFrom()->getHierarchyName().c_str(), connection->getEdgeFrom()->getACIcon());
450 edgeFromItem->setExpanded(true);
451 // create edge to item
452 FXTreeItem* edgeToItem = myTreeListDynamic->appendItem(nullptr, connection->getEdgeTo()->getHierarchyName().c_str(), connection->getEdgeTo()->getACIcon());
453 edgeToItem->setExpanded(true);
454 // create connection item
455 FXTreeItem* connectionItem = myTreeListDynamic->appendItem(edgeToItem, connection->getHierarchyName().c_str(), connection->getACIcon());
456 connectionItem->setExpanded(true);
457 // Save items in myTreeItemToACMap
458 myTreeItemToACMap[edgeFromItem] = connection->getEdgeFrom();
459 myTreeItemToACMap[edgeToItem] = connection->getEdgeTo();
460 myTreeItemToACMap[connectionItem] = connection;
461 // return connection item
462 return connectionItem;
463 } else {
464 return nullptr;
465 }
466 }
467 default:
468 break;
469 }
470 } else if (myHE->getTagProperty().getTag() == GNE_TAG_POILANE) {
471 // Obtain POILane
473 // obtain parent lane
474 GNELane* lane = attributeCarriers->retrieveLane(POILane->getParentLanes().at(0)->getID());
475 // obtain parent edge
476 GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID());
477 //insert Junctions of lane of edge in tree (Parallel because an edge has always two Junctions)
478 FXTreeItem* junctionSourceItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" origin")).c_str(), edge->getFromJunction()->getACIcon());
479 FXTreeItem* junctionDestinationItem = myTreeListDynamic->appendItem(nullptr, (edge->getFromJunction()->getHierarchyName() + TL(" destination")).c_str(), edge->getFromJunction()->getACIcon());
480 junctionDestinationItem->setExpanded(true);
481 // Create edge item
482 FXTreeItem* edgeItem = myTreeListDynamic->appendItem(junctionDestinationItem, edge->getHierarchyName().c_str(), edge->getACIcon());
483 edgeItem->setExpanded(true);
484 // Create lane item
485 FXTreeItem* laneItem = myTreeListDynamic->appendItem(edgeItem, lane->getHierarchyName().c_str(), lane->getACIcon());
486 laneItem->setExpanded(true);
487 // Save items in myTreeItemToACMap
488 myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction();
489 myTreeItemToACMap[junctionDestinationItem] = edge->getToJunction();
490 myTreeItemToACMap[edgeItem] = edge;
491 myTreeItemToACMap[laneItem] = lane;
492 // return Lane item
493 return laneItem;
494 } else if (myHE->getTagProperty().isAdditionalElement()) {
495 // Obtain Additional
496 const GNEAdditional* additional = attributeCarriers->retrieveAdditional(myHE->getGUIGlObject());
497 // declare auxiliary FXTreeItem, due a demand element can have multiple "roots"
498 FXTreeItem* root = nullptr;
499 // check if there is demand elements parents
500 if (additional->getParentAdditionals().size() > 0) {
501 // check if we have more than one edge
502 if (additional->getParentAdditionals().size() > 1) {
503 // insert first item
504 addListItem(additional->getParentAdditionals().front());
505 // insert "spacer"
506 if (additional->getParentAdditionals().size() > 2) {
507 addListItem(nullptr, ("..." + toString((int)additional->getParentAdditionals().size() - 2) + TL(" additionals...")).c_str(), 0, false);
508 }
509 }
510 // return last inserted item
511 root = addListItem(additional->getParentAdditionals().back());
512 }
513 // check if there is parent demand elements
514 if (additional->getParentDemandElements().size() > 0) {
515 // check if we have more than one demand element
516 if (additional->getParentDemandElements().size() > 1) {
517 // insert first item
518 addListItem(additional->getParentDemandElements().front());
519 // insert "spacer"
520 if (additional->getParentDemandElements().size() > 2) {
521 addListItem(nullptr, ("..." + toString((int)additional->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
522 }
523 }
524 // return last inserted item
525 root = addListItem(additional->getParentDemandElements().back());
526 }
527 // check if there is parent edges
528 if (additional->getParentEdges().size() > 0) {
529 // check if we have more than one edge
530 if (additional->getParentEdges().size() > 1) {
531 // insert first item
532 addListItem(additional->getParentEdges().front());
533 // insert "spacer"
534 if (additional->getParentEdges().size() > 2) {
535 addListItem(nullptr, ("..." + toString((int)additional->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
536 }
537 }
538 // return last inserted item
539 root = addListItem(additional->getParentEdges().back());
540 }
541 // check if there is parent lanes
542 if (additional->getParentLanes().size() > 0) {
543 // check if we have more than one parent lane
544 if (additional->getParentLanes().size() > 1) {
545 // insert first item
546 addListItem(additional->getParentLanes().front());
547 // insert "spacer"
548 if (additional->getParentLanes().size() > 2) {
549 addListItem(nullptr, ("..." + toString((int)additional->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
550 }
551 }
552 // return last inserted item
553 root = addListItem(additional->getParentLanes().back());
554 }
555 // return last inserted list item
556 return root;
557 } else if (myHE->getTagProperty().isTAZElement()) {
558 // Obtain TAZElement
560 // declare auxiliary FXTreeItem, due a demand element can have multiple "roots"
561 FXTreeItem* root = nullptr;
562 // check if there is demand elements parents
563 if (TAZElement->getParentAdditionals().size() > 0) {
564 // check if we have more than one edge
565 if (TAZElement->getParentAdditionals().size() > 1) {
566 // insert first item
567 addListItem(TAZElement->getParentAdditionals().front());
568 // insert "spacer"
569 if (TAZElement->getParentAdditionals().size() > 2) {
570 addListItem(nullptr, ("..." + toString((int)TAZElement->getParentAdditionals().size() - 2) + TL(" TAZElements...")).c_str(), 0, false);
571 }
572 }
573 // return last inserted item
574 root = addListItem(TAZElement->getParentAdditionals().back());
575 }
576 // check if there is parent demand elements
577 if (TAZElement->getParentDemandElements().size() > 0) {
578 // check if we have more than one demand element
579 if (TAZElement->getParentDemandElements().size() > 1) {
580 // insert first item
581 addListItem(TAZElement->getParentDemandElements().front());
582 // insert "spacer"
583 if (TAZElement->getParentDemandElements().size() > 2) {
584 addListItem(nullptr, ("..." + toString((int)TAZElement->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
585 }
586 }
587 // return last inserted item
588 root = addListItem(TAZElement->getParentDemandElements().back());
589 }
590 // check if there is parent edges
591 if (TAZElement->getParentEdges().size() > 0) {
592 // check if we have more than one edge
593 if (TAZElement->getParentEdges().size() > 1) {
594 // insert first item
595 addListItem(TAZElement->getParentEdges().front());
596 // insert "spacer"
597 if (TAZElement->getParentEdges().size() > 2) {
598 addListItem(nullptr, ("..." + toString((int)TAZElement->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
599 }
600 }
601 // return last inserted item
602 root = addListItem(TAZElement->getParentEdges().back());
603 }
604 // check if there is parent lanes
605 if (TAZElement->getParentLanes().size() > 0) {
606 // check if we have more than one parent lane
607 if (TAZElement->getParentLanes().size() > 1) {
608 // insert first item
609 addListItem(TAZElement->getParentLanes().front());
610 // insert "spacer"
611 if (TAZElement->getParentLanes().size() > 2) {
612 addListItem(nullptr, ("..." + toString((int)TAZElement->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
613 }
614 }
615 // return last inserted item
616 root = addListItem(TAZElement->getParentLanes().back());
617 }
618 // return last inserted list item
619 return root;
620 } else if (myHE->getTagProperty().isDemandElement()) {
621 // Obtain DemandElement
623 // declare auxiliar FXTreeItem, due a demand element can have multiple "roots"
624 FXTreeItem* root = nullptr;
625 // check if there are demand element parents
626 if (demandElement->getParentAdditionals().size() > 0) {
627 // check if we have more than one edge
628 if (demandElement->getParentAdditionals().size() > 1) {
629 // insert first item
630 addListItem(demandElement->getParentAdditionals().front());
631 // insert "spacer"
632 if (demandElement->getParentAdditionals().size() > 2) {
633 addListItem(nullptr, ("..." + toString((int)demandElement->getParentAdditionals().size() - 2) + TL(" additionals...")).c_str(), 0, false);
634 }
635 }
636 // return last inserted item
637 root = addListItem(demandElement->getParentAdditionals().back());
638 }
639 // check if there is parent demand elements
640 if (demandElement->getParentDemandElements().size() > 0) {
641 // check if we have more than one demand element
642 if (demandElement->getParentDemandElements().size() > 1) {
643 // insert first item
644 addListItem(demandElement->getParentDemandElements().front());
645 // insert "spacer"
646 if (demandElement->getParentDemandElements().size() > 2) {
647 addListItem(nullptr, ("..." + toString((int)demandElement->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
648 }
649 }
650 // return last inserted item
651 root = addListItem(demandElement->getParentDemandElements().back());
652 }
653 // check if there is parent edges
654 if (demandElement->getParentEdges().size() > 0) {
655 // check if we have more than one edge
656 if (demandElement->getParentEdges().size() > 1) {
657 // insert first item
658 addListItem(demandElement->getParentEdges().front());
659 // insert "spacer"
660 if (demandElement->getParentEdges().size() > 2) {
661 addListItem(nullptr, ("..." + toString((int)demandElement->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
662 }
663 }
664 // return last inserted item
665 root = addListItem(demandElement->getParentEdges().back());
666 }
667 // check if there is parent lanes
668 if (demandElement->getParentLanes().size() > 0) {
669 // check if we have more than one parent lane
670 if (demandElement->getParentLanes().size() > 1) {
671 // insert first item
672 addListItem(demandElement->getParentLanes().front());
673 // insert "spacer"
674 if (demandElement->getParentLanes().size() > 2) {
675 addListItem(nullptr, ("..." + toString((int)demandElement->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
676 }
677 }
678 // return last inserted item
679 root = addListItem(demandElement->getParentLanes().back());
680 }
681 // return last inserted list item
682 return root;
683 } else if (myHE->getTagProperty().isDataElement()) {
684 // check if is a GNEDataInterval or a GNEGenericData
686 return nullptr;
687 } else if (myHE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
689 } else {
690 // Obtain DataElement
691 GNEGenericData* dataElement = dynamic_cast<GNEGenericData*>(myHE);
692 if (dataElement) {
693 // declare auxiliary FXTreeItem, due a data element can have multiple "roots"
694 FXTreeItem* root = nullptr;
695 // set dataset
697 // set data interval
698 addListItem(dataElement->getDataIntervalParent());
699 // check if there is data elements parents
700 if (dataElement->getParentAdditionals().size() > 0) {
701 // check if we have more than one edge
702 if (dataElement->getParentAdditionals().size() > 1) {
703 // insert first item
704 addListItem(dataElement->getParentAdditionals().front());
705 // insert "spacer"
706 if (dataElement->getParentAdditionals().size() > 2) {
707 addListItem(nullptr, ("..." + toString((int)dataElement->getParentAdditionals().size() - 2) + TL(" additionals...")).c_str(), 0, false);
708 }
709 }
710 // return last inserted item
711 root = addListItem(dataElement->getParentAdditionals().back());
712 }
713 // check if there is parent demand elements
714 if (dataElement->getParentDemandElements().size() > 0) {
715 // check if we have more than one demand element
716 if (dataElement->getParentDemandElements().size() > 1) {
717 // insert first item
718 addListItem(dataElement->getParentDemandElements().front());
719 // insert "spacer"
720 if (dataElement->getParentDemandElements().size() > 2) {
721 addListItem(nullptr, ("..." + toString((int)dataElement->getParentDemandElements().size() - 2) + TL(" demand elements...")).c_str(), 0, false);
722 }
723 }
724 // return last inserted item
725 root = addListItem(dataElement->getParentDemandElements().back());
726 }
727 // check if there is parent edges
728 if (dataElement->getParentEdges().size() > 0) {
729 // check if we have more than one edge
730 if (dataElement->getParentEdges().size() > 1) {
731 // insert first ege
732 if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) {
733 addListItem(dataElement->getParentEdges().front(), nullptr, "from ");
734 } else {
735 addListItem(dataElement->getParentEdges().front());
736 }
737 // insert "spacer"
738 if (dataElement->getParentEdges().size() > 2) {
739 addListItem(nullptr, ("..." + toString((int)dataElement->getParentEdges().size() - 2) + TL(" edges...")).c_str(), 0, false);
740 }
741 }
742 // insert last ege
743 if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) {
744 addListItem(dataElement->getParentEdges().back(), nullptr, "to ");
745 } else {
746 addListItem(dataElement->getParentEdges().back());
747 }
748 }
749 // check if there is parent lanes
750 if (dataElement->getParentLanes().size() > 0) {
751 // check if we have more than one parent lane
752 if (dataElement->getParentLanes().size() > 1) {
753 // insert first item
754 addListItem(dataElement->getParentLanes().front());
755 // insert "spacer"
756 if (dataElement->getParentLanes().size() > 2) {
757 addListItem(nullptr, ("..." + toString((int)dataElement->getParentLanes().size() - 2) + TL(" lanes...")).c_str(), 0, false);
758 }
759 }
760 // return last inserted item
761 root = addListItem(dataElement->getParentLanes().back());
762 }
763 // return last inserted list item
764 return root;
765 }
766 }
767 }
768 // there aren't parents
769 return nullptr;
770}
771
772
773void
775 if (HE->getTagProperty().isNetworkElement()) {
776 // Switch gl type of ac
777 switch (HE->getTagProperty().getTag()) {
778 case SUMO_TAG_JUNCTION: {
779 // retrieve junction
781 if (junction) {
782 // insert junction item
783 FXTreeItem* junctionItem = addListItem(HE, itemParent);
784 // insert edges
785 for (const auto& edge : junction->getChildEdges()) {
786 showHierarchicalElementChildren(edge, junctionItem);
787 }
788 // insert crossings
789 for (const auto& crossing : junction->getGNECrossings()) {
790 showHierarchicalElementChildren(crossing, junctionItem);
791 }
792 }
793 break;
794 }
795 case SUMO_TAG_EDGE: {
796 // retrieve edge
798 if (edge) {
799 // insert edge item
800 FXTreeItem* edgeItem = addListItem(HE, itemParent);
801 // insert lanes
802 for (const auto& lane : edge->getLanes()) {
803 showHierarchicalElementChildren(lane, edgeItem);
804 }
805 // insert child additional
806 for (const auto& additional : edge->getChildAdditionals()) {
807 showHierarchicalElementChildren(additional, edgeItem);
808 }
809 // insert child demand elements
810 for (const auto& demandElement : edge->getChildDemandElements()) {
811 showHierarchicalElementChildren(demandElement, edgeItem);
812 }
813 // insert child data elements
814 if (edge->getChildGenericDatas().size() > 0) {
815 // insert intermediate list item
816 FXTreeItem* dataElements = addListItem(edgeItem, TL("Data elements"), GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), false);
817 for (const auto& genericDatas : edge->getChildGenericDatas()) {
818 showHierarchicalElementChildren(genericDatas, dataElements);
819 }
820 }
821 }
822 break;
823 }
824 case SUMO_TAG_LANE: {
825 // retrieve lane
827 if (lane) {
828 // insert lane item
829 FXTreeItem* laneItem = addListItem(HE, itemParent);
830 // insert child additional
831 for (const auto& additional : lane->getChildAdditionals()) {
832 showHierarchicalElementChildren(additional, laneItem);
833 }
834 // insert demand elements children
835 for (const auto& demandElement : lane->getChildDemandElements()) {
836 showHierarchicalElementChildren(demandElement, laneItem);
837 }
838 // insert incoming connections of lanes (by default isn't expanded)
839 if (lane->getGNEIncomingConnections().size() > 0) {
840 std::vector<GNEConnection*> incomingLaneConnections = lane->getGNEIncomingConnections();
841 // insert intermediate list item
842 FXTreeItem* incomingConnections = addListItem(laneItem, TL("Incomings"), incomingLaneConnections.front()->getACIcon(), false);
843 // insert incoming connections
844 for (const auto& connection : incomingLaneConnections) {
845 showHierarchicalElementChildren(connection, incomingConnections);
846 }
847 }
848 // insert outcoming connections of lanes (by default isn't expanded)
849 if (lane->getGNEOutcomingConnections().size() > 0) {
850 std::vector<GNEConnection*> outcomingLaneConnections = lane->getGNEOutcomingConnections();
851 // insert intermediate list item
852 FXTreeItem* outgoingConnections = addListItem(laneItem, TL("Outgoing"), outcomingLaneConnections.front()->getACIcon(), false);
853 // insert outcoming connections
854 for (const auto& connection : outcomingLaneConnections) {
855 showHierarchicalElementChildren(connection, outgoingConnections);
856 }
857 }
858 }
859 break;
860 }
862 case SUMO_TAG_CONNECTION: {
863 // insert connection item
864 addListItem(HE, itemParent);
865 break;
866 }
867 default:
868 break;
869 }
871 // insert additional item
872 FXTreeItem* treeItem = addListItem(HE, itemParent);
873 // insert child edges
874 for (const auto& edge : HE->getChildEdges()) {
875 showHierarchicalElementChildren(edge, treeItem);
876 }
877 // insert child lanes
878 for (const auto& lane : HE->getChildLanes()) {
879 showHierarchicalElementChildren(lane, treeItem);
880 }
881 // insert additional symbols
882 std::vector<GNEAdditional*> symbols;
883 for (const auto& additional : HE->getChildAdditionals()) {
884 if (additional->getTagProperty().isSymbol()) {
885 symbols.push_back(additional);
886 }
887 }
888 if (symbols.size() > 0) {
889 // insert intermediate list item
890 const auto additionalParent = symbols.front()->getParentAdditionals().front();
891 const std::string symbolType = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? TL("Edges") : TL("Lanes");
892 GUIIcon symbolIcon = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? GUIIcon::EDGE : GUIIcon::LANE;
893 FXTreeItem* symbolListItem = addListItem(treeItem, symbolType, GUIIconSubSys::getIcon(symbolIcon), false);
894 // insert symbols
895 for (const auto& symbol : symbols) {
896 showHierarchicalElementChildren(symbol, symbolListItem);
897 }
898 }
899 // insert additional children
900 for (const auto& additional : HE->getChildAdditionals()) {
901 if (!additional->getTagProperty().isSymbol()) {
902 showHierarchicalElementChildren(additional, treeItem);
903 }
904 }
905 // insert child demand elements
906 for (const auto& demandElement : HE->getChildDemandElements()) {
907 showHierarchicalElementChildren(demandElement, treeItem);
908 }
909 // insert child data elements
910 if (HE->getChildGenericDatas().size() > 0) {
911 // insert intermediate list item
912 FXTreeItem* dataElements = addListItem(treeItem, TL("Data elements"), GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), false);
913 for (const auto& genericDatas : HE->getChildGenericDatas()) {
914 showHierarchicalElementChildren(genericDatas, dataElements);
915 }
916 }
917 } else if (HE->getTagProperty().isDataElement()) {
918 // insert data item
919 FXTreeItem* dataElementItem = addListItem(HE, itemParent);
920 // insert intervals
921 if (HE->getTagProperty().getTag() == SUMO_TAG_DATASET) {
923 // iterate over intervals
924 for (const auto& interval : dataSet->getDataIntervalChildren()) {
925 showHierarchicalElementChildren(interval.second, dataElementItem);
926 }
927 } else if (HE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
928 GNEDataInterval* dataInterval = dynamic_cast<GNEDataInterval*>(HE);
929 // iterate over generic datas
930 for (const auto& genericData : dataInterval->getGenericDataChildren()) {
931 showHierarchicalElementChildren(genericData, dataElementItem);
932 }
933 }
934 }
935}
936
937
938FXTreeItem*
939GNEElementTree::addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent, std::string prefix, std::string sufix) {
940 // insert item in Tree list
941 FXTreeItem* item = myTreeListDynamic->appendItem(itemParent, (prefix + AC->getHierarchyName() + sufix).c_str(), AC->getACIcon());
942 // insert item in map
943 myTreeItemToACMap[item] = AC;
944 // by default item is expanded
945 item->setExpanded(true);
946 // return created FXTreeItem
947 return item;
948}
949
950
951FXTreeItem*
952GNEElementTree::addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded) {
953 // insert item in Tree list
954 FXTreeItem* item = myTreeListDynamic->appendItem(itemParent, text.c_str(), icon);
955 // expand item depending of flag expanded
956 item->setExpanded(expanded);
957 // return created FXTreeItem
958 return item;
959}
960
961/****************************************************************************/
FXDEFMAP(GNEElementTree) HierarchicalElementTreeMap[]
@ MID_GNE_DELETE
delete element
Definition GUIAppEnum.h:943
@ MID_GNE_CENTER
center element
Definition GUIAppEnum.h:951
@ MID_GNE_ACHIERARCHY_SHOWCHILDMENU
In GNEElementTree list, show child menu.
@ MID_GNE_ACHIERARCHY_MOVEUP
In GNEElementTree list, move element to up.
@ MID_GNE_INSPECT
inspect element
Definition GUIAppEnum.h:945
@ MID_GNE_ACHIERARCHY_MOVEDOWN
In GNEElementTree list, move element to down.
#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.
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
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
virtual GUIGlObject * getGUIGlObject()=0
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
virtual std::string getAttribute(SumoXMLAttr key) const =0
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition GNEEdge.cpp:1116
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
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:1955
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition GNELane.cpp:1934
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:423
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:590
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:646
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:664
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:685
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:728
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:631
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:741
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:125
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:715
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:377
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 bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
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
GUIGlID getGlID() const
Returns the numerical id of the object.
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