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 
25 #include "GNEAdditional.h"
26 
27 // ===========================================================================
28 // class declaration
29 // ===========================================================================
30 
31 class GNECalibrator;
34 class GNECalibratorRoute;
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
44 
45 public:
47  GNECalibratorFlow(GNEAdditional* calibratorParent);
48 
50  GNECalibratorFlow(GNEAdditional* calibratorParent, GNEAdditional* vehicleType, GNEAdditional* route, const std::string& vehsPerHour, const std::string& speed,
51  const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane,
52  const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute,
53  const std::string& departPosLat, const std::string& arrivalPosLat, double begin, double end);
54 
57 
60 
63  void moveGeometry(const Position& offset);
64 
68  void commitGeometryMoving(GNEUndoList* undoList);
69 
71  void updateGeometry(bool updateGrid);
72 
76 
79 
82  std::string getParentName() const;
83 
88  void drawGL(const GUIVisualizationSettings& s) const;
90 
93  /* @brief method for getting the Attribute of an XML key
94  * @param[in] key The attribute key
95  * @return string with the value associated to key
96  */
97  std::string getAttribute(SumoXMLAttr key) const;
98 
99  /* @brief method for setting the attribute and letting the object perform additional changes
100  * @param[in] key The attribute key
101  * @param[in] value The new value
102  * @param[in] undoList The undoList on which to register changes
103  * @param[in] net optionally the GNENet to inform about gui updates
104  */
105  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
106 
107  /* @brief method for setting the attribute and letting the object perform additional changes
108  * @param[in] key The attribute key
109  * @param[in] value The new value
110  * @param[in] undoList The undoList on which to register changes
111  */
112  bool isValid(SumoXMLAttr key, const std::string& value);
113 
115  std::string getPopUpID() const;
116 
118  std::string getHierarchyName() const;
120 
121 protected:
124 
127 
129  std::string myVehsPerHour;
130 
132  std::string mySpeed;
133 
136 
138  std::string myDepartLane;
139 
141  std::string myDepartPos;
142 
144  std::string myDepartSpeed;
145 
147  std::string myArrivalLane;
148 
150  std::string myArrivalPos;
151 
153  std::string myArrivalSpeed;
154 
156  std::string myLine;
157 
160 
163 
165  bool myReroute;
166 
168  std::string myDepartPosLat;
169 
171  std::string myArrivalPosLat;
172 
176  double myBegin;
177 
179  double myEnd;
181 
182 private:
184  void setAttribute(SumoXMLAttr key, const std::string& value);
185 
187  GNECalibratorFlow(const GNECalibratorFlow&) = delete;
188 
191 };
192 
193 #endif
194 /****************************************************************************/
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(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
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
std::string myArrivalSpeed
arrival speed
std::string myDepartSpeed
depart speed
std::string myVehsPerHour
flows per hour (String instead float because can be empty)