Eclipse SUMO - Simulation of Urban MObility
GNEChargingStation.cpp
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 /****************************************************************************/
14 // A class for visualizing chargingStation geometry (adapted from GUILaneWrapper)
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
29 #include <utils/gui/div/GLHelper.h>
33 
34 #include "GNEChargingStation.h"
35 
36 // ===========================================================================
37 // member method definitions
38 // ===========================================================================
39 
40 GNEChargingStation::GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet,
41  const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement) :
42  GNEStoppingPlace(id, viewNet, GLO_CHARGING_STATION, SUMO_TAG_CHARGING_STATION, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement),
43  myChargingPower(chargingPower),
44  myEfficiency(efficiency),
45  myChargeInTransit(chargeInTransit),
46  myChargeDelay(chargeDelay) {
47 }
48 
49 
51 
52 
53 void
55  // Get value of option "lefthand"
56  double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1;
57 
58  // Update common geometry of stopping place
60 
61  // Obtain a copy of the shape
63 
64  // Move shape to side
65  tmpShape.move2side(1.5 * offsetSign);
66 
67  // Get position of the sign
68  mySignPos = tmpShape.getLineCenter();
69 
70  // Set block icon position
72 
73  // Set block icon rotation, and using their rotation for sign
75 }
76 
77 
81 }
82 
83 
84 void
86  // Get exaggeration
87  const double exaggeration = s.addSize.getExaggeration(s, this);
88  // first check if additional has to be drawn
89  if (s.drawAdditionals(exaggeration)) {
90  // Push name
91  glPushName(getGlID());
92  // Push base matrix
93  glPushMatrix();
94  // Traslate matrix
95  glTranslated(0, 0, getType());
96  // Set Color
97  if (drawUsingSelectColor()) {
99  } else {
101  }
102  // Draw base
104  // Check if the distance is enought to draw details and if is being drawn for selecting
106  // only draw circle depending of distance between sign and mouse cursor
108  // Add a draw matrix for details
109  glPushMatrix();
110  // Start drawing sign traslating matrix to signal position
111  glTranslated(mySignPos.x(), mySignPos.y(), 0);
112  // scale matrix depending of the exaggeration
113  glScaled(exaggeration, exaggeration, 1);
114  // set color
116  // Draw circle
118  // pop draw matrix
119  glPopMatrix();
120  }
121  } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, exaggeration)) {
122  // Push matrix for details
123  glPushMatrix();
124  // draw power depending of detailSettings
125  if (s.drawDetail(s.detailSettings.stoppingPlaceText, exaggeration)) {
126  // push a new matrix for charging power
127  glPushMatrix();
128  // draw line with a color depending of the selection status
129  if (drawUsingSelectColor()) {
131  } else {
133  }
134  // pop matrix for charging power
135  glPopMatrix();
136  }
137  // Set position over sign
138  glTranslated(mySignPos.x(), mySignPos.y(), 0);
139  // Scale matrix
140  glScaled(exaggeration, exaggeration, 1);
141  // Set base color
142  if (drawUsingSelectColor()) {
144  } else {
146  }
147  // Draw extern
149  // Move to top
150  glTranslated(0, 0, .1);
151  // Set sign color
152  if (drawUsingSelectColor()) {
154  } else {
156  }
157  // Draw internt sign
159  // Draw sign 'C' depending of detail settings
160  if (s.drawDetail(s.detailSettings.stoppingPlaceText, exaggeration)) {
161  if (drawUsingSelectColor()) {
163  } else {
165  }
166  }
167  // Pop sign matrix
168  glPopMatrix();
169  // Draw icon
170  myBlockIcon.drawIcon(s, exaggeration);
171  }
172  // Pop base matrix
173  glPopMatrix();
174  // Draw name if isn't being drawn for selecting
178  }
179  // check if dotted contour has to be drawn
180  if (myViewNet->getDottedAC() == this) {
182  }
183  // Pop name matrix
184  glPopName();
185  // draw child demand elements
186  for (const auto& i : getChildDemandElements()) {
187  if (!i->getTagProperty().isPlacedInRTree()) {
188  i->drawGL(s);
189  }
190  }
191  }
192 }
193 
194 
195 std::string
197  switch (key) {
198  case SUMO_ATTR_ID:
199  return getAdditionalID();
200  case SUMO_ATTR_LANE:
201  return getParentLanes().front()->getID();
202  case SUMO_ATTR_STARTPOS:
204  return toString(myStartPosition);
205  } else {
206  return "";
207  }
208  case SUMO_ATTR_ENDPOS:
210  return toString(myEndPosition);
211  } else {
212  return "";
213  }
214  case SUMO_ATTR_NAME:
215  return myAdditionalName;
219  return toString(myChargingPower);
221  return toString(myEfficiency);
223  return toString(myChargeInTransit);
225  return time2string(myChargeDelay);
227  return toString(myBlockMovement);
228  case GNE_ATTR_SELECTED:
230  case GNE_ATTR_PARAMETERS:
231  return getParametersStr();
232  default:
233  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
234  }
235 }
236 
237 
238 void
239 GNEChargingStation::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
240  if (value == getAttribute(key)) {
241  return; //avoid needless changes, later logic relies on the fact that attributes have changed
242  }
243  switch (key) {
244  case SUMO_ATTR_ID:
245  case SUMO_ATTR_LANE:
246  case SUMO_ATTR_STARTPOS:
247  case SUMO_ATTR_ENDPOS:
248  case SUMO_ATTR_NAME:
255  case GNE_ATTR_SELECTED:
256  case GNE_ATTR_PARAMETERS:
257  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
258  break;
259  default:
260  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
261  }
262 }
263 
264 
265 bool
266 GNEChargingStation::isValid(SumoXMLAttr key, const std::string& value) {
267  switch (key) {
268  case SUMO_ATTR_ID:
269  return isValidAdditionalID(value);
270  case SUMO_ATTR_LANE:
271  if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) {
272  return true;
273  } else {
274  return false;
275  }
276  case SUMO_ATTR_STARTPOS:
277  if (value.empty()) {
278  return true;
279  } else if (canParse<double>(value)) {
280  return SUMORouteHandler::isStopPosValid(parse<double>(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
281  } else {
282  return false;
283  }
284  case SUMO_ATTR_ENDPOS:
285  if (value.empty()) {
286  return true;
287  } else if (canParse<double>(value)) {
288  return SUMORouteHandler::isStopPosValid(myStartPosition, parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
289  } else {
290  return false;
291  }
292  case SUMO_ATTR_NAME:
295  return canParse<bool>(value);
297  return (canParse<double>(value) && parse<double>(value) >= 0);
299  return (canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) <= 1);
301  return canParse<bool>(value);
303  return canParse<SUMOTime>(value);
305  return canParse<bool>(value);
306  case GNE_ATTR_SELECTED:
307  return canParse<bool>(value);
308  case GNE_ATTR_PARAMETERS:
309  return Parameterised::areParametersValid(value);
310  default:
311  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
312  }
313 }
314 
315 // ===========================================================================
316 // private
317 // ===========================================================================
318 
319 void
320 GNEChargingStation::setAttribute(SumoXMLAttr key, const std::string& value) {
321  switch (key) {
322  case SUMO_ATTR_ID:
323  changeAdditionalID(value);
324  break;
325  case SUMO_ATTR_LANE:
326  replaceParentLanes(this, value);
327  break;
328  case SUMO_ATTR_STARTPOS:
329  if (!value.empty()) {
330  myStartPosition = parse<double>(value);
332  } else {
334  }
335  break;
336  case SUMO_ATTR_ENDPOS:
337  if (!value.empty()) {
338  myEndPosition = parse<double>(value);
340  } else {
342  }
343  break;
344  case SUMO_ATTR_NAME:
345  myAdditionalName = value;
346  break;
348  myFriendlyPosition = parse<bool>(value);
349  break;
351  myChargingPower = parse<double>(value);
352  break;
354  myEfficiency = parse<double>(value);
355  break;
357  myChargeInTransit = parse<bool>(value);
358  break;
360  myChargeDelay = parse<SUMOTime>(value);
361  break;
363  myBlockMovement = parse<bool>(value);
364  break;
365  case GNE_ATTR_SELECTED:
366  if (parse<bool>(value)) {
368  } else {
370  }
371  break;
372  case GNE_ATTR_PARAMETERS:
373  setParametersStr(value);
374  break;
375  default:
376  throw InvalidArgument(getTagStr() + "attribute '" + toString(key) + "' not allowed");
377  }
378 }
379 
380 
381 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
SUMOXMLDefinitions::isValidAttribute
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
Definition: SUMOXMLDefinitions.cpp:995
GNEAdditional::BlockIcon::position
Position position
position of the block icon
Definition: GNEAdditional.h:318
GNEStoppingPlace::myStartPosition
double myStartPosition
The relative start position this stopping place is located at (optional, if empty takes 0)
Definition: GNEStoppingPlace.h:159
GLO_MAX
@ GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:165
GNEChargingStation::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEChargingStation.cpp:239
Parameterised::getParametersStr
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
Definition: Parameterised.cpp:112
GNEAdditional::getAdditionalID
const std::string & getAdditionalID() const
Definition: GNEAdditional.cpp:476
GUIVisualizationDetailSettings::stoppingPlaceDetails
static const double stoppingPlaceDetails
details for stopping places
Definition: GUIVisualizationSettings.h:298
GNEHierarchicalChildElements::getChildDemandElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Definition: GNEHierarchicalChildElements.cpp:296
GNEAdditional::BlockIcon::setRotation
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
Definition: GNEAdditional.cpp:400
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:354
GUIVisualizationSettings::drawForRectangleSelection
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
Definition: GUIVisualizationSettings.h:647
OptionsCont.h
GUIVisualizationTextSettings::color
RGBColor color
text color
Definition: GUIVisualizationSettings.h:74
GNEStoppingPlace::mySignPos
Position mySignPos
The position of the sign.
Definition: GNEStoppingPlace.h:171
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
FONS_ALIGN_LEFT
@ FONS_ALIGN_LEFT
Definition: fontstash.h:42
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
GNEHierarchicalParentElements::getParentLanes
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
Definition: GNEHierarchicalParentElements.cpp:235
STOPPINGPLACE_STARTPOS_SET
const int STOPPINGPLACE_STARTPOS_SET
Definition: GNEStoppingPlace.h:29
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
GNEViewNet
Definition: GNEViewNet.h:42
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
GLHelper.h
SUMO_ATTR_LANE
@ SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:637
SUMO_ATTR_ENDPOS
@ SUMO_ATTR_ENDPOS
Definition: SUMOXMLDefinitions.h:798
GNEChargingStation::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEChargingStation.cpp:79
STOPPINGPLACE_ENDPOS_SET
const int STOPPINGPLACE_ENDPOS_SET
Definition: GNEStoppingPlace.h:30
GNEAdditional::changeAdditionalID
void changeAdditionalID(const std::string &newID)
change ID of additional
Definition: GNEAdditional.cpp:502
PositionVector
A list of positions.
Definition: PositionVector.h:45
SUMO_ATTR_CHARGEINTRANSIT
@ SUMO_ATTR_CHARGEINTRANSIT
Allow/disallow charge in transit in Charging Stations.
Definition: SUMOXMLDefinitions.h:473
GNEChargingStation::GNEChargingStation
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const double startPos, const double endPos, const int parametersSet, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement)
Constructor of charging station.
Definition: GNEChargingStation.cpp:40
GNEChargingStation::myEfficiency
double myEfficiency
efficiency of the charge
Definition: GNEChargingStation.h:102
GNEAdditional::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNEAdditional.cpp:532
GNEAdditional::myBlockIcon
BlockIcon myBlockIcon
variable BlockIcon
Definition: GNEAdditional.h:353
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
PositionVector::getBoxBoundary
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Definition: PositionVector.cpp:390
GNEStoppingPlace::myCircleInWidth
static const double myCircleInWidth
inner circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:180
GLO_CHARGING_STATION
@ GLO_CHARGING_STATION
a chargingStation
Definition: GUIGlObjectTypes.h:65
GUIVisualizationColorSettings::chargingStation
static const RGBColor chargingStation
color for chargingStations
Definition: GUIVisualizationSettings.h:186
GUIVisualizationTextSettings::scaledSize
double scaledSize(double scale, double constFactor=0.1) const
get scale size
Definition: GUIVisualizationSettings.cpp:195
GNEAdditional::myViewNet
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
Definition: GNEAdditional.h:335
GNEChargingStation::myChargeDelay
SUMOTime myChargeDelay
delay in the starting of charge
Definition: GNEChargingStation.h:108
GNEStoppingPlace::myParametersSet
int myParametersSet
Variable used for set/unset start/endPositions.
Definition: GNEStoppingPlace.h:165
SUMO_ATTR_CHARGEDELAY
@ SUMO_ATTR_CHARGEDELAY
Delay in the charge of charging stations.
Definition: SUMOXMLDefinitions.h:475
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:57
GNEUndoList::p_add
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
Definition: GNEUndoList.cpp:131
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
GLHelper::drawFilledCircle
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:348
GNEAdditional::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEAdditional.cpp:548
GLHelper::drawText
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
Definition: GLHelper.cpp:673
GNEStoppingPlace::myFriendlyPosition
bool myFriendlyPosition
Flag for friendly position.
Definition: GNEStoppingPlace.h:168
GUIVisualizationSettings::addName
GUIVisualizationTextSettings addName
Definition: GUIVisualizationSettings.h:591
SUMO_ATTR_CHARGINGPOWER
@ SUMO_ATTR_CHARGINGPOWER
Definition: SUMOXMLDefinitions.h:469
GNEStoppingPlace::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEStoppingPlace.cpp:140
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:683
SUMO_ATTR_STARTPOS
@ SUMO_ATTR_STARTPOS
Definition: SUMOXMLDefinitions.h:797
SUMO_TAG_CHARGING_STATION
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
Definition: SUMOXMLDefinitions.h:111
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:147
GNEGeometry::Geometry::getShape
const PositionVector & getShape() const
The shape of the additional element.
Definition: GNEGeometry.cpp:147
GNEStoppingPlace
Definition: GNEStoppingPlace.h:39
GNEStoppingPlace::myCircleWidthSquared
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:177
GNEDemandElement.h
GNEAdditional::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
Definition: GNEAdditional.cpp:517
GNEStoppingPlace::setStoppingPlaceGeometry
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
Definition: GNEStoppingPlace.cpp:286
GNEViewNet.h
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
GNEViewNet::getDottedAC
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:1026
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEHierarchicalParentElements::replaceParentLanes
void replaceParentLanes(GNEShape *elementChild, const std::string &newLaneIDs)
replace the parent edges of a shape
Definition: GNEHierarchicalParentElements.cpp:469
GNE_ATTR_PARAMETERS
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
GNEGeometry::drawGeometry
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
Definition: GNEGeometry.cpp:795
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:632
GNEChargingStation::~GNEChargingStation
~GNEChargingStation()
Destructor.
Definition: GNEChargingStation.cpp:50
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
GNEEdge.h
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
GNEAdditional::myAdditionalGeometry
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
Definition: GNEAdditional.h:338
GNEAdditional::myAdditionalName
std::string myAdditionalName
name of additional
Definition: GNEAdditional.h:347
GUIVisualizationSettings::addFullName
GUIVisualizationTextSettings addFullName
Definition: GUIVisualizationSettings.h:593
GNEChargingStation::myChargeInTransit
bool myChargeInTransit
enable or disable charge in transit
Definition: GNEChargingStation.h:105
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:68
GNEAdditional::myBlockMovement
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Definition: GNEAdditional.h:350
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:190
GNEAdditional::BlockIcon::rotation
double rotation
The rotation of the block icon.
Definition: GNEAdditional.h:324
GNEChargingStation::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEChargingStation.cpp:54
GLHelper::drawShapeDottedContourAroundShape
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
Definition: GLHelper.cpp:461
SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_FRIENDLY_POS
Definition: SUMOXMLDefinitions.h:765
GNELane.h
Position::distanceSquaredTo2D
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:248
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:677
GUIVisualizationColorSettings::selectionColor
RGBColor selectionColor
basic selection color
Definition: GUIVisualizationSettings.h:129
GUIVisualizationSettings::getCircleResolution
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
Definition: GUIVisualizationSettings.cpp:1679
GUIVisualizationColorSettings::chargingStation_sign
static const RGBColor chargingStation_sign
color for chargingStation sign
Definition: GUIVisualizationSettings.h:189
Parameterised::setParametersStr
void setParametersStr(const std::string &paramsString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
Definition: Parameterised.cpp:139
GLIncludes.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNEAdditional::BlockIcon::drawIcon
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
Definition: GNEAdditional.cpp:416
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
GNEChargingStation::myChargingPower
double myChargingPower
Charging power pro timestep.
Definition: GNEChargingStation.h:99
GNEChargingStation::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEChargingStation.cpp:85
Parameterised::areParametersValid
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Definition: Parameterised.cpp:166
InvalidArgument
Definition: UtilExceptions.h:56
GNE_ATTR_BLOCK_MOVEMENT
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
Definition: SUMOXMLDefinitions.h:981
SUMORouteHandler.h
SUMO_ATTR_EFFICIENCY
@ SUMO_ATTR_EFFICIENCY
Eficiency of the charge in Charging Stations.
Definition: SUMOXMLDefinitions.h:471
GUIVisualizationSettings::drawAdditionals
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
Definition: GUIVisualizationSettings.cpp:1663
GNEAdditional::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNEAdditional.cpp:554
GUIVisualizationDetailSettings::stoppingPlaceText
static const double stoppingPlaceText
details for stopping place texts
Definition: GUIVisualizationSettings.h:301
GNEChargingStation::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEChargingStation.cpp:196
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1228
GUIVisualizationSettings::addSize
GUIVisualizationSizeSettings addSize
Definition: GUIVisualizationSettings.h:589
GNEChargingStation::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEChargingStation.cpp:266
GNEStoppingPlace::myEndPosition
double myEndPosition
The position this stopping place is located at (optional, if empty takes the lane length)
Definition: GNEStoppingPlace.h:162
GNE_ATTR_SELECTED
@ GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:971
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:300
GUIVisualizationSettings::drawDetail
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
Definition: GUIVisualizationSettings.cpp:1669
GNEStoppingPlace::myCircleInText
static const double myCircleInText
text inner circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:183
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1267
SUMO_ATTR_NAME
@ SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:380
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
PositionVector::getLineCenter
Position getLineCenter() const
get line center
Definition: PositionVector.cpp:474
GNEAdditional::isValidAdditionalID
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
Definition: GNEAdditional.cpp:482
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNEChargingStation.h
POSITION_EPS
#define POSITION_EPS
Definition: config.h:172
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GNEStoppingPlace::myCircleWidth
static const double myCircleWidth
circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:174
SUMORouteHandler::isStopPosValid
static bool isStopPosValid(const double startPos, const double endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if start and end position of a stop is valid
Definition: SUMORouteHandler.cpp:320
GNEChange_Attribute.h
GNENet.h
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
PositionVector::move2side
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Definition: PositionVector.cpp:1103
GNEUndoList.h
fontstash.h