1234567891011121314151617181920212223242526272829303132333435 |
- #include "read.h"
- #include "readOBJ.h"
- #include "readOFF.h"
- template <typename DerivedV, typename DerivedF>
- IGL_INLINE bool igl::read(
- const std::string str,
- Eigen::PlainObjectBase<DerivedV>& V,
- Eigen::PlainObjectBase<DerivedF>& F)
- {
- const char* p;
- for (p = str.c_str(); *p != '\0'; p++)
- ;
- while (*p != '.')
- p--;
-
- if (!strcmp(p, ".obj") || !strcmp(p, ".OBJ"))
- {
- return igl::readOBJ(str,V,F);
- }else if (!strcmp(p, ".off") || !strcmp(p, ".OFF"))
- {
- return igl::readOFF(str,V,F);
- }
- else
- {
- fprintf(stderr,"read() does not recognize extension: %s\n",p);
- return false;
- }
- }
- #ifndef IGL_HEADER_ONLY
- // Explicit template specialization
- // generated by autoexplicit.sh
- template bool igl::read<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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> >&);
- #endif
|