SUMO - Simulation of Urban MObility
GNECalibratorFlow.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 // Flow used by GNECalibrators
16 /****************************************************************************/
17 #ifndef GNECalibratorFlow_h
18 #define GNECalibratorFlow_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
28 #include <utils/common/RGBColor.h>
29 
30 #include "GNEAdditional.h"
31 
32 // ===========================================================================
33 // class declaration
34 // ===========================================================================
35 
36 class GNECalibrator;
39 class GNECalibratorRoute;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49 
50 public:
52  GNECalibratorFlow(GNEAdditional* calibratorParent);
53 
55  GNECalibratorFlow(GNEAdditional* calibratorParent, GNEAdditional* vehicleType, GNEAdditional* route, const std::string& vehsPerHour, const std::string& speed,
56  const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane,
57  const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute,
58  const std::string& departPosLat, const std::string& arrivalPosLat, double begin, double end);
59 
62 
65 
69  void moveGeometry(const Position& oldPos, const Position& offset);
70 
75  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
76 
78  void updateGeometry(bool updateGrid);
79 
83 
86 
89  std::string getParentName() const;
90 
95  void drawGL(const GUIVisualizationSettings& s) const;
97 
100  /* @brief method for getting the Attribute of an XML key
101  * @param[in] key The attribute key
102  * @return string with the value associated to key
103  */
104  std::string getAttribute(SumoXMLAttr key) const;
105 
106  /* @brief method for setting the attribute and letting the object perform additional changes
107  * @param[in] key The attribute key
108  * @param[in] value The new value
109  * @param[in] undoList The undoList on which to register changes
110  * @param[in] net optionally the GNENet to inform about gui updates
111  */
112  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
113 
114  /* @brief method for setting the attribute and letting the object perform additional changes
115  * @param[in] key The attribute key
116  * @param[in] value The new value
117  * @param[in] undoList The undoList on which to register changes
118  */
119  bool isValid(SumoXMLAttr key, const std::string& value);
120 
122  std::string getPopUpID() const;
123 
125  std::string getHierarchyName() const;
127 
128 protected:
131 
134 
136  std::string myVehsPerHour;
137 
139  std::string mySpeed;
140 
143 
145  std::string myDepartLane;
146 
148  std::string myDepartPos;
149 
151  std::string myDepartSpeed;
152 
154  std::string myArrivalLane;
155 
157  std::string myArrivalPos;
158 
160  std::string myArrivalSpeed;
161 
163  std::string myLine;
164 
167 
170 
172  bool myReroute;
173 
175  std::string myDepartPosLat;
176 
178  std::string myArrivalPosLat;
179 
183  double myBegin;
184 
186  double myEnd;
188 
189 private:
191  void setAttribute(SumoXMLAttr key, const std::string& value);
192 
194  GNECalibratorFlow(const GNECalibratorFlow&) = delete;
195 
198 };
199 
200 #endif
201 /****************************************************************************/
Position getPositionInView() const
Returns position of additional in view.
RGBColor myColor
color of flow
GNECalibratorFlow(GNEAdditional *calibratorParent)
default constructor (used only in GNECalibratorDialog)
~GNECalibratorFlow()
destructor
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string myLine
line of bus/container stop
Stores the information about how to visualize structures.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEAdditional * myRoute
route in which this flow is used
std::string myDepartPosLat
departPosLat
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool myReroute
reroute
std::string myArrivalPos
arrival pos
double myEnd
time step end
std::string getParentName() const
Returns the name of the parent object.
std::string myArrivalPosLat
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
int myPersonNumber
number of person
std::string myDepartPos
depart position
GNECalibratorFlow & operator=(const GNECalibratorFlow &)=delete
Invalidated assignment operator.
void updateGeometry(bool updateGrid)
update pre-computed geometry information
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string myDepartLane
depart lane
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
std::string myArrivalLane
arrival lane
std::string mySpeed
flow speed (String instead float because can be empty)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
int myContainerNumber
number of container
Dialog for edit calibrators.
GNEAdditional * myVehicleType
type of flow
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:53
std::string myArrivalSpeed
arrival speed
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
std::string myDepartSpeed
depart speed
std::string myVehsPerHour
flows per hour (String instead float because can be empty)