37 {}, {}, {}, {}, {}, {}, {}, {},
38 std::map<std::string, std::string>()),
48 const std::string& filename,
double probability,
bool off,
SUMOTime timeThreshold,
const std::vector<std::string>& vTypes,
49 const std::map<std::string, std::string>& parameters) :
51 {}, {}, {}, {}, {}, {}, {}, {},
55 myProbability(probability),
57 myTimeThreshold(timeThreshold),
60 updateCenteringBoundary(
false);
94 if (!rerouterInterval->getTagProperty().isSymbol()) {
95 rerouterInterval->writeAdditional(device);
117 additionalChildren->updateGeometry();
118 for (
const auto& rerouterElement : additionalChildren->getChildAdditionals()) {
119 rerouterElement->updateGeometry();
144 for (
const auto& rerouterElement : additionalChildren->getChildAdditionals()) {
196 for (
const auto& rerouterElement : interval->getChildAdditionals()) {
213 std::vector<std::string> edges;
215 if (rerouterSymbol->getTagProperty().isSymbol()) {
291 return canParse<std::vector<GNEEdge*> >(
myNet, value,
false);
293 return canParse<Position>(value);
299 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
301 return canParse<SUMOTime>(value);
309 return canParse<bool>(value);
311 return canParse<bool>(value);
353 if (
getID().size() > 0) {
370 myVTypes = parse<std::vector<std::string> >(value);
373 myOff = parse<bool>(value);
376 if (parse<bool>(value)) {
416 const std::vector<GNEEdge*> edges = parse<std::vector<GNEEdge*> >(
myNet, value);
418 for (
const auto& edge : edges) {
std::string time2string(SUMOTime t)
convert SUMOTime to string
@ SUMO_TAG_REROUTER
A rerouter.
@ SUMO_TAG_PARKING_AREA_REROUTE
entry for an alternative parking zone
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
std::string myAdditionalName
name of additional
void drawSquaredAdditional(const GUIVisualizationSettings &s, const Position &pos, const double size, GUITexture texture, GUITexture selectedTexture) const
draw squared additional
Boundary myAdditionalBoundary
Additional Boundary.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
PositionVector shapeToUpdate
shape to update (edited in moveElement)
A NBNetBuilder extended by visualisation and editing capabilities.
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
GNEViewNet * getViewNet() const
get view net
Dialog for edit rerouters.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
SUMOTime myTimeThreshold
attribute to configure activation time threshold
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
double getAttributeDouble(SumoXMLAttr key) const
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void rebuildRerouterSymbols(const std::string &value, GNEUndoList *undoList)
rebuild Rerouter Symbols
std::vector< std::string > myVTypes
optional vehicle types for restricting the rerouter
Position myPosition
position of rerouter in view
bool myOff
attribute to enable or disable inactive initially
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getPositionInView() const
Returns position of additional in view.
GNERerouter(GNENet *net)
default Constructor
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double myProbability
probability of rerouter
std::string getParentName() const
Returns the name of the parent object (if any)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void openAdditionalDialog()
open GNERerouterDialog
~GNERerouter()
Destructor.
std::string getAttribute(SumoXMLAttr key) const
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
bool isAttributeEnabled(SumoXMLAttr key) const
GNEMoveOperation * getMoveOperation()
get move operation
std::string myFilename
filename of rerouter
void updateGeometry()
update pre-computed geometry information
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
GNEUndoList * getUndoList() const
get the undoList object
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
void updateSinglePosGeometry(const Position &position, const double rotation)
update position and rotation
const PositionVector & getShape() const
The shape of the additional element.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
Stores the information about how to visualize structures.
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
A point in 2D or 3D with translation and scaling methods.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
bool showSubAdditionals() const
check if show sub-additionals
static const double rerouterSize
rerouter size
static const RGBColor connectionColor
connection color