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-2023 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
114
116 void updateGeometry() override;
117
119 Position getPositionInView() const override;
120
122 double getExaggeration(const GUIVisualizationSettings& s) const override;
123
125 void updateCenteringBoundary(const bool updateGrid) override;
126
128 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement,
129 const GNENetworkElement* newElement, GNEUndoList* undoList) override;
130
134 void writeAdditional(OutputDevice& device) const override;
135
137 bool isAdditionalValid() const override;
138
140 std::string getAdditionalProblem() const override;
141
143 void fixAdditionalProblem() override;
144
146 GUIGlID getGlID() const;
147
149
152
155 std::string getParentName() const override;
156
165
170 void drawGL(const GUIVisualizationSettings& s) const override;
171
172 double getClickPriority() const override {
173 return getShapeLayer();
174 }
176
179
184 std::string getAttribute(SumoXMLAttr key) const override;
185
186 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
187 * @param[in] key The attribute key
188 * @return double with the value associated to key
189 */
190 double getAttributeDouble(SumoXMLAttr key) const override;
191
193 const Parameterised::Map& getACParametersMap() const override;
194
200 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
201
207 bool isValid(SumoXMLAttr key, const std::string& value) override;
208
209 /* @brief method for check if the value for certain attribute is set
210 * @param[in] key The attribute key
211 */
212 bool isAttributeEnabled(SumoXMLAttr key) const override;
213
215
217 std::string getPopUpID() const override;
218
220 std::string getHierarchyName() const override;
221
222protected:
225
228
229private:
231 void setAttribute(SumoXMLAttr key, const std::string& value) override;
232
234 void setMoveShape(const GNEMoveResult& moveResult) override;
235
237 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
238
240 GNEPOI(const GNEPOI&) = delete;
241
243 GNEPOI& operator=(const GNEPOI&) = delete;
244};
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.
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:520
Position getPositionInView() const override
Returns position of shape in view.
Definition GNEPOI.cpp:255
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Definition GNEPOI.cpp:600
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition GNEPOI.cpp:330
const Parameterised::Map & getACParametersMap() const override
get parameters map
Definition GNEPOI.cpp:484
double getClickPriority() const override
Returns the priority of receiving mouse clicks.
Definition GNEPOI.h:172
PositionVector myShapeWidth
shape width of POI
Definition GNEPOI.h:224
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
Definition GNEPOI.cpp:769
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
Definition GNEPOI.cpp:267
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Definition GNEPOI.cpp:606
std::string getParentName() const override
Returns the name of the parent object.
Definition GNEPOI.cpp:298
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
Definition GNEPOI.cpp:212
std::string getAttribute(SumoXMLAttr key) const override
method for getting the Attribute of an XML key
Definition GNEPOI.cpp:413
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
Definition GNEPOI.cpp:261
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition GNEPOI.cpp:292
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
Definition GNEPOI.cpp:185
~GNEPOI()
Destructor.
Definition GNEPOI.cpp:85
GNEMoveOperation * getMoveOperation() override
get move operation
Definition GNEPOI.cpp:89
bool isAttributeEnabled(SumoXMLAttr key) const override
Definition GNEPOI.cpp:589
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
Definition GNEPOI.cpp:127
double getAttributeDouble(SumoXMLAttr key) const override
Definition GNEPOI.cpp:478
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition GNEPOI.cpp:133
GNEPOI(const GNEPOI &)=delete
Invalidated copy constructor.
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
Definition GNEPOI.cpp:158
void updateGeometry() override
update pre-computed geometry information
Definition GNEPOI.cpp:228
PositionVector myShapeHeight
shape height of POI
Definition GNEPOI.h:227
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
Definition GNEPOI.cpp:750
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Definition GNEPOI.cpp:286
bool isAdditionalValid() const override
check if current additional is valid to be writed into XML (must be reimplemented in all detector chi...
Definition GNEPOI.cpp:171
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:490
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
Definition GNEPOI.cpp:308
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
Definition GNEPOI.cpp:139
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.
double getShapeLayer() const
Returns the layer of the Shape.
Definition Shape.h:91