readNODE.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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. #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. /// @tparam Scalar type for positions and vectors (will be read as double and cast
  19. /// to Scalar)
  20. /// @tparam Index type for indices (will be read as int and cast to Index)
  21. /// @param[in] node_file_name path of .node file
  22. /// @param[out] V double matrix of vertex positions #V by dim
  23. /// @param[out] I list of indices (first tells whether 0 or 1 indexed)
  24. template <typename DerivedV, typename DerivedI>
  25. IGL_INLINE bool readNODE(
  26. const std::string node_file_name,
  27. Eigen::PlainObjectBase<DerivedV>& V,
  28. Eigen::PlainObjectBase<DerivedI>& I);
  29. /// \overload
  30. template <typename Scalar, typename Index>
  31. IGL_INLINE bool readNODE(
  32. const std::string node_file_name,
  33. std::vector<std::vector<Scalar > > & V,
  34. std::vector<std::vector<Index > > & I);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "readNODE.cpp"
  38. #endif
  39. #endif