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

Revision 2584, 776 bytes checked in by mattausch, 16 years ago (diff)
Line 
1#include "LogWriter.h"
2#include "ViewCellsManager.h"
3
4
5namespace GtpVisibilityPreprocessor
6{
7
8
9LogWriter::LogWriter()
10{
11}
12
13
14LogWriter::LogWriter(const std::string &filename): mFilename(filename)
15{
16}
17
18
19void LogWriter::SetFilename(const std::string &filename)
20{
21        mFilename = filename;
22}
23
24
25void 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.