44 const std::string
id = inputStorage.
readString();
47 if (!libsumo::Polygon::handleVariable(
id, variable, &server, &inputStorage)) {
61 std::string warning =
"";
68 "Change Polygon State: unsupported variable " +
toHex(variable, 2) +
" specified", outputStorage);
80 libsumo::Polygon::setType(
id, type);
88 libsumo::Polygon::setColor(
id, col);
101 libsumo::Polygon::setFilled(
id, value != 0);
109 libsumo::Polygon::setLineWidth(
id, value);
116 int itemNo = inputStorage.
readInt();
117 if (itemNo != 5 && itemNo != 6) {
132 bool fill = value != 0;
133 const int layer =
StoHelp::readTypedInt(inputStorage,
"The fourth polygon parameter must be the layer encoded as int.");
138 double lineWidth = 1;
145 libsumo::Polygon::add(
id, tp, col, fill, type, layer, lineWidth);
153 int itemNo = inputStorage.
readInt();
158 std::string trackedID;
163 std::vector<double> timeSpan;
168 std::vector<double> alphaSpan;
183 libsumo::Polygon::addDynamics(
id, trackedID, timeSpan, alphaSpan, looped != 0, rotate != 0);
188 libsumo::Polygon::remove(
id,
StoHelp::readTypedInt(inputStorage,
"The layer must be given using an int."));
205 libsumo::Polygon::setParameter(
id, name, value);
std::string toHex(const T i, std::streamsize numDigits=0)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc8: Change Polygon State)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa8: Get Polygon Variable)
TraCI server used to control sumo by a remote TraCI client.
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
tcpip::Storage & getWrapperStorage()
bool readTypeCheckingUnsignedByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and an unsigned byte, verifying the type.
void initWrapper(const int domainID, const int variable, const std::string &objID)
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
bool readTypeCheckingDoubleList(tcpip::Storage &inputStorage, std::vector< double > &into)
Reads the value type and a double list, verifying the type.
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
bool readTypeCheckingPolygon(tcpip::Storage &inputStorage, PositionVector &into)
Reads the value type and a polygon, verifying the type.
bool readTypeCheckingColor(tcpip::Storage &inputStorage, libsumo::TraCIColor &into)
Reads the value type and a color, verifying the type.
static TraCIPositionVector makeTraCIPositionVector(const PositionVector &positionVector)
helper functions
static int readTypedInt(tcpip::Storage &ret, const std::string &error="")
An error which allows to continue.
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int RESPONSE_GET_POLYGON_VARIABLE
TRACI_CONST int TYPE_COMPOUND
TRACI_CONST int VAR_MOVE_TO
TRACI_CONST int CMD_SET_POLYGON_VARIABLE
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_WIDTH
TRACI_CONST int CMD_SET_VEHICLE_VARIABLE
TRACI_CONST int VAR_SHAPE
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_ADD_DYNAMICS
TRACI_CONST int CMD_GET_POLYGON_VARIABLE