/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2005-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 PointOfInterest.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @author Melanie Knocke18/// @date 2005-09-1519///20// A point-of-interest (2D)21/****************************************************************************/22#pragma once23#include <config.h>2425#include <utils/common/FileHelpers.h>26#include <utils/common/Parameterised.h>27#include <utils/common/StringBijection.h>28#include <utils/common/StringUtils.h>29#include <utils/geom/GeoConvHelper.h>30#include <utils/geom/Position.h>31#include <utils/iodevices/OutputDevice.h>3233#include "Shape.h"3435// ===========================================================================36// class definitions37// ===========================================================================38/**39* @class PointOfInterest40* @brief A point-of-interest41*/42class PointOfInterest : public Shape, public Position, public Parameterised {4344public:45/** @brief Constructor46* @param[in] id The name of the POI47* @param[in] type The (abstract) type of the POI48* @param[in] color The color of the POI49* @param[in] pos The position of the POI50* @param[in[ geo use GEO coordinates (lon/lat)51* @param[in] lane The Lane in which this POI is placed52* @param[in] friendlyPos friendly position53* @param[in] posOverLane The position over Lane54* @param[in] posLat The position lateral over Lane55* @param[in] icon The icon of the POI56* @param[in] layer The layer of the POI57* @param[in] angle The rotation of the POI58* @param[in] imgFile The raster image of the shape59* @param[in] width The width of the POI image60* @param[in] height The height of the POI image61* @param[in] name POI name62* @param[in] parameters generic parameters63*/64PointOfInterest(const std::string& id, const std::string& type,65const RGBColor& color, const Position& pos, bool geo,66const std::string& lane, double posOverLane,67bool friendlyPos, double posLat,68const std::string& icon,69double layer = DEFAULT_LAYER,70double angle = DEFAULT_ANGLE,71const std::string& imgFile = DEFAULT_IMG_FILE,72double width = DEFAULT_IMG_WIDTH,73double height = DEFAULT_IMG_HEIGHT,74const std::string& name = DEFAULT_NAME,75const Parameterised::Map& parameters = DEFAULT_PARAMETERS);7677/// @brief Destructor78~PointOfInterest();7980/// @name Getter81/// @{8283/// @brief get icon84POIIcon getIcon() const;8586/// @brief get icon(in string format)87const std::string& getIconStr() const;8889/// @brief Returns the image width of the POI90double getWidth() const;9192/// @brief Returns the image height of the POI93double getHeight() const;9495/// @brief Returns the image center of the POI96Position getCenter() const;9798/// @brief returns friendly position99bool getFriendlyPos() const;100101/// @}102103104/// @name Setter105/// @{106107/// @brief set icon108void setIcon(const std::string& icon);109110/// @brief set the image width of the POI111void setWidth(double width);112113/// @brief set the image height of the POI114void setHeight(double height);115116/// @brief set friendly position117void setFriendlyPos(const bool friendlyPos);118119/// @}120121/* @brief POI definition to the given device122* @param[in] geo Whether to write the output in geo-coordinates123*/124void writeXML(OutputDevice& out, const bool geo = false, const double zOffset = 0., const std::string laneID = "", const double pos = 0., const bool friendlyPos = false, const double posLat = 0.) const;125126protected:127/// @brief flag to check if POI was loaded as GEO Position (main used by netedit)128bool myGeo;129130/// @brief ID of lane in which this POI is placed (main used by netedit)131std::string myLane;132133/// @brief position over lane in which this POI is placed (main used by netedit)134double myPosOverLane;135136/// @brief friendlyPos enable or disable friendly position for position over lane137bool myFriendlyPos;138139/// @brief lateral position over lane in which this POI is placed (main used by netedit)140double myPosLat;141142/// @brief POI icon143POIIcon myIcon;144145/// @brief The half width of the image when rendering this POI146double myHalfImgWidth;147148/// @brief The half height of the image when rendering this POI149double myHalfImgHeight;150};151152153