Rev | Line | |
---|
[2578] | 1 | #include "LogReader.h"
|
---|
| 2 | #include "ViewCellsManager.h"
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | namespace GtpVisibilityPreprocessor {
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | void LogReader::SetFilename(const std::string &filename)
|
---|
| 9 | {
|
---|
| 10 | mFilename = filename;
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 |
|
---|
[2584] | 14 | void LogReader::Read(int &numSamples, ViewCellInfoContainer &infos)
|
---|
[2578] | 15 | {
|
---|
[2584] | 16 | //char filename[64];
|
---|
[2580] | 17 | //sprintf(filename, "%s %06d", mFilename.c_str(), numSamples);
|
---|
[2578] | 18 | // open file
|
---|
[2580] | 19 | std::ifstream src(mFilename.c_str());
|
---|
[2578] | 20 |
|
---|
| 21 | if (src.is_open())
|
---|
| 22 | {
|
---|
[2584] | 23 | src >> numSamples;
|
---|
| 24 |
|
---|
| 25 | while (1)
|
---|
[2578] | 26 | {
|
---|
| 27 | ViewCellInfo info;
|
---|
[2584] | 28 | src >> info.mPiercingRays; src >> info.mPvsSize;
|
---|
| 29 |
|
---|
| 30 | if (src.eof()) break;
|
---|
| 31 |
|
---|
[2578] | 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 | }
|
---|
[2580] | 40 | }
|
---|
[2578] | 41 |
|
---|
| 42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.