Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPOI.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 class for visualizing and editing POIS in netedit (adapted from
19// GUIPointOfInterest and NLHandler)
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
26
27#include "GNEAdditional.h"
28
29// ===========================================================================
30// class declarations
31// ===========================================================================
32
33class GNELane;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
39class GNEPOI : public PointOfInterest, public GNEAdditional {
40
41public:
44
46 GNEPOI(SumoXMLTag tag, GNENet* net);
47
66 GNEPOI(const std::string& id, GNENet* net, const std::string& filename, const std::string& type, const RGBColor& color, const double xLon,
67 const double yLat, const bool geo, const std::string& icon, const double layer, const double angle, const std::string& imgFile,
68 const double width, const double height, const std::string& name, const Parameterised::Map& parameters);
69
88 GNEPOI(const std::string& id, GNENet* net, const std::string& filename, const std::string& type, const RGBColor& color, GNELane* lane,
89 const double posOverLane, const bool friendlyPos, const double posLat, const std::string& icon, const double layer, const double angle,
90 const std::string& imgFile, const double width, const double height, const std::string& name, const Parameterised::Map& parameters);
91
93 ~GNEPOI();
94
99
101 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;
102
104 std::string generateChildID(SumoXMLTag childTag);
105
108
111
113 void updateGeometry() override;
114
116 Position getPositionInView() const override;
117
119 double getExaggeration(const GUIVisualizationSettings& s) const override;
120
122 void updateCenteringBoundary(const bool updateGrid) override;
123
125 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement,
126 const GNENetworkElement* newElement, GNEUndoList* undoList) override;
127
131 void writeAdditional(OutputDevice& device) const override;
132
134 bool isAdditionalValid() const override;
135
137 std::string getAdditionalProblem() const override;
138
140 void fixAdditionalProblem() override;
141
143 GUIGlID getGlID() const;
144
146
149
151 bool checkDrawMoveContour() const override;
152
154
157
160 std::string getParentName() const override;
161
170
175 void drawGL(const GUIVisualizationSettings& s) const override;
176
178
181
186 std::string getAttribute(SumoXMLAttr key) const override;
187
188 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
189 * @param[in] key The attribute key
190 * @return double with the value associated to key
191 */
192 double getAttributeDouble(SumoXMLAttr key) const override;
193
195 const Parameterised::Map& getACParametersMap() const override;
196
202 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
203
209 bool isValid(SumoXMLAttr key, const std::string& value) override;
210
211 /* @brief method for check if the value for certain attribute is set
212 * @param[in] key The attribute key
213 */
214 bool isAttributeEnabled(SumoXMLAttr key) const override;
215
217
219 std::string getPopUpID() const override;
220
222 std::string getHierarchyName() const override;
223
224protected:
227
230
233
236
239
242
243private:
246 const bool movingGeometryPoints) const;
247
250 const double exaggeration, const bool movingGeometryPoints) const;
251
253 void setAttribute(SumoXMLAttr key, const std::string& value) override;
254
256 void setMoveShape(const GNEMoveResult& moveResult) override;
257
259 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
260
262 GNEPOI(const GNEPOI&) = delete;
263
265 GNEPOI& operator=(const GNEPOI&) = delete;
266};
unsigned int GUIGlID
Definition GUIGlObject.h:44
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::string getID() const
get ID (all Attribute Carriers have one)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
bool isValid(SumoXMLAttr key, const std::string &value) override
method for checking if the key and their correspond attribute are valids
Definition GNEPOI.cpp:498
Position getPositionInView() const override
Returns position of shape in view.
Definition GNEPOI.cpp:257
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Definition GNEPOI.cpp:570
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition GNEPOI.cpp:348
const Parameterised::Map & getACParametersMap() const override
get parameters map
Definition GNEPOI.cpp:463
GNEContour myMovingContourRight
variable used for moving contour right
Definition GNEPOI.h:241
PositionVector myShapeWidth
shape width of POI
Definition GNEPOI.h:226
void drawPOI(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const bool movingGeometryPoints) const
draw POI
Definition GNEPOI.cpp:585
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
Definition GNEPOI.cpp:779
void calculatePOIContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const bool movingGeometryPoints) const
calculate contour
Definition GNEPOI.cpp:612
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
Definition GNEPOI.cpp:269
GNEContour myMovingContourLeft
variable used for moving contour left
Definition GNEPOI.h:238
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Definition GNEPOI.cpp:576
std::string getParentName() const override
Returns the name of the parent object.
Definition GNEPOI.cpp:316
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
Definition GNEPOI.cpp:214
std::string getAttribute(SumoXMLAttr key) const override
method for getting the Attribute of an XML key
Definition GNEPOI.cpp:394
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
Definition GNEPOI.cpp:263
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition GNEPOI.cpp:294
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
Definition GNEPOI.cpp:187
~GNEPOI()
Destructor.
Definition GNEPOI.cpp:86
GNEMoveOperation * getMoveOperation() override
get move operation
Definition GNEPOI.cpp:90
bool isAttributeEnabled(SumoXMLAttr key) const override
Definition GNEPOI.cpp:552
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
Definition GNEPOI.cpp:129
double getAttributeDouble(SumoXMLAttr key) const override
Definition GNEPOI.cpp:457
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition GNEPOI.cpp:135
GNEContour myMovingContourDown
variable used for moving contour down
Definition GNEPOI.h:235
GNEPOI(const GNEPOI &)=delete
Invalidated copy constructor.
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
Definition GNEPOI.cpp:160
void updateGeometry() override
update pre-computed geometry information
Definition GNEPOI.cpp:230
bool checkDrawMoveContour() const override
check if draw move contour (red)
Definition GNEPOI.cpp:300
PositionVector myShapeHeight
shape height of POI
Definition GNEPOI.h:229
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
Definition GNEPOI.cpp:760
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Definition GNEPOI.cpp:288
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
Definition GNEPOI.cpp:173
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
method for setting the attribute and letting the object perform additional changes
Definition GNEPOI.cpp:469
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
Definition GNEPOI.cpp:326
GNEContour myMovingContourUp
variable used for moving contour up
Definition GNEPOI.h:232
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
Definition GNEPOI.cpp:141
GNEPOI & operator=(const GNEPOI &)=delete
Invalidated assignment operator.
The popup menu of a globject.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map
A point-of-interest.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.