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-2024 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
70 GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const double xLon,
71 const double yLat, const bool geo, const std::string& icon, const double layer, const double angle,
72 const std::string& imgFile, const bool relativePath, const double width, const double height,
73 const std::string& name, const Parameterised::Map& parameters);
74
93 GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, GNELane* lane,
94 const double posOverLane, const bool friendlyPos, const double posLat, const std::string& icon,
95 const double layer, const double angle, const std::string& imgFile, const bool relativePath,
96 const double width, const double height, const std::string& name, const Parameterised::Map& parameters);
97
99 ~GNEPOI();
100
105
107 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;
108
110 std::string generateChildID(SumoXMLTag childTag);
111
114
117
119 void updateGeometry() override;
120
122 Position getPositionInView() const override;
123
125 double getExaggeration(const GUIVisualizationSettings& s) const override;
126
128 void updateCenteringBoundary(const bool updateGrid) override;
129
131 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement,
132 const GNENetworkElement* newElement, GNEUndoList* undoList) override;
133
137 void writeAdditional(OutputDevice& device) const override;
138
140 bool isAdditionalValid() const override;
141
143 std::string getAdditionalProblem() const override;
144
146 void fixAdditionalProblem() override;
147
149 GUIGlID getGlID() const;
150
152
155
157 bool checkDrawMoveContour() const override;
158
160
163
166 std::string getParentName() const override;
167
176
181 void drawGL(const GUIVisualizationSettings& s) const override;
182
184
187
192 std::string getAttribute(SumoXMLAttr key) const override;
193
194 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
195 * @param[in] key The attribute key
196 * @return double with the value associated to key
197 */
198 double getAttributeDouble(SumoXMLAttr key) const override;
199
201 const Parameterised::Map& getACParametersMap() const override;
202
208 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
209
215 bool isValid(SumoXMLAttr key, const std::string& value) override;
216
217 /* @brief method for check if the value for certain attribute is set
218 * @param[in] key The attribute key
219 */
220 bool isAttributeEnabled(SumoXMLAttr key) const override;
221
223
225 std::string getPopUpID() const override;
226
228 std::string getHierarchyName() const override;
229
230protected:
233
236
239
242
245
248
249private:
252 const bool movingGeometryPoints) const;
253
256 const double exaggeration, const bool movingGeometryPoints) const;
257
259 void setAttribute(SumoXMLAttr key, const std::string& value) override;
260
262 void setMoveShape(const GNEMoveResult& moveResult) override;
263
265 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
266
268 GNEPOI(const GNEPOI&) = delete;
269
271 GNEPOI& operator=(const GNEPOI&) = delete;
272};
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:513
Position getPositionInView() const override
Returns position of shape in view.
Definition GNEPOI.cpp:261
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Definition GNEPOI.cpp:584
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition GNEPOI.cpp:357
const Parameterised::Map & getACParametersMap() const override
get parameters map
Definition GNEPOI.cpp:476
GNEContour myMovingContourRight
variable used for moving contour right
Definition GNEPOI.h:247
PositionVector myShapeWidth
shape width of POI
Definition GNEPOI.h:232
void drawPOI(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const bool movingGeometryPoints) const
draw POI
Definition GNEPOI.cpp:599
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
Definition GNEPOI.cpp:801
void calculatePOIContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const bool movingGeometryPoints) const
calculate contour
Definition GNEPOI.cpp:626
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
Definition GNEPOI.cpp:273
GNEContour myMovingContourLeft
variable used for moving contour left
Definition GNEPOI.h:244
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Definition GNEPOI.cpp:590
std::string getParentName() const override
Returns the name of the parent object.
Definition GNEPOI.cpp:320
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
Definition GNEPOI.cpp:218
std::string getAttribute(SumoXMLAttr key) const override
method for getting the Attribute of an XML key
Definition GNEPOI.cpp:403
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
Definition GNEPOI.cpp:267
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition GNEPOI.cpp:298
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
Definition GNEPOI.cpp:191
~GNEPOI()
Destructor.
Definition GNEPOI.cpp:89
GNEMoveOperation * getMoveOperation() override
get move operation
Definition GNEPOI.cpp:93
bool isAttributeEnabled(SumoXMLAttr key) const override
Definition GNEPOI.cpp:573
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
Definition GNEPOI.cpp:132
double getAttributeDouble(SumoXMLAttr key) const override
Definition GNEPOI.cpp:470
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition GNEPOI.cpp:138
GNEContour myMovingContourDown
variable used for moving contour down
Definition GNEPOI.h:241
GNEPOI(const GNEPOI &)=delete
Invalidated copy constructor.
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
Definition GNEPOI.cpp:164
void updateGeometry() override
update pre-computed geometry information
Definition GNEPOI.cpp:234
bool checkDrawMoveContour() const override
check if draw move contour (red)
Definition GNEPOI.cpp:304
PositionVector myShapeHeight
shape height of POI
Definition GNEPOI.h:235
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
Definition GNEPOI.cpp:782
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Definition GNEPOI.cpp:292
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:177
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:482
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
Definition GNEPOI.cpp:330
GNEContour myMovingContourUp
variable used for moving contour up
Definition GNEPOI.h:238
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
Definition GNEPOI.cpp:144
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.