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, double frequency, const std::string& filename, double begin);
59 
62 
64  void moveAdditionalGeometry(double, double);
65 
67  void commmitAdditionalGeometryMoved(double, double, GNEUndoList*);
68 
71  void updateGeometry();
72 
75 
79  void writeAdditional(OutputDevice& device) const;
80 
82  std::string getFilename() const;
83 
85  double getFrequency() const;
86 
88  double getBegin() const;
89 
91  void setFilename(std::string filename);
92 
94  void setFrequency(double frequency);
95 
97  void setBegin(double begin);
98 
103 
104  const std::string& getParentName() const;
109  void drawGL(const GUIVisualizationSettings& s) const;
111 
114  /* @brief method for getting the Attribute of an XML key
115  * @param[in] key The attribute key
116  * @return string with the value associated to key
117  */
118  std::string getAttribute(SumoXMLAttr key) const;
119 
120  /* @brief method for setting the attribute and letting the object perform additional changes
121  * @param[in] key The attribute key
122  * @param[in] value The new value
123  * @param[in] undoList The undoList on which to register changes
124  */
125  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
126 
127  /* @brief method for checking if the key and their correspond attribute are valids
128  * @param[in] key The attribute key
129  * @param[in] value The value asociated to key key
130  * @return true if the value is valid, false in other case
131  */
132  bool isValid(SumoXMLAttr key, const std::string& value);
134 
135 protected:
137  double myFrequency;
138 
140  std::string myFilename;
141 
143  double myBegin;
144 
147 
150 
153 
154 private:
156  void setAttribute(SumoXMLAttr key, const std::string& value);
157 
160 
163 };
164 
165 #endif
166 
167 /****************************************************************************/
int myRelativePosition
relative position regarding to other route probes
const std::string & getParentName() const
Returns the name of the parent object (if any)
void commmitAdditionalGeometryMoved(double, double, GNEUndoList *)
updated geometry changes in the attributes of additional
void moveAdditionalGeometry(double, double)
change the position of the RouteProbe geometry
Stores the information about how to visualize structures.
double myFrequency
Frequency of RouteProbe.
GNERouteProbe & operator=(const GNERouteProbe &)
Invalidated assignment operator.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
std::string myFilename
filename of RouteProbe
void setBegin(double begin)
set begin of RouteProbe
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
int myNumberOfLanes
number of lanes of edge (To improve efficiency)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
GNERouteProbe(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, double frequency, const std::string &filename, double begin)
Constructor.
Position myRouteProbeLogoOffset
route probe logo offset
std::string getFilename() const
get filename of RouteProbe
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
double getFrequency() const
get frequency of RouteProbe
std::string getAttribute(SumoXMLAttr key) const
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:57
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
double getBegin() const
get begin of RouteProbe
void setFilename(std::string filename)
set filename of RouteProbe
void updateGeometry()
update pre-computed geometry information
double myBegin
begin of rerouter
~GNERouteProbe()
Destructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
Position getPositionInView() const
Returns position of RouteProbe in view.
void setFrequency(double frequency)
set frequency of RouteProbe