37 std::vector<std::string> ids;
105 throw TraCIException(
"Could not remove polygon '" + polygonID +
"'");
138 Boundary b = i.second->getShape().getBoxBoundary();
139 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
140 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
141 t->
Insert(cmin, cmax, i.second);
static void setColor(const std::string &polygonID, const TraCIColor &c)
void Insert(const float a_min[2], const float a_max[2], Named *const &a_data)
Insert entry.
double ymin() const
Returns minimum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
static const std::string DEFAULT_IMG_FILE
const Polygons & getPolygons() const
Returns all polygons.
T get(const std::string &id) const
Retrieves an item.
A RT-tree for efficient storing of SUMO's Named objects.
static void setFilled(std::string polygonID, bool filled)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const PositionVector & getShape() const
Returns whether the shape of the polygon.
Storage for geometrical objects.
static TraCIPositionVector makeTraCIPositionVector(const PositionVector &positionVector)
helper functions
static PositionVector makePositionVector(const TraCIPositionVector &vector)
void insertIDs(std::vector< std::string > &into) const
A class that stores a 2D geometrical boundary.
static std::string getType(const std::string &polygonID)
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 geo, bool fill, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
virtual bool removePolygon(const std::string &id)
Removes a polygon from the container.
ShapeContainer & getShapeContainer()
Returns the shapes container.
static NamedRTree * getTree()
Returns a tree filled with polygon instances.
static std::string getParameter(const std::string &polygonID, const std::string ¶mName)
static TraCIColor makeTraCIColor(const RGBColor &color)
static void remove(const std::string &polygonID, int layer=0)
static TraCIPositionVector getShape(const std::string &polygonID)
static void setShape(const std::string &polygonID, const TraCIPositionVector &shape)
double xmin() const
Returns minimum x-coordinate.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
bool getFill() const
Returns whether the polygon is filled.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape)
Assigns a shape to the named polygon.
static void setParameter(std::string &name, std::string &value, std::string &string)
const std::string & getType() const
Returns the (abstract) type of the Shape.
static std::vector< std::string > getIDList()
void setType(const std::string &type)
Sets a new type.
const RGBColor & getColor() const
Returns the color of the Shape.
static void add(const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &c, bool fill, const std::string &type, int layer)
static TraCIColor getColor(const std::string &polygonID)
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static bool getFilled(const std::string &polygonID)
static SUMOPolygon * getPolygon(const std::string &id)
static RGBColor makeRGBColor(const TraCIColor &color)
double ymax() const
Returns maximum y-coordinate.
void setColor(const RGBColor &col)
Sets a new color.
void setFill(bool fill)
Sets whether the polygon shall be filled.
static const double DEFAULT_ANGLE
static void setType(const std::string &polygonID, const std::string &setType)