 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
46 {}, {}, {}, {stoppingPlace}, {stopParent}, {}, {}, {}, {}, {}),
55 {}, {lane}, {}, {}, {stopParent}, {}, {}, {}, {}, {}),
85 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() *
getParentLanes().front()->getLengthGeometryFactor();
88 double endPosCopy =
endPos;
90 if (startPosCopy < 0) {
91 startPosCopy += laneLength;
94 endPosCopy += laneLength;
100 return (endPosCopy <=
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
102 return (startPosCopy >= 0);
104 return ((startPosCopy >= 0) && (endPosCopy <=
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPosCopy - startPosCopy) >=
POSITION_EPS));
114 double endPosCopy =
endPos;
116 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
118 if (startPosCopy < 0) {
119 startPosCopy += laneLength;
121 if (endPosCopy < 0) {
122 endPosCopy += laneLength;
125 std::string errorStart, separator, errorEnd;
127 if (startPosCopy < 0) {
129 }
else if (startPosCopy >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
132 if (endPosCopy < 0) {
134 }
else if (endPosCopy >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
138 if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
141 return errorStart + separator + errorEnd;
218 newPosition.
add(offset);
226 double laneLengt =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() *
getParentLanes().front()->getLengthGeometryFactor();
230 endPos = stoppingPlaceLength;
232 startPos = laneLengt - stoppingPlaceLength;
286 if (previousDemandElement) {
290 if (nextDemandElement) {
313 if (previousDemandElement) {
317 if (nextDemandElement) {
346 return getParentLanes().front()->getLaneShape().positionAtOffset(end);
348 return getParentLanes().front()->getLaneShape().positionAtOffset(start);
350 return getParentLanes().front()->getLaneShape().positionAtOffset((start + end) / 2.0);
386 return Boundary(-0.1, -0.1, 0.1, 0.1);
400 bool drawPersonPlan =
false;
403 drawPersonPlan =
true;
406 drawPersonPlan =
true;
408 drawPersonPlan =
true;
410 drawPersonPlan =
true;
413 drawPersonPlan =
true;
416 if (drawPersonPlan) {
465 glTranslated(0, 1, 0);
474 glTranslated(0, 1.4, 0);
652 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
708 if (canParse<SUMOTime>(value)) {
709 return parse<SUMOTime>(value) >= 0;
714 if ((value ==
"fit") || (value ==
"end")) {
716 }
else if (canParse<int>(value)) {
717 return (parse<int>(value) >= 0);
722 return canParse<bool>(value);
724 return canParse<bool>(value);
730 std::vector<std::string> IDs = parse<std::vector<std::string>>(value);
731 for (
const auto& i : IDs) {
739 return canParse<bool>(value);
763 }
else if (canParse<double>(value)) {
771 }
else if (canParse<double>(value)) {
777 return canParse<bool>(value);
780 return canParse<bool>(value);
924 std::string stopType;
927 stopType =
"person stop";
929 stopType =
"vehicle stop";
934 return stopType +
": lane";
949 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
953 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
963 fixedPos =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
965 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
969 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
1007 if (value ==
"fit") {
1009 }
else if (value ==
"end") {
1012 index = parse<int>(value);
1034 if (value.empty()) {
1042 if (value.empty()) {
1056 if (value.empty()) {
1077 if (value.empty()) {
1086 if (value.empty()) {
1089 endPos = parse<double>(value);
1099 if (parse<bool>(value)) {
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
void endGeometryMoving()
end movement
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
An Element which don't belongs to GNENet but has influency in the simulation.
An Element which don't belongs to GNENet but has influency in the simulation.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
bool isValidDemandElementID(const std::string &newID) const
check if a new demand element ID is valid
void updateGeometryShape(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
bool friendlyPos
enable or disable friendly position (used by NETEDIT)
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
stop placed over a lane (used in netedit)
Static storage of an output device and its base (abstract) implementation.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
const GNEDemandElement * getLockedPerson() const
get locked person
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
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
friend class GNEChange_EnableAttribute
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
static const double stopsText
details for stop texts
int parametersSet
Information for the output which parameter were set.
void updateGeometry()
update pre-computed geometry information
DemandElementMove myStopMove
variable demand element move
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
bool showDemandElements() const
check if show demand elements checkbox is enabled
bool isStop() const
return true if tag correspond to a stop element
void updatePartialGeometry(const GNEEdge *edge)
partial update pre-computed geometry information
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const int STOP_EXTENSION_SET
Position originalViewPosition
value for saving first original position over lane before moving
const int STOP_TRIP_ID_SET
bool triggered
whether an arriving person lets the vehicle continue
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
SumoXMLTag
Numbers representing SUMO-XML - element names.
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.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
virtual void updatePartialGeometry(const GNEEdge *edge)=0
partial update pre-computed geometry information
GNEEdge * getToEdge() const
obtain to edge of this demand element
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
std::string secondOriginalPosition
value for saving second original position over lane before moving
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void changeDemandElementID(const std::string &newID)
change ID of demand element
GNENet * getNet() const
get the net object
double getAttributeDouble(SumoXMLAttr key) const
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
GUIVisualizationTextSettings addName
void reset()
Resets the boundary.
virtual void updateGeometry()=0
update pre-computed geometry information
bool isAttributeEnabled(SumoXMLAttr key) const
std::string tripId
id of the trip within a cyclical public transport route
GUIVisualizationDetailSettings detailSettings
detail settings
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
std::string getBegin() const
get begin time of demand element
const PositionVector & getShape() const
The shape of the additional element.
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
void startGeometryMoving()
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
SUMOTime until
The time at which the vehicle may continue its journey.
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
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
std::string getAttribute(SumoXMLAttr key) const
void computePath()
compute path
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
double scale
information about a lane's width (temporary, used for a single view)
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
A point in 2D or 3D with translation and scaling methods.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
const std::string & getDefaultValue() const
get default value
std::string time2string(SUMOTime t)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
void write(OutputDevice &dev) const
Writes the stop as XML.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
double endPos
The stopping position end.
void invalidatePath()
invalidate path
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
SUMOTime string2time(const std::string &r)
void replaceParentAdditional(GNEShape *shapeTobeChanged, const std::string &newParentAdditionalID, int additionalParentIndex)
replace the parent additional of a shape
std::string actType
act Type (only used by Persons) (used by NETEDIT)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
GUIVisualizationColorSettings colorSettings
color settings
double startPos
The stopping position start.
GNEStop(SumoXMLTag tag, GNEViewNet *viewNet, const SUMOVehicleParameter::Stop &stopParameter, GNEAdditional *stoppingPlace, GNEDemandElement *stopParent)
constructor used for stops over stoppingPlaces
const RGBColor & getColor() const
get color
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool isPersonPlan() const
return true if tag correspond to a person plan
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
GNEEdge * getFromEdge() const
bool containerTriggered
whether an arriving container lets the vehicle continue
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
bool isPersonStop() const
return true if tag correspond to a person stop element
int index
at which position in the stops list
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
SUMOTime extension
The maximum time extension for boarding / loading.
virtual std::string getAttribute(SumoXMLAttr key) const =0
const int STOP_DURATION_SET
GUISelectedStorage gSelected
A global holder of selected objects.
const std::string & getDemandElementID() const
returns DemandElement ID
const int STOP_EXPECTED_SET
GNEGeometry::Geometry myDemandElementGeometry
demand element geometry
const int STOP_TRIGGER_SET
const int STOP_CONTAINER_TRIGGER_SET
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
const AttributeProperties & getAttributeProperties(SumoXMLAttr attr) const
get attribute (throw error if doesn't exist)
GUIVisualizationSizeSettings addSize
void add(const Position &pos)
Adds the given position to this one.
bool isInitialised() const
check if Boundary is Initialised
const int STOP_EXPECTED_CONTAINERS_SET
const int STOP_PARKING_SET
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
static const RGBColor stops
color for Stops
Boundary & grow(double by)
extends the boundary by the given amount
Position getPositionInView() const
Returns position of demand element 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...
void removeLockedObject(const GUIGlObjectType type)
set object unselected
const std::string & getTagStr() const
get tag assigned to this object in string format
static const double stopsDetails
details for stops
Stores the information about how to visualize structures.
SUMOTime duration
The stopping duration.
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
std::string getParentName() const
Returns the name of the parent object.
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
static const RGBColor personStops
color for personStops
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 showAllPersonPlans() const
check all person plans has to be show
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
bool parking
whether the vehicle is removed from the net while stopping
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const double MIN_STOP_LENGTH
static bool isStopPosValid(const double startPos, const double endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if start and end position of a stop is valid
void updateGeometry(const GNEAdditional *additional)
update geometry (using geometry of another additional)
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
void deselect(GUIGlID id)
Deselects the object with the given id.
GNEViewParent * getViewParent() const
get the net object
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
Definition of vehicle stop (position and duration)
parent of an additional element
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
void addedLockedObject(const GUIGlObjectType type)
set object selected