asmaloney/libE57Format

How to iterate points?

Opened this issue · 0 comments

Hi, thanks for developing such a useful library.
I need to loop through the points and extract them later into another custom format, the simplest is console output, something like this:

e57::Reader* reader = nullptr;
e57::E57Root fileHeader;
e57::Data3D data3DHeader;

reader = new e57::Reader("C:\\temp\\input.e57", {});
reader->GetE57Root(fileHeader);
reader->ReadData3D(0, data3DHeader);

std::cout << "pointCount = " << data3DHeader.pointCount << '\n';

e57::Data3DPointsFloat pointsData(data3DHeader);

for (size_t i = 0; i < data3DHeader.pointCount; i++)
{
    std::cout << "X = " << pointsData[i].X << "Y = " << pointsData[i].Y << "Z = " << pointsData[i].Z
        << "R = " << pointsData[i].R << "G = " << pointsData[i].G << "B = " << pointsData[i].B << '\n';
}

but it doesn't work. help, i'm not a c++ programmer