readNODE.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  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. #ifndef IGL_READNODE_H
  9. #define IGL_READNODE_H
  10. #include "igl_inline.h"
  11. #include <string>
  12. #include <vector>
  13. #include <Eigen/Core>
  14. namespace igl
  15. {
  16. // load a list of points from a .node file
  17. //
  18. // Templates:
  19. // Scalar type for positions and vectors (will be read as double and cast
  20. // to Scalar)
  21. // Index type for indices (will be read as int and cast to Index)
  22. // Input:
  23. // node_file_name path of .node file
  24. // Outputs:
  25. // V double matrix of vertex positions #V by dim
  26. // I list of indices (first tells whether 0 or 1 indexed)
  27. template <typename Scalar, typename Index>
  28. IGL_INLINE bool readNODE(
  29. const std::string node_file_name,
  30. std::vector<std::vector<Scalar > > & V,
  31. std::vector<std::vector<Index > > & I);
  32. // Input:
  33. // node_file_name path of .node file
  34. // Outputs:
  35. // V eigen double matrix #V by dim
  36. template <typename DerivedV, typename DerivedI>
  37. IGL_INLINE bool readNODE(
  38. const std::string node_file_name,
  39. Eigen::PlainObjectBase<DerivedV>& V,
  40. Eigen::PlainObjectBase<DerivedI>& I);
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. # include "readNODE.cpp"
  44. #endif
  45. #endif