readWRL.h 946 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef IGL_READWRL_H
  2. #define IGL_READWRL_H
  3. #include "igl_inline.h"
  4. #include <string>
  5. #include <vector>
  6. namespace igl
  7. {
  8. // Read a mesh from an ascii wrl file, filling in vertex positions and face
  9. // indices of the first model. Mesh may have faces of any number of degree
  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. // Inputs:
  16. // str path to .wrl file
  17. // Outputs:
  18. // V double matrix of vertex positions #V by 3
  19. // F #F list of face indices into vertex positions
  20. // Returns true on success, false on errors
  21. template <typename Scalar, typename Index>
  22. IGL_INLINE bool readWRL(
  23. const std::string wrl_file_name,
  24. std::vector<std::vector<Scalar > > & V,
  25. std::vector<std::vector<Index > > & F);
  26. }
  27. #ifdef IGL_HEADER_ONLY
  28. # include "readWRL.cpp"
  29. #endif
  30. #endif