38 {}, {}, {}, {stoppingPlace}, {}, {}, {stopParent}, {}),
45 {}, {}, {lane}, {}, {}, {}, {stopParent}, {}),
75 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() *
getParentLanes().front()->getLengthGeometryFactor();
78 double endPosCopy =
endPos;
80 if (startPosCopy < 0) {
81 startPosCopy += laneLength;
84 endPosCopy += laneLength;
90 return (endPosCopy <=
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
92 return (startPosCopy >= 0);
94 return ((startPosCopy >= 0) && (endPosCopy <=
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPosCopy - startPosCopy) >= POSITION_EPS));
104 double endPosCopy =
endPos;
106 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
108 if (startPosCopy < 0) {
109 startPosCopy += laneLength;
111 if (endPosCopy < 0) {
112 endPosCopy += laneLength;
115 std::string errorStart, separator, errorEnd;
117 if (startPosCopy < 0) {
119 }
else if (startPosCopy >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
122 if (endPosCopy < 0) {
124 }
else if (endPosCopy >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
128 if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
131 return errorStart + separator + errorEnd;
184 newPosition.
add(offset);
192 double laneLengt =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() *
getParentLanes().front()->getLengthGeometryFactor();
196 endPos = stoppingPlaceLength;
198 startPos = laneLengt - stoppingPlaceLength;
275 return getParentLanes().front()->getLaneShape().positionAtOffset(end);
277 return getParentLanes().front()->getLaneShape().positionAtOffset(start);
279 return getParentLanes().front()->getLaneShape().positionAtOffset((start + end) / 2.0);
315 return Boundary(-0.1, -0.1, 0.1, 0.1);
329 bool drawPersonPlan =
false;
333 drawPersonPlan =
true;
336 drawPersonPlan =
true;
338 drawPersonPlan =
true;
340 drawPersonPlan =
true;
343 drawPersonPlan =
true;
346 if (drawPersonPlan) {
389 glTranslated(0, 1, 0);
398 glTranslated(0, 1.4, 0);
548 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
600 if (canParse<SUMOTime>(value)) {
601 return parse<SUMOTime>(value) >= 0;
606 return canParse<bool>(value);
608 return canParse<bool>(value);
614 std::vector<std::string> IDs = parse<std::vector<std::string>>(value);
615 for (
const auto& i : IDs) {
623 return canParse<bool>(value);
647 }
else if (canParse<double>(value)) {
655 }
else if (canParse<double>(value)) {
661 return canParse<bool>(value);
664 return canParse<bool>(value);
811 return "vehicle stop: lane";
816 const std::map<std::string, std::string>&
831 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
835 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
845 fixedPos =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
847 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
851 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
968 endPos = parse<double>(value);
978 if (parse<bool>(value)) {
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
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ 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.
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
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
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.
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
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< 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 RGBColor & getColor() const
get color
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string getBegin() const
get begin time of demand element
SUMOVehicleClass getVClass() const
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Position getPositionInView() const
Returns position of demand element in view.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
bool isAttributeEnabled(SumoXMLAttr key) const
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getParentName() const
Returns the name of the parent object.
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
double getAttributeDouble(SumoXMLAttr key) const
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
void computePath()
compute path
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
void endGeometryMoving()
end movement
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
GNEStop(SumoXMLTag tag, GNENet *net, const SUMOVehicleParameter::Stop &stopParameter, GNEAdditional *stoppingPlace, GNEDemandElement *stopParent)
constructor used for stops over stoppingPlaces
void invalidatePath()
invalidate path
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const double offsetFront) const
Draws partial object.
DemandElementMove myStopMove
variable demand element move
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
void updateGeometry()
update pre-computed geometry information
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
void startGeometryMoving()
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
const GNEAttributeProperties & getAttributeProperties(SumoXMLAttr attr) const
get attribute (throw error if doesn't exist)
bool isStop() const
return true if tag correspond to a stop element
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.
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
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
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