/****************************************************************************/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 GUIOverheadWire.h14/// @author Jakub Sevcik (RICE)15/// @author Jan Prikryl (RICE)16/// @date 2019-12-1517///18// The gui-version of a MSOverheadWire19/****************************************************************************/20#pragma once21#include <config.h>2223#include <vector>24#include <string>25#include <utils/common/Command.h>26#include <utils/common/VectorHelper.h>27#include <utils/geom/PositionVector.h>28#include <microsim/trigger/MSOverheadWire.h>29#include <guisim/GUIBusStop.h>30#include <utils/gui/globjects/GUIGlObject.h>31#include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>32#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>33#include <utils/geom/Position.h>34#include <gui/GUIManipulator.h>353637// ===========================================================================38// class declarations39// ===========================================================================40class MSNet;41class MSLane;42class GUIManipulator;43class GUIOverheadWire;44class GUIOverheadWireClamp;454647// ===========================================================================48// class definitions49// ===========================================================================50/**51* @class GUIOverheadWire52* @brief GUI for the overhead wire system.53*54* This gui-version of the overhead wire network extends MSOverheadWire by methods for displaying55* and interaction. It also adds a visual representation of an overhead wire clamp.56*57* @see MSOverheadWire58* @see GUIGlObject_AbstractAdd59* @see GUIGlObject60*/61class GUIOverheadWire : public MSOverheadWire, public GUIGlObject_AbstractAdd {62public:63/** @brief Constructor64* @param[in] id The id of the overhead wire segment65* @param[in] lane The lane the overhead wire segment is placed on66* @param[in] frompos Begin position of the overhead wire segment on the lane67* @param[in] topos End position of the overhead wire segment on the lane68* @param[in] voltageSource If the segment is the place of the connection of a traction substation69*/70GUIOverheadWire(const std::string& id, MSLane& lane, double frompos, double topos,71bool voltageSource);7273/// @brief Destructor74~GUIOverheadWire();7576/// @name inherited from GUIGlObject77//@{7879/** @brief Returns an own popup-menu80*81* @param[in] app The application needed to build the popup-menu82* @param[in] parent The parent window needed to build the popup-menu83* @return The built popup-menu84* @see GUIGlObject::getPopUpMenu85*/86GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent);8788/** @brief Returns an own parameter window89*90* Overhead wires have parameter windows showing beginning and end position of the overhead wire.91*92* @param[in] app The application needed to build the parameter window93* @param[in] parent The parent window needed to build the parameter window94* @return The built parameter window.95* @see GUIGlObject::getParameterWindow96*/97GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent);9899/// @brief return exaggeration associated with this GLObject100double getExaggeration(const GUIVisualizationSettings& s) const;101102/** @brief Returns the boundary to which the view shall be centered in order to show the object103*104* @return The boundary the object is within105* @see GUIGlObject::getCenteringBoundary106*/107Boundary getCenteringBoundary() const;108109/** @brief Draws the object110* @param[in] s The settings for the current view (may influence drawing)111* @see GUIGlObject::drawGL112*/113void drawGL(const GUIVisualizationSettings& s) const;114//@}115116private:117/// @brief The rotations of the shape parts118std::vector<double> myFGShapeRotations;119120/// @brief The lengths of the shape parts121std::vector<double> myFGShapeLengths;122123/// @brief The shape124PositionVector myFGShape;125126/// @brief The position of the sign127Position myFGSignPos;128129/// @brief The rotation of the sign130double myFGSignRot;131};132133class GUIOverheadWireClamp : public GUIGlObject_AbstractAdd {134public:135/** @brief Constructor136* @param[in] id The id of the overhead wire clamp137* @param[in] lane_start The lane, where is the overhead wire segment placed, to the start of which the overhead wire clamp is connected138* @param[in] lane_end The lane, where is the overhead wire segment placed, to the end of which the overhead wire clamp is connected139* @param[in] topos End position of the overhead wire segment on the lane140*/141GUIOverheadWireClamp(const std::string& id, MSLane& lane_start, MSLane& lane_end);142143/// @brief Destructor144~GUIOverheadWireClamp();145146/// @name inherited from GUIGlObject147//@{148149/** @brief Returns an own popup-menu150*151* @param[in] app The application needed to build the popup-menu152* @param[in] parent The parent window needed to build the popup-menu153* @return The built popup-menu154* @see GUIGlObject::getPopUpMenu155*/156GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent);157158/** @brief Returns an own parameter window159*160* Overhead wire clamps do not display anything in their parameter window yet.161*162* @param[in] app The application needed to build the parameter window163* @param[in] parent The parent window needed to build the parameter window164* @return The built parameter window165* @see GUIGlObject::getParameterWindow166*/167GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent);168169/// @brief return exaggeration associated with this GLObject170double getExaggeration(const GUIVisualizationSettings& s) const;171172/** @brief Returns the boundary to which the view shall be centered in order to show the object173*174* @return The boundary the object is within175* @see GUIGlObject::getCenteringBoundary176*/177Boundary getCenteringBoundary() const;178179/** @brief Draws the object180* @param[in] s The settings for the current view (may influence drawing)181* @see GUIGlObject::drawGL182*/183void drawGL(const GUIVisualizationSettings& s) const;184//@}185186private:187188/// @brief The shape189PositionVector myFGShape;190};191192193