67 myChargingPower(chargingPower),
68 myEfficiency(efficiency),
69 myChargeInTransit(chargeInTransit),
70 myChargeDelay(chargeDelay) {
102 int numberOfSegments = (int)
myShape.size() - 1;
105 if (numberOfSegments >= 0) {
112 for (
int i = 0; i < numberOfSegments; ++i) {
124 myShapeRotations.push_back((
double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double)
PI);
198 if (chargingPower > 0) {
201 throw InvalidArgument(
"Value of charging Power must be greater than 0");
208 if (efficiency >= 0 && efficiency <= 1) {
224 if (chargeDelay < 0) {
256 if (s.
scale * exaggeration >= 10) {
274 glRotated(180, 1, 0, 0);
280 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
289 glTranslated(1.2, 0, 0);
304 if (s.
scale * exaggeration > 25) {
305 noPoints =
MIN2((
int)(9.0 + (s.
scale * exaggeration) / 10.0), 36);
309 glScaled(exaggeration, exaggeration, 1);
322 glTranslated(0, 0, .1);
334 if (s.
scale * exaggeration >= 4.5) {
425 return (canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) < (
myEndPos - 1));
427 if (canParse<double>(value) && parse<double>(value) >= 1 && parse<double>(value) >
myStartPos) {
435 FXuint answer = FXMessageBox::question(
getViewNet()->getApp(), MBOX_YES_NO,
442 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
448 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
450 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
462 return (canParse<double>(value) && parse<double>(value) >= 0);
464 return (canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) <= 1);
466 return canParse<bool>(value);
468 return (canParse<double>(value) && parse<double>(value) >= 0);
470 return canParse<bool>(value);
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
int pfDrawString(const char *c)
double scale
information about a lane's width (temporary, used for a single view)
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double startPos, double endPos, double chargingPower, double efficiency, bool chargeInTransit, const double chargeDelay)
Constructor of charging station.
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.
begin/end of the description of a single lane
double getEfficiency()
Returns the charging efficiency of the chargingStation.
void pfSetScale(double s)
const std::string & getAdditionalID() const
returns the ID of additional
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
GNELane * myLane
The lane this additional belongs.
Stores the information about how to visualize structures.
bool myRotationLefthand
rotation depending of the option "Lefthand"
Allow/disallow charge in transit in Charging Stations.
double y() const
Returns the y-position.
RGBColor myTextColorSelected
Text color selected (Default blue)
double getPositionRelativeToParametricLength(double position) const
double x() const
Returns the x-position.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
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)
double myEfficiency
efficiency of the charge
#define WRITE_WARNING(msg)
Position getLineCenter() const
get line center
bool isTestingModeEnabled() const
check if netedit is running in testing mode
void setChargeInTransit(bool chargeInTransit)
Enable or disable charge in transit in the charging station.
double myEndPos
The end position this stopping place is located at.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
RGBColor myBaseColorSelected
base color selected (Default blue)
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GUIVisualizationSizeSettings addSize
double getLaneParametricLength() const
returns the parameteric length of the lane
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawLockIcon(double size=0.5) const
draw lock icon
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
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.
RGBColor mySignColor
sign color (Default yellow)
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
void setBlockIconRotation(GNELane *lane=NULL)
set Rotation of block Icon
friend class GNEChange_Attribute
declare friend class
RGBColor myTextColor
Text color (Default cyan)
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.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
~GNEChargingStation()
Destructor.
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
void setChargeDelay(double chargeDelay)
Set a new charge delay in the charging station.
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
std::string getAttribute(SumoXMLAttr key) const
double myChargingPower
Charging power pro timestep.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
const PositionVector & getShape() const
returns the shape of the lane
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
RGBColor myBaseColor
base color (Default green)
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
double myChargeDelay
delay in the starting of charge
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
double myStartPos
The start position this stopping place is located at.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
std::string getAttribute(SumoXMLAttr key) const
Static storage of an output device and its base (abstract) implementation.
Eficiency of the charge in Charging Stations.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
bool closeTag()
Closes the most recently opened tag.
bool isAdditionalSelected() const
Delay in the charge of charging stations.
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
double myBlockIconRotation
The rotation of the block icon.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
RGBColor mySignColorSelected
sign selected color (Default blue)
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 ...
SumoXMLTag getTag() const
get XML Tag assigned to this object