SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GNERouteProbe.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 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:
59  GNERouteProbe(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, int frequency, const std::string& filename, int begin, bool blocked);
60 
63 
66 
69 
72  void updateGeometry();
73 
76 
80  void writeAdditional(OutputDevice& device, const std::string&);
81 
84  void removeEdgeReference();
85 
87  std::string getFilename() const;
88 
90  int getFrequency() const;
91 
93  int getBegin() const;
94 
96  void setFilename(std::string filename);
97 
99  void setFrequency(int frequency);
100 
102  void setBegin(int begin);
103 
108 
109  const std::string& getParentName() const;
114  void drawGL(const GUIVisualizationSettings& s) const;
116 
119  /* @brief method for getting the Attribute of an XML key
120  * @param[in] key The attribute key
121  * @return string with the value associated to key
122  */
123  std::string getAttribute(SumoXMLAttr key) const;
124 
125  /* @brief method for setting the attribute and letting the object perform additional changes
126  * @param[in] key The attribute key
127  * @param[in] value The new value
128  * @param[in] undoList The undoList on which to register changes
129  */
130  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
131 
132  /* @brief method for checking if the key and their correspond attribute are valids
133  * @param[in] key The attribute key
134  * @param[in] value The value asociated to key key
135  * @return true if the value is valid, false in other case
136  */
137  bool isValid(SumoXMLAttr key, const std::string& value);
139 
140 protected:
143 
145  std::string myFilename;
146 
148  int myBegin;
149 
152 
155 
156 private:
158  void setAttribute(SumoXMLAttr key, const std::string& value);
159 
162 
165 };
166 
167 #endif
168 
169 /****************************************************************************/
void commmitAdditionalGeometryMoved(SUMOReal, SUMOReal, GNEUndoList *)
updated geometry changes in the attributes of additional
void removeEdgeReference()
remove reference to edge
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file
Stores the information about how to visualize structures.
int getFrequency() const
get frequency of RouteProbe
void setBegin(int begin)
set begin 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 ...
GNERouteProbe(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, int frequency, const std::string &filename, int begin, bool blocked)
Constructor.
Position myRouteProbeLogoOffset
route probe logo offset
int getBegin() const
get begin 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
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.
int myBegin
begin of rerouter
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:55
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:63
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
~GNERouteProbe()
Destructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:214
void setFrequency(int frequency)
set frequency of RouteProbe
int myFrequency
Frequency of RouteProbe.