in IsometricPatternMatcher/IsometricPattern.cpp [160:214]
bool IsometricGridDot::ParseXmlParamsString(
const std::string& s, std::string& binaryPattern, size_t& numberLayer,
Eigen::Vector2i& gridRowsCols, double& horizontalSpacing,
double& verticalSpacing, double& dotRadius) {
if (!ParseOption(s, "-vertical-spacing ", verticalSpacing)) {
LOG(ERROR) << "Xml comment in svg pattern file does not contain "
"-vertical-spacing field.";
return false;
}
if (!ParseOption(s, "-horizontal-spacing ", horizontalSpacing)) {
LOG(ERROR) << "Xml comment in svg pattern file does not contain "
"-horizontal-spacing field.";
return false;
}
if (!ParseOption(s, "-layer-number ", numberLayer)) {
LOG(ERROR) << "Xml comment in svg pattern file does not contain "
"-layer-number field.";
return false;
}
if (!ParseOption(s, "-rows ", gridRowsCols[0])) {
LOG(ERROR)
<< "Xml comment in svg pattern file does not contain -rows field.";
return false;
}
if (!ParseOption(s, "-cols ", gridRowsCols[1])) {
LOG(ERROR)
<< "Xml comment in svg pattern file does not contain -cols field.";
return false;
}
if (!ParseOption(s, "-grid-dotRadius ", dotRadius)) {
LOG(ERROR) << "Xml comment in svg pattern file does not contain "
"-grid-dotRadius field.";
return false;
}
if (!ParseOption(s, "-grid-pattern ", binaryPattern)) {
LOG(ERROR) << "Xml comment in svg pattern file does not contain "
"-grid-pattern field.";
return false;
}
if (std::ceil((numberLayer * 2 + 1) * (numberLayer * 2 + 1)) !=
binaryPattern.length()) {
LOG(ERROR)
<< "Pattern string length does not agree with the specified grid size.";
return false;
}
return true;
}