readTGF.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef IGL_READTGF_H
  2. #define IGL_READTGF_H
  3. #include "igl_inline.h"
  4. #include <vector>
  5. #include <string>
  6. #ifndef IGL_NO_EIGEN
  7. #include <Eigen/Dense>
  8. #endif
  9. namespace igl
  10. {
  11. // READTGF
  12. //
  13. // [V,E,P,BE,CE,PE] = readTGF(filename)
  14. //
  15. // Read a graph from a .tgf file
  16. //
  17. // Input:
  18. // filename .tgf file name
  19. // Ouput:
  20. // V # vertices by 3 list of vertex positions
  21. // E # edges by 2 list of edge indices
  22. // P # point-handles list of point handle indices
  23. // BE # bone-edges by 2 list of bone-edge indices
  24. // CE # cage-edges by 2 list of cage-edge indices
  25. // PE # pseudo-edges by 2 list of pseudo-edge indices
  26. //
  27. // Assumes that graph vertices are 3 dimensional
  28. IGL_INLINE bool readTGF(
  29. const std::string tgf_filename,
  30. std::vector<std::vector<double> > & C,
  31. std::vector<std::vector<int> > & E,
  32. std::vector<int> & P,
  33. std::vector<std::vector<int> > & BE,
  34. std::vector<std::vector<int> > & CE,
  35. std::vector<std::vector<int> > & PE);
  36. #ifndef IGL_NO_EIGEN
  37. IGL_INLINE bool readTGF(
  38. const std::string tgf_filename,
  39. Eigen::MatrixXd & C,
  40. Eigen::MatrixXi & E,
  41. Eigen::VectorXi & P,
  42. Eigen::MatrixXi & BE,
  43. Eigen::MatrixXi & CE,
  44. Eigen::MatrixXi & PE);
  45. #endif
  46. }
  47. #ifdef IGL_HEADER_ONLY
  48. # include "readTGF.cpp"
  49. #endif
  50. #endif