Added FileVersion attribute to XML format to distinguish legacy float binary files from new double binary files

This commit is contained in:
jrheinlaender
2013-03-27 11:47:18 +04:30
parent 4dcc5eb6cb
commit fdc3e50811
39 changed files with 119 additions and 78 deletions

View File

@@ -134,19 +134,22 @@ void PointKernel::Restore(Base::XMLReader &reader)
}
}
void PointKernel::RestoreDocFile(Base::Reader &reader)
void PointKernel::RestoreDocFile(Base::Reader &reader, const int FileVersion)
{
Base::InputStream str(reader);
uint32_t uCt = 0;
str >> uCt;
_Points.resize(uCt);
for (unsigned long i=0; i < uCt; i++) {
// if doubleFileVersion
// double x, y, z
// else
float x, y, z;
str >> x >> y >> z;
_Points[i].Set(x,y,z);
if (FileVersion > 0) {
double x, y, z;
str >> x >> y >> z;
_Points[i].Set(x,y,z);
} else {
float x, y, z;
str >> x >> y >> z;
_Points[i].Set(x,y,z);
}
}
}