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-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 GNECalibrator_h
20 #define GNECalibrator_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 // class declaration
36 // ===========================================================================
37 
38 class GNERouteProbe;
39 class GNECalibratorFlow;
41 class GNECalibratorRoute;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
50 class GNECalibrator : public GNEAdditional {
51 
52 public:
53 
65  GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, double pos, double frequency, const std::string& output);
66 
78  GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNELane* lane, double pos, double frequency, const std::string& output);
79 
82 
86  void writeAdditional(OutputDevice& device) const;
87 
89  void openAdditionalDialog();
90 
93 
96 
99 
101  const std::vector<GNECalibratorRoute*>& getCalibratorRoutes() const;
102 
105 
108 
110  const std::vector<GNECalibratorFlow*>& getCalibratorFlows() const;
111 
114 
117 
119  const std::vector<GNECalibratorVehicleType*>& getCalibratorVehicleTypes() const;
120 
122 
125 
129  void moveGeometry(const Position& oldPos, const Position& offset);
130 
135  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
136 
138  void updateGeometry();
139 
141  Position getPositionInView() const;
143 
146 
149  const std::string& getParentName() const;
150 
155  void drawGL(const GUIVisualizationSettings& s) const;
157 
160  /* @brief method for getting the Attribute of an XML key
161  * @param[in] key The attribute key
162  * @return string with the value associated to key
163  */
164  std::string getAttribute(SumoXMLAttr key) const;
165 
166  /* @brief method for setting the attribute and letting the object perform additional changes
167  * @param[in] key The attribute key
168  * @param[in] value The new value
169  * @param[in] undoList The undoList on which to register changes
170  */
171  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
172 
173  /* @brief method for checking if the key and their correspond attribute are valids
174  * @param[in] key The attribute key
175  * @param[in] value The value asociated to key key
176  * @return true if the value is valid, false in other case
177  */
178  bool isValid(SumoXMLAttr key, const std::string& value) ;
180 
181 protected:
184 
187 
190 
192  double myFrequency;
193 
195  std::string myOutput;
196 
199 
201  std::vector<GNECalibratorRoute*> myCalibratorRoutes;
202 
204  std::vector<GNECalibratorFlow*> myCalibratorFlows;
205 
207  std::vector<GNECalibratorVehicleType*> myCalibratorVehicleTypes;
208 
209 private:
211  void setAttribute(SumoXMLAttr key, const std::string& value);
212 
214  GNECalibrator(const GNECalibrator&) = delete;
215 
217  GNECalibrator& operator=(const GNECalibrator&) = delete;
218 };
219 
220 #endif
221 /****************************************************************************/
void removeCalibratorFlow(GNECalibratorFlow *flow)
remove calibrator flow
std::vector< GNECalibratorRoute * > myCalibratorRoutes
calibrator route values
Stores the information about how to visualize structures.
const std::vector< GNECalibratorVehicleType * > & getCalibratorVehicleTypes() const
get calibrator vehicleTypes
std::vector< GNECalibratorVehicleType * > myCalibratorVehicleTypes
calibrator vehicleType values
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
~GNECalibrator()
Destructor.
Position getPositionInView() const
Returns position of additional in view.
Representation of a RouteProbe in netedit.
Definition: GNERouteProbe.h:42
GNERouteProbe * myRouteProbe
pointer to current RouteProbe
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
void removeCalibratorVehicleType(GNECalibratorVehicleType *vehicleType)
remove calibrator vehicleType
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::vector< GNECalibratorFlow * > myCalibratorFlows
calibrator flow values
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 &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:45
void addCalibratorRoute(GNECalibratorRoute *route)
add calibrator route
void removeCalibratorRoute(GNECalibratorRoute *route)
add calibrator route
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
const std::vector< GNECalibratorRoute * > & getCalibratorRoutes() const
get calibrator routes
GNELane * myLane
The lane in which CalibratorLane are placed.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
void addCalibratorVehicleType(GNECalibratorVehicleType *vehicleType)
add calibrator vehicleType
const std::string & getParentName() const
Returns the name of the parent object.
double myPositionOverLane
position over Lane
void addCalibratorFlow(GNECalibratorFlow *flow)
add calibrator flow
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:59
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.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
double myFrequency
Frequency of calibrator.
void updateGeometry()
update pre-computed geometry information
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::vector< GNECalibratorFlow * > & getCalibratorFlows() const
get calibrator flows