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*>
488 glRotated(180, 0, 0, 1);
505 if (s.
scale * exaggeration >= 3) {
508 for (
int lanePosIt = 0; lanePosIt < (int)i->positionsOverLanes.size(); lanePosIt++) {
510 glTranslated(i->positionsOverLanes.at(lanePosIt).x(), i->positionsOverLanes.at(lanePosIt).y(), 0);
511 glRotated(i->rotationsOverLanes.at(lanePosIt), 0, 0, 1);
513 glScaled(exaggeration, exaggeration, 1);
514 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
516 glBegin(GL_TRIANGLES);
517 glColor3d(1, .8f, 0);
519 glVertex2d(0 - 1.4, 0);
520 glVertex2d(0 - 1.4, 6);
521 glVertex2d(0 + 1.4, 6);
522 glVertex2d(0 + 1.4, 0);
523 glVertex2d(0 - 1.4, 0);
524 glVertex2d(0 + 1.4, 6);
527 glTranslated(0, 0, .1);
532 glRotated(180, 0, 1, 0);
533 glTranslated(-w / 2., 2, 0);
536 glTranslated(w / 2., -2, 0);
541 glTranslated(-w / 2., 4, 0);
612 std::vector<std::string> edgeIds;
615 if (edgeIds.empty()) {
619 for (
int i = 0; i < (int)edgeIds.size(); i++) {
632 return canParse<SUMOReal>(value);
634 return canParse<bool>(value);
649 std::vector<std::string> edgeIds;
650 std::vector<GNEEdge*> edges;
654 for (
int i = 0; i < (int)edgeIds.size(); i++) {
657 edges.push_back(edge);
677 myOff = parse<bool>(value);
SUMOReal getExaggeration(const GUIVisualizationSettings &s, SUMOReal factor=20) const
return the drawing size including exaggeration and constantSize values
std::vector< std::string > getDisallowVehicles() const
get disallow vehicles
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)
SUMOReal getProbability() const
get probability
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
~closingReroute()
destructor
std::vector< std::string > myAllowVehicles
vector of allow vehicles
~GNERerouter()
Destructor.
GUIVisualizationTextSettings addName
~destProbReroute()
destructor
Stores the information about how to visualize structures.
std::vector< closingReroute * > myClosingReroutes
vector with the closingReroutes
bool isAdditionalSelected() const
childEdges myChildEdges
map of child edges and their positions and rotation
void setOff(bool off)
set attribute to enable or disable inactive initially
void pfSetPosition(SUMOReal x, SUMOReal y)
const std::string & getParentName() const
Returns the name of the parent object (if any)
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
std::string getAttribute(SumoXMLAttr key) const
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file
std::string getClosedEdgeId() const
get closed edge Id
bool getOff() const
get attribute to enable or disable inactive initially
An Element wich group additionalSet elements.
void removeDisallowVehicle(std::string vehicleid)
remove a previously inserted disallow vehicle
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)
void removeAllowVehicle(std::string vehicleid)
remove a previously inserted allow vehicle
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
void insertAllowVehicle(std::string vehicleid)
insert an allow vehicle
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
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::set< rerouterInterval > myRerouterIntervals
set with the rerouterInterval
void setProbability(SUMOReal probability)
set probability of rerouter
GUIVisualizationSizeSettings addSize
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.
bool isValid(SumoXMLAttr key, const std::string &value)
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.
std::vector< routeProbReroute * > myRouteProbReroutes
vector with the routeProbReroutes
const std::string & getAdditionalID() const
returns the ID of additional
PositionVector myShape
The shape of the additional element.
std::string myFilename
filename of rerouter
A point in 2D or 3D with translation and scaling methods.
std::string myNewDestinationId
id of new edge destination
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.
void setBlockIconRotation(GNELane *lane=NULL)
void insertDestProbReroutes(destProbReroute *dpr)
insert destiny probability reroute
void setEdgeChilds(std::vector< GNEEdge * > edges)
set edge childs
friend class GNEChange_Attribute
declare friend class
void removeDestProbReroutes(destProbReroute *dpr)
remove a previously inserted destiny probability reroute
std::vector< destProbReroute * > getDestProbReroutes() const
get destiny probability reroutes
routeProbReroute(std::string newRouteId, SUMOReal probability)
constructor
void drawLockIcon(SUMOReal size=0.5) const
draw lock icon
SUMOReal myProbability
probability with which a vehicle will use the given edge as destination
SUMOTime getBegin() const
get time begin
SUMOTime getEnd() const
get time end
void setAdditionalID(const std::string &id)
set the ID of additional
std::string myNewRouteId
id of new route
const std::string getID() const
function to support debugging
void insertRouteProbReroute(routeProbReroute *rpr)
insert route probability reroute
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
draw name of item
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
void drawConnections() const
draw connections.
std::string getNewRouteId() const
get new route id
std::string getFilename() const
get filename of rerouter
Position myBlockIconOffset
The offSet of the block icon.
std::vector< std::string > getAllowVehicles() const
get allow vehicles
void insertClosingReroutes(closingReroute *cr)
insert a new closing reroute
std::vector< closingReroute * > getClosingReroutes() const
get closing reroutes
A road/street connecting two junctions (netedit-version)
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
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.
std::vector< std::string > myDisallowVehicles
vector of disallow vehicles
rerouterInterval(SUMOTime begin, SUMOTime end)
constructor
std::vector< destProbReroute * > myDestProbReroutes
vector with the destProbReroutes
std::vector< routeProbReroute * > getRouteProbReroutes() const
get reoute probability reroutes
SUMOReal y() const
Returns the y-position.
void removeClosingReroutes(closingReroute *cr)
remove a previously inserted closing reroute
RGBColor myBaseColor
base color (Default green)
void setProbability(SUMOReal probability)
set probability
~routeProbReroute()
destructor
GNENet * getNet() const
get the net object
void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList *undoList)
change the position of the rerouter geometry
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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
std::vector< std::string > getEdgeChildIds() const
get ids of edge childs
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
Position getPositionInView() const
Returns position of Rerouter in view.
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 insertDisallowVehicle(std::string vehicleid)
insert a disallow vehicle
~rerouterInterval()
destructor
void removeRouteProbReroute(routeProbReroute *rpr)
remove a previously inserted route probability reroute
SUMOReal getProbability() const
get probability
SUMOReal myProbability
probability of rerouter
std::string getNewDestinationId() const
id of new edge destination
static GUIGlID getGif(GUITexture which)
returns a texture Gif previously defined in the enum GUITexture
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
SUMOReal getProbability() const
get probability of rerouter
std::string myClosedEdgeId
edge ID
Position myBlockIconPosition
position of the block icon