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 #include <config.h>
25 
26 #include "GNEAdditional.h"
27 
28 // ===========================================================================
29 // class declaration
30 // ===========================================================================
31 
32 class GNERouteProbe;
33 class GNECalibratorFlow;
34 class GNECalibratorRoute;
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 class GNECalibrator : public GNEAdditional {
44 
45 public:
46 
58  GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, double pos, double frequency, const std::string& name, const std::string& output);
59 
71  GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNELane* lane, double pos, double frequency, const std::string& name, const std::string& output);
72 
75 
77  void openAdditionalDialog();
78 
81 
85  void moveGeometry(const Position& oldPos, const Position& offset);
86 
91  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
92 
94  void updateGeometry(bool updateGrid);
95 
99 
102 
105  std::string getParentName() const;
106 
111  void drawGL(const GUIVisualizationSettings& s) const;
113 
116  /* @brief method for getting the Attribute of an XML key
117  * @param[in] key The attribute key
118  * @return string with the value associated to key
119  */
120  std::string getAttribute(SumoXMLAttr key) const;
121 
122  /* @brief method for setting the attribute and letting the object perform additional changes
123  * @param[in] key The attribute key
124  * @param[in] value The new value
125  * @param[in] undoList The undoList on which to register changes
126  */
127  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
128 
129  /* @brief method for checking if the key and their correspond attribute are valids
130  * @param[in] key The attribute key
131  * @param[in] value The value asociated to key key
132  * @return true if the value is valid, false in other case
133  */
134  bool isValid(SumoXMLAttr key, const std::string& value);
135 
137  std::string getPopUpID() const;
138 
140  std::string getHierarchyName() const;
142 
143 protected:
146 
149 
152 
154  double myFrequency;
155 
157  std::string myOutput;
158 
161 
162 private:
164  void setAttribute(SumoXMLAttr key, const std::string& value);
165 
167  GNECalibrator(const GNECalibrator&) = delete;
168 
170  GNECalibrator& operator=(const GNECalibrator&) = delete;
171 };
172 
173 #endif
174 /****************************************************************************/
void updateGeometry(bool updateGrid)
update pre-computed geometry information
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:36
GNERouteProbe * myRouteProbe
pointer to current RouteProbe
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
GNECalibrator(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, double pos, double frequency, const std::string &name, const std::string &output)
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
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&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:53
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
GNEEdge * myEdge
The edge in which Calibrators are placed.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
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)