#include "LogReader.h" #include "ViewCellsManager.h" namespace GtpVisibilityPreprocessor { void LogReader::SetFilename(const std::string &filename) { mFilename = filename; } /*void LogReader::Read(ViewCellHistoryContainer &history) { int numViewCells, numSamples; // open file std::ifstream src(mFilename.c_str()); if (src.is_open()) { src >> numViewCells; src >> numSamples; while (!src.eof()) { ViewCellInfoContainer *infos = new ViewCellInfoContainer(); for (size_t i = 0; i << numViewCells; ++ i) { ViewCellInfo info; src >> info.mPiercingRays; infos->push_back(info); } history[numSamples] = infos; } src.close(); } }*/ void LogReader::Read(const int numSamples, ViewCellInfoContainer &infos) { char filename[64]; //sprintf(filename, "%s %06d", mFilename.c_str(), numSamples); // open file std::ifstream src(mFilename.c_str()); if (src.is_open()) { while (!src.eof()) { ViewCellInfo info; src >> info.mPiercingRays; infos.push_back(info); } // HACK pop last frame, was doubled while reading //framelist.pop_back(); src.close(); } } }