read.h 780 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // IGL Lib - Simple C++ mesh library
  3. //
  4. // Copyright 2011, Daniele Panozzo. All rights reserved.
  5. // History:
  6. // return type changed from void to bool Alec 18 Sept 2011
  7. #ifndef IGL_READ_H
  8. #define IGL_READ_H
  9. #include "igl_inline.h"
  10. #include <Eigen/Core>
  11. #include <string>
  12. namespace igl
  13. {
  14. // read mesh from an ascii file with automatic detection of file format. supported: obj, off)
  15. // Inputs:
  16. // str path to .obj/.off file
  17. // Outputs:
  18. // V eigen double matrix #V by 3
  19. // F eigen int matrix #F by 3
  20. template <typename DerivedV, typename DerivedF>
  21. IGL_INLINE bool read(
  22. const std::string str,
  23. Eigen::PlainObjectBase<DerivedV>& V,
  24. Eigen::PlainObjectBase<DerivedF>& F);
  25. }
  26. #ifdef IGL_HEADER_ONLY
  27. # include "read.cpp"
  28. #endif
  29. #endif