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

Revision 2576, 1.1 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
9void LogWriter::SetFilename(const std::string &filename)
10{
11        mFilename = filename;
12}
13
14
15void LogWriter::Write(ofstream &myfile, const int numSamples, const ViewCellInfoContainer &infos)
16{
17        ViewCellInfoContainer::const_iterator vit, vit_end = infos.end();
18
19        for (vit = infos.begin(); vit != vit_end; ++ vit)
20        {
21                myfile << (*vit).mPiercingRays;
22                //ViewCell *vc = *vit;
23                //myfile << "vc: " << vc->GetPvs().GetSize() << " " << vc->GetNumPiercingRays();
24        }
25}
26
27
28void LogWriter::Write(const ViewCellHistoryContainer &hist)
29{
30        ofstream myfile;
31
32        //char filename[64];
33        //sprintf(filename, "%s %06d", mFilename.c_str(), numSamples);
34        //myfile.open(filename);
35        myfile.open(mFilename.c_str());
36
37        ViewCellHistoryContainer::const_iterator vit, vit_end = hist.end();
38
39        // number of samples
40        //myfile << "samples: " << numSamples << endl;
41        myfile << (int)hist.size() << endl;
42
43        for (vit = hist.begin(); vit != vit_end; ++ vit)
44        {
45                Write(myfile, (*vit).first, *(*vit).second);
46        }
47}
48
49}
Note: See TracBrowser for help on using the repository browser.