#ifndef IGL_WRITEPLY_H #define IGL_WRITEPLY_H #include #include #include #include #include #include namespace igl { // write triangular mesh to ply file // // Templates: // Derived from Eigen matrix parameters // Inputs: // ply_stream ply file output stream // V (#V,3) matrix of vertex positions // F (#F,3) list of face indices into vertex positions // E (#E,2) list of edge indices into vertex positions // N (#V,3) list of normals // UV (#V,2) list of texture coordinates // VD (#V,*) additional vertex data // Vheader (#V) list of vertex data headers // FD (#F,*) additional face data // Fheader (#F) list of face data headers // ED (#E,*) additional edge data // Eheader (#E) list of edge data headers // comments (*) file comments // encoding - enum, to set binary or ascii file format // Returns 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 & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & E, const Eigen::MatrixBase & N, const Eigen::MatrixBase & UV, const Eigen::MatrixBase & VD, const std::vector & VDheader, const Eigen::MatrixBase & FD, const std::vector & FDheader, const Eigen::MatrixBase & ED, const std::vector & EDheader, const std::vector & comments, FileEncoding encoding ); // write triangular mesh to ply file // // Templates: // Derived from Eigen matrix parameters // Inputs: // filename ply file name // V (#V,3) matrix of vertex positions // F (#F,3) list of face indices into vertex positions // E (#E,2) list of edge indices into vertex positions // N (#V,3) list of normals // UV (#V,2) list of texture coordinates // VD (#V,*) additional vertex data // Vheader (#V) list of vertex data headers // FD (#F,*) additional face data // Fheader (#F) list of face data headers // ED (#E,*) additional edge data // Eheader (#E) list of edge data headers // comments (*) file comments // encoding - enum, to set binary or ascii file format // Returns 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( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & E, const Eigen::MatrixBase & N, const Eigen::MatrixBase & UV, const Eigen::MatrixBase & VD, const std::vector & VDheader, const Eigen::MatrixBase & FD, const std::vector & FDheader, const Eigen::MatrixBase & ED, const std::vector & EDheader, const std::vector & comments, FileEncoding encoding ); template < typename DerivedV, typename DerivedF > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F ); template < typename DerivedV, typename DerivedF, typename DerivedE > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & E ); template < typename DerivedV, typename DerivedF, typename DerivedN, typename DerivedUV > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & N, const Eigen::MatrixBase & UV ); template < typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedN, typename DerivedUV > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & E, const Eigen::MatrixBase & N, const Eigen::MatrixBase & UV ); template < typename DerivedV, typename DerivedF > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, FileEncoding encoding ); template < typename DerivedV, typename DerivedF, typename DerivedE > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & E, FileEncoding encoding ); template < typename DerivedV, typename DerivedF, typename DerivedN, typename DerivedUV, typename DerivedVD > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & N, const Eigen::MatrixBase & UV, const Eigen::MatrixBase & VD=Eigen::MatrixXd(0,0), const std::vector & VDheader={}, const std::vector & comments={} ); template < typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedN, typename DerivedUV, typename DerivedVD > bool writePLY( const std::string & filename, const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & E, const Eigen::MatrixBase & N, const Eigen::MatrixBase & UV, const Eigen::MatrixBase & VD=Eigen::MatrixXd(0,0), const std::vector & VDheader={}, const std::vector & comments={} ); } #ifndef IGL_STATIC_LIBRARY # include "writePLY.cpp" #endif #endif