/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2012-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 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 Constructor54* @param[in] id The name of the shape55* @param[in] type The (abstract) type of the shape56* @param[in] color The color of the shape57* @param[in] layer The layer of the shape58* @param[in] angle The rotation of the shape in navigational degrees59* @param[in] imgFile The raster image of the shape60* @param[in] name shape name61*/62Shape(const std::string& id, const std::string& type, const RGBColor& color, double layer,63double angle, const std::string& imgFile, const std::string& name);6465/// @brief Destructor66virtual ~Shape();6768/// @name Getter69/// @{7071/** @brief Returns the (abstract) type of the Shape72* @return The Shape's (abstract) type73*/74inline const std::string& getShapeType() const {75return myType;76}7778/** @brief Returns the color of the Shape79* @return The Shape's color80*/81inline const RGBColor& getShapeColor() const {82return myColor;83}8485/** @brief Returns the layer of the Shape86* @return The Shape's layer87*/88inline double getShapeLayer() const {89return myLayer;90}9192/** @brief Returns the angle of the Shape in navigational degrees93* @return The Shape's rotation angle94*/95inline double getShapeNaviDegree() const {96return myNaviDegreeAngle;97}9899/** @brief Returns the imgFile of the Shape100* @return The Shape's rotation imgFile101*/102inline const std::string& getShapeImgFile() const {103return myImgFile;104}105106/// @brief Returns the name of the Shape107inline const std::string getShapeName() const {108return myName;109}110111/// @}112113114/// @name Setter115/// @{116117/** @brief Sets a new type118* @param[in] type The new type to use119*/120inline void setShapeType(const std::string& type) {121myType = type;122}123124/** @brief Sets a new color125* @param[in] col The new color to use126*/127inline void setShapeColor(const RGBColor& col) {128myColor = col;129}130131/** @brief Sets a new alpha value132* @param[in] alpha The new value to use133*/134inline void setShapeAlpha(unsigned char alpha) {135myColor.setAlpha(alpha);136}137138/** @brief Sets a new layer139* @param[in] layer The new layer to use140*/141inline void setShapeLayer(const double layer) {142myLayer = layer;143}144145/** @brief Sets a new angle in navigational degrees146* @param[in] layer The new angle to use147*/148virtual void setShapeNaviDegree(const double angle) {149myNaviDegreeAngle = angle;150}151152/** @brief Sets a new imgFile153* @param[in] imgFile The new imgFile to use154*/155inline void setShapeImgFile(const std::string& imgFile) {156myImgFile = imgFile;157}158159/// @brief Sets a new shape name160inline void setShapeName(const std::string& name) {161myName = name;162}163164/// @}165166private:167/// @brief The type of the Shape168std::string myType;169170/// @brief The color of the Shape171RGBColor myColor;172173/// @brief The layer of the Shape174double myLayer;175176/// @brief The angle of the Shape177double myNaviDegreeAngle;178179/// @brief The img file (include path)180std::string myImgFile;181182/// @brief shape name183std::string myName;184};185186187