42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
50 using namespace traci;
75 std::vector<std::string> ids;
105 for (
unsigned int iPoint = 0; iPoint < MIN2(static_cast<size_t>(255), p->
getShape().size()); ++iPoint) {
127 std::string warning =
"";
131 && variable !=
ADD && variable !=
REMOVE) {
138 if (variable !=
ADD && variable !=
REMOVE) {
196 bool fill = value != 0;
233 Polygon* poly = getPolygon(
id);
253 for (std::map<std::string, Polygon*>::const_iterator i = polygons.begin(); i != polygons.end(); ++i) {
254 Boundary b = (*i).second->getShape().getBoxBoundary();
static const std::string DEFAULT_IMG_FILE
static Polygon * getPolygon(const std::string &id)
Returns the named polygon.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
static bool processSet(traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc8: Change Polygon State)
#define RESPONSE_GET_POLYGON_VARIABLE
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Storage for geometrical objects.
#define CMD_GET_POLYGON_VARIABLE
virtual void writeUnsignedByte(int)
const Polygons & getPolygons() const
Returns all polygons.
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
TraCI server used to control sumo by a remote TraCI client.
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
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)
void addObject(Named *o, Boundary &b)
Adds an additional object (detector/shape/trigger) for visualisation.
virtual std::string readString()
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.
const IDMap & getMyMap() const
void push_back(const PositionVector &p)
Appends all positions from the given vector.
A RT-tree for efficient storing of SUMO's GL-objects.
#define CMD_SET_POLYGON_VARIABLE
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
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)
unsigned char green() const
Returns the green-amount of the color.
bool readTypeCheckingUnsignedByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and an unsigned byte, verifying the type.
const std::string & getType() const
Returns the (abstract) type of the Shape.
bool readTypeCheckingColor(tcpip::Storage &inputStorage, RGBColor &into)
Reads the value type and a color, verifying the type.
unsigned char red() const
Returns the red-amount of the color.
void setFill(bool fill)
Sets whether the polygon shall be filled.
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
bool getFill() const
Returns whether the polygon is filled.
void setColor(const RGBColor &col)
Sets a new color.
bool readTypeCheckingPolygon(tcpip::Storage &inputStorage, PositionVector &into)
Reads the value type and a polygon, verifying the type.
static TraCIRTree * getTree()
Returns a tree filled with inductive loop instances.
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
static bool getShape(const std::string &id, PositionVector &shape)
Returns the named polygons's shape.
static bool processGet(traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa8: Get Polygon Variable)