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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // A class for visualizing and editing POIS in netedit (adapted from
18 // GUIPointOfInterest and NLHandler)
19 /****************************************************************************/
20 #ifndef GNEPOI_h
21 #define GNEPOI_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEShape.h"
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
46 class GNEPOI : public GUIPointOfInterest, public GNEShape {
47 
48 public:
50  using GNEShape::getID;
51  using Shape::getType;
52 
67  GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
68  double layer, double angle, const std::string& imgFile, double width, double height, bool movementBlocked);
69 
71  ~GNEPOI();
72 
77  void moveGeometry(const Position& oldPos, const Position& offset);
78 
83  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
84 
88  void updateGeometry();
89 
93  void writeShape(OutputDevice& device);
94 
97 
99  GUIGlID getGlID() const;
101 
104 
107  const std::string& getParentName() const;
108 
117 
126 
129 
134  void drawGL(const GUIVisualizationSettings& s) const;
136 
139 
143  std::string getAttribute(SumoXMLAttr key) const;
144 
150  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
151 
157  bool isValid(SumoXMLAttr key, const std::string& value);
159 
160 protected:
163 
164 private:
166  void setAttribute(SumoXMLAttr key, const std::string& value);
167 
169  GNEPOI(const GNEPOI&) = delete;
170 
172  GNEPOI& operator=(const GNEPOI&) = delete;
173 };
174 
175 
176 #endif
177 
178 /****************************************************************************/
179 
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, double width, double height, bool movementBlocked)
Constructor.
Definition: GNEPOI.cpp:64
const std::string & getParentName() const
Returns the name of the parent object.
Definition: GNEPOI.cpp:124
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEPOI.cpp:112
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEPOI.cpp:84
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEPOI.cpp:153
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GNEPOI.cpp:118
Definition: GNEPOI.h:46
Stores the information about how to visualize structures.
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:196
GNEPOI & operator=(const GNEPOI &)=delete
Invalidated assignment operator.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEPOI.cpp:130
~GNEPOI()
Destructor.
Definition: GNEPOI.cpp:75
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Definition: GNEPOI.cpp:95
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
Definition: GNEPOI.cpp:222
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEPOI.cpp:147
const std::string getID() const
function to support debugging
unsigned int GUIGlID
Definition: GUIGlObject.h:49
const std::string & getType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:70
Position myGEOPosition
Position of POI in GEO coordinates.
Definition: GNEPOI.h:162
void updateGeometry()
update pre-computed geometry information
Definition: GNEPOI.cpp:105
The popup menu of a globject.
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
Definition: GNEPOI.cpp:163
void writeShape(OutputDevice &device)
writte shape element into a xml file
Definition: GNEPOI.cpp:78
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNEPOI.cpp:141
A window containing a gl-object&#39;s parameter.