Changing the internal representation of Point / Pointf / Point3 / Pointf3 to Eigen Matrix types, first step

This commit is contained in:
bubnikv 2018-08-14 18:33:26 +02:00
parent 077680b806
commit 86da661097
60 changed files with 1228 additions and 1206 deletions

View file

@ -637,9 +637,9 @@ public:
std::string serialize() const override
{
std::ostringstream ss;
ss << this->value.x;
ss << this->value.x();
ss << ",";
ss << this->value.y;
ss << this->value.y();
return ss.str();
}
@ -647,8 +647,8 @@ public:
{
UNUSED(append);
char dummy;
return sscanf(str.data(), " %lf , %lf %c", &this->value.x, &this->value.y, &dummy) == 2 ||
sscanf(str.data(), " %lf x %lf %c", &this->value.x, &this->value.y, &dummy) == 2;
return sscanf(str.data(), " %lf , %lf %c", &this->value.x(), &this->value.y(), &dummy) == 2 ||
sscanf(str.data(), " %lf x %lf %c", &this->value.x(), &this->value.y(), &dummy) == 2;
}
};
@ -671,9 +671,9 @@ public:
std::ostringstream ss;
for (Pointfs::const_iterator it = this->values.begin(); it != this->values.end(); ++it) {
if (it - this->values.begin() != 0) ss << ",";
ss << it->x;
ss << it->x();
ss << "x";
ss << it->y;
ss << it->y();
}
return ss.str();
}
@ -700,9 +700,9 @@ public:
std::istringstream iss(point_str);
std::string coord_str;
if (std::getline(iss, coord_str, 'x')) {
std::istringstream(coord_str) >> point.x;
std::istringstream(coord_str) >> point.x();
if (std::getline(iss, coord_str, 'x')) {
std::istringstream(coord_str) >> point.y;
std::istringstream(coord_str) >> point.y();
}
}
this->values.push_back(point);