33 delete myPTStop.second;
39 std::string
id = ptStop->
getID();
60 std::vector<NBPTStop*> reverseStops;
69 if (!platformsDefined) {
72 if (reverseStop != 0) {
73 reverseStops.push_back(reverseStop);
75 }
else if (multipleStopPositions) {
82 if (additionalStop != 0) {
83 reverseStops.push_back(additionalStop);
89 for (
auto& reverseStop : reverseStops) {
95 for (
auto i = myPTStops.begin(); i != myPTStops.end();) {
98 WRITE_WARNING(
"Could not find corresponding edge or compatible lane for pt stop: " + i->second->getName()
99 +
". Thus, it will be removed!");
102 myPTStops.erase(i++);
115 if (reverse !=
nullptr) {
131 bool rightOfEdge =
false;
132 bool leftOfEdge =
false;
149 if (leftOfEdge && rightOfEdge) {
153 }
else if (leftOfEdge) {
155 if (reverse !=
nullptr) {
194 if (offset2 < offset) {
201 if (idx1 < 0 || idx1 >= (
int)geom.size() || idx2 < 0 || idx2 >= (int)geom.size()) {
212 double x2 = closestPlatform->
x();
213 double y2 = closestPlatform->
y();
214 double crossProd = (x1 - x0) * (y2 - y0) - (y1 - y0) * (x2 - x0);
229 if (sqrDist < minSqrDist) {
230 minSqrDist = sqrDist;
242 if (edge !=
nullptr) {
246 for (
const auto& it : edge->
getLanes()) {
255 const std::string& lane = edge->
getLaneID(laneNr);
271 if (edge !=
nullptr) {
284 if (cont.
getByID((*i).second->getEdgeId()) ==
nullptr) {
285 WRITE_WARNING(
"Removing pt stop:" + (*i).first +
" on non existing edge: " + (*i).second->getEdgeId());
const std::string getName()
void reviseStops(NBEdgeCont &cont)
revise pt stops and remove stops on non existing (removed) edges
PTStopsCont myPTStops
The map of names to pt stops.
void assignPTStopToEdgeOfClosestPlatform(NBPTStop *pStop, NBEdgeCont &cont)
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
const std::string getEdgeId()
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
double x() const
Returns the x-position.
NBPTPlatform * getClosestPlatformToPTStopPosition(NBPTStop *pStop)
The representation of a single edge during network building.
NBPTStop * assignAndCreatNewPTStopAsNeeded(NBPTStop *pStop, NBEdgeCont &cont)
The representation of a single pt stop.
static bool findLaneAndComputeBusStopExtend(NBPTStop *pStop, NBEdgeCont &cont)
#define WRITE_WARNING(msg)
NBEdge * getByID(const std::string &edgeID) const
Returns the edge with id if it exists.
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
const std::string & getID() const
Returns the id.
SVCPermissions getPermissions()
std::string getID() const
A point in 2D or 3D with translation and scaling methods.
int indexOfClosest(const Position &p) const
index of the closest position to p
void computExtent(double center, double d)
double y() const
Returns the y-position.
Storage for edges, including some functionality operating on multiple edges.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions) ...
bool getIsMultipleStopPositions()
void process(NBEdgeCont &cont)
void setLaneID(const std::string &laneId)
NBNode * getToNode() const
Returns the destination node of the edge.
double getLength() const
Returns the computed length of the edge.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const PositionVector & getGeometry() const
Returns the geometry of the edge.
std::vector< NBPTPlatform > & getPlatformCands()
NBPTStop * get(std::string id)
Retrieve a previously inserted pt stop.
NBPTStop * getReverseStop(NBPTStop *pStop, NBEdgeCont &cont)
const Position & getPosition()
void setEdgeId(std::string edgeId)
std::string getLaneID(int lane) const
get Lane ID (Secure)
double offsetAtIndex2D(int index) const
return the offset at the given index
bool insert(NBPTStop *ptStop)
Inserts a node into the map.
EdgeVector getGeneratedFrom(const std::string &id) const
Returns the edges which have been built by splitting the edge of the given id.
static NBEdge * getReverseEdge(NBEdge *edge)
void setMyPTStopLength(double myPTStopLength)
double computeCrossProductEdgePosition(const NBEdge *edge, const Position *closestPlatform) const
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
NBNode * getFromNode() const
Returns the origin node of the edge.