Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GNEElementTree.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 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#pragma once
21#include <config.h>
22
25
26// ===========================================================================
27// class declaration
28// ===========================================================================
29
30class GNEAdditional;
31class GNEConnection;
32class GNECrossing;
33class GNEDataInterval;
34class GNEDataSet;
35class GNEDataSet;
37class GNEEdge;
38class GNEFrame;
39class GNEGenericData;
40class GNEJunction;
41class GNELane;
43
44// ===========================================================================
45// class definitions
46// ===========================================================================
47
50 FXDECLARE(GNEElementTree)
51
52public:
54 GNEElementTree(GNEFrame* frameParent);
55
58
61
64
67
70
74 long onCmdShowChildMenu(FXObject*, FXSelector, void* data);
75
77 long onCmdCenterItem(FXObject*, FXSelector, void*);
78
80 long onCmdInspectItem(FXObject*, FXSelector, void*);
81
83 long onCmdDeleteItem(FXObject*, FXSelector, void*);
84
86 long onCmdMoveItemUp(FXObject*, FXSelector, void*);
87
89 long onCmdMoveItemDown(FXObject*, FXSelector, void*);
91
92protected:
93 FOX_CONSTRUCTOR(GNEElementTree)
94
95 // @brief create pop-up menu in the positions X-Y for the clicked attribute carrier
96 void createPopUpMenu(int X, int Y, GNEAttributeCarrier* clickedAC);
97
99 FXTreeItem* showAttributeCarrierParents();
100
102 void showHierarchicalElementChildren(GNEAttributeCarrier* hierarchicalElement, FXTreeItem* itemParent);
103
105 FXTreeItem* addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent = nullptr, std::string prefix = "", std::string sufix = "");
106
108 FXTreeItem* addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded);
109
111 bool isSupermodeValid(const GNEAttributeCarrier* AC) const;
112
113private:
116
119
122
125
128
131
134
137
140
143
146
149
152
155
158
160 std::map<FXTreeItem*, GNEAttributeCarrier*> myTreeItemToACMap;
161
163 std::set<FXTreeItem*> myTreeItemsConnections;
164};
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition GNECrossing.h:44
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
std::set< FXTreeItem * > myTreeItemsConnections
set used to save tree items without AC assigned, the Incoming/Outcoming connections
bool isSupermodeValid(const GNEAttributeCarrier *AC) const
check if current supermode is valid for select/remove the given AC
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)
GNEFrame * myFrameParent
frame Parent
GNEAttributeCarrier * myHierarchicalElement
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
GNETAZSourceSink * myClickedTAZSourceSink
sourceSink (casted from myClickedAC)
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)
void showHierarchicalElementChildren(GNEAttributeCarrier *hierarchicalElement, FXTreeItem *itemParent)
show children of given hierarchical element
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
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
MFXGroupBoxModule (based on FXGroupBox)
MFXTreeListDynamic.