39 {}, {}, {}, {stoppingPlace}, {}, {}, {personParent}, {}),
46 {}, {edge}, {}, {}, {}, {}, {personParent}, {}),
79 double endPosCopy =
endPos;
81 if (startPosCopy < 0) {
82 startPosCopy += laneLength;
85 endPosCopy += laneLength;
91 return (endPosCopy <=
getParentEdges().front()->getNBEdge()->getFinalLength());
93 return (startPosCopy >= 0);
95 return ((startPosCopy >= 0) && (endPosCopy <=
getParentEdges().front()->getNBEdge()->getFinalLength()) && ((endPosCopy - startPosCopy) >= POSITION_EPS));
105 double endPosCopy =
endPos;
107 double laneLength =
getParentEdges().front()->getNBEdge()->getFinalLength();
109 if (startPosCopy < 0) {
110 startPosCopy += laneLength;
112 if (endPosCopy < 0) {
113 endPosCopy += laneLength;
116 std::string errorStart, separator, errorEnd;
118 if (startPosCopy < 0) {
120 }
else if (startPosCopy >
getParentEdges().front()->getNBEdge()->getFinalLength()) {
123 if (endPosCopy < 0) {
125 }
else if (endPosCopy >
getParentEdges().front()->getNBEdge()->getFinalLength()) {
129 if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
132 return errorStart + separator + errorEnd;
185 newPosition.
add(offset);
197 endPos = stoppingPlaceLength;
199 startPos = laneLengt - stoppingPlaceLength;
251 if (previousDemandElement) {
255 if (nextDemandElement) {
283 return getParentLanes().front()->getLaneShape().positionAtOffset(end);
285 return getParentLanes().front()->getLaneShape().positionAtOffset(start);
287 return getParentLanes().front()->getLaneShape().positionAtOffset((start + end) / 2.0);
323 return Boundary(-0.1, -0.1, 0.1, 0.1);
337 bool drawPersonPlan =
false;
341 drawPersonPlan =
true;
344 drawPersonPlan =
true;
346 drawPersonPlan =
true;
348 drawPersonPlan =
true;
351 drawPersonPlan =
true;
354 if (drawPersonPlan) {
399 glTranslated(0, 1, 0);
408 glTranslated(0, 1.4, 0);
621 if (canParse<SUMOTime>(value)) {
622 return parse<SUMOTime>(value) >= 0;
627 if ((value ==
"fit") || (value ==
"end")) {
629 }
else if (canParse<int>(value)) {
630 return (parse<int>(value) >= 0);
635 return canParse<bool>(value);
637 return canParse<bool>(value);
643 std::vector<std::string> IDs = parse<std::vector<std::string>>(value);
644 for (
const auto& i : IDs) {
652 return canParse<bool>(value);
676 }
else if (canParse<double>(value)) {
684 }
else if (canParse<double>(value)) {
690 return canParse<bool>(value);
693 return canParse<bool>(value);
840 return "person stop: lane";
845 const std::map<std::string, std::string>&
861 const double len =
getParentEdges().front()->getNBEdge()->getFinalLength();
865 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
875 fixedPos =
getParentEdges().front()->getNBEdge()->getFinalLength();
877 const double len =
getParentEdges().front()->getNBEdge()->getFinalLength();
881 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
916 if (value ==
"fit") {
918 }
else if (value ==
"end") {
921 index = parse<int>(value);
998 endPos = parse<double>(value);
1008 if (parse<bool>(value)) {
@ GLO_PERSONSTOP
a person stop
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const int STOP_DURATION_SET
const int STOP_EXPECTED_SET
const int STOP_PARKING_SET
const int STOP_TRIP_ID_SET
const int STOP_CONTAINER_TRIGGER_SET
const int STOP_EXTENSION_SET
const int STOP_TRIGGER_SET
const double MIN_STOP_LENGTH
const int STOP_EXPECTED_CONTAINERS_SET
@ GNE_TAG_PERSONSTOP_BUSSTOP
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PARKING_AREA
A parking area.
@ GNE_TAG_PERSONSTOP_EDGE
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_CONTAINER_TRIGGERED
@ SUMO_ATTR_CONTAINER_STOP
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CHARGING_STATION
@ SUMO_ATTR_EXPECTED_CONTAINERS
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
bool isInitialised() const
check if Boundary is Initialised
void reset()
Resets the boundary.
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 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 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)
An Element which don't belongs to GNENet but has influency in the simulation.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_EnableAttribute
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
const std::string & getDefaultValue() const
get default value
An Element which don't belongs to GNENet but has influency in the simulation.
virtual void updateGeometry()=0
update pre-computed geometry information
void replaceDemandParentLanes(const std::string &value)
replace demand parent lanes
GNEGeometry::Geometry myDemandElementGeometry
demand element geometry (also called "stacked geometry")
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
A road/street connecting two junctions (netedit-version)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
A NBNetBuilder extended by visualisation and editing capabilities.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEViewNet * getViewNet() const
get view net
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
GNEPersonStop(GNENet *net, GNEDemandElement *personParent, GNEAdditional *stoppingPlace, const SUMOVehicleParameter::Stop &stopParameter)
constructor used for stops over busStops
void invalidatePath()
invalidate path
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
DemandElementMove myStopMove
variable demand element move
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
const RGBColor & getColor() const
get color
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
std::string getBegin() const
get begin time of demand element
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
bool isAttributeEnabled(SumoXMLAttr key) const
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
void startGeometryMoving()
~GNEPersonStop()
destructor
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
void endGeometryMoving()
end movement
double getAttributeDouble(SumoXMLAttr key) const
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const double offsetFront) const
Draws partial object.
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
SUMOVehicleClass getVClass() const
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
std::string getParentName() const
Returns the name of the parent object.
Position getPositionInView() const
Returns position of demand element in view.
void updateGeometry()
update pre-computed geometry information
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void computePath()
compute path
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
bool isPersonStop() const
return true if tag correspond to a person stop element
const GNEAttributeProperties & getAttributeProperties(SumoXMLAttr attr) const
get attribute (throw error if doesn't exist)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
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...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
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.
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationDetailSettings detailSettings
detail settings
GUIVisualizationSizeSettings addSize
bool drawDottedContour() const
check if dotted contour can be drawn
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single 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...
Static storage of an output device and its base (abstract) implementation.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
void add(const Position &pos)
Adds the given position to this one.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
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
Definition of vehicle stop (position and duration)
void write(OutputDevice &dev, bool close=true) const
Writes the stop as XML.
SUMOTime extension
The maximum time extension for boarding / loading.
bool friendlyPos
enable or disable friendly position (used by NETEDIT)
double startPos
The stopping position start.
int parametersSet
Information for the output which parameter were set.
int index
at which position in the stops list
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
double endPos
The stopping position end.
bool parking
whether the vehicle is removed from the net while stopping
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 tripId
id of the trip within a cyclical public transport route
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime duration
The stopping duration.
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
Position originalViewPosition
value for saving first original position over lane before moving
std::string secondOriginalPosition
value for saving second original position over lane before moving
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
bool showDemandElements() const
check if show demand elements checkbox is enabled
bool showAllPersonPlans() const
check all person plans has to be show
const GNEDemandElement * getLockedPerson() const
get locked person
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
bool showDemandElements() const
check if show demand elements checkbox is enabled
static const RGBColor personStops
color for personStops
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
static const RGBColor stops
color for Stops
static const double stopsText
details for stop texts
static const double stopsDetails
details for stops
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values