72 myProbability(probability),
151 std::vector<std::string> edgeIDs;
152 for (std::vector<GNEEdge*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
153 edgeIDs.push_back((*i)->getID());
173 for (std::vector<GNEClosingLaneReroute>::const_iterator j = i->getClosingLaneReroutes().begin(); j != i->getClosingLaneReroutes().end(); j++) {
182 for (std::vector<GNEClosingReroute>::const_iterator j = i->getClosingReroutes().begin(); j != i->getClosingReroutes().end(); j++) {
191 for (std::vector<GNEDestProbReroute>::const_iterator j = i->getDestProbReroutes().begin(); j != i->getDestProbReroutes().end(); j++) {
199 for (std::vector<GNERouteProbReroute>::const_iterator j = i->getRouteProbReroutes().begin(); j != i->getRouteProbReroutes().end(); j++) {
241 const std::vector<GNEEdge*>&
250 std::vector<GNERerouterInterval> copyOfMyRerouterIntervals;
251 copyOfMyRerouterIntervals.push_back(rerouterInterval);
261 const std::vector<GNERerouterInterval>&
293 glRotated(180, 0, 0, 1);
375 std::vector<std::string> edgeIDs;
376 for (std::vector<GNEEdge*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
377 edgeIDs.push_back((*i)->getID());
429 std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
431 if (edgeIds.empty()) {
435 for (
int i = 0; i < (int)edgeIds.size(); i++) {
449 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
451 return canParse<bool>(value);
453 return canParse<bool>(value);
468 std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
471 for (std::vector<GNEEdge*>::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
477 for (
int i = 0; i < (int)edgeIds.size(); i++) {
481 edge->addGNERerouter(
this);
501 myOff = parse<bool>(value);
516 if (rerouterIntervals.size() <= 1) {
520 std::sort(rerouterIntervals.begin(), rerouterIntervals.end());
523 for (std::vector<GNERerouterInterval>::const_iterator i = (rerouterIntervals.begin() + 1); i != rerouterIntervals.end(); i++) {
524 if ((i - 1)->getBegin() == i->getBegin()) {
529 for (std::vector<GNERerouterInterval>::const_iterator i = rerouterIntervals.begin(); i != (rerouterIntervals.end() - 1); i++) {
530 if (i->getEnd() > (i + 1)->getBegin()) {
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void setBlockIconRotation()
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
double scale
information about a lane's width (temporary, used for a single view)
~GNERerouter()
Destructor.
GUIVisualizationTextSettings addName
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
double x() const
Returns the x-position.
Stores the information about how to visualize structures.
bool isAdditionalSelected() const
Position myPosition
position of rerouter in view
weights: time range begin
const std::string & getParentName() const
Returns the name of the parent object (if any)
void removeEdgeChild(GNEEdge *edge)
remove edge child
bool myOff
attribute to enable or disable inactive initially
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...
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double myProbability
probability of rerouter
static bool isValidFilename(const std::string &value)
true if value is a valid file value
GUIGlID getGlID() const
Returns the numerical id of the object.
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Dialog for edit rerouters.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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.
bool addRerouterInterval(const GNERerouterInterval &rerouterInterval)
add rerouter interval
std::string myFilename
filename of rerouter
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.
bool checkOverlapping(std::vector< GNERerouterInterval > rerouterIntervals)
check overlapping of a vector of rerouter intervals
const std::vector< GNERerouterInterval > & getRerouterIntervals() const
get rerouter intervals
bool setRerouterIntervals(const std::vector< GNERerouterInterval > &rerouterIntervals)
set rerouter intervals
void removeGNERerouter(GNERerouter *rerouter)
remove a reference to a rerouter that has this edge as parameter
friend class GNEChange_Attribute
declare friend class
double y() const
Returns the y-position.
block movement of a graphic element
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
void drawLockIcon(double size=0.5) const
draw lock icon
const std::vector< GNEEdge * > & getEdgeChilds() const
get edge chidls
Position myBlockIconOffset
The offSet of the block icon.
begin/end of the description of an edge
GNERerouter(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNEEdge * > edges, const std::string &filename, double probability, bool off)
Constructor.
A road/street connecting two junctions (netedit-version)
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
std::vector< GNEEdge * > myEdges
edges of Rerouter
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.
void addEdgeChild(GNEEdge *edge)
add edge child
GNENet * getNet() const
get the net object
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void updateGeometry()
update pre-computed geometry information
Position getPositionInView() const
Returns position of additional in view.
SumoXMLTag getTag() const
get XML Tag assigned to this object
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
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.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::vector< GNERerouterInterval > myRerouterIntervals
set with the GNERerouterInterval
void openAdditionalDialog()
open GNERerouterDialog
Position myBlockIconPosition
position of the block icon