38 GNERerouter::GNERerouter(
const std::string&
id,
GNEViewNet* viewNet,
const Position& pos,
const std::vector<GNEEdge*>& edges,
const std::string& name,
const std::string& filename,
double probability,
bool off,
SUMOTime timeThreshold,
const std::string& vTypes,
bool blockMovement) :
39 GNEAdditional(id, viewNet,
GLO_REROUTER,
SUMO_TAG_REROUTER, name, blockMovement, {}, {}, {}, {}, {}, edges, {}, {}, {}, {}),
138 glRotated(180, 0, 0, 1);
245 return canParse<std::vector<GNEEdge*> >(
myViewNet->
getNet(), value,
false);
248 return canParse<Position>(value);
254 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
256 return canParse<SUMOTime>(value);
264 return canParse<bool>(value);
266 return canParse<bool>(value);
268 return canParse<bool>(value);
322 myOff = parse<bool>(value);
328 if (parse<bool>(value)) {
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
double scale
information about a lane's width (temporary, used for a single view)
~GNERerouter()
Destructor.
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (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) ...
GUIVisualizationTextSettings addName
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void add(const Position &pos)
Adds the given position to this one.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
Stores the information about how to visualize structures.
const std::vector< GNEEdge * > & getEdgeChildren() const
get edge chidls
Position offset
The offSet of the block icon.
double y() const
Returns the y-position.
std::string getAttribute(SumoXMLAttr key) const
Position getPositionInView() const
Returns position of additional in view.
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
std::string time2string(SUMOTime t)
double x() const
Returns the x-position.
Position myPosition
position of rerouter in view
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Position position
position of the block icon
bool myOff
attribute to enable or disable inactive initially
BlockIcon myBlockIcon
variable BlockIcon
Position originalViewPosition
value for saving first original position over lane before moving
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...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double myProbability
probability of rerouter
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
void changeAdditionalID(const std::string &newID)
change ID of additional
A class that stores a 2D geometrical boundary.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
AdditionalMove myMove
variable AdditionalMove
ChildConnections myChildConnections
variable ChildConnections
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
GUIVisualizationSizeSettings addSize
Dialog for edit rerouters.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
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 myAdditionalName
name of additional
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
friend class GNEChange_Attribute
declare friend class
void selectAttributeCarrier(bool changeFlag=true)
void update()
update Connection's geometry
block movement of a graphic element
static const double laneTextures
details for lane textures
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Boundary & grow(double by)
extends the boundary by the given amount
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
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
std::string myVTypes
optional vehicle types for restricting the rerouter
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
GUIVisualizationDetailSettings detailSettings
detail settings
std::vector< PositionVector > connectionPositions
Matrix with the Vertex's positions of connections between parents an their children.
static const RGBColor RED
named colors
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void drawChildConnections(const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
An Element which don't belongs to GNENet but has influency in the simulation.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
const std::string & getTagStr() const
get tag assigned to this object in string format
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE
bool isInitialised() const
check if Boundary is Initialised
std::string getGenericParametersStr() const
return generic parameters in string format
std::string getParentName() const
Returns the name of the parent object (if any)
void updateGeometry()
update pre-computed geometry information
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
an aggreagated-output interval
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
void changeEdgeChildren(GNEAdditional *elementChild, const std::string &newEdgeIDs)
change edge children of an additional
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name) ...
GNERerouter(const std::string &id, GNEViewNet *viewNet, const Position &pos, const std::vector< GNEEdge *> &edges, const std::string &name, const std::string &filename, double probability, bool off, SUMOTime timeThreshold, const std::string &vTypes, bool blockMovement)
Constructor.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool drawBoundaries
enable or disable draw boundaries
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
void openAdditionalDialog()
open GNERerouterDialog
SUMOTime myTimeThreshold
attribute to configure activation time threshold