Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNESegment.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// GNESegment used in Path Manager
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23// ===========================================================================
24// class declaration
25// ===========================================================================
26
27class GNELane;
28class GNEJunction;
29class GNEPathElement;
30class GNEPathManager;
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
37
38public:
40 GNESegment(GNEPathManager* pathManager, GNEPathElement* element, const GNELane* lane, std::vector<GNESegment*>& segments);
41
43 GNESegment(GNEPathManager* pathManager, GNEPathElement* element, const GNEJunction* junction, std::vector<GNESegment*>& segments);
44
47
51 GNEContour* getContour() const;
52
55
57 GNEContour* getToContour() const;
58
60
65
68
70 bool isFirstSegment() const;
71
73 bool isLastSegment() const;
74
76
81
83 const GNELane* getLane() const;
84
86 const GNELane* getPreviousLane() const;
87
89 const GNELane* getNextLane() const;
90
92 int getLaneIndex() const;
93
95 const GNEJunction* getJunction() const;
96
98 int getJunctionIndex() const;
99
101
104
106 bool isLabelSegment() const;
107
109 void markSegmentLabel();
110
112
113protected:
116
119
122
125
127 int myLaneIndex = 0;
128
131
134
137
140
143
146
149
150private:
152 GNESegment();
153
155 GNESegment(const GNESegment&) = delete;
156
158 GNESegment& operator=(const GNESegment&) = delete;
159};
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const GNELane * getLane() const
get lane associated with this segment
GNESegment(const GNESegment &)=delete
Invalidated copy constructor.
void markSegmentLabel()
mark segment as middle segment
GNEContour * myContour
contour associated with segment
Definition GNESegment.h:142
const GNEJunction * getJunction() const
get junction associated with this segment
GNESegment * getPreviousSegment() const
get previous segment
GNESegment * myNextSegment
pointer to next segment
Definition GNESegment.h:133
GNESegment & operator=(const GNESegment &)=delete
Invalidated assignment operator.
bool myLabelSegment
flag for check if this segment is a label segment
Definition GNESegment.h:139
const GNELane * getNextLane() const
get next lane
GNEContour * myToContour
to contour, used for moving elements (only in the last segment)
Definition GNESegment.h:148
const GNELane * getPreviousLane() const
get previous lane
GNEContour * myFromContour
from contour, used for moving elements (only in the first segment)
Definition GNESegment.h:145
int myJunctionIndex
junction index
Definition GNESegment.h:130
GNESegment * myPreviousSegment
pointer to previous segment
Definition GNESegment.h:136
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
Definition GNESegment.h:124
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
Definition GNESegment.h:121
GNESegment()
default constructor
GNEContour * getContour() const
int myLaneIndex
lane index
Definition GNESegment.h:127
int getLaneIndex() const
get lane index
GNEPathManager * myPathManager
pointer to path manager
Definition GNESegment.h:115
bool isLastSegment() const
check if segment is the last path's segment
GNEPathElement * myPathElement
path element associated with this segment
Definition GNESegment.h:118
bool isLabelSegment() const
check if segment is label segment
~GNESegment()
destructor
GNEContour * getToContour() const
get to contour associated with segment (only if this is the last path segment)