|
@@ -286,70 +286,6 @@ IGL_INLINE bool igl::readOBJ(
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // Legacy
|
|
|
|
- if(F.cols() != 3)
|
|
|
|
- {
|
|
|
|
- fprintf(stderr,
|
|
|
|
- "Error: readOBJ(filename,V,F) is meant for reading triangle-only"
|
|
|
|
- " meshes. This mesh has faces all with size %d. See readOBJ.h for other"
|
|
|
|
- " options.\n",
|
|
|
|
- (int)F.cols());
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-template <typename DerivedV, typename DerivedF, typename DerivedT, typename Index>
|
|
|
|
-IGL_INLINE bool igl::readOBJPoly(
|
|
|
|
- const std::string str,
|
|
|
|
- Eigen::PlainObjectBase<DerivedV>& V,
|
|
|
|
- std::vector<std::vector< Index > >& F,
|
|
|
|
- Eigen::PlainObjectBase<DerivedV>& CN,
|
|
|
|
- Eigen::PlainObjectBase<DerivedF>& FN,
|
|
|
|
- Eigen::PlainObjectBase<DerivedT>& TC,
|
|
|
|
- Eigen::PlainObjectBase<DerivedF>& FTC)
|
|
|
|
-{
|
|
|
|
- std::vector<std::vector<double> > vV,vTC,vN;
|
|
|
|
- std::vector<std::vector<Index> > vF,vFTC,vFN;
|
|
|
|
- bool success = igl::readOBJ(str,vV,vTC,vN,vF,vFTC,vFN);
|
|
|
|
- if(!success)
|
|
|
|
- return false;
|
|
|
|
-
|
|
|
|
- bool V_rect = igl::list_to_matrix(vV,V);
|
|
|
|
- if(!V_rect)
|
|
|
|
- return false;
|
|
|
|
-
|
|
|
|
- F = vF;
|
|
|
|
-
|
|
|
|
- if(!vN.empty())
|
|
|
|
- {
|
|
|
|
- bool VN_rect = igl::list_to_matrix(vN,CN);
|
|
|
|
- if(!VN_rect)
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(!vFN.empty())
|
|
|
|
- {
|
|
|
|
- bool FN_rect = igl::list_to_matrix(vFN,FN);
|
|
|
|
- if(!FN_rect)
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(!vTC.empty())
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- bool T_rect = igl::list_to_matrix(vTC,TC);
|
|
|
|
- if(!T_rect)
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- if(!vFTC.empty())
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- bool FTC_rect = igl::list_to_matrix(vFTC,FTC);
|
|
|
|
- if(!FTC_rect)
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -380,17 +316,6 @@ IGL_INLINE bool igl::readOBJ(
|
|
// igl::list_to_matrix(vF,F) already printed error message to std err
|
|
// igl::list_to_matrix(vF,F) already printed error message to std err
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- // THIS IS ANNOYING, I WANT TO READ QUADS, Why not?
|
|
|
|
- //// Legacy
|
|
|
|
- //if(F.cols() != 3)
|
|
|
|
- //{
|
|
|
|
- // fprintf(stderr,
|
|
|
|
- // "Error: readOBJ(filename,V,F) is meant for reading triangle-only"
|
|
|
|
- // " meshes. This mesh has faces all with size %d. See readOBJ.h for other"
|
|
|
|
- // " options.\n",
|
|
|
|
- // (int)F.cols());
|
|
|
|
- // return false;
|
|
|
|
- //}
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -401,5 +326,4 @@ template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matr
|
|
template bool igl::readOBJ<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 2, 1, -1, 2> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 1, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >&);
|
|
template bool igl::readOBJ<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 2, 1, -1, 2> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 1, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >&);
|
|
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
template bool igl::readOBJ<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(std::string, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
|
|
template bool igl::readOBJ<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(std::string, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
|
|
-template bool igl::readOBJPoly<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, int>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
|
#endif
|
|
#endif
|