diff --git a/src/Prep/TerraFit/terrafit.cc b/src/Prep/TerraFit/terrafit.cc index 8cd9f8ea..4743133c 100644 --- a/src/Prep/TerraFit/terrafit.cc +++ b/src/Prep/TerraFit/terrafit.cc @@ -174,13 +174,11 @@ void fit_file(const SGPath& path) { inarray.parse(bucket); inarray.close(); - ArrayMap *DEM=new ArrayMap(inarray); + ArrayMap DEM(inarray); - Terra::GreedySubdivision *mesh; + Terra::GreedySubdivision mesh(&DEM); - mesh=new Terra::GreedySubdivision(DEM); - - greedy_insertion(mesh); + greedy_insertion(&mesh); gzFile fp; if ( (fp = gzopen( outPath.c_str(), "wb9" )) == NULL ) { @@ -188,23 +186,20 @@ void fit_file(const SGPath& path) { return; } - gzprintf(fp,"%d\n",mesh->pointCount()); + gzprintf(fp,"%d\n",mesh.pointCount()); - for (int x=0;xwidth;x++) { - for (int y=0;yheight;y++) { - if (mesh->is_used(x,y) != DATA_POINT_USED) + for (int x=0;xeval(x,y); + vz=DEM.eval(x,y); gzprintf(fp,"%+03.8f %+02.8f %0.2f\n",vx,vy,vz); } } - delete mesh; - delete DEM; - gzclose(fp); } @@ -352,9 +347,9 @@ int main(int argc, char** argv) { exit(1); } - std::vector threads; + std::vector > threads; for (unsigned int t=0; t thread(new FitThread); thread->start(); threads.push_back(thread); }