41 if (segments.size() > 0) {
43 myPreviousSegment = segments.back();
44 myPreviousSegment->myNextSegment = this;
46 myToContour = myPreviousSegment->myToContour;
47 myPreviousSegment->myToContour = nullptr;
49 if (myPreviousSegment->myPreviousSegment && myPreviousSegment->myPreviousSegment->myLane) {
50 myLaneIndex = myPreviousSegment->myPreviousSegment->myLaneIndex + 1;
52 myLaneIndex = myPreviousSegment->myLaneIndex + 1;
60 segments.push_back(
this);
62 myPathManager->addSegmentInLaneSegments(
this, lane);
78 if (segments.size() > 0) {
80 myPreviousSegment = segments.back();
81 myPreviousSegment->myNextSegment = this;
83 myToContour = myPreviousSegment->myToContour;
84 myPreviousSegment->myToContour = nullptr;
86 if (myPreviousSegment->myPreviousSegment && myPreviousSegment->myPreviousSegment->myJunction) {
87 myJunctionIndex = myPreviousSegment->myPreviousSegment->myJunctionIndex + 1;
89 myJunctionIndex = myPreviousSegment->myJunctionIndex + 1;
97 segments.push_back(
this);
99 myPathManager->addSegmentInJunctionSegments(
this, junction);
107 myPathManager->clearSegmentFromJunctionAndLaneSegments(
this);
const GNELane * getLane() const
get lane associated with this segment
void markSegmentLabel()
mark segment as middle segment
GNEContour * myContour
contour associated with segment
const GNEJunction * getJunction() const
get junction associated with this segment
GNESegment * getPreviousSegment() const
get previous segment
GNESegment * myNextSegment
pointer to next segment
bool myLabelSegment
flag for check if this segment is a label segment
const GNELane * getNextLane() const
get next lane
GNEContour * myToContour
to contour, used for moving elements (only in the last segment)
const GNELane * getPreviousLane() const
get previous lane
GNEContour * myFromContour
from contour, used for moving elements (only in the first segment)
int myJunctionIndex
junction index
GNESegment * myPreviousSegment
pointer to previous segment
GNESegment * getNextSegment() const
functions related with the other paht segments
GNEContour * getFromContour() const
get from contour associated with segment (only if this is the first path segment)
const GNEJunction * myJunction
junction associated with this segment
int getJunctionIndex() const
get lane index
GNEPathElement * getPathElement() const
bool isFirstSegment() const
check if segment is the first path's segment
const GNELane * myLane
lane associated with this segment
GNESegment()
default constructor
GNEContour * getContour() const
int myLaneIndex
lane index
int getLaneIndex() const
get lane index
GNEPathManager * myPathManager
pointer to path manager
bool isLastSegment() const
check if segment is the last path's segment
GNEPathElement * myPathElement
path element associated with this segment
bool isLabelSegment() const
check if segment is label segment
GNEContour * getToContour() const
get to contour associated with segment (only if this is the last path segment)