SUMO - Simulation of Urban MObility
GNEPOILane.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 over lanes (adapted from
18 // GUIPointOfInterest and NLHandler)
19 /****************************************************************************/
20 #ifndef GNEPOILane_h
21 #define GNEPOILane_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 // class declarations
37 // ===========================================================================
38 class GNELane;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
50 class GNEPOILane : public GUIPointOfInterest, public GNEShape {
51 
52 public:
54  using GNEShape::getID;
55  using Shape::getType;
56 
72  GNEPOILane(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color,
73  double layer, double angle, const std::string& imgFile, GNELane* lane, double posOverLane,
74  double posLat, double width, double height, bool movementBlocked);
75 
77  ~GNEPOILane();
78 
83  void moveGeometry(const Position& oldPos, const Position& offset);
84 
89  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
90 
92  GNELane* getLane() const;
93 
97  void updateGeometry();
98 
102  void writeShape(OutputDevice& device);
103 
105  Position getPositionInView() const;
106 
108  GUIGlID getGlID() const;
110 
113 
116  const std::string& getParentName() const;
117 
126 
135 
138 
143  void drawGL(const GUIVisualizationSettings& s) const;
145 
148 
152  std::string getAttribute(SumoXMLAttr key) const;
153 
159  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
160 
166  bool isValid(SumoXMLAttr key, const std::string& value);
168 
169 protected:
172 
173 private:
175  void setAttribute(SumoXMLAttr key, const std::string& value);
176 
178  GNEPOILane(const GNEPOILane&) = delete;
179 
181  GNEPOILane& operator=(const GNEPOILane&) = delete;
182 };
183 
184 
185 #endif
186 
187 /****************************************************************************/
188 
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GNEPOILane.cpp:132
void writeShape(OutputDevice &device)
writte shape element into a xml file
Definition: GNEPOILane.cpp:77
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNEPOILane.cpp:155
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEPOILane.cpp:161
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEPOILane.cpp:167
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Definition: GNEPOILane.cpp:97
Stores the information about how to visualize structures.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
Definition: GNEPOILane.cpp:236
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
GNEPOILane & operator=(const GNEPOILane &)=delete
Invalidated assignment operator.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Definition: GNEPOILane.cpp:210
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEPOILane.cpp:86
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
GNELane * getLane() const
get GNELane
Definition: GNEPOILane.cpp:109
const std::string getID() const
function to support debugging
const std::string & getParentName() const
Returns the name of the parent object.
Definition: GNEPOILane.cpp:138
GNELane * myGNELane
GNElane in which this POILane is placed.
Definition: GNEPOILane.h:171
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
Definition: GNEPOILane.cpp:177
unsigned int GUIGlID
Definition: GUIGlObject.h:49
const std::string & getType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:70
void updateGeometry()
update pre-computed geometry information
Definition: GNEPOILane.cpp:115
The popup menu of a globject.
~GNEPOILane()
Destructor.
Definition: GNEPOILane.cpp:73
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEPOILane.cpp:126
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEPOILane.cpp:144
A window containing a gl-object&#39;s parameter.
GNEPOILane(GNENet *net, const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, GNELane *lane, double posOverLane, double posLat, double width, double height, bool movementBlocked)
Constructor.
Definition: GNEPOILane.cpp:64