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

Revision 2580, 1.2 KB checked in by mattausch, 17 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
14/*void LogReader::Read(ViewCellHistoryContainer &history)
15{
16        int numViewCells, numSamples;
17   
18        // open file
19        std::ifstream src(mFilename.c_str());
20
21        if (src.is_open())
22        {
23                src >> numViewCells;
24                src >> numSamples;
25
26                while (!src.eof())
27                {
28                        ViewCellInfoContainer *infos = new ViewCellInfoContainer();
29
30                        for (size_t i = 0; i << numViewCells; ++ i)
31                        {
32                                ViewCellInfo info;
33                                src >> info.mPiercingRays;     
34                                infos->push_back(info);
35                        }
36
37                        history[numSamples] = infos;
38                }
39
40                src.close();
41        }
42}*/
43
44
45void LogReader::Read(const int numSamples, ViewCellInfoContainer &infos)
46{
47         char filename[64];
48         //sprintf(filename, "%s %06d", mFilename.c_str(), numSamples);
49       
50         // open file
51         std::ifstream src(mFilename.c_str());
52
53         if (src.is_open())
54         {
55                 while (!src.eof())
56                 {
57                         ViewCellInfo info;
58                         src >> info.mPiercingRays;     
59
60                         infos.push_back(info);
61                 }
62
63                 // HACK pop last frame, was doubled while reading
64                 //framelist.pop_back();
65
66                 src.close();
67         }
68}
69
70}
Note: See TracBrowser for help on using the repository browser.