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-2019 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 
93  std::string generateChildID(SumoXMLTag childTag);
94 
98  void startGeometryMoving();
99 
101  void endGeometryMoving();
102 
107  void moveGeometry(const Position& oldPos, const Position& offset);
108 
113  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
115 
119  void updateGeometry();
120 
123 
127  void writeShape(OutputDevice& device);
128 
130  Position getPositionInView() const;
131 
133  GUIGlID getGlID() const;
135 
138 
141  std::string getParentName() const;
142 
151 
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 
209 private:
212 
214  void setAttribute(SumoXMLAttr key, const std::string& value);
215 
217  const GUIGlObject* getGUIGlObject() const;
218 
220  GNEPOI(const GNEPOI&) = delete;
221 
223  GNEPOI& operator=(const GNEPOI&) = delete;
224 };
225 
226 #endif
227 
228 /****************************************************************************/
229 
SumoXMLTag
Numbers representing SUMO-XML - element names.
void startGeometryMoving()
Definition: GNEPOI.cpp:77
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEPOI.cpp:153
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEPOI.cpp:100
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEPOI.cpp:213
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GNEPOI.cpp:170
Definition: GNEPOI.h:45
Stores the information about how to visualize structures.
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNEPOI.cpp:67
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:308
GNEPOI & operator=(const GNEPOI &)=delete
Invalidated assignment operator.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEPOI.cpp:182
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:63
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Position myOriginalViewPosition
position used for move POILanes
Definition: GNEPOI.h:211
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
std::string getGenericParametersStr() const
return generic parameters in string format
Definition: GNEPOI.cpp:396
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Definition: GNEPOI.cpp:120
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
Definition: GNEPOI.cpp:339
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:159
std::string getParentName() const
Returns the name of the parent object.
Definition: GNEPOI.cpp:176
const std::string getID() const
function to support debugging
const GUIGlObject * getGUIGlObject() const
get GUIGlObject associated to this GNEShape
Definition: GNEPOI.cpp:571
unsigned int GUIGlID
Definition: GUIGlObject.h:43
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
Definition: GNEPOI.cpp:422
Position myGEOPosition
Position of POI in GEO coordinates (Only used by POIs that aren&#39;t placed over lanes) ...
Definition: GNEPOI.h:207
void updateGeometry()
update pre-computed geometry information
Definition: GNEPOI.cpp:142
The popup menu of a globject.
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
Definition: GNEPOI.cpp:257
void writeShape(OutputDevice &device)
writte shape element into a xml file
Definition: GNEPOI.cpp:87
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
Definition: GNEPOI.cpp:411
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:207
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:82