Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPathElement.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-2025 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// Class used for path elements (routes, trips, flows...)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28
29class GNELane;
30class GNESegment;
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
37
38public:
39 enum class Options : int {
40 NETWORK_ELEMENT = 1 << 0, // Network element
41 ADDITIONAL_ELEMENT = 1 << 1, // Additional element
42 DEMAND_ELEMENT = 1 << 2, // Demand element
43 DATA_ELEMENT = 1 << 3, // Data element
44 ROUTE = 1 << 4, // Route (needed for overlapping labels)
45 };
46
49
51 virtual ~GNEPathElement();
52
55
57 bool isNetworkElement() const;
58
60 bool isAdditionalElement() const;
61
63 bool isDemandElement() const;
64
66 bool isDataElement() const;
67
69 bool isRoute() const;
70
73
75 virtual void computePathElement() = 0;
76
78 virtual bool isPathElementSelected() const = 0;
79
85 virtual void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const = 0;
86
92 virtual void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const = 0;
93
95 virtual GNELane* getFirstPathLane() const = 0;
96
98 virtual GNELane* getLastPathLane() const = 0;
99
101
102private:
105
107 GNEPathElement() = delete;
108
111
114};
115
118 return static_cast<GNEPathElement::Options>(static_cast<int>(a) | static_cast<int>(b));
119}
120
123 return (static_cast<int>(a) & static_cast<int>(b)) != 0;
124}
constexpr bool operator&(GNEPathElement::Options a, GNEPathElement::Options b)
override tag parent bit operator
constexpr GNEPathElement::Options operator|(GNEPathElement::Options a, GNEPathElement::Options b)
override tag parent bit operator
const GNEPathElement::Options myOptions
pathElement option
GNEPathElement & operator=(const GNEPathElement &)=delete
Invalidated assignment operator.
virtual GNELane * getLastPathLane() const =0
get last path lane
virtual ~GNEPathElement()
destructor
GNEPathElement::Options getPathElementOptions() const
get path element option
virtual bool isPathElementSelected() const =0
check if path element is selected
GNEPathElement()=delete
invalidate default constructor
virtual void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const =0
Draws partial object over lane.
bool isRoute() const
check if pathElement is a route
bool isNetworkElement() const
check if pathElement is a network element
GNEPathElement(const GNEPathElement &)=delete
Invalidated copy constructor.
virtual void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const =0
Draws partial object over junction.
bool isDemandElement() const
check if pathElement is a demand element
virtual void computePathElement()=0
implement in children+
bool isAdditionalElement() const
check if pathElement is an additional element
virtual GNELane * getFirstPathLane() const =0
get first path lane
bool isDataElement() const
check if pathElement is a data element
Stores the information about how to visualize structures.