source: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/LogReader.cpp @ 2584

Revision 2584, 753 bytes checked in by mattausch, 16 years ago (diff)
Line 
1#include "LogReader.h"
2#include "ViewCellsManager.h"
3
4
5namespace GtpVisibilityPreprocessor {
6
7
8void LogReader::SetFilename(const std::string &filename)
9{
10        mFilename = filename;
11}
12
13
14void LogReader::Read(int &numSamples, ViewCellInfoContainer &infos)
15{
16         //char filename[64];
17         //sprintf(filename, "%s %06d", mFilename.c_str(), numSamples);
18         // open file
19         std::ifstream src(mFilename.c_str());
20
21         if (src.is_open())
22         {
23                 src >> numSamples;
24
25                 while (1)
26                 {
27                         ViewCellInfo info;
28                         src >> info.mPiercingRays;     src >> info.mPvsSize;
29                         
30                         if (src.eof()) break;
31                         
32                         infos.push_back(info);
33                 }
34
35                 // HACK pop last frame, was doubled while reading
36                 //framelist.pop_back();
37
38                 src.close();
39         }
40}
41
42}
Note: See TracBrowser for help on using the repository browser.