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-2020 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
23 
24 #include "GNEShape.h"
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 class GNELane;
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
41 class GNEPOI : public PointOfInterest, public GNEShape {
42 
43 public:
45  using GNEShape::getID;
46 
62  GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
63  double layer, double angle, const std::string& imgFile, bool relativePath, double width, double height, bool movementBlocked);
64 
81  GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color,
82  double layer, double angle, const std::string& imgFile, bool relativePath, GNELane* lane, double posOverLane,
83  double posLat, double width, double height, bool movementBlocked);
84 
86  ~GNEPOI();
87 
91  GNEMoveOperation* getMoveOperation(const double shapeOffset);
92 
94  void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
95 
97  std::string generateChildID(SumoXMLTag childTag);
98 
103  void setParameter(const std::string& key, const std::string& value);
104 
108  void updateGeometry();
109 
111  void updateCenteringBoundary(const bool updateGrid);
112 
116  void writeShape(OutputDevice& device);
117 
119  GUIGlID getGlID() const;
120 
122 
125 
128  std::string getParentName() const;
129 
138 
147 
152  void drawGL(const GUIVisualizationSettings& s) const;
154 
157 
161  std::string getAttribute(SumoXMLAttr key) const;
162 
168  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
169 
175  bool isValid(SumoXMLAttr key, const std::string& value);
176 
177  /* @brief method for check if the value for certain attribute is set
178  * @param[in] key The attribute key
179  */
180  bool isAttributeEnabled(SumoXMLAttr key) const;
182 
184  const std::map<std::string, std::string>& getACParametersMap() const;
185 
186 protected:
189 
190 private:
192  void setAttribute(SumoXMLAttr key, const std::string& value);
193 
195  void setMoveShape(const GNEMoveResult& moveResult);
196 
198  void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
199 
201  GNEPOI(const GNEPOI&) = delete;
202 
204  GNEPOI& operator=(const GNEPOI&) = delete;
205 };
unsigned int GUIGlID
Definition: GUIGlObject.h:40
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:40
Definition: GNEPOI.h:41
GNEPOI & operator=(const GNEPOI &)=delete
Invalidated assignment operator.
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
Definition: GNEPOI.cpp:389
GNEPOI(GNENet *net, const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool movementBlocked)
Constructor.
Definition: GNEPOI.cpp:41
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEPOI.cpp:158
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GNEPOI.cpp:142
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition: GNEPOI.cpp:514
~GNEPOI()
Destructor.
Definition: GNEPOI.cpp:66
std::string getParentName() const
Returns the name of the parent object.
Definition: GNEPOI.cpp:148
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNEPOI.cpp:378
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition: GNEPOI.cpp:507
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNEPOI.cpp:183
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition: GNEPOI.cpp:123
void writeShape(OutputDevice &device)
writte shape element into a xml file
Definition: GNEPOI.cpp:99
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNEPOI.cpp:83
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNEPOI.cpp:77
GNEPOI(const GNEPOI &)=delete
Invalidated copy constructor.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEPOI.cpp:194
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
Definition: GNEPOI.cpp:320
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
Definition: GNEPOI.cpp:70
void updateGeometry()
update pre-computed geometry information
Definition: GNEPOI.cpp:112
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
Definition: GNEPOI.cpp:238
Position myGEOPosition
Position of POI in GEO coordinates (Only used by POIs that aren't placed over lanes)
Definition: GNEPOI.h:188
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
Definition: GNEPOI.cpp:93
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEPOI.cpp:289
const std::string & getID() const
get ID (all shapes have one)
Definition: GNEShape.cpp:53
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.
Definition: OutputDevice.h:60
A point-of-interest.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36