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

Revision 2580, 1.4 KB checked in by mattausch, 17 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(//ofstream &myfile,
26                                          const int numSamples, const ViewCellInfoContainer &infos)
27{
28        ofstream myfile;
29        myfile.open(mFilename.c_str());
30
31        if (!myfile.is_open())
32                myfile.open(mFilename.c_str());
33
34        ViewCellInfoContainer::const_iterator vit, vit_end = infos.end();
35
36        for (vit = infos.begin(); vit != vit_end; ++ vit)
37        {
38                myfile << (*vit).mPiercingRays;
39                //ViewCell *vc = *vit;
40                //myfile << "vc: " << vc->GetPvs().GetSize() << " " << vc->GetNumPiercingRays();
41        }
42}
43
44/*
45void LogWriter::Write(const ViewCellHistoryContainer &hist)
46{
47        //ofstream myfile;
48        //char filename[64];
49        //sprintf(filename, "%s %06d", mFilename.c_str(), numSamples);
50        //myfile.open(filename);
51        if (!mFile.is_open())
52                mFile.open(mFilename.c_str());
53
54        ViewCellHistoryContainer::const_iterator vit, vit_end = hist.end();
55
56        // number of samples
57        //myfile << "samples: " << numSamples << endl;
58        mFile << (int)hist.size() << endl;
59
60        for (vit = hist.begin(); vit != vit_end; ++ vit)
61        {
62                Write(myfile, (*vit).first, *(*vit).second);
63        }
64}
65
66*/
67
68}
Note: See TracBrowser for help on using the repository browser.