46 {}, {}, {}, {stoppingPlace}, {stopParent}, {}, {}, {}, {}, {}),
56 {}, {
lane}, {}, {}, {stopParent}, {}, {}, {}, {}, {}),
87 double laneLength =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength() *
getLaneParents().front()->getLengthGeometryFactor();
90 double endPosCopy =
endPos;
92 if (startPosCopy < 0) {
93 startPosCopy += laneLength;
96 endPosCopy += laneLength;
102 return (endPosCopy <=
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength());
104 return (startPosCopy >= 0);
106 return ((startPosCopy >= 0) && (endPosCopy <=
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength()) && ((endPosCopy - startPosCopy) >=
POSITION_EPS));
116 double endPosCopy =
endPos;
118 double laneLength =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
120 if (startPosCopy < 0) {
121 startPosCopy += laneLength;
123 if (endPosCopy < 0) {
124 endPosCopy += laneLength;
127 std::string errorStart, separator, errorEnd;
129 if (startPosCopy < 0) {
131 }
else if (startPosCopy >
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength()) {
134 if (endPosCopy < 0) {
136 }
else if (endPosCopy >
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength()) {
140 if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
143 return errorStart + separator + errorEnd;
226 newPosition.
add(offset);
234 double laneLengt =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength() *
getLaneParents().front()->getLengthGeometryFactor();
238 endPos = stoppingPlaceLength;
240 startPos = laneLengt - stoppingPlaceLength;
313 return getLaneParents().front()->getGeometry().shape.positionAtOffset(end);
315 return getLaneParents().front()->getGeometry().shape.positionAtOffset(start);
317 return getLaneParents().front()->getGeometry().shape.positionAtOffset((start + end) / 2.0);
353 return Boundary(-0.1, -0.1, 0.1, 0.1);
361 bool drawPersonPlan =
false;
364 drawPersonPlan =
true;
367 drawPersonPlan =
true;
369 drawPersonPlan =
true;
371 drawPersonPlan =
true;
374 drawPersonPlan =
true;
377 if (drawPersonPlan) {
428 glTranslated(0, 1, 0);
432 glTranslated(0, 1.4, 0);
602 return getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
657 if (canParse<SUMOTime>(value)) {
658 return parse<SUMOTime>(value) >= 0;
663 if ((value ==
"fit") || (value ==
"end")) {
665 }
else if (canParse<int>(value)) {
666 return (parse<int>(value) >= 0);
671 return canParse<bool>(value);
673 return canParse<bool>(value);
679 std::vector<std::string> IDs = parse<std::vector<std::string>>(value);
680 for (
const auto &i : IDs) {
688 return canParse<bool>(value);
690 return (value ==
"waiting");
712 }
else if (canParse<double>(value)) {
720 }
else if (canParse<double>(value)) {
726 return canParse<bool>(value);
729 return canParse<bool>(value);
779 std::string stopType;
782 stopType =
"person stop";
784 stopType =
"vehicle stop";
789 return stopType +
": lane";
798 const double len =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
802 return fixedPos *
getLaneParents().front()->getLengthGeometryFactor();
813 const double len =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
817 return fixedPos *
getLaneParents().front()->getLengthGeometryFactor();
829 result += i.first +
"=" + i.second +
"|";
832 if (!result.empty()) {
839 std::vector<std::pair<std::string, std::string> >
841 std::vector<std::pair<std::string, std::string> > result;
844 result.push_back(std::make_pair(i.first, i.second));
855 std::vector<std::string> parsedValues;
858 parsedValues.push_back(stValues.
next());
861 for (
auto i : parsedValues) {
862 std::vector<std::string> parsedParameters;
865 parsedParameters.push_back(stParam.
next());
869 setParameter(parsedParameters.front(), parsedParameters.back());
891 if (value ==
"fit") {
893 }
else if (value ==
"end") {
896 index = parse<int>(value);
975 endPos = parse<double>(value);
984 if (parse<bool>(value)) {
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const int STOP_CONTAINER_TRIGGER_SET
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
void calculateShapeRotationsAndLengths()
calculate shape rotations and lengths
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool isPersonStop() const
return true if tag correspond to a person stop element
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
DemandElementGeometry myDemandElementGeometry
demand element geometry
void clearGeometry()
reset geometry
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.
std::string lane
The lane to stop at.
double scale
information about a lane's width (temporary, used for a single view)
static const RGBColor personStops
color for personStops
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
void addedLockedObject(const GUIGlObjectType type)
set object selected
void endGeometryMoving()
end movement
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
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.
GUIVisualizationTextSettings addName
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool isStop() const
return true if tag correspond to a stop element
void add(const Position &pos)
Adds the given position to this one.
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
const GNEDemandElement * getLockedPerson() const
get locked person
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
bool isPersonPlan() const
return true if tag correspond to a person plan
Stores the information about how to visualize structures.
DemandElementMove myStopMove
variable demand element move
void changeAdditionalParent(GNEShape *shapeTobeChanged, const std::string &newAdditionalParentID, int additionalParentIndex)
change additional parent of a shape
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
GNEViewParent * getViewParent() const
get the net object
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
std::string secondOriginalPosition
value for saving second original position over lane before moving
static bool checkStoppinPlacePosition(const std::string &startPosStr, const std::string &endPosStr, const double laneLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid (without modifications) ...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
Position originalViewPosition
value for saving first original position over lane before moving
std::string time2string(SUMOTime t)
stop placed over a lane (used in netedit)
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)
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
int parametersSet
Information for the output which parameter were set.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
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 updateGeometry()
update pre-computed geometry information
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void changeDemandElementID(const std::string &newID)
change ID of demand element
bool hasNext()
returns the information whether further substrings exist
static const double stopsDetails
details for stops
PositionVector shape
The shape of the additional element.
virtual std::string getAttribute(SumoXMLAttr key) const =0
double getAttributeDouble(SumoXMLAttr key) const
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
A class that stores a 2D geometrical boundary.
bool triggered
whether an arriving person lets the vehicle continue
bool isAttributeEnabled(SumoXMLAttr key) const
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
friend class GNEChange_EnableAttribute
std::string tripId
id of the trip within a cyclical public transport route
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
bool myFriendlyPosition
Flag for friendly position.
std::string getBegin() const
get begin time of demand element
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GNEEdge * getToEdge() const
obtain to edge of this demand element
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GUIVisualizationSizeSettings addSize
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
std::string getAttribute(SumoXMLAttr key) const
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
std::vector< double > shapeLengths
The lengths of the single shape parts.
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
void startGeometryMoving()
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeLockedObject(const GUIGlObjectType type)
set object unselected
friend class GNEChange_Attribute
declare friend class
SUMOTime until
The time at which the vehicle may continue its journey.
bool isValidDemandElementID(const std::string &newID) const
check if a new demand element ID is valid
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
SUMOTime string2time(const std::string &r)
const int STOP_TRIP_ID_SET
const std::string & getDemandElementID() const
returns DemandElement ID
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes ...
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
const int STOP_EXPECTED_SET
Boundary & grow(double by)
extends the boundary by the given amount
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
const RGBColor & getColor() const
get color
void write(OutputDevice &dev) const
Writes the stop as XML.
double endPos
The stopping position end.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
static const RGBColor stops
color for Stops
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
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition of vehicle stop (position and duration)
void compute()
compute demand element
int index
at which position in the stops list
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
A road/street connecting two junctions (netedit-version)
GUIVisualizationDetailSettings detailSettings
detail settings
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
const int STOP_PARKING_SET
GNEStop(SumoXMLTag tag, GNEViewNet *viewNet, const SUMOVehicleParameter::Stop &stopParameter, GNEAdditional *stoppingPlace, GNEDemandElement *stopParent)
constructor used for stops over stoppingPlaces
void reset()
Resets the boundary.
double startPos
The stopping position start.
void changeLaneParents(GNEShape *elementChild, const std::string &newLaneIDs)
change edge parents of a shape
bool showDemandElements() const
check if show demand elements checkbox is enabled
const int STOP_TRIGGER_SET
void deselect(GUIGlID id)
Deselects the object with the given id.
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
GNEEdge * getFromEdge() const
const int STOP_EXPECTED_CONTAINERS_SET
bool containerTriggered
whether an arriving container lets the vehicle continue
An Element which don't belongs to GNENet but has influency in the simulation.
static const double stopsText
details for stop texts
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
bool isInitialised() const
check if Boundary is Initialised
Position getPositionInView() const
Returns position of demand element in view.
GNENet * getNet() const
get the net object
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
std::string getParentName() const
Returns the name of the parent object.
Static storage of an output device and its base (abstract) implementation.
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) ...
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
GUIVisualizationColorSettings colorSettings
color settings
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
parent of an additional element
bool showAllPersonPlans() const
check all person plans has to be show
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
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) ...
std::vector< double > shapeRotations
The rotations of the single shape parts.
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
GUISelectedStorage gSelected
A global holder of selected objects.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
std::string getGenericParametersStr() const
return generic parameters in string format
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
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
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
bool parking
whether the vehicle is removed from the net while stopping
An Element which don't belongs to GNENet but has influency in the simulation.
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
void clearParameter()
Clears the parameter map.