66 mySaveInFilename(false) {
150 i->writeStep(device);
156 i->writeStep(device);
172 throw ProcessError(
"Variable Speed Sign Step already exist");
185 throw ProcessError(
"Variable Speed Sign Step doesn't exist");
190 const std::vector<GNEVariableSpeedSignStep*>&
199 std::vector<GNEVariableSpeedSignStep*> sortedSteps;
204 for (
int i = 0; i < (int)
mySteps.size(); i++) {
205 if (
mySteps.at(i)->getTime() <
mySteps.at(time_small)->getTime()) {
210 sortedSteps.push_back(
mySteps.at(time_small));
233 glRotated(180, 0, 0, 1);
254 glScaled(exaggeration, exaggeration, 1);
255 glTranslated(i.first.x(), i.first.y(),
getType());
256 glRotated(-1 * i.second, 0, 0, 1);
257 glTranslated(0, -1.5, 0);
261 noPoints = (int)(9.0 + s.
scale / 10.0);
269 glTranslated(0, 0, .1);
275 glTranslated(0, 0, .1);
276 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
354 return canParse<bool>(value);
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void close()
Closes the device and removes it from the dictionary.
double scale
information about a lane's width (temporary, used for a single view)
void sortVariableSpeedSignSteps()
sort steps
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
GUIVisualizationTextSettings addName
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void add(const Position &pos)
Adds the given position to this one.
void refreshElement(GUIGlObject *o)
refreshes boundary information for o and update
const std::string & getAdditionalID() const
returns Additional ID
const std::vector< GNEVariableSpeedSignStep * > & getVariableSpeedSignSteps() const
get values of variable speed signal
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
void removeVariableSpeedSignStep(GNEVariableSpeedSignStep *step)
remove an existent step of variable speed signal
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
void openAdditionalDialog()
open GNEVariableSpeedSignDialog
double x() const
Returns the x-position.
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)
Position getPositionInView() const
Returns position of additional in view.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
static bool isValidFilename(const std::string &value)
true if value is a valid file value
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
void changeAdditionalID(const std::string &newID)
change ID of additional
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.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GUIVisualizationSizeSettings addSize
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void drawChildConnections() const
draw connections between Parent and childrens
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)
PositionVector myShape
The shape of the additional element.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
friend class GNEChange_Attribute
declare friend class
static bool checkGNELanesValid(GNENet *net, const std::string &value, bool report)
check if a list of Lane IDs is valid
bool mySaveInFilename
enable or disable save in external filename
block movement of a graphic element
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void updateGeometry()
update pre-computed geometry information
void updateChildConnections()
update Connection's geometry
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
std::vector< GNEVariableSpeedSignStep * > mySteps
values of variable speed signal
const std::string getID() const
function to support debugging
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Position myBlockIconOffset
The offSet of the block icon.
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
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.
void setBlockIconRotation(GNELane *additionalLane=NULL)
std::vector< std::pair< Position, double > > mySymbolsPositionAndRotation
position and rotation of every simbol over lane
~GNEVariableSpeedSign()
Destructor.
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
GNEVariableSpeedSign(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNELane *> lanes, const std::string &filename)
Constructor.
Static storage of an output device and its base (abstract) implementation.
Position myPosition
position of VSS in view
bool closeTag()
Closes the most recently opened tag.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
bool isAdditionalSelected() const
std::string myFilename
filename of variable speed sign
static std::vector< GNELane * > parseGNELanes(GNENet *net, const std::string &value)
parse string into vector of GNELanes
const std::string & getParentName() const
Returns the name of the parent object.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
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 addVariableSpeedSignStep(GNEVariableSpeedSignStep *step)
insert a new step in variable speed signal
Position myBlockIconPosition
position of the block icon
std::vector< GNELane * > myLaneChilds
vector with the lane childs of this additional
SumoXMLTag getTag() const
get XML Tag assigned to this object