 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
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) {
113 glScaled(exaggeration, exaggeration, 1);
140 glScaled(exaggeration, exaggeration, 1);
150 glTranslated(0, 0, .1);
187 if (!i->getTagProperty().isPlacedInRTree()) {
279 }
else if (canParse<double>(value)) {
287 }
else if (canParse<double>(value)) {
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);
307 return canParse<bool>(value);
329 if (!value.empty()) {
337 if (!value.empty()) {
366 if (parse<bool>(value)) {
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
Position position
position of the block icon
double myStartPosition
The relative start position this stopping place is located at (optional, if empty takes 0)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
const std::string & getAdditionalID() const
static const double stoppingPlaceDetails
details for stopping places
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
Position mySignPos
The position of the sign.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const int STOPPINGPLACE_STARTPOS_SET
static OptionsCont & getOptions()
Retrieves the options.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const int STOPPINGPLACE_ENDPOS_SET
void changeAdditionalID(const std::string &newID)
change ID of additional
Allow/disallow charge in transit in Charging Stations.
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.
double myEfficiency
efficiency of the charge
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
BlockIcon myBlockIcon
variable BlockIcon
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static const double myCircleInWidth
inner circle width resolution for all stopping places
static const RGBColor chargingStation
color for chargingStations
double scaledSize(double scale, double constFactor=0.1) const
get scale size
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
SUMOTime myChargeDelay
delay in the starting of charge
int myParametersSet
Variable used for set/unset start/endPositions.
Delay in the charge of charging stations.
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GNENet * getNet() const
get the net object
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
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)
bool myFriendlyPosition
Flag for friendly position.
GUIVisualizationTextSettings addName
Position getPositionInView() const
Returns position of additional in view.
GUIVisualizationDetailSettings detailSettings
detail settings
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
const PositionVector & getShape() const
The shape of the additional element.
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
void selectAttributeCarrier(bool changeFlag=true)
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
void replaceParentLanes(GNEShape *elementChild, const std::string &newLaneIDs)
replace the parent edges of a shape
parameters "key1=value1|key2=value2|...|keyN=valueN"
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
double scale
information about a lane's width (temporary, used for a single view)
~GNEChargingStation()
Destructor.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
std::string time2string(SUMOTime t)
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
std::string myAdditionalName
name of additional
GUIVisualizationTextSettings addFullName
bool myChargeInTransit
enable or disable charge in transit
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
double rotation
The rotation of the block icon.
void updateGeometry()
update pre-computed geometry information
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
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
GUIVisualizationColorSettings colorSettings
color settings
RGBColor selectionColor
basic selection color
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
static const RGBColor chargingStation_sign
color for chargingStation sign
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
double y() const
Returns the y-position.
double myChargingPower
Charging power pro timestep.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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|....
block movement of a graphic element
Eficiency of the charge in Charging Stations.
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
static const double stoppingPlaceText
details for stopping place texts
std::string getAttribute(SumoXMLAttr key) const
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GUIVisualizationSizeSettings addSize
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double myEndPosition
The position this stopping place is located at (optional, if empty takes the lane length)
Boundary & grow(double by)
extends the boundary by the given amount
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
static const double myCircleInText
text inner circle width resolution for all stopping places
const std::string & getTagStr() const
get tag assigned to this object in string format
Stores the information about how to visualize structures.
Position getLineCenter() const
get line center
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
static const double myCircleWidth
circle width resolution for all stopping places
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
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount