SUMO - Simulation of Urban MObility
GNERouteProbe.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 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 GNERouteProbe_h
21 #define GNERouteProbe_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 "GNEAdditional.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 
39 class GNEEdge;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 class GNERouteProbe : public GNEAdditional {
49 public:
58  GNERouteProbe(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, SUMOReal frequency, const std::string& filename, SUMOReal begin);
59 
62 
65 
68 
71  void updateGeometry();
72 
75 
79  void writeAdditional(OutputDevice& device) const;
80 
83  void removeEdgeReference();
84 
86  std::string getFilename() const;
87 
89  SUMOReal getFrequency() const;
90 
92  SUMOReal getBegin() const;
93 
95  void setFilename(std::string filename);
96 
98  void setFrequency(SUMOReal frequency);
99 
101  void setBegin(SUMOReal begin);
102 
107 
108  const std::string& getParentName() const;
113  void drawGL(const GUIVisualizationSettings& s) const;
115 
118  /* @brief method for getting the Attribute of an XML key
119  * @param[in] key The attribute key
120  * @return string with the value associated to key
121  */
122  std::string getAttribute(SumoXMLAttr key) const;
123 
124  /* @brief method for setting the attribute and letting the object perform additional changes
125  * @param[in] key The attribute key
126  * @param[in] value The new value
127  * @param[in] undoList The undoList on which to register changes
128  */
129  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
130 
131  /* @brief method for checking if the key and their correspond attribute are valids
132  * @param[in] key The attribute key
133  * @param[in] value The value asociated to key key
134  * @return true if the value is valid, false in other case
135  */
136  bool isValid(SumoXMLAttr key, const std::string& value);
138 
139 protected:
142 
144  std::string myFilename;
145 
148 
151 
154 
155 private:
157  void setAttribute(SumoXMLAttr key, const std::string& value);
158 
161 
164 };
165 
166 #endif
167 
168 /****************************************************************************/
void commmitAdditionalGeometryMoved(SUMOReal, SUMOReal, GNEUndoList *)
updated geometry changes in the attributes of additional
void removeEdgeReference()
remove reference to edge
Stores the information about how to visualize structures.
void setFrequency(SUMOReal frequency)
set frequency of RouteProbe
void moveAdditionalGeometry(SUMOReal, SUMOReal)
change the position of the RouteProbe geometry
GNERouteProbe & operator=(const GNERouteProbe &)
Invalidated assignment operator.
std::string myFilename
filename of RouteProbe
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
void setBegin(SUMOReal begin)
set begin of RouteProbe
Position myRouteProbeLogoOffset
route probe logo offset
SUMOReal getBegin() const
get begin of RouteProbe
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
int numberOfLanes
number of lanes of edge (To improve efficiency)
std::string getFilename() const
get filename of RouteProbe
std::string getAttribute(SumoXMLAttr key) const
Position getPositionInView() const
Returns position of RouteProbe in view.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
GNERouteProbe(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, SUMOReal frequency, const std::string &filename, SUMOReal begin)
Constructor.
SUMOReal getFrequency() const
get frequency of RouteProbe
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
const std::string & getParentName() const
Returns the name of the parent object (if any)
void setFilename(std::string filename)
set filename of RouteProbe
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void updateGeometry()
update pre-computed geometry information
SUMOReal myBegin
begin of rerouter
~GNERouteProbe()
Destructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:208
SUMOReal myFrequency
Frequency of RouteProbe.