SUMO - Simulation of Urban MObility
GNECalibrator.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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 //
16 /****************************************************************************/
17 #ifndef GNECalibrator_h
18 #define GNECalibrator_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include "GNEAdditional.h"
26 
27 // ===========================================================================
28 // class declaration
29 // ===========================================================================
30 
31 class GNERouteProbe;
32 class GNECalibratorFlow;
33 class GNECalibratorRoute;
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
42 class GNECalibrator : public GNEAdditional {
43 
44 public:
45 
58  GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, double pos, double frequency, const std::string& name, const std::string& output, const std::string& routeprobe);
59 
72  GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNELane* lane, double pos, double frequency, const std::string& name, const std::string& output, const std::string& routeprobe);
73 
76 
78  void openAdditionalDialog();
79 
82 
85  void moveGeometry(const Position& offset);
86 
90  void commitGeometryMoving(GNEUndoList* undoList);
91 
93  void updateGeometry(bool updateGrid);
94 
98 
101 
104  std::string getParentName() const;
105 
110  void drawGL(const GUIVisualizationSettings& s) const;
112 
115  /* @brief method for getting the Attribute of an XML key
116  * @param[in] key The attribute key
117  * @return string with the value associated to key
118  */
119  std::string getAttribute(SumoXMLAttr key) const;
120 
121  /* @brief method for setting the attribute and letting the object perform additional changes
122  * @param[in] key The attribute key
123  * @param[in] value The new value
124  * @param[in] undoList The undoList on which to register changes
125  */
126  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
127 
128  /* @brief method for checking if the key and their correspond attribute are valids
129  * @param[in] key The attribute key
130  * @param[in] value The value asociated to key key
131  * @return true if the value is valid, false in other case
132  */
133  bool isValid(SumoXMLAttr key, const std::string& value);
134 
136  std::string getPopUpID() const;
137 
139  std::string getHierarchyName() const;
141 
142 protected:
145 
148 
151 
153  double myFrequency;
154 
156  std::string myOutput;
157 
159  std::string myRouteProbe;
160 
161 private:
163  void setAttribute(SumoXMLAttr key, const std::string& value);
164 
166  GNECalibrator(const GNECalibrator&) = delete;
167 
169  GNECalibrator& operator=(const GNECalibrator&) = delete;
170 };
171 
172 #endif
173 /****************************************************************************/
std::string myRouteProbe
ID to current RouteProbe.
GNECalibrator(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, double pos, double frequency, const std::string &name, const std::string &output, const std::string &routeprobe)
Constructor using edge.
void updateGeometry(bool updateGrid)
update pre-computed geometry information
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Stores the information about how to visualize structures.
std::string getAttribute(SumoXMLAttr key) const
~GNECalibrator()
Destructor.
Position getPositionInView() const
Returns position of additional in view.
Representation of a RouteProbe in netedit.
Definition: GNERouteProbe.h:35
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
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 openAdditionalDialog()
open Calibrator Dialog
std::string myOutput
output of calibrator
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNELane * myLane
The lane in which CalibratorLane are placed.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
double myPositionOverLane
position over Lane
std::string getParentName() const
Returns the name of the parent object.
GNECalibrator & operator=(const GNECalibrator &)=delete
Invalidated assignment operator.
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEEdge * myEdge
The edge in which Calibrators are placed.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
double myFrequency
Frequency of calibrator.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)