Eclipse 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-2019 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 GNERoute;
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, SUMOTime 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, SUMOTime 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();
94 
97 
101 
104 
107  std::string getParentName() const;
108 
113  void drawGL(const GUIVisualizationSettings& s) const;
115 
118  /* @brief method for getting the Attribute of an XML key
119  * @param[in] key The attribute key
120  * @return string with the value associated to key
121  */
122  std::string getAttribute(SumoXMLAttr key) const;
123 
124  /* @brief method for setting the attribute and letting the object perform additional changes
125  * @param[in] key The attribute key
126  * @param[in] value The new value
127  * @param[in] undoList The undoList on which to register changes
128  */
129  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
130 
131  /* @brief method for checking if the key and their correspond attribute are valids
132  * @param[in] key The attribute key
133  * @param[in] value The value asociated to key key
134  * @return true if the value is valid, false in other case
135  */
136  bool isValid(SumoXMLAttr key, const std::string& value);
137 
139  std::string getPopUpID() const;
140 
142  std::string getHierarchyName() const;
144 
145 protected:
148 
151 
153  std::string myOutput;
154 
156  std::string myRouteProbe;
157 
158 private:
160  void setAttribute(SumoXMLAttr key, const std::string& value);
161 
163  GNECalibrator(const GNECalibrator&) = delete;
164 
166  GNECalibrator& operator=(const GNECalibrator&) = delete;
167 };
168 
169 #endif
170 /****************************************************************************/
std::string myRouteProbe
ID to current RouteProbe.
long long int SUMOTime
Definition: SUMOTime.h:35
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.
SUMOTime myFrequency
Frequency of calibrator.
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:46
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 ...
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
void openAdditionalDialog()
open Calibrator Dialog
GNECalibrator(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, double pos, SUMOTime frequency, const std::string &name, const std::string &output, const std::string &routeprobe)
Constructor using edge.
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
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:47
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
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
void updateGeometry()
update pre-computed geometry information
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)