SUMO - Simulation of Urban MObility
GNERouteProbe.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 //
18 /****************************************************************************/
19 #ifndef GNERouteProbe_h
20 #define GNERouteProbe_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEAdditional.h"
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
42 class GNERouteProbe : public GNEAdditional {
43 
44 public:
53  GNERouteProbe(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, double frequency, const std::string& filename, double begin);
54 
57 
61  void writeAdditional(OutputDevice& device) const;
62 
64  const std::string& getFilename() const;
65 
67  double getFrequency() const;
68 
70  double getBegin() const;
71 
73  void setFilename(const std::string& filename);
74 
76  void setFrequency(double frequency);
77 
79  void setBegin(double begin);
80 
83 
87  void moveGeometry(const Position& oldPos, const Position& offset);
88 
93  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
94 
96  void updateGeometry();
97 
101 
106  const std::string& getParentName() const;
107 
112  void drawGL(const GUIVisualizationSettings& s) const;
114 
117  /* @brief method for getting the Attribute of an XML key
118  * @param[in] key The attribute key
119  * @return string with the value associated to key
120  */
121  std::string getAttribute(SumoXMLAttr key) const;
122 
123  /* @brief method for setting the attribute and letting the object perform additional changes
124  * @param[in] key The attribute key
125  * @param[in] value The new value
126  * @param[in] undoList The undoList on which to register changes
127  */
128  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
129 
130  /* @brief method for checking if the key and their correspond attribute are valids
131  * @param[in] key The attribute key
132  * @param[in] value The value asociated to key key
133  * @return true if the value is valid, false in other case
134  */
135  bool isValid(SumoXMLAttr key, const std::string& value);
137 
138 protected:
141 
143  double myFrequency;
144 
146  std::string myFilename;
147 
149  double myBegin;
150 
153 
156 
159 
160 private:
162  void setAttribute(SumoXMLAttr key, const std::string& value);
163 
166 
169 };
170 
171 #endif
172 
173 /****************************************************************************/
GNEEdge * myEdge
The edge in which this RouteProbe is placed.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
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.
Representation of a RouteProbe in netedit.
Definition: GNERouteProbe.h:42
GNERouteProbe & operator=(const GNERouteProbe &)
Invalidated assignment operator.
std::string myFilename
filename of RouteProbe
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
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
double getFrequency() const
get frequency of RouteProbe
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
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 all GNEAttributeCarriers.
Position getPositionInView() const
Returns position of additional in view.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:59
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:70
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
void setFrequency(double frequency)
set frequency of RouteProbe