Eclipse SUMO - Simulation of Urban MObility
GNEFrameAttributeModules.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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// Auxiliar class for GNEFrame Modules (only for attributes edition)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
31
32// ===========================================================================
33// class declaration
34// ===========================================================================
35
36class GNEFrame;
37class GNEViewParent;
38class GNEFlowEditor;
39
40// ===========================================================================
41// class definitions
42// ===========================================================================
43
45
46public:
47 // ===========================================================================
48 // class declaration
49 // ===========================================================================
50
51 class AttributesEditor;
52 class AttributesEditorFlow;
53
54 // ===========================================================================
55 // class AttributesEditorRow
56 // ===========================================================================
57
58 class AttributesEditorRow : protected FXHorizontalFrame {
61
62 public:
64 AttributesEditorRow(AttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, const std::string& value,
65 const bool attributeEnabled, const bool computed, GNEAttributeCarrier* ACParent);
66
68 void destroy();
69
71 void refreshAttributesEditorRow(const std::string& value, const bool forceRefresh, const bool attributeEnabled, const bool computed, GNEAttributeCarrier* ACParent);
72
74 bool isAttributesEditorRowValid() const;
75
78
80 long onCmdSetAttribute(FXObject*, FXSelector, void*);
81
83 long onCmdSelectCheckButton(FXObject*, FXSelector, void*);
84
86 long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*);
87
89 long onCmdInspectVTypeParent(FXObject*, FXSelector, void*);
91
92 protected:
95
97 std::string stripWhitespaceAfterComma(const std::string& stringValue);
98
100 bool mergeJunction(SumoXMLAttr attr, const std::vector<GNEAttributeCarrier*>& inspectedACs, const std::string& newVal) const;
101
102 private:
105
108
111
113 FXCheckButton* myAttributeCheckButton = nullptr;
114
117
120
123
126
129
131 FXCheckButton* myValueCheckButton = nullptr;
132
135 };
136
137 // ===========================================================================
138 // class AttributesEditor
139 // ===========================================================================
140
144
145 public:
147 AttributesEditor(GNEFrame* inspectorFrameParent);
148
150 void showAttributeEditorModule(bool includeExtended, bool forceAttributeEnabled);
151
154
156 void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition);
157
159 GNEFrame* getFrameParent() const;
160
164 long onCmdAttributesEditorHelp(FXObject*, FXSelector, void*);
166
167 protected:
169 FOX_CONSTRUCTOR(AttributesEditor)
170
171 private:
174
177
179 std::vector<AttributesEditorRow*> myAttributesEditorRows;
180
182 FXButton* myHelpButton = nullptr;
183
186 };
187
188 // ===========================================================================
189 // class AttributesEditorExtended
190 // ===========================================================================
191
195
196 public:
199
202
205
208
212 long onCmdOpenDialog(FXObject*, FXSelector, void*);
214
215 protected:
216 FOX_CONSTRUCTOR(AttributesEditorExtended)
217
218 private:
221 };
222
223 // ===========================================================================
224 // class GenericDataAttributes
225 // ===========================================================================
226
230
231 public:
233 GenericDataAttributes(GNEFrame* frameParent);
234
237
240
243
246
249
251 std::string getParametersStr() const;
252
254 std::vector<std::pair<std::string, std::string> > getParameters() const;
255
257 void setParameters(const std::vector<std::pair<std::string, std::string> >& parameters);
258
260 GNEFrame* getFrameParent() const;
261
263 bool areAttributesValid() const;
264
268 long onCmdEditParameters(FXObject*, FXSelector, void*);
269
271 long onCmdSetParameters(FXObject*, FXSelector, void*);
273
274 protected:
275 FOX_CONSTRUCTOR(GenericDataAttributes)
276
277 private:
280
283
285 FXTextField* myTextFieldParameters = nullptr;
286
288 FXButton* myButtonEditParameters = nullptr;
289 };
290
292 static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeCarrier* AC);
293
295 static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeProperties& ACAttr);
296};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void showAttributesEditorExtendedModule()
show AttributesEditorExtended modul
AttributesEditorExtended(GNEFrame *frameParent)
FOX-declaration.
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
void showAttributeEditorModule(bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
bool myIncludeExtended
flag used to mark if current edited ACs are bein edited including extended attribute
GNEFlowEditor * myAttributesEditorFlow
GNEFlowEditor modul.
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
std::vector< AttributesEditorRow * > myAttributesEditorRows
list of Attribute editor rows
AttributesEditor(GNEFrame *inspectorFrameParent)
FOX-declaration.
void refreshAttributesEditorRow(const std::string &value, const bool forceRefresh, const bool attributeEnabled, const bool computed, GNEAttributeCarrier *ACParent)
refresh current row
bool mergeJunction(SumoXMLAttr attr, const std::vector< GNEAttributeCarrier * > &inspectedACs, const std::string &newVal) const
check junction merging
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
GNEAttributeCarrier * myACParent
pointer to AC Parent
const GNEAttributeProperties myACAttr
current AC Attribute
std::string stripWhitespaceAfterComma(const std::string &stringValue)
removed invalid spaces of Positions and shapes
long onCmdInspectVTypeParent(FXObject *, FXSelector, void *)
inspect vType/VTypeDistribution parent
bool isAttributesEditorRowValid() const
check if current attribute of TextField/ComboBox is valid
MFXButtonTooltip * myAttributeButtonCombinableChoices
pointer to buttonCombinableChoices
MFXButtonTooltip * myAttributeColorButton
Button for open color editor.
void destroy()
destroy GNEAttributesCreatorRow (but don't delete)
FXCheckButton * myValueCheckButton
pointer to menu check
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
MFXLabelTooltip * myAttributeLabel
pointer to attribute label
MFXIconComboBox * myValueComboBoxChoices
pointer to combo box choices
long onCmdSelectCheckButton(FXObject *, FXSelector, void *)
called when user press a check button
AttributesEditor * myAttributesEditorParent
pointer to AttributesEditor parent
MFXTextFieldTooltip * myValueTextField
textField to modify the value of string attributes
FXCheckButton * myAttributeCheckButton
pointer to attribute menu check
MFXButtonTooltip * myAttributeVTypeButton
Button for inspect Vtype/VtypeDistribution parent.
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
bool areAttributesValid() const
check if current attributes are valid
const Parameterised::Map & getParametersMap() const
get parameters as map
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
void refreshGenericDataAttributes()
refresh netedit attributes
FXTextField * myTextFieldParameters
text field for write parameters
void showGenericDataAttributes()
show netedit attributes EditorCreator
long onCmdEditParameters(FXObject *, FXSelector, void *)
GNEFrame * getFrameParent() const
pointer to frame parent
std::vector< std::pair< std::string, std::string > > getParameters() const
get parameters as vector of strings
std::string getParametersStr() const
get parameters as string
GenericDataAttributes(GNEFrame *frameParent)
FOX-declaration.
Parameterised::Map myParameters
pointer to current map of parameters
void hideGenericDataAttributes()
hide netedit attributes EditorCreator
void setParameters(const std::vector< std::pair< std::string, std::string > > &parameters)
set parameters
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:84
MFXGroupBoxModule (based on FXGroupBox)
ComboBox with icon.
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45