Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEGenericData.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-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/****************************************************************************/
18// A abstract class for generic datas
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
28
29// ===========================================================================
30// class declarations
31// ===========================================================================
32
33class GNEDataInterval;
34class GNENet;
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
39
41
42public:
45
51 GNEGenericData(const SumoXMLTag tag, GNEDataInterval* dataIntervalParent,
52 const Parameterised::Map& parameters);
53
55 virtual ~GNEGenericData();
56
59
62
64 GNEMoveElement* getMoveElement() const override;
65
67 Parameterised* getParameters() override;
68
70 const Parameterised* getParameters() const override;
71
73 GUIGlObject* getGUIGlObject() override;
74
76 const GUIGlObject* getGUIGlObject() const override;
77
79
81 virtual bool isGenericDataVisible() const = 0;
82
84 FileBucket* getFileBucket() const override;
85
88
89 // @brief draw attribute
90 void drawAttribute(const PositionVector& shape) const;
91
93 virtual Position getPositionInView() const = 0;
94
97
99 bool checkDrawFromContour() const override;
100
102 bool checkDrawToContour() const override;
103
105 bool checkDrawRelatedContour() const override;
106
108 bool checkDrawOverContour() const override;
109
111 bool checkDrawDeleteContour() const override;
112
114 bool checkDrawDeleteContourSmall() const override;
115
117 bool checkDrawSelectContour() const override;
118
120 bool checkDrawMoveContour() const override;
121
123
126
129 virtual void writeGenericData(OutputDevice& device) const = 0;
130
132 virtual bool isGenericDataValid() const;
133
135 virtual std::string getGenericDataProblem() const;
136
138 virtual void fixGenericDataProblem();
140
143
151
160
162 void deleteGLObject() override;
163
165 void selectGLObject() override;
166
168 void updateGLObject() override;
169
171
174
175 /* @brief method for getting the Attribute of an XML key in position format
176 * @param[in] key The attribute key
177 * @return position with the value associated to key
178 */
179 Position getAttributePosition(SumoXMLAttr key) const override;
180
181 /* @brief method for getting the Attribute of an XML key in positionVector format
182 * @param[in] key The attribute key
183 * @return positionVector with the value associated to key
184 */
186
188
191
193 bool isPathElementSelected() const override;
194
196
197protected:
200
202 void drawFilteredAttribute(const GUIVisualizationSettings& s, const PositionVector& laneShape, const std::string& attribute, const GNEDataInterval* dataIntervalParent) const;
203
205 bool isVisibleInspectDeleteSelect() const;
206
208 void replaceFirstParentEdge(const std::string& value);
209
211 void replaceLastParentEdge(const std::string& value);
212
214 void replaceParentTAZElement(const int index, const std::string& value);
215
217 std::string getPartialID() const;
218
219private:
222
225};
226
227/****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Position getAttributePosition(SumoXMLAttr key) const override
bool isPathElementSelected() const override
check if path element is selected
virtual void writeGenericData(OutputDevice &device) const =0
write data set element into a xml file
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
bool checkDrawOverContour() const override
check if draw over contour (orange)
GNEGenericData(const GNEGenericData &)=delete
Invalidated copy constructor.
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
virtual bool isGenericDataVisible() const =0
check if current generic data is visible
virtual void fixGenericDataProblem()
fix data set problem (by default throw an exception, has to be reimplemented in children)
GUIGlObject * getGUIGlObject() override
get GUIGlObject associated with this genericData
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
void selectGLObject() override
select element
void drawAttribute(const PositionVector &shape) const
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
virtual std::string getGenericDataProblem() const
return a string with the current data set problem (by default empty, can be reimplemented in children...
bool checkDrawSelectContour() const override
check if draw select contour (blue)
virtual ~GNEGenericData()
Destructor.
GNEMoveElement * getMoveElement() const override
get GNEMoveElement associated with this genericData
bool checkDrawToContour() const override
check if draw from contour (magenta)
virtual Position getPositionInView() const =0
Returns element position in view.
bool checkDrawFromContour() const override
check if draw from contour (green)
GNEDataInterval * myDataIntervalParent
dataInterval Parent
std::string getPartialID() const
get partial ID
virtual bool isGenericDataValid() const
check if current data set is valid to be written into XML (by default true, can be reimplemented in c...
GNEGenericData & operator=(const GNEGenericData &)=delete
Invalidated assignment operator.
GNEHierarchicalElement * getHierarchicalElement() override
methods to retrieve the elements linked to this dataSet
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
bool isVisibleInspectDeleteSelect() const
check if attribute is visible in inspect, delete or select mode
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
GNEDataInterval * getDataIntervalParent() const
get data interval parent
void replaceFirstParentEdge(const std::string &value)
replace the first parent edge
void deleteGLObject() override
delete element
void updateGLObject() override
update GLObject (geometry, ID, etc.)
bool checkDrawMoveContour() const override
check if draw move contour (red)
void replaceParentTAZElement(const int index, const std::string &value)
replace the first parent TAZElement
void drawFilteredAttribute(const GUIVisualizationSettings &s, const PositionVector &laneShape, const std::string &attribute, const GNEDataInterval *dataIntervalParent) const
draw filtered attribute
Parameterised * getParameters() override
get parameters associated with this genericData
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
The popup menu of a globject.
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.