71 myProbability(probability),
153 std::vector<std::string> edgeIDs;
154 for (std::vector<GNEEdge*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
155 edgeIDs.push_back((*i)->getID());
175 for (std::vector<GNEClosingLaneReroute>::const_iterator j = i->getClosingLaneReroutes().begin(); j != i->getClosingLaneReroutes().end(); j++) {
184 for (std::vector<GNEClosingReroute>::const_iterator j = i->getClosingReroutes().begin(); j != i->getClosingReroutes().end(); j++) {
193 for (std::vector<GNEDestProbReroute>::const_iterator j = i->getDestProbReroutes().begin(); j != i->getDestProbReroutes().end(); j++) {
201 for (std::vector<GNERouteProbReroute>::const_iterator j = i->getRouteProbReroutes().begin(); j != i->getRouteProbReroutes().end(); j++) {
243 const std::vector<GNEEdge*>&
252 std::vector<GNERerouterInterval> copyOfMyRerouterIntervals;
253 copyOfMyRerouterIntervals.push_back(rerouterInterval);
263 const std::vector<GNERerouterInterval>&
295 glRotated(180, 0, 0, 1);
377 std::vector<std::string> edgeIDs;
378 for (std::vector<GNEEdge*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
379 edgeIDs.push_back((*i)->getID());
431 std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
433 if (edgeIds.empty()) {
437 for (
int i = 0; i < (int)edgeIds.size(); i++) {
451 return canParse<double>(value) && (parse<double>(value)) >= 0 && (parse<double>(value) <= 1);
453 return canParse<bool>(value);
455 return canParse<bool>(value);
470 std::vector<std::string> edgeIds = GNEAttributeCarrier::parse<std::vector<std::string> > (value);
473 for (std::vector<GNEEdge*>::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
479 for (
int i = 0; i < (int)edgeIds.size(); i++) {
483 edge->addGNERerouter(
this);
503 myOff = parse<bool>(value);
518 if (rerouterIntervals.size() <= 1) {
522 std::sort(rerouterIntervals.begin(), rerouterIntervals.end());
525 for (std::vector<GNERerouterInterval>::const_iterator i = (rerouterIntervals.begin() + 1); i != rerouterIntervals.end(); i++) {
526 if ((i - 1)->getBegin() == i->getBegin()) {
531 for (std::vector<GNERerouterInterval>::const_iterator i = rerouterIntervals.begin(); i != (rerouterIntervals.end() - 1); i++) {
532 if (i->getEnd() > (i + 1)->getBegin()) {
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
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
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
const std::string & getAdditionalID() const
returns the ID of additional
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
std::string getAttribute(SumoXMLAttr key) const
const std::vector< GNERerouterInterval > & getRerouterIntervals() const
get rerouter intervals
Position getPositionInView() const
Returns position of Rerouter in view.
double x() const
Returns the x-position.
weights: time range begin
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...
const std::string & getParentName() const
Returns the name of the parent object (if any)
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
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
const std::vector< GNEEdge * > & getEdgeChilds() const
get edge chidls
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
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Dialog for edit rerouters.
GNERerouter(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNEEdge *> edges, const std::string &filename, double probability, bool off)
Constructor.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
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)
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
void setBlockIconRotation(GNELane *lane=NULL)
set Rotation of block Icon
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
block movement of a graphic element
void moveAdditionalGeometry(double offsetx, double offsety)
change the position of the rerouter geometry
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void setAdditionalID(const std::string &id)
set the ID of additional
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const std::string getID() const
function to support debugging
Position myBlockIconOffset
The offSet of the block icon.
begin/end of the description of an edge
A road/street connecting two junctions (netedit-version)
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::vector< GNEEdge * > myEdges
edges of Rerouter
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.
An Element which don't belongs to GNENet but has influency in the simulation.
void addEdgeChild(GNEEdge *edge)
add edge child
RGBColor myBaseColor
base color (Default green)
void updateGeometry()
update pre-computed geometry information
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the 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.
bool isAdditionalSelected() const
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
SumoXMLTag getTag() const
get XML Tag assigned to this object