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