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 
27 
28 #include "GNEShape.h"
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class GNELane;
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
45 class GNEPOI : public GUIPointOfInterest, public GNEShape {
46 
47 public:
49  using GNEShape::getID;
50 
66  GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
67  double layer, double angle, const std::string& imgFile, bool relativePath, double width, double height, bool movementBlocked);
68 
85  GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color,
86  double layer, double angle, const std::string& imgFile, bool relativePath, GNELane* lane, double posOverLane,
87  double posLat, double width, double height, bool movementBlocked);
88 
90  ~GNEPOI();
91 
95  void startGeometryMoving();
96 
98  void endGeometryMoving();
99 
104  void moveGeometry(const Position& oldPos, const Position& offset);
105 
110  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
112 
116  void updateGeometry(bool updateGrid);
117 
121  void writeShape(OutputDevice& device);
122 
124  Position getPositionInView() const;
125 
127  GUIGlID getGlID() const;
129 
131  GNELane* getLane() const;
132 
135 
138  std::string getParentName() const;
139 
148 
157 
160 
165  void drawGL(const GUIVisualizationSettings& s) const;
167 
170 
174  std::string getAttribute(SumoXMLAttr key) const;
175 
181  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
182 
188  bool isValid(SumoXMLAttr key, const std::string& value);
190 
193 
195  std::string getGenericParametersStr() const;
196 
198  std::vector<std::pair<std::string, std::string> > getGenericParameters() const;
199 
201  void setGenericParametersStr(const std::string& value);
202 
204 
205 protected:
208 
211 
212 private:
215 
217  void setAttribute(SumoXMLAttr key, const std::string& value);
218 
220  void mouseOverObject(const GUIVisualizationSettings& s) const;
221 
223  GNEPOI(const GNEPOI&) = delete;
224 
226  GNEPOI& operator=(const GNEPOI&) = delete;
227 };
228 
229 #endif
230 
231 /****************************************************************************/
232 
void startGeometryMoving()
Definition: GNEPOI.cpp:69
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEPOI.cpp:174
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEPOI.cpp:107
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEPOI.cpp:234
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GNEPOI.cpp:180
Definition: GNEPOI.h:45
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:322
GNEPOI & operator=(const GNEPOI &)=delete
Invalidated assignment operator.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEPOI.cpp:192
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:44
~GNEPOI()
Destructor.
Definition: GNEPOI.cpp:65
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
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:149
Position myOriginalViewPosition
position used for move POILanes
Definition: GNEPOI.h:214
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:582
std::string getGenericParametersStr() const
return generic parameters in string format
Definition: GNEPOI.cpp:410
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Definition: GNEPOI.cpp:127
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
Definition: GNEPOI.cpp:353
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:223
std::string getParentName() const
Returns the name of the parent object.
Definition: GNEPOI.cpp:186
const std::string getID() const
function to support debugging
void updateGeometry(bool updateGrid)
update pre-computed geometry information
Definition: GNEPOI.cpp:155
unsigned int GUIGlID
Definition: GUIGlObject.h:43
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
Definition: GNEPOI.cpp:436
Position myGEOPosition
Position of POI in GEO coordinates (Only used by POIs that aren&#39;t placed over lanes) ...
Definition: GNEPOI.h:207
The popup menu of a globject.
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
Definition: GNEPOI.cpp:271
void writeShape(OutputDevice &device)
writte shape element into a xml file
Definition: GNEPOI.cpp:94
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
Definition: GNEPOI.cpp:425
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:217
GNELane * myGNELane
GNElane in which this POILane is placed (Only used by POIs placed over lanes)
Definition: GNEPOI.h:210
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:78