| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- #ifndef IGL_WRITEPLY_H
- #define IGL_WRITEPLY_H
- #include "igl_inline.h"
- #include "FileEncoding.h"
- #include <string>
- #include <iostream>
- #include <vector>
- #include <Eigen/Core>
- namespace igl
- {
- /// write triangular mesh to ply file
- ///
- /// @tparam Derived from Eigen matrix parameters
- /// @param[in] ply_stream ply file output stream
- /// @param[in] V (#V,3) matrix of vertex positions
- /// @param[in] F (#F,3) list of face indices into vertex positions
- /// @param[in] E (#E,2) list of edge indices into vertex positions
- /// @param[in] N (#V,3) list of normals
- /// @param[in] UV (#V,2) list of texture coordinates
- /// @param[in] VD (#V,*) additional vertex data
- /// @param[in] Vheader (#V) list of vertex data headers
- /// @param[in] FD (#F,*) additional face data
- /// @param[in] Fheader (#F) list of face data headers
- /// @param[in] ED (#E,*) additional edge data
- /// @param[in] Eheader (#E) list of edge data headers
- /// @param[in] comments (*) file comments
- /// @param[in] encoding - enum, to set binary or ascii file format
- /// @return true on success, false on errors
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedE,
- typename DerivedN,
- typename DerivedUV,
- typename DerivedVD,
- typename DerivedFD,
- typename DerivedED
- >
- bool writePLY(
- std::ostream & ply_stream,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedE> & E,
- const Eigen::MatrixBase<DerivedN> & N,
- const Eigen::MatrixBase<DerivedUV> & UV,
- const Eigen::MatrixBase<DerivedVD> & VD,
- const std::vector<std::string> & VDheader,
- const Eigen::MatrixBase<DerivedFD> & FD,
- const std::vector<std::string> & FDheader,
- const Eigen::MatrixBase<DerivedED> & ED,
- const std::vector<std::string> & EDheader,
- const std::vector<std::string> & comments,
- FileEncoding encoding
- );
- /// \overload
- /// \param[in] filename path to .ply file
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedE,
- typename DerivedN,
- typename DerivedUV,
- typename DerivedVD,
- typename DerivedFD,
- typename DerivedED
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedE> & E,
- const Eigen::MatrixBase<DerivedN> & N,
- const Eigen::MatrixBase<DerivedUV> & UV,
- const Eigen::MatrixBase<DerivedVD> & VD,
- const std::vector<std::string> & VDheader,
- const Eigen::MatrixBase<DerivedFD> & FD,
- const std::vector<std::string> & FDheader,
- const Eigen::MatrixBase<DerivedED> & ED,
- const std::vector<std::string> & EDheader,
- const std::vector<std::string> & comments,
- FileEncoding encoding);
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F
- );
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedE
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedE> & E
- );
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedN,
- typename DerivedUV
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedN> & N,
- const Eigen::MatrixBase<DerivedUV> & UV
- );
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedE,
- typename DerivedN,
- typename DerivedUV
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedE> & E,
- const Eigen::MatrixBase<DerivedN> & N,
- const Eigen::MatrixBase<DerivedUV> & UV
- );
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- FileEncoding encoding
- );
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedE
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedE> & E,
- FileEncoding encoding
- );
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedN,
- typename DerivedUV,
- typename DerivedVD
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedN> & N,
- const Eigen::MatrixBase<DerivedUV> & UV,
- const Eigen::MatrixBase<DerivedVD> & VD=Eigen::MatrixXd(0,0),
- const std::vector<std::string> & VDheader={},
- const std::vector<std::string> & comments={}
- );
- /// \overload
- template <
- typename DerivedV,
- typename DerivedF,
- typename DerivedE,
- typename DerivedN,
- typename DerivedUV,
- typename DerivedVD
- >
- bool writePLY(
- const std::string & filename,
- const Eigen::MatrixBase<DerivedV> & V,
- const Eigen::MatrixBase<DerivedF> & F,
- const Eigen::MatrixBase<DerivedE> & E,
- const Eigen::MatrixBase<DerivedN> & N,
- const Eigen::MatrixBase<DerivedUV> & UV,
- const Eigen::MatrixBase<DerivedVD> & VD=Eigen::MatrixXd(0,0),
- const std::vector<std::string> & VDheader={},
- const std::vector<std::string> & comments={}
- );
- }
- #ifndef IGL_STATIC_LIBRARY
- # include "writePLY.cpp"
- #endif
- #endif
|