44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
71 std::vector<std::string> ids;
101 for (
unsigned int iPoint = 0; iPoint < MIN2(static_cast<size_t>(255), p->
getShape().size()); ++iPoint) {
123 std::string warning =
"";
127 && variable !=
ADD && variable !=
REMOVE) {
134 if (variable !=
ADD && variable !=
REMOVE) {
192 bool fill = value != 0;
249 for (std::map<std::string, Polygon*>::const_iterator i = polygons.begin(); i != polygons.end(); ++i) {
250 Boundary b = (*i).second->getShape().getBoxBoundary();
253 t->
Insert(cmin, cmax, (*i).second);
void Insert(const float a_min[2], const float a_max[2], Named *a_data)
Insert entry.
static const std::string DEFAULT_IMG_FILE
static Polygon * getPolygon(const std::string &id)
Returns the named polygon.
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)
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)
const IDMap & getMyMap() const
void push_back(const PositionVector &p)
Appends all positions from the given vector.
#define CMD_SET_POLYGON_VARIABLE
virtual void writeString(const std::string &s)
void setType(const std::string &type)
Sets a new type.
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)
Builds a polygon using the given values and adds it to the container.
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.
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)