diff --git a/wrap/io_trimesh/import_out.h b/wrap/io_trimesh/import_out.h index 5a432426..38ec8114 100644 --- a/wrap/io_trimesh/import_out.h +++ b/wrap/io_trimesh/import_out.h @@ -25,6 +25,8 @@ #include #include +#include +#include #include #include #include @@ -35,13 +37,13 @@ namespace tri { namespace io { struct Correspondence{ - Correspondence(unsigned int id_img_,unsigned int key_,float x_,float y_):id_img(id_img_),key(key_),x(x_),y(y_){}; + Correspondence(unsigned int id_img_,unsigned int key_,float x_,float y_):id_img(id_img_),key(key_),x(x_),y(y_){} unsigned int id_img,key; float x; float y; }; - typedef std::vector CorrVec; + typedef std::vector CorrVec; /** This class encapsulate a filter for opening bundler file @@ -82,7 +84,7 @@ static bool ReadHeader(FILE *fp,unsigned int &num_cams, unsigned int &num_points } static bool ReadHeader(const char * filename,unsigned int &num_cams, unsigned int &num_points){ - FILE *fp = fopen(s.c_str(), "r"); + FILE *fp = fopen(filename, "r"); if(!fp) return false; ReadHeader(fp); fclose(fp); @@ -129,22 +131,22 @@ static int Open( OpenMeshType &m, std::vector > & shots, shots[i].Extrinsics.SetRot(mat); shots[i].Intrinsics.FocalMm = f; - shot.Intrinsics.k[0] = 0.0;//k1; To be uncommented when distortion is taken into account reliably - shot.Intrinsics.k[1] = 0.0;//k2; - AddIntrinsics(shots[i],image_filenames[i].c_str()); + shots[i].Intrinsics.k[0] = 0.0;//k1; To be uncommented when distortion is taken into account reliably + shots[i].Intrinsics.k[1] = 0.0;//k2; + AddIntrinsics(shots[i],image_filenames[i].c_str()); } // load all correspondences - OpenMeshType::template PerVertexAttributeHandle ch = vcg::tri::Allocator::GetPerVertexAttribute(m,"correspondences"); + typename OpenMeshType::template PerVertexAttributeHandle ch = vcg::tri::Allocator::template GetPerVertexAttribute(m,"correspondences"); if(!vcg::tri::Allocator::IsValidHandle(m,ch)) - ch = vcg::tri::Allocator::AddPerVertexAttribute(m,"correspondences"); + ch = vcg::tri::Allocator::template AddPerVertexAttribute(m,"correspondences"); - OpenMeshType::VertexIterator vi = vcg::tri::Allocator::AddVertices(m,num_points); + typename OpenMeshType::VertexIterator vi = vcg::tri::Allocator::AddVertices(m,num_points); for(int i = 0; i < num_points;++i,++vi){ float x,y,z; unsigned int r,g,b,i_cam, key_sift,n_corr; fscanf(fp,"%f %f %f ",&x,&y,&z); - (*vi).P() = vcg::Point3(x,y,z); + (*vi).P() = vcg::Point3(x,y,z); fscanf(fp,"%d %d %d ",&r,&g,&b); (*vi).C() = vcg::Color4b(r,g,b,255); @@ -161,11 +163,11 @@ static int Open( OpenMeshType &m, std::vector > & shots, return (shots.size() == 0); } -static int Open( OpenMeshType &m, std::vector > shots, const char * filename_out,const char * filename_list, CallBackPos *cb=0){ - QStringList image_files; +static int Open( OpenMeshType &m, std::vector > shots, const char * filename_out,const char * filename_list, CallBackPos *cb=0){ ReadHeader(filename_out); - ReadImagesFilenames(QString(filename_list),list,num_cams); - return Open( m, shots,filename, image_files, cb); + std::vector image_filenames; + ReadImagesFilenames(filename_list,image_filenames); + return Open( m, shots,filename_out, image_filenames, cb); }