/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNEPathElement.h14/// @author Pablo Alvarez Lopez15/// @date Nov 202416///17// Class used for path elements (routes, trips, flows...)18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/gui/settings/GUIVisualizationSettings.h>2324// ===========================================================================25// class declaration26// ===========================================================================2728class GNELane;29class GNESegment;3031// ===========================================================================32// class definitions33// ===========================================================================3435class GNEPathElement {3637public:38enum class Options : int {39NETWORK_ELEMENT = 1 << 0, // Network element40ADDITIONAL_ELEMENT = 1 << 1, // Additional element41DEMAND_ELEMENT = 1 << 2, // Demand element42DATA_ELEMENT = 1 << 3, // Data element43ROUTE = 1 << 4, // Route (needed for overlapping labels)44};4546/// @brief constructor47GNEPathElement(const GNEPathElement::Options options);4849/// @brief destructor50virtual ~GNEPathElement();5152/// @brief get path element option53GNEPathElement::Options getPathElementOptions() const;5455/// @brief check if pathElement is a network element56bool isNetworkElement() const;5758/// @brief check if pathElement is an additional element59bool isAdditionalElement() const;6061/// @brief check if pathElement is a demand element62bool isDemandElement() const;6364/// @brief check if pathElement is a data element65bool isDataElement() const;6667/// @brief check if pathElement is a route68bool isRoute() const;6970/// @brief implement in children+71/// @{7273/// @brief compute pathElement74virtual void computePathElement() = 0;7576/// @brief check if path element is selected77virtual bool isPathElementSelected() const = 0;7879/**@brief Draws partial object over lane80* @param[in] s The settings for the current view (may influence drawing)81* @param[in] segment lane segment82* @param[in] offsetFront front offset83*/84virtual void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const = 0;8586/**@brief Draws partial object over junction87* @param[in] s The settings for the current view (may influence drawing)88* @param[in] segment junction segment89* @param[in] offsetFront front offset90*/91virtual void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const = 0;9293/// @brief get first path lane94virtual GNELane* getFirstPathLane() const = 0;9596/// @brief get last path lane97virtual GNELane* getLastPathLane() const = 0;9899/// @}100101private:102/// @brief pathElement option103const GNEPathElement::Options myOptions = GNEPathElement::Options::NETWORK_ELEMENT;104105/// @brief invalidate default constructor106GNEPathElement() = delete;107108/// @brief Invalidated copy constructor.109GNEPathElement(const GNEPathElement&) = delete;110111/// @brief Invalidated assignment operator.112GNEPathElement& operator=(const GNEPathElement&) = delete;113};114115/// @brief override tag parent bit operator116constexpr GNEPathElement::Options operator|(GNEPathElement::Options a, GNEPathElement::Options b) {117return static_cast<GNEPathElement::Options>(static_cast<int>(a) | static_cast<int>(b));118}119120/// @brief override tag parent bit operator121constexpr bool operator&(GNEPathElement::Options a, GNEPathElement::Options b) {122return (static_cast<int>(a) & static_cast<int>(b)) != 0;123}124125126