Many changes to jensen.

This commit is contained in:
2017-03-15 10:40:34 -04:00
parent 1faaaf0d63
commit c29d64583f
9 changed files with 167 additions and 63 deletions

View File

@@ -136,11 +136,9 @@ kdTree::~kdTree(){}
void kdTree::addPhoton(Photon p)
{
Photons.push_back(p);
}
void kdTree::createNodeKdTree(treeNode** node, std::vector<Photon> & originalData , int* xyz, int* yzx, int* zxy, superKey key, int begin, int end, int* xyz_2, int* yzx_2, int* zxy_2)
{
if(end - begin < 2)
@@ -400,9 +398,9 @@ size_t kdTree::getNumPhotons() {
return Photons.size();
}
void kdTree::save_photon_list() const {
cout << "Writing photons to \x1b[1;33mphotons.txt\x1b[m" << endl;
ofstream ofs("photons.txt", ios::out);
void kdTree::save_photon_list(const char * file_name) const {
cout << "Writing photons to \x1b[1;33m" << file_name << "\x1b[m" << endl;
ofstream ofs(file_name, ios::out);
float r, g, b;
for (std::vector<Photon>::const_iterator it = Photons.begin(); it != Photons.end(); it++) {
rgbe2float(r, g, b, (*it).radiance);