37{}, {}, {}, {}, {}, {}),
48 double probability,
bool off,
bool optional,
SUMOTime timeThreshold,
const std::vector<std::string>& vTypes,
51{}, {}, {}, {}, {}, {}),
54myProbability(probability),
57myTimeThreshold(timeThreshold),
60 updateCenteringBoundary(
false);
96 if (!rerouterInterval->getTagProperty().isSymbol()) {
97 rerouterInterval->writeAdditional(device);
155 additionalChildren->updateGeometry();
156 for (
const auto& rerouterElement : additionalChildren->getChildAdditionals()) {
157 rerouterElement->updateGeometry();
234 interval->isAttributeCarrierSelected() || inspectedElements.isACInspected(interval) ||
239 for (
const auto& rerouterElement : interval->getChildAdditionals()) {
240 if (rerouterElement->isAttributeCarrierSelected() || inspectedElements.isACInspected(rerouterElement) ||
257 std::vector<std::string> edges;
259 if (rerouterSymbol->getTagProperty().isSymbol()) {
341 return canParse<std::vector<GNEEdge*> >(
myNet, value,
false);
343 return canParse<Position>(value);
347 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
349 return canParse<SUMOTime>(value);
357 return canParse<bool>(value);
359 return canParse<bool>(value);
361 return canParse<bool>(value);
397 if (
getID().size() > 0) {
411 myVTypes = parse<std::vector<std::string> >(value);
414 myOff = parse<bool>(value);
420 if (parse<bool>(value)) {
454 undoList->
begin(
this, (
"change " +
getTagStr() +
" attribute").c_str());
460 const std::vector<GNEEdge*> edges = parse<std::vector<GNEEdge*> >(
myNet, value);
462 for (
const auto& edge : edges) {
@ NETWORK_MOVE
mode for moving network elements
GUIIcon
An enumeration of icons used by the gui applications.
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
@ SUMO_TAG_REROUTER
A rerouter.
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)
Boundary & grow(double by)
extends the boundary by the given amount
An Element which don't belong to GNENet but has influence in the simulation.
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void setAdditionalID(const std::string &newID)
set additional 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 (used only by additionals placed over grid)
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
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
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
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
const Parameterised::Map & getACParametersMap() const
get parameters map
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 isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
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
write 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 correspondent attribute are valids
double myProbability
probability of rerouter
std::string getParentName() const
Returns the name of the parent object.
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
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 myOptional
attribute to enable or disable request trigger
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
bool checkDrawMoveContour() const
check if draw move contour (red)
GNEMoveOperation * getMoveOperation()
get move operation
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...
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
void updateSinglePosGeometry(const Position &position, const double rotation)
update position and rotation
const PositionVector & getShape() const
The shape of the additional element.
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Stores the information about how to visualize structures.
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
An upper class for objects with additional parameters.
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|....
std::map< std::string, std::string > Map
parameters map
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"
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
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 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 showAdditionals() const
check if additionals has to be drawn
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
bool showSubAdditionals() const
check if show sub-additionals
static const double rerouterSize
rerouter size
static const RGBColor connectionColor
connection color