31 std::vector<std::string> ids;
79 throw TraCIException(
"Could not remove polygon '" + polygonID +
"'");
static TraCIColor getColor(const std::string &polygonID)
static const std::string DEFAULT_IMG_FILE
static void add(const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &c, bool fill, const std::string &type, int layer)
const Polygons & getPolygons() const
Returns all polygons.
bool getFill() const
Returns whether the polygon is filled.
static std::string getParameter(const std::string &polygonID, const std::string ¶mName)
static TraCIColor makeTraCIColor(const RGBColor &color)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static void remove(const std::string &polygonID, int layer=0)
Storage for geometrical objects.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
static void setParameter(std::string &name, std::string &value, std::string &string)
static void setColor(const std::string &polygonID, const TraCIColor &c)
static bool getFilled(const std::string &polygonID)
static std::string getType(const std::string &polygonID)
static void setFilled(std::string polygonID, bool filled)
static std::vector< std::string > getIDList()
static PositionVector makePositionVector(const TraCIPositionVector &vector)
virtual bool removePolygon(const std::string &id)
Removes a polygon from the container.
ShapeContainer & getShapeContainer()
Returns the shapes container.
virtual bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, const PositionVector &shape, bool fill, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape)
Assigns a shape to the named polygon.
const std::string & getType() const
Returns the (abstract) type of the Shape.
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
void setType(const std::string &type)
Sets a new type.
const RGBColor & getColor() const
Returns the color of the Shape.
static TraCIPositionVector makeTraCIPositionVector(const PositionVector &positionVector)
helper functions
static TraCIPositionVector getShape(const std::string &polygonID)
static void setType(const std::string &polygonID, const std::string &setType)
static RGBColor makeRGBColor(const TraCIColor &color)
static void setShape(const std::string &polygonID, const TraCIPositionVector &shape)
void setFill(bool fill)
Sets whether the polygon shall be filled.
void setColor(const RGBColor &col)
Sets a new color.
static SUMO::Polygon * getPolygon(const std::string &id)
static const double DEFAULT_ANGLE