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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A class for visualizing and editing POIS in netedit (adapted from
16 // GUIPointOfInterest and NLHandler)
17 /****************************************************************************/
18 #ifndef GNEPOI_h
19 #define GNEPOI_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include "GNEShape.h"
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class GNELane;
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
44 class GNEPOI : public GUIPointOfInterest, public GNEShape {
45 
46 public:
48  using GNEShape::getID;
49 
65  GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
66  double layer, double angle, const std::string& imgFile, bool relativePath, double width, double height, bool movementBlocked);
67 
84  GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color,
85  double layer, double angle, const std::string& imgFile, bool relativePath, GNELane* lane, double posOverLane,
86  double posLat, double width, double height, bool movementBlocked);
87 
89  ~GNEPOI();
90 
94  void startGeometryMoving();
95 
97  void endGeometryMoving();
98 
103  void moveGeometry(const Position& oldPos, const Position& offset);
104 
109  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
111 
115  void updateGeometry(bool updateGrid);
116 
120  void writeShape(OutputDevice& device);
121 
123  Position getPositionInView() const;
124 
126  GUIGlID getGlID() const;
128 
130  GNELane* getLane() const;
131 
134 
137  std::string getParentName() const;
138 
147 
156 
159 
164  void drawGL(const GUIVisualizationSettings& s) const;
166 
169 
173  std::string getAttribute(SumoXMLAttr key) const;
174 
180  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
181 
187  bool isValid(SumoXMLAttr key, const std::string& value);
189 
192 
194  bool addGenericParameter(const std::string& key, const std::string& value);
195 
197  bool removeGenericParameter(const std::string& key);
198 
200  bool updateGenericParameter(const std::string& oldKey, const std::string& newKey);
201 
203  bool updateGenericParameterValue(const std::string& key, const std::string& newValue);
204 
206  std::string getGenericParametersStr() const;
207 
209  std::vector<std::pair<std::string, std::string> > getGenericParameters() const;
210 
212  void setGenericParametersStr(const std::string& value);
213 
215 
216 protected:
219 
222 
223 private:
225  void setAttribute(SumoXMLAttr key, const std::string& value);
226 
228  void mouseOverObject(const GUIVisualizationSettings& s) const;
229 
231  GNEPOI(const GNEPOI&) = delete;
232 
234  GNEPOI& operator=(const GNEPOI&) = delete;
235 };
236 
237 #endif
238 
239 /****************************************************************************/
240 
void startGeometryMoving()
Definition: GNEPOI.cpp:85
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEPOI.cpp:186
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEPOI.cpp:120
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEPOI.cpp:240
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GNEPOI.cpp:192
Definition: GNEPOI.h:44
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:326
GNEPOI & operator=(const GNEPOI &)=delete
Invalidated assignment operator.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEPOI.cpp:204
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:60
~GNEPOI()
Destructor.
Definition: GNEPOI.cpp:81
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:80
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNELane * getLane() const
get GNELane
Definition: GNEPOI.cpp:161
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
void mouseOverObject(const GUIVisualizationSettings &s) const
method for check if mouse is over objects
Definition: GNEPOI.cpp:634
bool addGenericParameter(const std::string &key, const std::string &value)
add generic parameter
Definition: GNEPOI.cpp:416
std::string getGenericParametersStr() const
return generic parameters in string format
Definition: GNEPOI.cpp:462
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Definition: GNEPOI.cpp:139
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
Definition: GNEPOI.cpp:357
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEPOI.cpp:229
std::string getParentName() const
Returns the name of the parent object.
Definition: GNEPOI.cpp:198
const std::string getID() const
function to support debugging
void updateGeometry(bool updateGrid)
update pre-computed geometry information
Definition: GNEPOI.cpp:167
bool updateGenericParameterValue(const std::string &key, const std::string &newValue)
update value generic parameter
Definition: GNEPOI.cpp:451
unsigned int GUIGlID
Definition: GUIGlObject.h:43
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
Definition: GNEPOI.cpp:488
Position myGEOPosition
Position of POI in GEO coordinates (Only used by POIs that aren&#39;t placed over lanes) ...
Definition: GNEPOI.h:218
bool updateGenericParameter(const std::string &oldKey, const std::string &newKey)
update generic parameter
Definition: GNEPOI.cpp:438
The popup menu of a globject.
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
Definition: GNEPOI.cpp:275
void writeShape(OutputDevice &device)
writte shape element into a xml file
Definition: GNEPOI.cpp:107
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
Definition: GNEPOI.cpp:477
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNEPOI.cpp:223
GNELane * myGNELane
GNElane in which this POILane is placed (Only used by POIs placed over lanes)
Definition: GNEPOI.h:221
A window containing a gl-object&#39;s parameter.
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
Definition: GNEPOI.cpp:92
bool removeGenericParameter(const std::string &key)
remove generic parameter
Definition: GNEPOI.cpp:427