writeTGF.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_WRITETGF_H
  9. #define IGL_WRITETGF_H
  10. #include "igl_inline.h"
  11. #include <vector>
  12. #include <string>
  13. #ifndef IGL_NO_EIGEN
  14. #include <Eigen/Dense>
  15. #endif
  16. namespace igl
  17. {
  18. // WRITETGF
  19. //
  20. // Write a graph to a .tgf file
  21. //
  22. // Input:
  23. // filename .tgf file name
  24. // V # vertices by 3 list of vertex positions
  25. // E # edges by 2 list of edge indices
  26. //
  27. // Assumes that graph vertices are 3 dimensional
  28. IGL_INLINE bool writeTGF(
  29. const std::string tgf_filename,
  30. const std::vector<std::vector<double> > & C,
  31. const std::vector<std::vector<int> > & E);
  32. #ifndef IGL_NO_EIGEN
  33. IGL_INLINE bool writeTGF(
  34. const std::string tgf_filename,
  35. const Eigen::MatrixXd & C,
  36. const Eigen::MatrixXi & E);
  37. #endif
  38. }
  39. #ifndef IGL_STATIC_LIBRARY
  40. # include "writeTGF.cpp"
  41. #endif
  42. #endif