Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/GNEFrame.h
193692 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 GNEFrame.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Jun 2016
17
///
18
// Abstract class for lateral frames in NetEdit
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <string>
24
#include <vector>
25
26
#include <utils/foxtools/fxheader.h>
27
#include <utils/xml/SUMOXMLDefinitions.h>
28
29
// ===========================================================================
30
// class declaration
31
// ===========================================================================
32
33
class GNEAttributeCarrier;
34
class GNEViewNet;
35
class GNEViewParent;
36
37
// ===========================================================================
38
// class definitions
39
// ===========================================================================
40
41
class GNEFrame : public FXVerticalFrame {
42
43
public:
44
/**@brief Constructor
45
* @brief viewParent GNEViewParent in which this GNEFrame is placed
46
* @brief viewNet viewNet that uses this GNEFrame
47
* @brief frameLabel label of the frame
48
*/
49
GNEFrame(GNEViewParent* viewParent, GNEViewNet* viewNet, const std::string& frameLabel);
50
51
/// @brief destructor
52
~GNEFrame();
53
54
/// @brief focus upper element of frame
55
void focusUpperElement();
56
57
/**@brief show Frame
58
* @note some GNEFrames needs a re-implementation
59
*/
60
virtual void show();
61
62
/**@brief hide Frame
63
* @note some GNEFrames needs a re-implementation
64
*/
65
virtual void hide();
66
67
/// @brief set width of GNEFrame
68
void setFrameWidth(const int newWidth);
69
70
/// @brief get view net
71
GNEViewNet* getViewNet() const;
72
73
/// @brief get vertical frame that holds all widgets of frame
74
FXVerticalFrame* getContentFrame() const;
75
76
/// @brief get the label for the frame's header
77
FXLabel* getFrameHeaderLabel() const;
78
79
/// @brief get font of the header's frame
80
FXFont* getFrameHeaderFont() const;
81
82
/// @brief get scrollBar width (zero if is hidden)
83
int getScrollBarWidth() const;
84
85
/// @brief Open help attributes dialog
86
void openHelpAttributesDialog(const GNEAttributeCarrier* AC) const;
87
88
/// @brief function called after undo/redo in the current frame (can be reimplemented in frame children)
89
virtual void updateFrameAfterUndoRedo();
90
91
/// @brief function called after setting new width in current frame (can be reimplemented in frame children)
92
virtual void frameWidthUpdated();
93
94
/// @name functions called by moduls that can be reimplemented in frame children (note: reimplement as protected, just for safety)
95
/// @{
96
97
/// @brief Tag selected in GNETagSelector
98
virtual void tagSelected();
99
100
/// @brief selected demand element in DemandElementSelector
101
virtual void demandElementSelected();
102
103
/// @brief build a shaped element using the drawed shape
104
virtual bool shapeDrawed();
105
106
/// @brief function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/...
107
virtual void attributeUpdated(SumoXMLAttr attribute);
108
109
/// @brief open GNEAttributesCreator extended dialog
110
virtual void selectedOverlappedElement(GNEAttributeCarrier* AC);
111
112
/// @brief create path between two elements
113
virtual bool createPath(const bool useLastRoute);
114
115
/// @}
116
117
protected:
118
/// @brief FOX need this
119
FOX_CONSTRUCTOR(GNEFrame)
120
121
/// @brief View Net
122
GNEViewNet* myViewNet = nullptr;
123
124
/// @brief Vertical frame that holds all widgets of frame
125
FXVerticalFrame* myContentFrame = nullptr;
126
127
/// @brief fame for header elements
128
FXHorizontalFrame* myHeaderFrame = nullptr;
129
130
/// @brief fame for left header elements
131
FXHorizontalFrame* myHeaderLeftFrame = nullptr;
132
133
/// @brief fame for right header elements
134
FXHorizontalFrame* myHeaderRightFrame = nullptr;
135
136
/// @brief get predefinedTagsMML
137
const std::vector<std::string>& getPredefinedTagsMML() const;
138
139
/// @brief build rainbow in frame modul
140
static FXLabel* buildRainbow(FXComposite* parent);
141
142
private:
143
/// @brief scroll windows that holds the content frame
144
FXScrollWindow* myScrollWindowsContents = nullptr;
145
146
/// @brief static Font for the Header (it's common for all headers, then create only one time)
147
static FXFont* myFrameHeaderFont;
148
149
/// @brief the label for the frame's header
150
FXLabel* myFrameHeaderLabel = nullptr;
151
152
/// @brief Map of attribute ids to their (readable) string-representation (needed for SUMOSAXAttributesImpl_Cached)
153
std::vector<std::string> myPredefinedTagsMML;
154
155
/// @brief Invalidated copy constructor.
156
GNEFrame(const GNEFrame&) = delete;
157
158
/// @brief Invalidated assignment operator.
159
GNEFrame& operator=(const GNEFrame&) = delete;
160
};
161
162