Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEAttributesEditor.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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/****************************************************************************/
18// Table used for pack GNEAttributeRows
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <vector>
25
26// ===========================================================================
27// class declaration
28// ===========================================================================
29
30class GNEFrame;
33
34// ===========================================================================
35// class GNEAttributesEditor
36// ===========================================================================
37
40 FXDECLARE(GNEAttributesEditor)
41
42
44
45public:
46
55
57 GNEAttributesEditor(GNEFrame* frameParent, const std::string attributesEditorName, const int editorOptions);
58
60 GNEFrame* getFrameParent() const;
61
64
66 void showAttributesEditor(const std::unordered_set<GNEAttributeCarrier*>& ACs);
67
70
73
77 bool isReparenting() const;
78
80 bool checkNewParent(const GNEAttributeCarrier* AC) const;
81
83 void setNewParent(const GNEAttributeCarrier* AC);
84
86 void abortReparenting();
87
89
93 long onCmdMarkAsFront(FXObject*, FXSelector, void*);
94
96 long onCmdOpenElementDialog(FXObject*, FXSelector, void*);
97
99 long onCmdOpenExtendedAttributesDialog(FXObject*, FXSelector, void*);
100
102 long onCmdAttributesEditorHelp(FXObject*, FXSelector, void*);
103
105
106protected:
108 FOX_CONSTRUCTOR(GNEAttributesEditor)
109
110
112
114 void setAttribute(SumoXMLAttr attr, const std::string& value);
115
117 void toggleEnableAttribute(SumoXMLAttr attr, const bool value);
118
120 void enableReparent();
121
123 void inspectParent();
124
126 void moveLaneUp();
127
129 void moveLaneDown();
130
132
133private:
136
138 FXButton* myHelpButton;
139
141 FXButton* myFrontButton = nullptr;
142
144 FXButton* myOpenDialogButton = nullptr;
145
148
150 std::vector<GNEAttributeCarrier*> myEditedACs;
151
153 std::vector<GNEAttributesEditorRow*> myAttributesEditorRows;
154
157
160
163};
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
called when user press the help button
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
long onCmdOpenElementDialog(FXObject *, FXSelector, void *)
called when user press the "Open element dialog" button
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
std::vector< GNEAttributeCarrier * > myEditedACs
current edited ACs
long onCmdMarkAsFront(FXObject *, FXSelector, void *)
GNEFrame * myFrameParent
pointer to GNEFrame parent
int myMaxNumberOfRows
maximum number of rows used in this attributes editor
void refreshAttributesEditor()
refresh attribute editor
int myEditorOptions
variable use for packing attribute editor options
void toggleEnableAttribute(SumoXMLAttr attr, const bool value)
set attribute in the current ACs (Callend from row)
bool checkNewParent(const GNEAttributeCarrier *AC) const
check if the given AC can be a new parent
void moveLaneDown()
move lane down
void inspectParent()
inspect parent (Callend from row)
EditorOptions
Options for filter attributes.
void enableReparent()
void enable reparent
std::vector< GNEAttributesEditorRow * > myAttributesEditorRows
list of attributes editor rows
void showAttributesEditor(GNEAttributeCarrier *AC)
edit attributes of the given AC (usually the edited template AC)
SumoXMLTag myReparentTag
check if we're reparent
long onCmdOpenExtendedAttributesDialog(FXObject *, FXSelector, void *)
called when user press the "Open extended attributes" button
void abortReparenting()
abort selecting parent
void hideAttributesEditor()
hide attribute editor
FXButton * myFrontButton
pointer to front button
FXButton * myOpenExtendedAttributesButton
pointer to open extended attributes button
void moveLaneUp()
move lane up
FXButton * myOpenDialogButton
pointer to open dialog button (usually additionals)
void setAttribute(SumoXMLAttr attr, const std::string &value)
set attribute in the current ACs (Callend from row)
FXButton * myHelpButton
button for help
MFXGroupBoxModule (based on FXGroupBox)
every row value