66 double chargingPower,
double efficiency,
bool chargeInTransit,
const double chargeDelay,
bool friendlyPosition) :
68 myChargingPower(chargingPower),
69 myEfficiency(efficiency),
70 myChargeInTransit(chargeInTransit),
71 myChargeDelay(chargeDelay) {
126 if (
myName.empty() ==
false) {
168 if (chargingPower > 0) {
171 throw InvalidArgument(
"Value of charging Power must be greater than 0");
178 if (efficiency >= 0 && efficiency <= 1) {
194 if (chargeDelay < 0) {
226 if (s.
scale * exaggeration >= 10) {
244 glRotated(180, 1, 0, 0);
250 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
259 glTranslated(1.2, 0, 0);
274 if (s.
scale * exaggeration > 25) {
275 noPoints =
MIN2((
int)(9.0 + (s.
scale * exaggeration) / 10.0), 36);
279 glScaled(exaggeration, exaggeration, 1);
292 glTranslated(0, 0, .1);
304 if (s.
scale * exaggeration >= 4.5) {
401 if (canParse<double>(value)) {
408 if (canParse<double>(value)) {
417 return canParse<bool>(value);
419 return (canParse<double>(value) && parse<double>(value) >= 0);
421 return (canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) <= 1);
423 return canParse<bool>(value);
425 return (canParse<double>(value) && parse<double>(value) >= 0);
427 return canParse<bool>(value);
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
int pfDrawString(const char *c)
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void setBlockIconRotation()
double scale
information about a lane's width (temporary, used for a single view)
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
GUIVisualizationTextSettings addName
bool getChargeInTransit()
Returns the value of charge in transit of the chargingStation.
double getEfficiency()
Returns the charging efficiency of the chargingStation.
void pfSetScale(double s)
double getAbsoluteStartPosition() const
get absolute start Position
double x() const
Returns the x-position.
GNELane * myLane
The lane this additional belongs.
Stores the information about how to visualize structures.
Allow/disallow charge in transit in Charging Stations.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
bool isAdditionalSelected() const
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool myFriendlyPosition
Flag for friendly position.
void setEfficiency(double efficiency)
Set a new efficiency in the charging station.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void pfSetPosition(double x, double y)
std::vector< double > myShapeRotations
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
GUIGlID getGlID() const
Returns the numerical id of the object.
double myEfficiency
efficiency of the charge
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void undo()
undo the last command group
static OptionsCont & getOptions()
Retrieves the options.
void setChargeInTransit(bool chargeInTransit)
Enable or disable charge in transit in the charging station.
GNEUndoList * getUndoList() const
get the undoList object
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static const RGBColor selectedAdditionalColor
color of selected additionals
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GNEEdge & getParentEdge()
Returns underlying parent edge.
const std::string & getAdditionalID() const
returns the ID of additional
void refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
friend class GNEChange_Attribute
declare friend class
double y() const
Returns the y-position.
double getChargeDelay()
Returns the charge delay of the chargingStation.
double getChargingPower()
Returns the charging power of the chargingStation.
block movement of a graphic element
void updateGeometry()
update pre-computed geometry information
std::vector< double > myShapeLengths
The lengths of the shape parts.
~GNEChargingStation()
Destructor.
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
void setChargeDelay(double chargeDelay)
Set a new charge delay in the charging station.
void drawLockIcon(double size=0.5) const
draw lock icon
bool myChargeInTransit
enable or disable charge in transit
void changeLane(const std::string &laneID)
change lane of additional
void move2side(double amount)
move position vector to side using certain ammount
double myChargingPower
Charging power pro timestep.
std::string myName
name of stoppingPlace
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double startPos, double endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, const double chargeDelay, bool friendlyPosition)
Constructor of charging station.
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
double myEndPosRelative
The relative [0,1] end position this stopping place is located at.
double myStartPosRelative
The relative [0,1] start position this stopping place is located at.
void setChargingPower(double chargingPower)
Set a new charging power in the charging station.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNENet * getNet() const
get the net object
double myChargeDelay
delay in the starting of charge
Position getLineCenter() const
get line center
void setStoppingPlaceGeometry()
set geometry common to all stopping places
SumoXMLTag getTag() const
get XML Tag assigned to this object
Static storage of an output device and its base (abstract) implementation.
Eficiency of the charge in Charging Stations.
bool closeTag()
Closes the most recently opened tag.
static const RGBColor selectionColor
Delay in the charge of charging stations.
double getAbsoluteEndPosition() const
get absolute end Position
Position mySignPos
The position of the sign.
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)
draw Text with given parameters
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
double getLaneParametricLength() const
returns the parameteric length of the lane
double myBlockIconRotation
The rotation of the block icon.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
Position myBlockIconPosition
position of the block icon
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...