readWRL.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_READWRL_H
  9. #define IGL_READWRL_H
  10. #include "igl_inline.h"
  11. #include <string>
  12. #include <vector>
  13. namespace igl
  14. {
  15. // Read a mesh from an ascii wrl file, filling in vertex positions and face
  16. // indices of the first model. Mesh may have faces of any number of degree
  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. // Inputs:
  23. // str path to .wrl file
  24. // Outputs:
  25. // V double matrix of vertex positions #V by 3
  26. // F #F list of face indices into vertex positions
  27. // Returns true on success, false on errors
  28. template <typename Scalar, typename Index>
  29. IGL_INLINE bool readWRL(
  30. const std::string wrl_file_name,
  31. std::vector<std::vector<Scalar > > & V,
  32. std::vector<std::vector<Index > > & F);
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "readWRL.cpp"
  36. #endif
  37. #endif