Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/network/GNEAdditionalFrame.h
169686 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 GNEAdditionalFrame.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Dec 2015
17
///
18
// The Widget for add additional elements
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/frames/GNEFrame.h>
24
#include <netedit/GNEViewNetHelper.h>
25
26
// ===========================================================================
27
// class declaration
28
// ===========================================================================
29
30
class GNEAttributesEditor;
31
class GNEConsecutiveSelector;
32
class GNESelectorParent;
33
class GNETagSelector;
34
class GNEViewObjectSelector;
35
36
// ===========================================================================
37
// class definitions
38
// ===========================================================================
39
40
class GNEAdditionalFrame : public GNEFrame {
41
42
public:
43
// ===========================================================================
44
// class EdgeTypeSelector
45
// ===========================================================================
46
47
class E2MultilaneLegendModule : public MFXGroupBoxModule {
48
49
public:
50
/// @brief constructor
51
E2MultilaneLegendModule(GNEFrame* frameParent);
52
53
/// @brief destructor
54
~E2MultilaneLegendModule();
55
56
/// @brief show Legend modul
57
void showE2MultilaneLegend();
58
59
/// @brief hide Legend modul
60
void hideE2MultilaneLegend();
61
};
62
63
// ===========================================================================
64
// class HelpCreationModule
65
// ===========================================================================
66
67
class HelpCreationModule : public MFXGroupBoxModule {
68
69
public:
70
/// @brief constructor
71
HelpCreationModule(GNEFrame* frameParent);
72
73
/// @brief destructor
74
~HelpCreationModule();
75
76
/// @brief show Legend modul
77
void showHelpCreationModule(SumoXMLTag XMLTag);
78
79
/// @brief hide Legend modul
80
void hideHelpCreationModule();
81
82
private:
83
/// @brief add translated string
84
std::string addTLString(const std::string& str);
85
86
/// @brief help label
87
FXLabel* myHelpLabel = nullptr;
88
89
/// @brief map with tags and their associated help
90
std::map<SumoXMLTag, std::string> myHelpMap;
91
};
92
93
/**@brief Constructor
94
* @brief viewParent GNEViewParent in which this GNEFrame is placed
95
* @brief viewNet viewNet that uses this GNEFrame
96
*/
97
GNEAdditionalFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
98
99
/// @brief Destructor
100
~GNEAdditionalFrame();
101
102
/// @brief show Frame
103
void show();
104
105
/**@brief add additional element
106
* @param viewObjects collection of objects under cursor after click over view
107
* @return true if additional was successfully added
108
*/
109
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
110
111
/// @brief get additional tag selector
112
GNETagSelector* getAdditionalTagSelector() const;
113
114
/// @brief get consecutive lane selector
115
GNEConsecutiveSelector* getConsecutiveLaneSelector() const;
116
117
/// @brief get attribtues editor
118
GNEAttributesEditor* getAttributesEditor() const;
119
120
/// @brief get module for select view objects
121
GNEViewObjectSelector* getViewObjetsSelector() const;
122
123
/// @brief create path
124
bool createPath(const bool useLastRoute);
125
126
protected:
127
/// @brief SumoBaseObject used for create additional
128
CommonXMLStructure::SumoBaseObject* myBaseAdditional = nullptr;
129
130
/// @brief Tag selected in GNETagSelector
131
void tagSelected();
132
133
/// @brief last clicked position
134
Position myLastClickedPosition;
135
136
private:
137
// @brief reste base additional object
138
void resetBaseAdditionalObject();
139
140
// @brief init baseAdditionalObject
141
bool initBaseAdditionalObject(const GNETagProperties* tagProperty, const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
142
143
/// @brief item selector
144
GNETagSelector* myAdditionalTagSelector = nullptr;
145
146
/// @brief additional attributes editor
147
GNEAttributesEditor* myAdditionalAttributesEditor = nullptr;
148
149
/// @brief Module for select a single parent additional
150
GNESelectorParent* mySelectorAdditionalParent = nullptr;
151
152
/// @brief Module for select view objects
153
GNEViewObjectSelector* myViewObjetsSelector = nullptr;
154
155
/// @brief Module for select consecutive lanes
156
GNEConsecutiveSelector* myConsecutiveLaneSelector = nullptr;
157
158
/// @brief Module for show additional help legend
159
HelpCreationModule* myHelpCreationModule = nullptr;
160
161
/// @brief Module for show E2 Detector legend
162
E2MultilaneLegendModule* myE2MultilaneLegendModule = nullptr;
163
};
164
165