read_into_tetgenio.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_READ_INTO_TETGENIO_H
  9. #define IGL_READ_INTO_TETGENIO_H
  10. #include "../igl_inline.h"
  11. #include <string>
  12. #define TETLIBRARY
  13. #include "tetgen.h" // Defined tetgenio, REAL
  14. namespace igl
  15. {
  16. // Read a mesh or point set into tetgenio (input object for calling tetgen).
  17. // Many file formats are already supported by tetgen:
  18. // .off
  19. // .ply
  20. // .node
  21. // .ply
  22. // .medit
  23. // .vtk
  24. // etc.
  25. // Noteably it does not support .obj which is loaded by hand here (also
  26. // demonstrating how to load points/faces programatically)
  27. //
  28. // If the file extension is not recognized the filename is assumed to be the
  29. // basename of a collection describe a tetmesh, (of which at least the .node
  30. // file must exist):
  31. // [filename].node
  32. // [filename].ele
  33. // [filename].face
  34. // [filename].edge
  35. // [filename].vol
  36. //
  37. // Inputs:
  38. // path path to file or basename to files
  39. // Outputs:
  40. // in tetgenio input object
  41. // Returns true on success, false on error
  42. IGL_INLINE bool read_into_tetgenio(const std::string & path, tetgenio & in);
  43. }
  44. #ifdef IGL_HEADER_ONLY
  45. # include "read_into_tetgenio.cpp"
  46. #endif
  47. #endif