write_triangle_mesh.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "write_triangle_mesh.h"
  9. #include "../write_triangle_mesh.h"
  10. #include "../pathinfo.h"
  11. #include "writeDAE.h"
  12. template <typename DerivedV, typename DerivedF>
  13. IGL_INLINE bool igl::xml::write_triangle_mesh(
  14. const std::string str,
  15. const Eigen::MatrixBase<DerivedV>& V,
  16. const Eigen::MatrixBase<DerivedF>& F,
  17. const FileEncoding fe)
  18. {
  19. // dirname, basename, extension and filename
  20. std::string d,b,e,f;
  21. pathinfo(str,d,b,e,f);
  22. // Convert extension to lower case
  23. std::transform(e.begin(), e.end(), e.begin(), ::tolower);
  24. if(e == "dae")
  25. {
  26. return writeDAE(str,V,F);
  27. }else
  28. {
  29. return igl::write_triangle_mesh(str,V,F,fe);
  30. }
  31. }
  32. #ifdef IGL_STATIC_LIBRARY
  33. // Explicit template instantiation
  34. // generated by autoexplicit.sh
  35. template bool igl::xml::write_triangle_mesh<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::FileEncoding);
  36. #endif