#ifndef IGL_READPLY_H #define IGL_READPLY_H #include #include #include #include #include "tinyply.h" namespace igl { template < typename DerivedV, typename DerivedF > IGL_INLINE bool readPLY( FILE *fp, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F ); // Read triangular mesh from ply file, filling in vertex positions, normals // and texture coordinates, if available // also read additional properties associated with vertex,faces and edges // and file comments // // Templates: // Derived from Eigen matrix parameters // Inputs: // ply_stream ply file input stream // Outputs: // 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 // 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 readPLY( std::istream & ply_stream, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & E, Eigen::PlainObjectBase & N, Eigen::PlainObjectBase & UV, Eigen::PlainObjectBase & VD, std::vector & Vheader, Eigen::PlainObjectBase & FD, std::vector & Fheader, Eigen::PlainObjectBase & ED, std::vector & Eheader, std::vector & comments ); // Read triangular mesh from ply file, filling in vertex positions, normals // and texture coordinates, if available // also read additional properties associated with vertex,faces and edges // and file comments // // Templates: // Derived from Eigen matrix parameters // Inputs: // ply_file ply file name // Outputs: // 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 // 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 readPLY( const std::string& ply_file, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & E, Eigen::PlainObjectBase & N, Eigen::PlainObjectBase & UV, Eigen::PlainObjectBase & VD, std::vector & VDheader, Eigen::PlainObjectBase & FD, std::vector & FDheader, Eigen::PlainObjectBase & ED, std::vector & EDheader, std::vector & comments ); // Read triangular mesh from ply file, filling in vertex positions, normals // and texture coordinates, if available // also read additional properties associated with vertex,faces and edges // and file comments // // Templates: // Derived from Eigen matrix parameters // Inputs: // ply_file ply file name // Outputs: // V (#V,3) matrix of vertex positions // F (#F,3) list of face 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 // Returns true on success, false on errors template < typename DerivedV, typename DerivedF, typename DerivedN, typename DerivedUV, typename DerivedVD > bool readPLY( const std::string & filename, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & N, Eigen::PlainObjectBase & UV, Eigen::PlainObjectBase & VD, std::vector & Vheader ); // Read triangular mesh from ply file, filling in vertex positions, normals // and texture coordinates, if available // also read additional properties associated with vertex,faces and edges // and file comments // // Templates: // Derived from Eigen matrix parameters // Inputs: // ply_file ply file name // Outputs: // 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 // Returns true on success, false on errors template < typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedN, typename DerivedUV > bool readPLY( const std::string & filename, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & E, Eigen::PlainObjectBase & N, Eigen::PlainObjectBase & UV ); template < typename DerivedV, typename DerivedF > bool readPLY( const std::string & filename, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F ); template < typename DerivedV, typename DerivedF, typename DerivedE > bool readPLY( const std::string & filename, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & E ); } #ifndef IGL_STATIC_LIBRARY # include "readPLY.cpp" #endif #endif