Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/GNEAttributesEditor.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 GNEAttributesEditor.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Feb 2025
17
///
18
// pack of all GNEAttributesEditorTypes
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
# include "GNEAttributesEditorType.h"
24
25
// ===========================================================================
26
// class GNEAttributesEditor
27
// ===========================================================================
28
29
class GNEAttributesEditor {
30
31
public:
32
/// @brief constructor
33
GNEAttributesEditor(GNEFrame* frameParent, GNEAttributesEditorType::EditorType editorType);
34
35
/// @brief edit attributes of the given AC (usually the edited template AC)
36
void showAttributesEditor(GNEAttributeCarrier* AC, const bool primaryAttributeEditor);
37
38
/// @brief edit attributes of the given hash of ACs (usually the inspected ACs)
39
void showAttributesEditor(const std::unordered_set<GNEAttributeCarrier*>& ACs, const bool primaryAttributeEditor);
40
41
/// @brief hide attribute editor
42
void hideAttributesEditor();
43
44
/// @brief refresh attribute editor
45
void refreshAttributesEditor();
46
47
/// @brief disable attribute editor
48
void disableAttributesEditor();
49
50
/// @brief check if current edited attributes are valid
51
bool checkAttributes(const bool showWarning);
52
53
/// @brief fill sumo Base object
54
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject* baseObject) const;
55
56
/// @name Functions related with selecting parents (only affect the Netedit Attributes editor)
57
/// @{
58
/// @brief check if we're selecting a parent clicking over view
59
bool isReparenting() const;
60
61
/// @brief check if the given AC can be a new parent
62
bool checkNewParent(const GNEAttributeCarrier* AC) const;
63
64
/// @brief set new parent
65
void setNewParent(const GNEAttributeCarrier* AC);
66
67
/// @brief abort selecting parent
68
void abortReparenting();
69
70
/// @}
71
72
protected:
73
/// @brief basic attributes editor
74
GNEAttributesEditorType* myBasicAttributesEditor = nullptr;
75
76
/// @brief extended attributes editor
77
GNEAttributesEditorType* myExtendedAttributesEditor = nullptr;
78
79
/// @brief flow attributes editor
80
GNEAttributesEditorType* myFlowAttributesEditor = nullptr;
81
82
/// @brief geo attributes editor
83
GNEAttributesEditorType* myGeoAttributesEditor = nullptr;
84
85
/// @brief parameteres attributes editor
86
GNEAttributesEditorType* myParametersAttributesEditor = nullptr;
87
88
/// @brief netedit attributes editor
89
GNEAttributesEditorType* myNeteditAttributesEditor = nullptr;
90
91
private:
92
/// @brief Invalidated copy constructor.
93
GNEAttributesEditor(GNEAttributesEditor*) = delete;
94
95
/// @brief Invalidated assignment operator.
96
GNEAttributesEditor& operator=(GNEAttributesEditor*) = delete;
97
};
98
99