38 const char* objectid,
bool& ok,
bool allowEmpty,
bool report) {
41 emitError(report,
"Shape", objecttype, objectid,
"the shape is empty");
50 if (pos.
size() != 2 && pos.
size() != 3) {
51 emitError(report,
"Shape", objecttype, objectid,
"the position is neither x,y nor x,y,z");
58 if (pos.
size() == 2) {
65 emitError(report,
"Shape", objecttype, objectid,
"not numeric position entry");
69 emitError(report,
"Shape", objecttype, objectid,
"empty position entry");
80 const char* objectid,
bool& ok,
bool report,
bool offsets) {
83 emitError(report,
"Bounding box", objecttype, objectid,
"mismatching entry number");
97 return Boundary(xmin, ymin, xmax, ymax);
100 emitError(report,
"Shape", objecttype, objectid,
"not numeric entry");
102 emitError(report,
"Shape", objecttype, objectid,
"empty entry");
111 const char* objectid,
const std::string& desc) {
115 std::ostringstream oss;
116 oss << what <<
" of ";
117 if (objectid ==
nullptr) {
121 if (objectid !=
nullptr) {
122 oss <<
" '" << objectid <<
"'";
124 oss <<
" is broken: " << desc <<
".";
A class that stores a 2D geometrical boundary.
void setOffsets(double xmin, double ymin, double xmax, double ymax)
Sets the boundary to the given values, ignoring min < max constraints.
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, bool offsets=false)
Builds a boundary from its string representation, reporting occurred errors.
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.
A point in 2D or 3D with translation and scaling methods.
int size() const
returns the number of existing substrings
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter