 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
41 {}, {lane}, {}, {busStop}, {}, {}, {}, {}, {}, {}),
42 myPositionOverLane(pos),
44 myFriendlyPosition(friendlyPos) {
56 newPosition.
add(offset);
85 double fixedPositionOverLane;
87 fixedPositionOverLane =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
89 fixedPositionOverLane = 0;
91 fixedPositionOverLane =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
118 if (posOverLane < 0) {
120 }
else if (posOverLane >
getLaneParents().front()->getGeometry().shape.length()) {
123 return getLaneParents().front()->getGeometry().shape.positionAtOffset(posOverLane);
250 if (lane !=
nullptr) {
264 return canParse<double>(value);
270 return (canParse<double>(value) && (parse<double>(value) >= 0));
273 return canParse<bool>(value);
275 return canParse<bool>(value);
277 return canParse<bool>(value);
323 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.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
const std::string getID() const
function to support debugging
PositionVector shape
The shape of the additional element.
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,...
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
std::vector< double > shapeRotations
The rotations of the single shape parts.
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void updateGeometry()
update pre-computed geometry information
std::string myPositionOverLane
position over lane
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.
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
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
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 lenght.
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...)
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.
GNEEdge & getParentEdge()
Returns underlying parent edge.
static void drawShapeDottedContourAroundClosedShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape)
draw a dotted contour around the given closed shape with certain width
void clearGeometry()
reset geometry
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.
bool myFriendlyPosition
flag to check if friendly position is enabled
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge &edge)
check if a GNEAccess can be created in a certain Edge
GUIVisualizationColorSettings colorSettings
color settings
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GNEAccess(GNEAdditional *busStop, GNELane *lane, GNEViewNet *viewNet, const std::string &pos, const std::string &length, bool friendlyPos, bool blockMovement)
Constructor.
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
std::string getGenericParametersStr() const
return generic parameters in string format
block movement of a graphic element
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool isAccessPositionFixed() const
check if Position of Access is fixed
void changeLaneParents(GNEShape *elementChild, const std::string &newLaneIDs)
change edge parents of a shape
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
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.
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.
An access point for a train stop.
Position getLineCenter() const
get line center
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.
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
parent of an additional element
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects