فهرست منبع

ply duplicate symbol issues

Former-commit-id: df0f9d7afe26113c2de82e2d76a7931c77054743
Alec Jacobson 10 سال پیش
والد
کامیت
8692dd8258
4فایلهای تغییر یافته به همراه28 افزوده شده و 5 حذف شده
  1. 1 0
      include/igl/draw_skeleton_3d.cpp
  2. 1 1
      include/igl/ply.h.REMOVED.git-id
  3. 18 4
      include/igl/writePLY.cpp
  4. 8 0
      include/igl/writePLY.h

+ 1 - 0
include/igl/draw_skeleton_3d.cpp

@@ -160,4 +160,5 @@ IGL_INLINE void igl::draw_skeleton_3d(
 template void igl::draw_skeleton_3d<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
 template void igl::draw_skeleton_3d<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&);
 template void igl::draw_skeleton_3d<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<float, 4, 1, 0, 4, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 4, 1, 0, 4, 1> > const&, double);
+template void igl::draw_skeleton_3d<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, double);
 #endif

+ 1 - 1
include/igl/ply.h.REMOVED.git-id

@@ -1 +1 @@
-05e282fe767ea0bd8987f68ae4b79d0ab4c26a09
+6693ed81cd72749c90548f5078b27623d108a17f

+ 18 - 4
include/igl/writePLY.cpp

@@ -57,7 +57,7 @@ IGL_INLINE bool igl::writePLY(
   const bool has_texture_coords = UV.rows() > 0;
   std::vector<Vertex> vlist(V.rows());
   std::vector<Face> flist(F.rows());
-  for(size_t i = 0;i<V.rows();i++)
+  for(size_t i = 0;i<(size_t)V.rows();i++)
   {
     vlist[i].x = V(i,0);
     vlist[i].y = V(i,1);
@@ -74,11 +74,11 @@ IGL_INLINE bool igl::writePLY(
       vlist[i].t = UV(i,1);
     }
   }
-  for(size_t i = 0;i<F.rows();i++)
+  for(size_t i = 0;i<(size_t)F.rows();i++)
   {
     flist[i].nverts = F.cols();
     flist[i].verts = new int[F.cols()];
-    for(size_t c = 0;c<F.cols();c++)
+    for(size_t c = 0;c<(size_t)F.cols();c++)
     {
       flist[i].verts[c] = F(i,c);
     }
@@ -130,13 +130,27 @@ IGL_INLINE bool igl::writePLY(
 
   ply_close(ply);
   fclose(fp);
-  for(size_t i = 0;i<F.rows();i++)
+  for(size_t i = 0;i<(size_t)F.rows();i++)
   {
     delete[] flist[i].verts;
   }
   return true;
 }
 
+template <
+  typename DerivedV,
+  typename DerivedF>
+IGL_INLINE bool igl::writePLY(
+  const std::string & filename,
+  const Eigen::PlainObjectBase<DerivedV> & V,
+  const Eigen::PlainObjectBase<DerivedF> & F,
+  const bool ascii)
+{
+  Eigen::MatrixXd N,UV;
+  return writePLY(filename,V,F,N,UV,ascii);
+}
+
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template bool igl::writePLY<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, bool);
 #endif

+ 8 - 0
include/igl/writePLY.h

@@ -34,6 +34,14 @@ namespace igl
     const Eigen::PlainObjectBase<DerivedN> & N,
     const Eigen::PlainObjectBase<DerivedUV> & UV,
     const bool ascii = true);
+  template <
+    typename DerivedV,
+    typename DerivedF>
+  IGL_INLINE bool writePLY(
+    const std::string & filename,
+    const Eigen::PlainObjectBase<DerivedV> & V,
+    const Eigen::PlainObjectBase<DerivedF> & F,
+    const bool ascii = true);
 }
 #ifndef IGL_STATIC_LIBRARY
 #  include "writePLY.cpp"