![]() |
SUMO - Simulation of Urban MObility
|
#include <GeomConvHelper.h>
Static Public Member Functions | |
static Boundary | parseBoundaryReporting (const std::string &def, const std::string &objecttype, const char *objectid, bool &ok, bool report=true) |
Builds a boundary from its string representation, reporting occured errors. More... | |
static PositionVector | parseShapeReporting (const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true) |
Builds a PositionVector from a string representation, reporting occured errors. More... | |
Static Private Member Functions | |
static void | emitError (bool report, const std::string &what, const std::string &objecttype, const char *objectid, const std::string &desc) |
Writes an error message into the MessageHandler. More... | |
This class holds some helping functions for the parsing of geometries
Definition at line 46 of file GeomConvHelper.h.
|
staticprivate |
Writes an error message into the MessageHandler.
[in] | report | Whether errors shall be written to msg handler's error instance |
[in] | what | Name of the parsed object ("Shape", or "Boundary") |
[in] | objecttype | The name of the parsed object type the error occured at |
[in] | objectid | The name of the parsed object type the error occured at |
[out] | desc | Error description |
Definition at line 112 of file GeomConvHelper.cpp.
References WRITE_ERROR.
Referenced by parseBoundaryReporting(), and parseShapeReporting().
|
static |
Builds a boundary from its string representation, reporting occured errors.
It is assumed that the boundary is stored as a quadruple of double, divided by ','.
[in] | def | The boundary definition to parse |
[in] | objecttype | The name of the parsed object type; used for error message generation |
[in] | objectid | The name of the parsed object; used for error message generation |
[out] | ok | Whether the value could be read |
[in] | report | Whether errors shall be written to msg handler's error instance |
Definition at line 87 of file GeomConvHelper.cpp.
References TplConvert::_2double(), emitError(), StringTokenizer::next(), and StringTokenizer::size().
Referenced by main().
|
static |
Builds a PositionVector from a string representation, reporting occured errors.
It is assumed, the vector is stored as "x,y[ x,y]*" where x and y are doubles.
[in] | shpdef | The shape definition to parse |
[in] | objecttype | The name of the parsed object type; used for error message generation |
[in] | objectid | The name of the parsed object; used for error message generation |
[out] | ok | Whether the value could be read |
[in] | allowEmpty | Whether an empty shape definition is valid |
[in] | report | Whether errors shall be written to msg handler's error instance |
Definition at line 45 of file GeomConvHelper.cpp.
References TplConvert::_2double(), emitError(), StringTokenizer::hasNext(), and StringTokenizer::next().
Referenced by GNEPolygonFrame::addPOI(), GNEPolygonFrame::addPolygon(), GNEAdditionalHandler::buildAdditional(), GNECrossing::isValid(), GNEConnection::isValid(), GNEVariableSpeedSign::isValid(), GNERerouter::isValid(), GNEPOI::isValid(), GNEPoly::isValid(), GNELane::isValid(), GNEJunction::isValid(), GNEEdge::isValid(), GNECrossing::setAttribute(), GNEVariableSpeedSign::setAttribute(), GNEPOI::setAttribute(), GNERerouter::setAttribute(), GNEConnection::setAttribute(), GNEPoly::setAttribute(), GNELane::setAttribute(), GNEJunction::setAttribute(), and GNEEdge::setAttribute().