writeWRL.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_WRITE_WRL_H
  9. #define IGL_WRITE_WRL_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <string>
  13. namespace igl
  14. {
  15. /// Write mesh to a .wrl file
  16. ///
  17. /// @param[in] str path to .wrl file
  18. /// @param[in] V #V by 3 list of vertex positions
  19. /// @param[in] F #F by 3 list of triangle indices
  20. /// @return true iff succes
  21. template <typename DerivedV, typename DerivedF>
  22. IGL_INLINE bool writeWRL(
  23. const std::string & str,
  24. const Eigen::MatrixBase<DerivedV> & V,
  25. const Eigen::MatrixBase<DerivedF> & F);
  26. /// \overload
  27. ///
  28. /// @param[in] C double matrix of rgb values per vertex #V by 3
  29. template <typename DerivedV, typename DerivedF, typename DerivedC>
  30. IGL_INLINE bool writeWRL(
  31. const std::string & str,
  32. const Eigen::MatrixBase<DerivedV> & V,
  33. const Eigen::MatrixBase<DerivedF> & F,
  34. const Eigen::MatrixBase<DerivedC> & C);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. #include "writeWRL.cpp"
  38. #endif
  39. #endif