61 #ifdef CHECK_MEMORY_LEAKS 74 myClosedEdgeId(closedEdgeId),
75 myAllowVehicles(allowVehicles),
76 myDisallowVehicles(disallowVehicles) {
88 if ((*i) == vehicleid) {
101 if ((*i) == vehicleid) {
115 if ((*i) == vehicleid) {
128 if ((*i) == vehicleid) {
138 std::vector<std::string>
144 std::vector<std::string>
160 myNewDestinationId(newDestinationId),
183 if (probability >= 0 && probability <= 1) {
195 myNewRouteId(newRouteId),
218 if (probability >= 0 && probability <= 1) {
331 std::vector<GNERerouter::closingReroute*>
337 std::vector<GNERerouter::destProbReroute*>
343 std::vector<GNERerouter::routeProbReroute*>
502 glRotated(180, 0, 0, 1);
519 if (s.
scale * exaggeration >= 3) {
522 for (
int lanePosIt = 0; lanePosIt < (int)i->positionsOverLanes.size(); lanePosIt++) {
524 glTranslated(i->positionsOverLanes.at(lanePosIt).x(), i->positionsOverLanes.at(lanePosIt).y(), 0);
525 glRotated(i->rotationsOverLanes.at(lanePosIt), 0, 0, 1);
527 glScaled(exaggeration, exaggeration, 1);
528 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
530 glBegin(GL_TRIANGLES);
531 glColor3d(1, .8f, 0);
533 glVertex2d(0 - 1.4, 0);
534 glVertex2d(0 - 1.4, 6);
535 glVertex2d(0 + 1.4, 6);
536 glVertex2d(0 + 1.4, 0);
537 glVertex2d(0 - 1.4, 0);
538 glVertex2d(0 + 1.4, 6);
541 glTranslated(0, 0, .1);
546 glRotated(180, 0, 1, 0);
547 glTranslated(-w / 2., 2, 0);
550 glTranslated(w / 2., -2, 0);
555 glTranslated(-w / 2., 4, 0);
629 std::vector<std::string> edgeIds;
632 if (edgeIds.empty()) {
636 for (
int i = 0; i < (int)edgeIds.size(); i++) {
649 return canParse<SUMOReal>(value);
651 return canParse<bool>(value);
653 return canParse<bool>(value);
668 std::vector<std::string> edgeIds;
669 std::vector<GNEEdge*> edges;
673 for (
int i = 0; i < (int)edgeIds.size(); i++) {
676 edges.push_back(edge);
696 myOff = parse<bool>(value);
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
draw name of item
SUMOReal getProbability() const
get probability of rerouter
GNERerouter(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNEEdge *> edges, const std::string &filename, SUMOReal probability, bool off, const std::set< rerouterInterval > &rerouterIntervals, bool blocked)
Constructor.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
int pfDrawString(const char *c)
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
std::vector< std::string > getEdgeChildIds() const
get ids of edge childs
~closingReroute()
destructor
std::vector< std::string > myAllowVehicles
vector of allow vehicles
~GNERerouter()
Destructor.
SUMOTime getEnd() const
get time end
bool getOff() const
get attribute to enable or disable inactive initially
GUIVisualizationTextSettings addName
const std::string & getAdditionalID() const
returns the ID of additional
std::string getNewDestinationId() const
id of new edge destination
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
~destProbReroute()
destructor
Stores the information about how to visualize structures.
std::vector< closingReroute * > myClosingReroutes
vector with the closingReroutes
std::string getAttribute(SumoXMLAttr key) const
childEdges myChildEdges
map of child edges and their positions and rotation
Position getPositionInView() const
Returns position of Rerouter in view.
SUMOReal getProbability() const
get probability
void setOff(bool off)
set attribute to enable or disable inactive initially
void pfSetPosition(SUMOReal x, SUMOReal y)
void setProbability(SUMOReal probability)
set probability
SUMOReal myProbability
probability with which a vehicle will use the given edge as destination
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.
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file
void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety)
change the position of the rerouter geometry
std::vector< closingReroute * > getClosingReroutes() const
get closing reroutes
An Element wich group additionalSet elements.
std::vector< routeProbReroute * > getRouteProbReroutes() const
get reoute probability reroutes
void removeDisallowVehicle(std::string vehicleid)
remove a previously inserted disallow vehicle
SUMOReal scale
information about a lane's width (temporary, used for a single view)
void removeAllowVehicle(std::string vehicleid)
remove a previously inserted allow vehicle
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 insertAllowVehicle(std::string vehicleid)
insert an allow vehicle
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 ...
std::set< rerouterInterval > myRerouterIntervals
set with the rerouterInterval
void setProbability(SUMOReal probability)
set probability of rerouter
GUIVisualizationSizeSettings addSize
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
void updateConnections()
update connections.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
static bool isValidFileValue(const std::string &value)
true if value is a valid file value
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::vector< routeProbReroute * > myRouteProbReroutes
vector with the routeProbReroutes
void refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
PositionVector myShape
The shape of the additional element.
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.
std::string myNewDestinationId
id of new edge destination
void setBlockIconRotation(GNELane *lane=NULL)
void insertDestProbReroutes(destProbReroute *dpr)
insert destiny probability reroute
friend class GNEChange_Attribute
declare friend class
void removeDestProbReroutes(destProbReroute *dpr)
remove a previously inserted destiny probability reroute
SUMOReal getProbability() const
get probability
routeProbReroute(std::string newRouteId, SUMOReal probability)
constructor
void drawConnections() const
draw connections.
SUMOReal x() const
Returns the x-position.
SUMOReal myProbability
probability with which a vehicle will use the given edge as destination
void drawLockIcon(SUMOReal size=0.5) const
draw lock icon
void setAdditionalID(const std::string &id)
set the ID of additional
std::string myNewRouteId
id of new route
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
void insertRouteProbReroute(routeProbReroute *rpr)
insert route probability reroute
std::vector< std::string > getDisallowVehicles() const
get disallow vehicles
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Position myBlockIconOffset
The offSet of the block icon.
void insertClosingReroutes(closingReroute *cr)
insert a new closing reroute
A road/street connecting two junctions (netedit-version)
std::string getClosedEdgeId() const
get closed edge Id
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
void setEdgeChilds(std::vector< GNEEdge *> edges)
set edge childs
void commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void pfSetScale(SUMOReal s)
An Element which don't belongs to GNENet but has influency in the simulation.
std::vector< std::string > myDisallowVehicles
vector of disallow vehicles
rerouterInterval(SUMOTime begin, SUMOTime end)
constructor
SUMOTime getBegin() const
get time begin
std::vector< destProbReroute * > myDestProbReroutes
vector with the destProbReroutes
void removeClosingReroutes(closingReroute *cr)
remove a previously inserted closing reroute
RGBColor myBaseColor
base color (Default green)
void setProbability(SUMOReal probability)
set probability
~routeProbReroute()
destructor
std::string getNewRouteId() const
get new route id
SUMOReal pfdkGetStringWidth(const char *c)
closingReroute(std::string closedEdgeId, std::vector< std::string > allowVehicles, std::vector< std::string > disallowVehicles)
constructor
void updateGeometry()
update pre-computed geometry information
GNENet * getNet() const
get the net object
std::vector< destProbReroute * > getDestProbReroutes() const
get destiny probability reroutes
GUIGlID getGlID() const
Returns the numerical id of the object.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
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.
std::string getFilename() const
get filename of rerouter
SUMOReal getExaggeration(const GUIVisualizationSettings &s, SUMOReal factor=20) const
return the drawing size including exaggeration and constantSize values
void insertDisallowVehicle(std::string vehicleid)
insert a disallow vehicle
~rerouterInterval()
destructor
void removeRouteProbReroute(routeProbReroute *rpr)
remove a previously inserted route probability reroute
bool isAdditionalSelected() const
SUMOReal myProbability
probability of rerouter
std::vector< std::string > getAllowVehicles() const
get allow vehicles
static GUIGlID getGif(GUITexture which)
returns a texture Gif previously defined in the enum GUITexture
SUMOReal y() const
Returns the y-position.
static void drawTexturedBox(int which, SUMOReal size)
Draws a named texture as a box with the given size.
void setFilename(std::string filename)
set filename of rerouter
destProbReroute(std::string newDestinationId, SUMOReal probability)
constructor
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)
void openAdditionalDialog()
open GNERerouterDialog
std::string myClosedEdgeId
edge ID
Position myBlockIconPosition
position of the block icon
SumoXMLTag getTag() const
get Tag assigned to this object