Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/common/GNEInspectorFrame.h
193874 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2026 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
/****************************************************************************/
14
/// @file GNEInspectorFrame.h
15
/// @author Jakob Erdmann
16
/// @author Pablo Alvarez Lopez
17
/// @date Mar 2011
18
///
19
// The Widget for modifying network-element attributes (i.e. lane speed)
20
/****************************************************************************/
21
#pragma once
22
#include <config.h>
23
24
#include <netedit/frames/GNEFrame.h>
25
#include <netedit/GNEViewNetHelper.h>
26
#include <netedit/frames/common/GNEGroupBoxModule.h>
27
28
// ===========================================================================
29
// class declaration
30
// ===========================================================================
31
32
class GNEAttributesEditor;
33
class GNEEdgeTemplate;
34
class GNEElementTree;
35
class GNEOverlappedInspection;
36
37
// ===========================================================================
38
// class definitions
39
// ===========================================================================
40
41
class GNEInspectorFrame : public GNEFrame {
42
/// @brief FOX-declaration
43
FXDECLARE(GNEInspectorFrame)
44
45
public:
46
// ===========================================================================
47
// class TemplateEditor
48
// ===========================================================================
49
50
class TemplateEditor : public GNEGroupBoxModule {
51
/// @brief FOX-declaration
52
FXDECLARE(GNEInspectorFrame::TemplateEditor)
53
54
public:
55
/// @brief constructor
56
TemplateEditor(GNEInspectorFrame* inspectorFrameParent);
57
58
/// @brief destructor
59
~TemplateEditor();
60
61
/// @brief show template editor
62
bool showTemplateEditor();
63
64
/// @brief hide template editor
65
void hideTemplateEditor();
66
67
/// @brief get edge template (to copy attributes from)
68
GNEEdgeTemplate* getEdgeTemplate() const;
69
70
/// @brief set edge template
71
void setEdgeTemplate(const GNEEdge* edge);
72
73
/// @brief update edge template
74
void updateEdgeTemplate();
75
76
/// @brief set template (used by shortcut)
77
void setTemplate();
78
79
/// @brief copy template (used by shortcut)
80
void copyTemplate();
81
82
/// @brief clear template (used by shortcut)
83
void clearTemplate();
84
85
/// @name FOX-callbacks
86
/// @{
87
/// @brief set current edge as new template
88
long onCmdSetTemplate(FXObject*, FXSelector, void*);
89
90
/// @brief copy edge attributes from edge template
91
long onCmdCopyTemplate(FXObject*, FXSelector, void*);
92
93
/// @brief clear current edge template
94
long onCmdClearTemplate(FXObject*, FXSelector, void*);
95
/// @}
96
97
protected:
98
/// @brief FOX need this
99
FOX_CONSTRUCTOR(TemplateEditor)
100
101
/// @brief update frame buttons
102
void updateButtons();
103
104
private:
105
/// @brief current GNEInspectorFrame parent
106
GNEInspectorFrame* myInspectorFrameParent;
107
108
/// @brief set template button
109
FXButton* mySetTemplateButton;
110
111
/// @brief copy template button
112
FXButton* myCopyTemplateButton;
113
114
/// @brief clear template button
115
FXButton* myClearTemplateButton;
116
117
/// @brief edge Template
118
GNEEdgeTemplate* myEdgeTemplate;
119
};
120
121
/**@brief Constructor
122
* @brief viewParent GNEViewParent in which this GNEFrame is placed
123
* @brief net net that uses this GNEFrame
124
*/
125
GNEInspectorFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
126
127
/// @brief Destructor
128
~GNEInspectorFrame();
129
130
/// @brief show inspector frame
131
void show();
132
133
/// @brief hide inspector frame
134
void hide();
135
136
/**@brief process click over Viewnet
137
* @param[in] viewObjects objects under cursors
138
* @return true if something was sucefully done
139
*/
140
bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector& viewObjects, const Position& clickedPosition,
141
const bool shiftKeyPressed);
142
143
/// @brief Inspect a single element
144
void inspectElement(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousInspectedAC = nullptr);
145
146
/// @brief Inspect the given elements
147
void inspectElements(const std::vector<GNEAttributeCarrier*>& ACs, GNEAttributeCarrier* previousInspectedAC = nullptr);
148
149
/// @brief clear inspection
150
void clearInspection();
151
152
/// @brief refresh current inspection
153
void refreshInspection();
154
155
/// @brief get AttributesEditor
156
GNEAttributesEditor* getAttributesEditor() const;
157
158
/// @brief get template editor
159
TemplateEditor* getTemplateEditor() const;
160
161
/// @brief get GNEOverlappedInspection modul
162
GNEOverlappedInspection* getOverlappedInspection() const;
163
164
/// @brief get GNEElementTree modul
165
GNEElementTree* getHierarchicalElementTree() const;
166
167
/// @name FOX-callbacks
168
/// @{
169
170
/// @brief called when user press inspet previous elemnt button
171
long onCmdInspectPreviousElement(FXObject*, FXSelector, void*);
172
/// @}
173
174
/// @brief function called after undo/redo in the current frame (can be reimplemented in frame children)
175
void updateFrameAfterUndoRedo();
176
177
/// @brief open GNEAttributesCreator extended dialog (can be reimplemented in frame children)
178
void selectedOverlappedElement(GNEAttributeCarrier* AC);
179
180
protected:
181
/// @brief FOX need this
182
FOX_CONSTRUCTOR(GNEInspectorFrame)
183
184
private:
185
/// @brief Overlapped Inspection
186
GNEOverlappedInspection* myOverlappedInspection = nullptr;
187
188
/// @brief Attributes editor
189
GNEAttributesEditor* myAttributesEditor = nullptr;
190
191
/// @brief Template editor
192
TemplateEditor* myTemplateEditor = nullptr;
193
194
/// @brief Attribute Carrier Hierarchy
195
GNEElementTree* myHierarchicalElementTree = nullptr;
196
197
/// @brief Back Button
198
FXButton* myBackButton = nullptr;
199
200
/// @brief Pointer to previous element inspected
201
GNEAttributeCarrier* myPreviousInspectedAC = nullptr;
202
};
203
204