Rev | Line | |
---|
[2576] | 1 | #include "LogWriter.h"
|
---|
| 2 | #include "ViewCellsManager.h"
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | namespace GtpVisibilityPreprocessor
|
---|
| 6 | {
|
---|
| 7 |
|
---|
| 8 |
|
---|
[2580] | 9 | LogWriter::LogWriter()
|
---|
| 10 | {
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 |
|
---|
| 14 | LogWriter::LogWriter(const std::string &filename): mFilename(filename)
|
---|
| 15 | {
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 |
|
---|
[2576] | 19 | void LogWriter::SetFilename(const std::string &filename)
|
---|
| 20 | {
|
---|
| 21 | mFilename = filename;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 |
|
---|
[2584] | 25 | void LogWriter::Write(const int numSamples, const ViewCellContainer &viewCells)
|
---|
[2576] | 26 | {
|
---|
[2580] | 27 | ofstream myfile;
|
---|
| 28 | myfile.open(mFilename.c_str());
|
---|
| 29 |
|
---|
| 30 | if (!myfile.is_open())
|
---|
| 31 | myfile.open(mFilename.c_str());
|
---|
| 32 |
|
---|
[2584] | 33 | ViewCellContainer::const_iterator vit, vit_end =viewCells.end();
|
---|
[2576] | 34 |
|
---|
[2581] | 35 | myfile << numSamples << endl;
|
---|
| 36 |
|
---|
[2584] | 37 | for (vit = viewCells.begin(); vit != vit_end; ++ vit)
|
---|
[2576] | 38 | {
|
---|
[2584] | 39 | myfile << (*vit)->GetNumPiercingRays() << " " << (*vit)->GetPvs().GetSize() << endl;
|
---|
[2576] | 40 | }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.