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