59 #ifdef CHECK_MEMORY_LEAKS
69 myChargingPower(chargingPower),
70 myEfficiency(efficiency),
71 myChargeInTransit(chargeInTransit),
72 myChargeDelay(chargeDelay) {
104 int numberOfSegments = (int)
myShape.size() - 1;
107 if (numberOfSegments >= 0) {
114 for (
int i = 0; i < numberOfSegments; ++i) {
200 if (chargingPower > 0) {
203 throw InvalidArgument(
"Value of charging Power must be greather than 0");
210 if (efficiency >= 0 && efficiency <= 1) {
226 if (chargeDelay < 0) {
259 if (s.
scale * exaggeration >= 10) {
277 glRotated(180, 1, 0, 0);
283 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
292 glTranslated(1.2, 0, 0);
307 if (s.
scale * exaggeration > 25) {
308 noPoints =
MIN2((
int)(9.0 + (s.
scale * exaggeration) / 10.0), 36);
312 glScaled(exaggeration, exaggeration, 1);
325 glTranslated(0, 0, .1);
337 if (s.
scale * exaggeration >= 4.5) {
428 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 0 && parse<SUMOReal>(value) < (
myEndPos - 1));
430 if (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 1 && parse<SUMOReal>(value) >
myStartPos) {
434 FXuint answer = FXMessageBox::question(
getViewNet()->getApp(), MBOX_YES_NO,
435 "EndPosition exceeds the size of the lane",
"%s",
436 "EndPosition exceeds the size of the lane. You want to assign the size of the lane as endPosition?");
450 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 0);
452 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 0 && parse<SUMOReal>(value) <= 1);
454 return canParse<bool>(value);
456 return (canParse<int>(value) && parse<int>(value) >= 0);
458 return canParse<bool>(value);
SUMOReal getExaggeration(const GUIVisualizationSettings &s, SUMOReal factor=20) const
return the drawing size including exaggeration and constantSize values
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)
SUMOReal getEfficiency()
Returns the charging efficiency of the chargingStation.
int myChargeDelay
delay in the starting of charge
GUIVisualizationTextSettings addName
bool getChargeInTransit()
Returns the value of charge in transit of the chargingStation.
GNELane * myLane
The lane this additional belongs NULL if additional doesnt' belongs to a lane.
Stores the information about how to visualize structures.
bool myRotationLefthand
rotation depending of the option "Lefthand"
bool isAdditionalSelected() const
RGBColor myTextColorSelected
Text color selected (Default blue)
void pfSetPosition(SUMOReal x, SUMOReal y)
static void drawBoxLines(const PositionVector &geom, const std::vector< SUMOReal > &rots, const std::vector< SUMOReal > &lengths, SUMOReal width, int cornerDetail=0, SUMOReal offset=0)
Draws thick lines.
SUMOReal getChargeDelay()
Returns the charge delay of the chargingStation.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
SUMOReal getChargingPower()
Returns the charging power of the chargingStation.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
static void drawText(const std::string &text, const Position &pos, const SUMOReal layer, const SUMOReal size, const RGBColor &col=RGBColor::BLACK, const SUMOReal angle=0)
draw Text with given parameters
SUMOReal myEndPos
The end position this stopping place is located at.
SUMOReal x() const
Returns the x-position.
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
SUMOReal myEfficiency
efficiency of the charge
void setChargeInTransit(bool chargeInTransit)
Enable or disable charge in transit in the charging station.
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
static void drawFilledCircle(SUMOReal width, int steps=8)
Draws a filled circle around (0,0)
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
SUMOReal myBlockIconRotation
The rotation of the block icon.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
const std::string & getAdditionalID() const
returns the ID of additional
SUMOReal getLaneParametricLenght() const
returns the parameteric length of the lane
void refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
SUMOReal getPositionRelativeToParametricLenght(SUMOReal position) const
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)
friend class GNEChange_Attribute
declare friend class
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file
RGBColor myTextColor
Text color (Default cyan)
void updateGeometry()
update pre-computed geometry information
void drawLockIcon(SUMOReal size=0.5) const
draw lock icon
SUMOReal myStartPos
The start position this stopping place is located at.
void setChargeDelay(SUMOReal chargeDelay)
Set a new charge delay in the charging station.
~GNEChargingStation()
Destructor.
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
draw name of item
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
bool myChargeInTransit
enable or disable charge in transit
void changeLane(const std::string &laneID)
change lane of additional
std::string getAttribute(SumoXMLAttr key) const
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
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) ...
std::string getAttribute(SumoXMLAttr key) const
SUMOReal myChargingPower
Charging power pro timestep.
void pfSetScale(SUMOReal s)
SUMOReal y() const
Returns the y-position.
RGBColor myBaseColor
base color (Default green)
std::vector< SUMOReal > myShapeRotations
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
Position getLineCenter() const
get line center
GNEChargingStation(const std::string &id, GNELane *lane, GNEViewNet *viewNet, SUMOReal startPos, SUMOReal endPos, SUMOReal chargingPower, SUMOReal efficiency, bool chargeInTransit, int chargeDelay, bool blocked)
Constructor of charging station.
SumoXMLTag getTag() const
get Tag assigned to this object
void move2side(SUMOReal amount)
move position vector to side using certain ammount
void setEfficiency(SUMOReal efficiency)
Set a new efficiency in the charging station.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
void setChargingPower(SUMOReal chargingPower)
Set a new charging power in the charging station.
Position mySignPos
The position of the sign.
PositionVector getSubpart(SUMOReal beginOffset, SUMOReal endOffset) const
get subpart of a position vector
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 ...