readNODE.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef IGL_READNODE_H
  2. #define IGL_READNODE_H
  3. #include "igl_inline.h"
  4. #include <string>
  5. #include <vector>
  6. #include <Eigen/Core>
  7. namespace igl
  8. {
  9. // load a list of points from a .node file
  10. //
  11. // Templates:
  12. // Scalar type for positions and vectors (will be read as double and cast
  13. // to Scalar)
  14. // Index type for indices (will be read as int and cast to Index)
  15. // Input:
  16. // node_file_name path of .node file
  17. // Outputs:
  18. // V double matrix of vertex positions #V by dim
  19. // I list of indices (first tells whether 0 or 1 indexed)
  20. template <typename Scalar, typename Index>
  21. IGL_INLINE bool readNODE(
  22. const std::string node_file_name,
  23. std::vector<std::vector<Scalar > > & V,
  24. std::vector<std::vector<Index > > & I);
  25. // Input:
  26. // node_file_name path of .node file
  27. // Outputs:
  28. // V eigen double matrix #V by dim
  29. template <typename DerivedV, typename DerivedI>
  30. IGL_INLINE bool readNODE(
  31. const std::string node_file_name,
  32. Eigen::PlainObjectBase<DerivedV>& V,
  33. Eigen::PlainObjectBase<DerivedI>& I);
  34. }
  35. #ifdef IGL_HEADER_ONLY
  36. # include "readNODE.cpp"
  37. #endif
  38. #endif