SUMO - Simulation of Urban MObility
GNERouteProbe.h
Go to the documentation of this file.
1 /****************************************************************************/
7 //
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 
67  void writeAdditional(OutputDevice& device, bool volatileOptionsEnabled) const;
68 
70  const std::string& getFilename() const;
71 
73  double getFrequency() const;
74 
76  double getBegin() const;
77 
79  void setFilename(const std::string& filename);
80 
82  void setFrequency(double frequency);
83 
85  void setBegin(double begin);
86 
89 
93  void moveGeometry(const Position& newPosition);
94 
99  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
100 
102  void updateGeometry();
103 
105  Position getPositionInView() const;
107 
112  const std::string& getParentName() const;
113 
118  void drawGL(const GUIVisualizationSettings& s) const;
120 
123  /* @brief method for getting the Attribute of an XML key
124  * @param[in] key The attribute key
125  * @return string with the value associated to key
126  */
127  std::string getAttribute(SumoXMLAttr key) const;
128 
129  /* @brief method for setting the attribute and letting the object perform additional changes
130  * @param[in] key The attribute key
131  * @param[in] value The new value
132  * @param[in] undoList The undoList on which to register changes
133  */
134  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
135 
136  /* @brief method for checking if the key and their correspond attribute are valids
137  * @param[in] key The attribute key
138  * @param[in] value The value asociated to key key
139  * @return true if the value is valid, false in other case
140  */
141  bool isValid(SumoXMLAttr key, const std::string& value);
143 
144 protected:
146  double myFrequency;
147 
149  std::string myFilename;
150 
152  double myBegin;
153 
156 
159 
162 
163 private:
165  void setAttribute(SumoXMLAttr key, const std::string& value);
166 
169 
172 };
173 
174 #endif
175 
176 /****************************************************************************/
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
double getBegin() const
get begin of RouteProbe
Stores the information about how to visualize structures.
void setFilename(const std::string &filename)
set filename of RouteProbe
double myFrequency
Frequency of RouteProbe.
GNERouteProbe & operator=(const GNERouteProbe &)
Invalidated assignment operator.
std::string myFilename
filename of RouteProbe
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
void setBegin(double begin)
set begin of RouteProbe
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
int myNumberOfLanes
number of lanes of edge (To improve efficiency)
int myRelativePositionY
relative position regarding to other route probes
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
const std::string & getFilename() const
get filename of RouteProbe
double getFrequency() const
get frequency 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
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
Position getPositionInView() const
Returns position of additional in view.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:58
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 drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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
void setFrequency(double frequency)
set frequency of RouteProbe