44 #ifdef CHECK_MEMORY_LEAKS 46 #endif // CHECK_MEMORY_LEAKS 71 std::vector<std::string> ids;
101 for (
int iPoint = 0; iPoint <
MIN2(255, (
int)p->
getShape().size()); ++iPoint) {
111 std::string paramName =
"";
132 std::string warning =
"";
143 if (variable !=
ADD && variable !=
REMOVE) {
201 bool fill = value != 0;
274 const std::map<std::string, SUMO::Polygon*>& polygons = shapeCont.
getPolygons().
getMyMap();
275 for (std::map<std::string, SUMO::Polygon*>::const_iterator i = polygons.begin(); i != polygons.end(); ++i) {
276 Boundary b = (*i).second->getShape().getBoxBoundary();
277 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
278 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
279 t->
Insert(cmin, cmax, (*i).second);
void Insert(const float a_min[2], const float a_max[2], Named *const &a_data)
Insert entry.
static const std::string DEFAULT_IMG_FILE
bool readTypeCheckingColor(tcpip::Storage &inputStorage, RGBColor &into)
Reads the value type and a color, verifying the type.
static NamedRTree * getTree()
Returns a tree filled with polygon instances.
SUMOReal ymin() const
Returns minimum y-coordinate.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
SUMOReal xmin() const
Returns minimum x-coordinate.
A RT-tree for efficient storing of SUMO's Named objects.
#define RESPONSE_GET_POLYGON_VARIABLE
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
Storage for geometrical objects.
#define CMD_GET_POLYGON_VARIABLE
bool readTypeCheckingPolygon(tcpip::Storage &inputStorage, PositionVector &into)
Reads the value type and a polygon, verifying the type.
virtual void writeUnsignedByte(int)
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
const Polygons & getPolygons() const
Returns all polygons.
SUMOReal xmax() const
Returns maximum x-coordinate.
A class that stores a 2D geometrical boundary.
virtual void writeInt(int)
virtual int readUnsignedByte()
T get(const std::string &id) const
Retrieves an item.
unsigned char blue() const
Returns the blue-amount of the color.
static const SUMOReal DEFAULT_ANGLE
virtual bool removePolygon(const std::string &id)
Removes a polygon from the container.
ShapeContainer & getShapeContainer()
Returns the shapes container.
void insertIDs(std::vector< std::string > &into) const
unsigned char alpha() const
Returns the alpha-amount of the color.
virtual void writeStringList(const std::vector< std::string > &s)
virtual std::string readString()
bool readTypeCheckingUnsignedByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and an unsigned byte, verifying the type.
TraCI server used to control sumo by a remote TraCI client.
const RGBColor & getColor() const
Returns the color of the Shape.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape)
Assigns a shape to the named polygon.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
virtual bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal 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.
const IDMap & getMyMap() const
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
#define CMD_SET_POLYGON_VARIABLE
virtual void writeString(const std::string &s)
void setType(const std::string &type)
Sets a new type.
std::string toHex(const T i, std::streamsize numDigits=0)
virtual void writeDouble(double)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa8: Get Polygon Variable)
unsigned char green() const
Returns the green-amount of the color.
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
static SUMO::Polygon * getPolygon(const std::string &id)
Returns the named polygon.
SUMOReal ymax() const
Returns maximum y-coordinate.
const std::string & getType() const
Returns the (abstract) type of the Shape.
unsigned char red() const
Returns the red-amount of the color.
void setFill(bool fill)
Sets whether the polygon shall be filled.
bool getFill() const
Returns whether the polygon is filled.
void setColor(const RGBColor &col)
Sets a new color.
static bool getShape(const std::string &id, PositionVector &shape)
Returns the named polygons's shape.
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc8: Change Polygon State)