SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GNENetElement.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A abstract class for net elements
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNENetElement_h
21 #define GNENetElement_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 <string>
34 #include <utility>
35 #include <vector>
36 #include <netbuild/NBConnection.h>
37 #include <netbuild/NBEdge.h>
38 #include <netbuild/NBNode.h>
39 #include <utils/geom/Boundary.h>
40 #include <utils/geom/Position.h>
49 
50 #include "GNEAttributeCarrier.h"
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
55 
57 public:
64  GNENetElement(GNENet* net, const std::string& id, GUIGlObjectType type, SumoXMLTag tag);
65 
68 
71  virtual void updateGeometry() = 0;
72 
74  GNENet* getNet() const;
75 
80  virtual const std::string& getParentName() const;
81 
90 
99 
104  virtual Boundary getCenteringBoundary() const = 0;
105 
110  virtual void drawGL(const GUIVisualizationSettings& s) const = 0;
112 
115  /* @brief method for getting the Attribute of an XML key
116  * @param[in] key The attribute key
117  * @return string with the value associated to key
118  */
119  virtual std::string getAttribute(SumoXMLAttr key) const = 0;
120 
121  /* @brief method for setting the attribute and letting the object perform additional changes
122  * @param[in] key The attribute key
123  * @param[in] value The new value
124  * @param[in] undoList The undoList on which to register changes
125  */
126  virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0;
127 
128  /* @brief method for checking if the key and their conrrespond attribute are valids
129  * @param[in] key The attribute key
130  * @param[in] value The value asociated to key key
131  * @return true if the value is valid, false in other case
132  */
133  virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0;
135 
136 protected:
139 
140 private:
142  virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0;
143 
146 
149 };
150 
151 
152 #endif
153 
154 /****************************************************************************/
155 
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNENet * myNet
the net to inform about updates
GUIGlObjectType
virtual const std::string & getParentName() const
Returns the name of the parent object (if any)
Stores the information about how to visualize structures.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:87
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
virtual Boundary getCenteringBoundary() const =0
Returns the boundary to which the view shall be centered in order to show the object.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
virtual GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)=0
Returns an own parameter window.
~GNENetElement()
Destructor.
GNENetElement(GNENet *net, const std::string &id, GUIGlObjectType type, SumoXMLTag tag)
Constructor.
GNENet * getNet() const
get Net in which this element is placed
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)=0
Returns an own popup-menu.
virtual void updateGeometry()=0
update pre-computed geometry information
GNENetElement & operator=(const GNENetElement &)
Invalidated assignment operator.
The popup menu of a globject.
virtual std::string getAttribute(SumoXMLAttr key) const =0
A window containing a gl-object's parameter.