 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
39 GNEAdditional(busStop, viewNet,
GLO_ACCESS,
SUMO_TAG_ACCESS,
"", blockMovement, {}, {lane}, {}, {busStop}, {}, {}, {}, {}, {}, {}),
40 myPositionOverLane(pos),
42 myFriendlyPosition(friendlyPos) {
54 newPosition.
add(offset);
77 double fixedPositionOverLane;
79 fixedPositionOverLane =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
81 fixedPositionOverLane = 0;
83 fixedPositionOverLane =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
255 if (lane !=
nullptr) {
269 return canParse<double>(value);
275 return (canParse<double>(value) && (parse<double>(value) >= 0));
278 return canParse<bool>(value);
280 return canParse<bool>(value);
282 return canParse<bool>(value);
334 if (parse<bool>(value)) {
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Position position
position of the block icon
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
static const RGBColor busStop
color for busStops
An Element which don't belongs to GNENet but has influency in the simulation.
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
const std::string & getAdditionalID() const
const std::string getID() const
function to support debugging
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
GNEEdge * getEdge() const
get edge in which this Access is placed
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GNEEdge * getParentEdge() const
Returns underlying parent edge.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void updateGeometryPosition(const GNELane *lane, const double posOverLane)
update position and rotation
void updateGeometry()
update pre-computed geometry information
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
double getAttributeDouble(SumoXMLAttr key) const
Position getPositionInView() const
Returns position of additional in view.
void changeAdditionalID(const std::string &newID)
change ID of additional
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
BlockIcon myBlockIcon
variable BlockIcon
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
std::string getParentName() const
Returns the name of the parent object (if any)
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
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.
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
AdditionalMove myMove
variable AdditionalMove
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GNENet * getNet() const
get the net object
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
std::string myLength
Acces length.
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
const PositionVector & getShape() const
The shape of the additional element.
void selectAttributeCarrier(bool changeFlag=true)
static std::vector< Position > drawFilledCircleReturnVertices(double width, int steps=8)
Draws a filled circle around (0,0) returning circle vertex.
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
void replaceParentLanes(GNEShape *elementChild, const std::string &newLaneIDs)
replace the parent edges of a shape
static void drawShapeDottedContourAroundClosedShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape)
draw a dotted contour around the given closed shape with certain width
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
bool myFriendlyPosition
flag to check if friendly position is enabled
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
const Position & getPosition() const
get Position
GUIVisualizationColorSettings colorSettings
color settings
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double y() const
Returns the y-position.
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
double myPositionOverLane
position over lane
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool isAccessPositionFixed() const
check if Position of Access is fixed
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GUIVisualizationSizeSettings addSize
void add(const Position &pos)
Adds the given position to this one.
@ GNE_ATTR_SELECTED
element is selected
Boundary & grow(double by)
extends the boundary by the given amount
const std::string & getTagStr() const
get tag assigned to this object in string format
Stores the information about how to visualize structures.
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge *edge)
check if a GNEAccess can be created in a certain Edge
@ SUMO_TAG_ACCESS
An access point for a train stop.
Position getLineCenter() const
get line center
GNEAccess(GNEAdditional *busStop, GNELane *lane, GNEViewNet *viewNet, double pos, const std::string &length, bool friendlyPos, bool blockMovement)
Constructor.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
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.
bool isAttributeEnabled(SumoXMLAttr key) const
Position originalViewPosition
value for saving first original position over lane before moving
std::string getAttribute(SumoXMLAttr key) const
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Position offset
The offSet of the block icon.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
@ GNE_ATTR_PARENT
parent of an additional element