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