writeTGF.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[email protected]>
  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. #include <Eigen/Dense>
  14. namespace igl
  15. {
  16. /// Write a graph to a .tgf file
  17. ///
  18. /// @param[in] filename .tgf file name
  19. /// @param[in] V # vertices by 3 list of vertex positions
  20. /// @param[in] E # edges by 2 list of edge indices
  21. ///
  22. /// \pre Assumes that graph vertices are 3 dimensional
  23. ///
  24. /// \see readTGF
  25. IGL_INLINE bool writeTGF(
  26. const std::string tgf_filename,
  27. const std::vector<std::vector<double> > & C,
  28. const std::vector<std::vector<int> > & E);
  29. /// \overload
  30. IGL_INLINE bool writeTGF(
  31. const std::string tgf_filename,
  32. const Eigen::MatrixXd & C,
  33. const Eigen::MatrixXi & E);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "writeTGF.cpp"
  37. #endif
  38. #endif