write.cpp 585 B

1234567891011121314151617181920212223
  1. #include "write.h"
  2. #include "writeOBJ.h"
  3. #include "writeOFF.h"
  4. template <typename DerivedV, typename DerivedF>
  5. IGL_INLINE bool igl::write(
  6. const std::string str,
  7. const Eigen::PlainObjectBase<DerivedV>& V,
  8. const Eigen::PlainObjectBase<DerivedF>& F)
  9. {
  10. const char* p;
  11. for (p = str.c_str(); *p != '\0'; p++)
  12. ;
  13. while (*p != '.')
  14. p--;
  15. if (!strcmp(p, ".obj") || !strcmp(p, ".OBJ"))
  16. return igl::writeOBJ(str,V,F);
  17. if (!strcmp(p, ".off") || !strcmp(p, ".OFF"))
  18. return igl::writeOFF(str,V,F);
  19. }