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-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// Class used for path elements (routes, trips, flows...)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
33 enum Options {
34 NETWORK_ELEMENT = 1 << 0, // Network element
35 ADDITIONAL_ELEMENT = 1 << 1, // Additional element
36 DEMAND_ELEMENT = 1 << 2, // Demand element
37 DATA_ELEMENT = 1 << 3, // Data element
38 ROUTE = 1 << 4, // Route (needed for overlapping labels)
39 };
40
42 GNEPathElement(GUIGlObjectType type, const std::string& microsimID, FXIcon* icon, const int options);
43
45 virtual ~GNEPathElement();
46
48 bool isNetworkElement() const;
49
51 bool isAdditionalElement() const;
52
54 bool isDemandElement() const;
55
57 bool isDataElement() const;
58
60 bool isRoute() const;
61
63 virtual void computePathElement() = 0;
64
66 virtual bool isPathElementSelected() const = 0;
67
73 virtual void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const = 0;
74
80 virtual void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const = 0;
81
83 virtual GNELane* getFirstPathLane() const = 0;
84
86 virtual GNELane* getLastPathLane() const = 0;
87
88private:
90 const int myOption;
91
93 GNEPathElement() = delete;
94
97
100};
GUIGlObjectType
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
GNEPathElement & operator=(const GNEPathElement &)=delete
Invalidated assignment operator.
virtual GNELane * getLastPathLane() const =0
get last path lane
virtual ~GNEPathElement()
destructor
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.
const int myOption
pathElement option
bool isDemandElement() const
check if pathElement is a demand element
virtual void computePathElement()=0
compute pathElement
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.