write.cpp 445 B

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