Eclipse SUMO - Simulation of Urban MObility
GNEPOI.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// A class for visualizing and editing POIS in netedit (adapted from
19// GUIPointOfInterest and NLHandler)
20/****************************************************************************/
21#pragma once
22#include <config.h>
25
26#include "GNEAdditional.h"
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31class GNELane;
32
33// ===========================================================================
34// class definitions
35// ===========================================================================
43class GNEPOI : public PointOfInterest, public GNEAdditional {
44
45public:
48
50 GNEPOI(SumoXMLTag tag, GNENet* net);
51
69 GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const double xLon,
70 const double yLat, const bool geo, const double layer, const double angle, const std::string& imgFile,
71 const bool relativePath, const double width, const double height, const std::string& name,
72 const Parameterised::Map& parameters);
73
91 GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, GNELane* lane, const double posOverLane, const bool friendlyPos,
92 const double posLat, const double layer, const double angle, const std::string& imgFile, const bool relativePath, const double width,
93 const double height, const std::string& name, const Parameterised::Map& parameters);
94
96 ~GNEPOI();
97
102
104 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;
105
107 std::string generateChildID(SumoXMLTag childTag);
108
111
115 void updateGeometry() override;
116
118 Position getPositionInView() const override;
119
121 double getExaggeration(const GUIVisualizationSettings& s) const override;
122
124 void updateCenteringBoundary(const bool updateGrid) override;
125
127 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement,
128 const GNENetworkElement* newElement, GNEUndoList* undoList) override;
129
133 void writeAdditional(OutputDevice& device) const override;
134
136 GUIGlID getGlID() const;
137
139
142
145 std::string getParentName() const override;
146
155
160 void drawGL(const GUIVisualizationSettings& s) const override;
161
162 double getClickPriority() const override {
163 return getShapeLayer();
164 }
166
169
173 std::string getAttribute(SumoXMLAttr key) const override;
174
175 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
176 * @param[in] key The attribute key
177 * @return double with the value associated to key
178 */
179 double getAttributeDouble(SumoXMLAttr key) const override;
180
182 const Parameterised::Map& getACParametersMap() const override;
183
189 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
190
196 bool isValid(SumoXMLAttr key, const std::string& value) override;
197
198 /* @brief method for check if the value for certain attribute is set
199 * @param[in] key The attribute key
200 */
201 bool isAttributeEnabled(SumoXMLAttr key) const override;
203
205 std::string getPopUpID() const override;
206
208 std::string getHierarchyName() const override;
209
210protected:
213
216
217private:
219 void setAttribute(SumoXMLAttr key, const std::string& value) override;
220
222 void setMoveShape(const GNEMoveResult& moveResult) override;
223
225 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
226
228 GNEPOI(const GNEPOI&) = delete;
229
231 GNEPOI& operator=(const GNEPOI&) = delete;
232};
unsigned int GUIGlID
Definition: GUIGlObject.h:43
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:48
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
Definition: GNEPOI.h:43
bool isValid(SumoXMLAttr key, const std::string &value) override
method for checking if the key and their correspond attribute are valids
Definition: GNEPOI.cpp:461
Position getPositionInView() const override
Returns position of shape in view.
Definition: GNEPOI.cpp:196
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Definition: GNEPOI.cpp:541
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition: GNEPOI.cpp:271
const Parameterised::Map & getACParametersMap() const override
get parameters map
Definition: GNEPOI.cpp:425
double getClickPriority() const override
Returns the priority of receiving mouse clicks.
Definition: GNEPOI.h:162
PositionVector myShapeWidth
shape width of POI
Definition: GNEPOI.h:212
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
Definition: GNEPOI.cpp:710
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
Definition: GNEPOI.cpp:208
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNEPOI.cpp:547
std::string getParentName() const override
Returns the name of the parent object.
Definition: GNEPOI.cpp:239
std::string getAttribute(SumoXMLAttr key) const override
method for getting the Attribute of an XML key
Definition: GNEPOI.cpp:354
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
Definition: GNEPOI.cpp:202
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GNEPOI.cpp:233
~GNEPOI()
Destructor.
Definition: GNEPOI.cpp:83
GNEMoveOperation * getMoveOperation() override
get move operation
Definition: GNEPOI.cpp:87
bool isAttributeEnabled(SumoXMLAttr key) const override
Definition: GNEPOI.cpp:530
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
Definition: GNEPOI.cpp:125
double getAttributeDouble(SumoXMLAttr key) const override
Definition: GNEPOI.cpp:419
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNEPOI.cpp:131
GNEPOI(const GNEPOI &)=delete
Invalidated copy constructor.
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
Definition: GNEPOI.cpp:156
void updateGeometry() override
update pre-computed geometry information
Definition: GNEPOI.cpp:169
PositionVector myShapeHeight
shape height of POI
Definition: GNEPOI.h:215
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
Definition: GNEPOI.cpp:691
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Definition: GNEPOI.cpp:227
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:431
GNEPOI(SumoXMLTag tag, GNENet *net)
Constructor.
Definition: GNEPOI.cpp:45
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
Definition: GNEPOI.cpp:249
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
Definition: GNEPOI.cpp:137
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.
Definition: OutputDevice.h:61
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
A point-of-interest.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
A list of positions.
double getShapeLayer() const
Returns the layer of the Shape.
Definition: Shape.h:91