59 #ifdef CHECK_MEMORY_LEAKS 70 myVSSValues(VSSValues),
71 mySaveInFilename(false) {
182 std::map<SUMOTime, SUMOReal>
226 glRotated(180, 0, 0, 1);
254 glScaled(exaggeration, exaggeration, 1);
255 glTranslated(i->positionOverLane.x(), i->positionOverLane.y(), 0);
256 glRotated(i->rotationOverLane, 0, 0, 1);
257 glTranslated(0, -1.5, 0);
261 noPoints = (int)(9.0 + s.
scale / 10.0);
269 glTranslated(0, 0, .1);
273 SUMOReal speed = i->lane->getSpeed();
276 if (((
int) speed + 1) % 10 == 0) {
277 speed = (
SUMOReal)(((
int) speed + 1) / 10 * 10);
280 std::string speedToDraw = toString<SUMOReal>(speed);
282 glTranslated(0, 0, .1);
283 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
287 glRotated(180, 0, 1, 0);
288 glTranslated(-w / 2., 0.3, 0);
357 std::vector<std::string> laneIds;
360 if (laneIds.empty()) {
364 for (
int i = 0; i < (int)laneIds.size(); i++) {
387 std::vector<std::string> laneIds;
388 std::vector<GNELane*> lanes;
392 for (
int i = 0; i < (int)laneIds.size(); i++) {
395 lanes.push_back(lane);
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)
void close()
Closes the device and removes it from the dictionary.
std::string getFilename() const
get filename of rerouter
void setLaneChilds(std::vector< GNELane * > lanes)
set lane childs
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
GUIVisualizationTextSettings addName
void setFilename(std::string filename)
set filename of rerouter
Stores the information about how to visualize structures.
bool isAdditionalSelected() const
childLanes myChildLanes
list of child lanes and their positions and rotation
void pfSetPosition(SUMOReal x, SUMOReal y)
Position getPositionInView() const
Returns position of Variable Speed Signal in view.
void updateGeometry()
update pre-computed geometry information
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setVariableSpeedSignalSteps(const std::map< SUMOTime, SUMOReal > &vssValues)
set values of variable speed signal
An Element wich group additionalSet elements.
SUMOReal x() const
Returns the x-position.
GUIGlID getGlID() const
Returns the numerical id of the object.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
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)
void writeAdditional(OutputDevice &device, const std::string ¤tDirectory)
writte additional element into a xml file
GUIVisualizationSizeSettings addSize
std::string getAttribute(SumoXMLAttr key) const
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
void updateConnections()
update connections.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
static bool isValidFileValue(const std::string &value)
true if value is a valid file value
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
const std::string & getAdditionalID() const
returns the ID of additional
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
void setBlockIconRotation(GNELane *lane=NULL)
std::map< SUMOTime, SUMOReal > myVSSValues
values of variable speed signal
friend class GNEChange_Attribute
declare friend class
void drawLockIcon(SUMOReal size=0.5) const
draw lock icon
std::map< SUMOTime, SUMOReal > getVariableSpeedSignalSteps() const
get values of variable speed signal
bool isValid(SumoXMLAttr key, const std::string &value)
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
void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList *undoList)
change the position of the rerouter geometry
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
void drawConnections() const
draw connections.
Position myBlockIconOffset
The offSet of the block icon.
A road/street connecting two junctions (netedit-version)
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
std::string myFilename
filename of rerouter
GNEVariableSpeedSignal(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNELane * > lanes, const std::string &filename, const std::map< SUMOTime, SUMOReal > &VSSValues, bool blocked)
Constructor.
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
void pfSetScale(SUMOReal s)
An Element which don't belongs to GNENet but has influency in the simulation.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
SUMOReal y() const
Returns the y-position.
RGBColor myBaseColor
base color (Default green)
const std::string & getParentName() const
Returns the name of the parent object (if any)
GNENet * getNet() const
get the net object
SUMOReal pfdkGetStringWidth(const char *c)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
SumoXMLTag getTag() const
get Tag assigned to this object
Static storage of an output device and its base (abstract) implementation.
Position myPosition
The position in which this additional element is located.
bool closeTag()
Closes the most recently opened tag.
void openAdditionalDialog()
open GNEVariableSpeedSignalDialog
std::vector< std::string > getLaneChildIds() const
get ids of lane childs
static GUIGlID getGif(GUITexture which)
returns a texture Gif previously defined in the enum GUITexture
bool insertStep(const SUMOTime time, const SUMOReal speed)
insert a new step in variable speed signal
static void drawTexturedBox(int which, SUMOReal size)
Draws a named texture as a box with the given size.
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occured errors.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void append(const PositionVector &v, SUMOReal sameThreshold=2.0)
~GNEVariableSpeedSignal()
Destructor.
Position myBlockIconPosition
position of the block icon
bool mySaveInFilename
enable or disable save in external filename