38#pragma warning(disable: 4355)
44 myCreationIndex(myNet->getAttributeCarriers()->getStopIndex()) {
68 myCreationIndex(myNet->getAttributeCarriers()->getStopIndex()) {
70 setParent<GNEAdditional*>(stoppingPlace);
71 setParent<GNEDemandElement*>(stopParent);
110 myCreationIndex(myNet->getAttributeCarriers()->getStopIndex()) {
112 setParent<GNELane*>(
lane);
113 setParent<GNEDemandElement*>(stopParent);
202 write(device,
true,
false);
221 return (
"Downstream stop");
251 if ((inspectedAC->getTagProperty()->isRoute() || inspectedAC->getTagProperty()->isVehicle()) && (inspectedAC !=
getParentDemandElements().front())) {
346 const double width = stopLane ? stopLane->getParentEdge()->getNBEdge()->getLaneWidth(stopLane->getIndex()) * 0.5 : exaggeration * 0.8;
395 if (stop.
speed > 0) {
397 }
else if (stop.
busstop !=
"") {
398 label +=
"busStop:" + stop.
busstop;
411 label +=
" triggered:";
419 label +=
"container";
426 if (stop.
join !=
"") {
427 label +=
"(" + stop.
join +
")";
434 if (stop.
until >= 0) {
440 if (stop.
ended >= 0) {
445 label +=
" duration:1day+";
451 label +=
" actType:" + stop.
actType;
587 std::vector<GNEDemandElement*> stops;
589 if (parent->getTagProperty()->isVehicleStop()) {
590 stops.push_back(parent);
594 for (
int i = 0; i < (int)stops.size(); i++) {
595 if (stops.at(i) ==
this) {
599 return "invalid index";
616 std::vector<GNEDemandElement*> stops, filteredStops;
618 if (parent->getTagProperty()->isVehicleStop()) {
619 stops.push_back(parent);
623 for (
const auto& stop : stops) {
625 filteredStops.push_back(stop);
629 for (
int i = 0; i < (int)filteredStops.size(); i++) {
630 if (filteredStops.at(i) ==
this) {
656 return laneShape.front();
658 return laneShape.back();
719 if (canParse<SUMOTime>(value)) {
720 return parse<SUMOTime>(value) >= 0;
726 const auto triggeredValues = parse<std::vector<std::string> >(value);
727 for (
const auto& triggeredValue : triggeredValues) {
728 if (std::find(expectedValues.begin(), expectedValues.end(), triggeredValue) == expectedValues.end()) {
738 const std::vector<std::string> expectedValues = parse<std::vector<std::string> >(value);
739 for (
const auto& expectedValue : expectedValues) {
753 const std::vector<std::string> expectedValues = parse<std::vector<std::string> >(value);
754 for (
const auto& expectedValue : expectedValues) {
762 if (value ==
"opportunistic") {
766 const auto triggeredValues = parse<std::vector<std::string> >(value);
767 for (
const auto& triggeredValue : triggeredValues) {
768 if (std::find(expectedValues.begin(), expectedValues.end(), triggeredValue) == expectedValues.end()) {
781 return canParse<bool>(value);
783 if ((value ==
"-1") || (value.empty())) {
785 }
else if (canParse<double>(value)) {
786 return parse<double>(value) >= 0;
792 if (canParse<double>(value)) {
793 return (parse<double>(value) >= 0);
813 return canParse<double>(value);
922 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
926 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
933 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
937 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
949 }
else if (inspectedElements.isACInspected(
this)) {
975 }
else if (stopFrame->shown() && (stopFrame->getStopParentSelector()->getCurrentDemandElement() ==
getParentDemandElements().front())) {
986 const double width,
const double exaggeration)
const {
991 exaggeration * 0.1, 0, width);
995 exaggeration * 0.1, 0, width * -1);
1005 glTranslated(0, exaggeration * 0.5, 0);
1009 glTranslated(0, 1, 0.1);
1015 glTranslated(0, 1.4, 0);
1021 glTranslated(-2.1, -2.4, 0);
1022 glRotated(-90, 0, 0, 1);
1038 const double width,
const double exaggeration)
const {
1052 glTranslated(-1.4, exaggeration * 0.5, 0.1);
1053 glRotated(-90, 0, 0, 1);
1069 if (value.empty()) {
1077 if (value.empty()) {
1085 if (value.empty()) {
1104 if ((value ==
"person") || (value ==
"true")) {
1110 }
else if (value ==
"container") {
1117 }
else if (value ==
"join") {
1142 if (
join.size() > 0) {
1150 if (value.empty()) {
1154 permitted = parse<std::set<std::string> >(value);
1177 if (parse<bool>(value)) {
1186 if ((value ==
"-1") || value.empty()) {
1196 speed = parse<double>(value);
1225 if (value.empty()) {
1229 posLat = parse<double>(value);
1235 if (
split.size() > 0) {
1312 glTranslated(0, 0, 0.1);
1345 for (
const auto& edgeStop : edgeStopIndex) {
1346 for (
const auto& stop : edgeStop.stops) {
1348 return edgeStop.stopIndex;
@ GLO_VEHICLELABELS
stack and flow labels (used in netedit)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const int STOP_DURATION_SET
const int STOP_POSLAT_SET
const int STOP_EXPECTED_SET
const int STOP_PARKING_SET
const int STOP_TRIP_ID_SET
const int STOP_PERMITTED_SET
const int STOP_CONTAINER_TRIGGER_SET
const int STOP_EXTENSION_SET
const int STOP_TRIGGER_SET
const int STOP_ONDEMAND_SET
const int STOP_EXPECTED_CONTAINERS_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_WAYPOINT_PARKINGAREA
@ GNE_TAG_STOP_PARKINGAREA
stop placed over a parking area
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_STOP
stop for vehicles
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_CONTAINER_STOP
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_CHARGING_STATION
@ GNE_ATTR_STOPINDEX
stop index (position in the parent's children
@ GNE_ATTR_PLAN_GEOMETRY_ENDPOS
person/container geometry end position
@ GNE_ATTR_PATHSTOPINDEX
stop index (position in the parent's path)
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
bool isInitialised() const
check if Boundary is Initialised
Boundary & grow(double by)
extends the boundary by the given amount
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
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.
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
static void pushMatrix()
push matrix
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, const int align=0, double width=-1)
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
bool drawMovingGeometryPoints() const
check if draw moving geometry points
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::string getID() const override
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
Position getCommonAttributePosition(SumoXMLAttr key) const
friend class GNEChange_ToggleAttribute
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset, const GNESegment *segment, const GUIGlObject *boundaryParent, const bool addToSelectedObjects=true) const
calculate contour extruded (used in elements formed by a central shape)
bool drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
GUIGeometry myDemandElementGeometry
demand element geometry (also called "stacked geometry")
void replaceFirstParentAdditional(SumoXMLTag tag, const std::string &value)
replace the first parent additional
void setDemandElementID(const std::string &newID)
set demand element id
std::vector< EdgeStopIndex > getEdgeStopIndex() const
get edgeStopIndex
Problem
enum class for demandElement problems
void replaceFirstParentLane(const std::string &value)
replace the first parent lane
GNEDemandElement * getCurrentDemandElement() const
get current demand element
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const PositionVector & getLaneShape() const
get elements shape
double myMovingLateralOffset
move element lateral offset
std::string getMovingAttribute(SumoXMLAttr key) const override
get moving attribute
void fixMovingProblem()
fix moving problem
double getMovingAttributeDouble(SumoXMLAttr key) const override
get moving attribute double
std::string getMovingProblem() const
return a string with the current moving problem
bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const override
check if the given moving attribute is valid
bool isMoveElementValid() const
check if current moving element is valid to be written into XML
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewParent * getViewParent() const
get view parent (used for simplify code)
GNEViewNet * getViewNet() const
get view net (used for simplify code)
GNEDemandElementSelector * getStopParentSelector() const
get stop parent selector
int getPathStopIndex() const
get pathStopIndex
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this stop
void setStopMicrosimID()
set stop microsim ID
SUMOVehicleClass getVClass() const override
obtain VClass related with this demand element
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList) override
GNEStop(SumoXMLTag tag, GNENet *net)
default constructor
bool drawIndex() const
draw index
GNEMoveElementLaneDouble * myMoveElementLaneDouble
move element lane double
GNEContour myStopContour
variable used for draw contours
Position getPositionInView() const override
Returns position of demand element in view.
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
void writeDemandElement(OutputDevice &device) const override
write demand element element into a xml file
GNELane * getFirstPathLane() const override
get first path lane
Boundary myMovingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
void drawStopOverStoppingPlace(const GUIVisualizationSettings::Detail d, const RGBColor &color, const double width, const double exaggeration) const
draw stop over stoppingPlace
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void computePathElement() override
compute pathElement
void drawStopOverLane(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const RGBColor &color, const double width, const double exaggeration) const
draw stop over lane
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
Problem isDemandElementValid() const override
check if current demand element is valid to be written into XML (by default true, can be reimplemente...
double getAttributeDouble(SumoXMLAttr key) const override
Parameterised * getParameters() override
get parameters associated with this stop
void drawStopLabel(const GUIVisualizationSettings &s) const
std::string getDemandElementProblem() const override
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
void toggleAttribute(SumoXMLAttr key, const bool value) override
method for enable or disable the attribute and nothing else (used in GNEChange_ToggleAttribute)
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList) override
bool isValid(SumoXMLAttr key, const std::string &value) override
void updateGeometry() override
update pre-computed geometry information
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
const int myCreationIndex
creation index (using for saving sorted)
Position getAttributePosition(SumoXMLAttr key) const override
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
void drawGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const RGBColor &baseColor) const
draw geometry points
bool canDrawVehicleStop() const
check if vehicle stop can be draw
void fixDemandElementProblem() override
fix demand element problem (by default throw an exception, has to be reimplemented in children)
GNELane * getLastPathLane() const override
get last path lane
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
bool isAttributeEnabled(SumoXMLAttr key) const override
std::string getParentName() const override
Returns the name of the parent object.
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
const RGBColor & getColor() const override
get color
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isVehicleWaypoint() const
return true if tag correspond to a vehicle waypoint element
const std::vector< const GNEAttributeProperties * > & getAttributeProperties() const
get all attribute properties
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...
bool isACInspected(GNEAttributeCarrier *AC) const
GNEAttributeCarrier * getFirstAC() const
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings addSize
bool checkDrawAdditional(Detail d, const bool selected) const
check if draw additionals
bool showParkingInfo
Set whether parking related information should be shown.
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings vehicleText
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
double angle
The current view rotation angle.
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.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
double length2D() const
Returns the length.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Position positionAtOffset2D(double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
Returns the position at the given length.
static const RGBColor GREY
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition of vehicle stop (position and duration)
SUMOTime started
the time at which this stop was reached
ParkingType parking
whether the vehicle is removed from the net while stopping
std::string lane
The lane to stop at.
SUMOTime extension
The maximum time extension for boarding / loading.
double speed
the speed at which this stop counts as reached (waypoint mode)
std::string parkingarea
(Optional) parking area if one is assigned to the stop
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
double startPos
The stopping position start.
std::string line
the new line id of the trip within a cyclical public transport route
double posLat
the lateral offset when stopping
bool onDemand
whether the stop may be skipped
std::string chargingStation
(Optional) charging station if one is assigned to the stop
std::string overheadWireSegment
(Optional) overhead line segment if one is assigned to the stop
std::set< std::string > permitted
IDs of persons or containers that may board/load at this stop.
int parametersSet
Information for the output which parameter were set.
SUMOTime jump
transfer time if there shall be a jump from this stop to the next route edge
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
SUMOTime until
The time at which the vehicle may continue its journey.
std::string actType
act Type (only used by Persons) (used by netedit)
bool triggered
whether an arriving person lets the vehicle continue
void write(OutputDevice &dev, const bool close=true, const bool writeTagAndParents=true) const
Writes the stop as XML.
SUMOTime ended
the time at which this stop was ended
double endPos
The stopping position end.
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
std::string busstop
(Optional) bus stop if one is assigned to the stop
bool joinTriggered
whether an joined vehicle lets this vehicle continue
std::string tripId
id of the trip within a cyclical public transport route
std::string containerstop
(Optional) container stop if one is assigned to the stop
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime arrival
The (expected) time at which the vehicle reaches the stop.
SUMOTime duration
The stopping duration.
Structure representing possible vehicle parameter.
static ParkingType parseParkingType(const std::string &value)
parses parking type value
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
Definition of vehicle stop (position and duration)
bool showAllTrips() const
check if trips has to be drawn
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
RGBColor waypointColor
color for Waypoints
RGBColor stopColor
color for Stops
static const double segmentWidth
width of dotted contour segments
static const double additionalGeometryPointRadius
moving additional geometry point radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values