40 const char* objectid,
bool& ok,
bool allowEmpty,
bool report) {
43 emitError(report,
"Shape", objecttype, objectid,
"the shape is empty");
52 if (pos.size() != 2 && pos.size() != 3) {
53 emitError(report,
"Shape", objecttype, objectid,
"the position is neither x,y nor x,y,z");
60 if (pos.size() == 2) {
67 emitError(report,
"Shape", objecttype, objectid,
"not numeric position entry");
71 emitError(report,
"Shape", objecttype, objectid,
"empty position entry");
82 const char* objectid,
bool& ok,
bool report) {
85 emitError(report,
"Bounding box", objecttype, objectid,
"mismatching entry number");
94 return Boundary(xmin, ymin, xmax, ymax);
96 emitError(report,
"Shape", objecttype, objectid,
"not numeric entry");
98 emitError(report,
"Shape", objecttype, objectid,
"empty entry");
107 const char* objectid,
const std::string& desc) {
111 std::ostringstream oss;
112 oss << what <<
" of ";
113 if (objectid ==
nullptr) {
117 if (objectid !=
nullptr) {
118 oss <<
" '" << objectid <<
"'";
120 oss <<
" is broken: " << desc <<
".";
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.
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 occurred errors.
A class that stores a 2D geometrical boundary.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
A point in 2D or 3D with translation and scaling methods.
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 occurred errors.