/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2012-2026 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 Shape.h14/// @author Jakob Erdmann15/// @author Michael Behrisch16/// @date Oct 201217///18// A 2D- or 3D-Shape19/****************************************************************************/20#pragma once21#include <config.h>2223#include <string>24#include <map>25#include <utils/common/Named.h>26#include <utils/common/RGBColor.h>27#include <utils/common/Parameterised.h>282930// ===========================================================================31// class definitions32// ===========================================================================33/**34* @class Shape35* @brief A 2D- or 3D-Shape36*/37class Shape : public Named {38public:39/// @name default shape's values40/// @{41static const std::string DEFAULT_TYPE;42static const double DEFAULT_LAYER;43static const double DEFAULT_LINEWIDTH;44static const double DEFAULT_LAYER_POI;45static const double DEFAULT_ANGLE;46static const std::string DEFAULT_IMG_FILE;47static const double DEFAULT_IMG_WIDTH;48static const double DEFAULT_IMG_HEIGHT;49static const std::string DEFAULT_NAME;50static const Parameterised::Map DEFAULT_PARAMETERS;51/// @}5253/** @brief default consructor54* @param[in] id The name of the shape55*/56Shape(const std::string& id);5758/** @brief Constructor59* @param[in] id The name of the shape60* @param[in] type The (abstract) type of the shape61* @param[in] color The color of the shape62* @param[in] layer The layer of the shape63* @param[in] angle The rotation of the shape in navigational degrees64* @param[in] imgFile The raster image of the shape65* @param[in] name shape name66*/67Shape(const std::string& id, const std::string& type, const RGBColor& color, double layer,68double angle, const std::string& imgFile, const std::string& name);6970/// @brief Destructor71virtual ~Shape();7273/**@brief write shape attributes in a xml file74* @param[in] device device in which write parameters of shape75*/76void writeShapeAttributes(OutputDevice& device, const RGBColor& defaultColor, const double defaultLayer) const;7778/// @name Getter79/// @{8081/** @brief Returns the (abstract) type of the Shape82* @return The Shape's (abstract) type83*/84const std::string& getShapeType() const;8586/** @brief Returns the color of the Shape87* @return The Shape's color88*/89const RGBColor& getShapeColor() const;9091/** @brief Returns the layer of the Shape92* @return The Shape's layer93*/94double getShapeLayer() const;9596/** @brief Returns the angle of the Shape in navigational degrees97* @return The Shape's rotation angle98*/99double getShapeNaviDegree() const;100101/** @brief Returns the imgFile of the Shape102* @return The Shape's rotation imgFile103*/104const std::string& getShapeImgFile() const;105106/// @brief Returns the name of the Shape107const std::string& getShapeName() const;108109/// @}110111/// @name Setter112/// @{113114/** @brief Sets a new type115* @param[in] type The new type to use116*/117void setShapeType(const std::string& type);118119/** @brief Sets a new color120* @param[in] col The new color to use121*/122void setShapeColor(const RGBColor& col);123124/** @brief Sets a new alpha value125* @param[in] alpha The new value to use126*/127void setShapeAlpha(unsigned char alpha);128129/** @brief Sets a new layer130* @param[in] layer The new layer to use131*/132void setShapeLayer(const double layer);133134/** @brief Sets a new angle in navigational degrees135* @param[in] layer The new angle to use136*/137virtual void setShapeNaviDegree(const double angle);138139/** @brief Sets a new imgFile140* @param[in] imgFile The new imgFile to use141*/142void setShapeImgFile(const std::string& imgFile);143144/// @brief Sets a new shape name145void setShapeName(const std::string& name);146147/// @}148149private:150/// @brief The type of the Shape151std::string myType;152153/// @brief The color of the Shape154RGBColor myColor;155156/// @brief The layer of the Shape157double myLayer;158159/// @brief The angle of the Shape160double myNaviDegreeAngle;161162/// @brief The img file (include path)163std::string myImgFile;164165/// @brief shape name166std::string myName;167};168169170