60 "Get Polygon Variable: unsupported variable " +
toHex(variable, 2) +
" specified", outputStorage);
99 for (
int iPoint = 0; iPoint < (int)tp.size(); ++iPoint) {
111 std::string paramName =
"";
132 std::string warning =
"";
138 "Change Polygon State: unsupported variable " +
toHex(variable, 2) +
" specified", outputStorage);
195 bool fill = value != 0;
267 const std::map<std::string, SUMO::Polygon*>& polygons = shapeCont.
getPolygons().getMyMap();
268 for (std::map<std::string, SUMO::Polygon*>::const_iterator i = polygons.begin(); i != polygons.end(); ++i) {
269 Boundary b = (*i).second->getShape().getBoxBoundary();
270 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
271 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
272 t->
Insert(cmin, cmax, (*i).second);
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.
bool readTypeCheckingColor(tcpip::Storage &inputStorage, TraCIColor &into)
Reads the value type and a color, verifying the type.
static TraCIColor getColor(const std::string &polygonID)
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.
static std::string getParameter(const std::string &polygonID, const std::string ¶mName)
static NamedRTree * getTree()
Returns a tree filled with polygon instances.
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.
static void remove(const std::string &polygonID, int layer=0)
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 PositionVector & getShape() const
Returns whether the shape of the polygon.
A class that stores a 2D geometrical boundary.
static void setParameter(std::string &name, std::string &value, std::string &string)
virtual void writeInt(int)
static void setColor(const std::string &polygonID, const TraCIColor &c)
virtual int readUnsignedByte()
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()
ShapeContainer & getShapeContainer()
Returns the shapes container.
virtual void writeStringList(const std::vector< std::string > &s)
double xmin() const
Returns minimum x-coordinate.
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.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
#define CMD_SET_POLYGON_VARIABLE
virtual void writeString(const std::string &s)
std::string toHex(const T i, std::streamsize numDigits=0)
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)
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)
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.
static void setShape(const std::string &polygonID, const TraCIPositionVector &shape)
double ymax() const
Returns maximum y-coordinate.
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)