asmaloney / libE57Format

Library for reading & writing the E57 file format
Boost Software License 1.0
137 stars 66 forks source link

How to iterate points? #312

Open alexeygritsenko opened 1 week ago

alexeygritsenko commented 1 week ago

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