瀏覽代碼

fixed namespace and missing include

Former-commit-id: bf657bdab0e569d8c6230ef8c743d2be1f61518a
Teseo Schneider 7 年之前
父節點
當前提交
4a1547e5f6
共有 4 個文件被更改,包括 21 次插入18 次删除
  1. 4 1
      include/igl/guess_extension.cpp
  2. 1 1
      include/igl/ply.h.REMOVED.git-id
  3. 11 11
      include/igl/readPLY.cpp
  4. 5 5
      include/igl/writePLY.cpp

+ 4 - 1
include/igl/guess_extension.cpp

@@ -1,4 +1,7 @@
 #include "guess_extension.h"
+
+#include <string.h>
+
 #include "is_stl.h"
 #include "ply.h"
 
@@ -21,7 +24,7 @@ IGL_INLINE void igl::guess_extension(FILE * fp, std::string & guess)
   {
     int nelems;
     char ** elem_names;
-    external::ply::PlyFile * in_ply = external::ply::ply_read(ply_file,&nelems,&elem_names);
+    igl::ply::PlyFile * in_ply = igl::ply::ply_read(ply_file,&nelems,&elem_names);
     if(in_ply==NULL)
     {
       return false;

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

@@ -1 +1 @@
-5f0a2f5ab56b7b90d8b22816cec80e1a11cfcd4c
+60f2b29de2e29d034e068eb5ae4bf9747a63232e

+ 11 - 11
include/igl/readPLY.cpp

@@ -58,7 +58,7 @@ IGL_INLINE bool igl::readPLY(
      void *other_props;       /* other properties */
    } Face;
 
-  external::ply::PlyProperty vert_props[] = { /* list of property information for a vertex */
+  igl::ply::PlyProperty vert_props[] = { /* list of property information for a vertex */
     {"x", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,x), 0, 0, 0, 0},
     {"y", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,y), 0, 0, 0, 0},
     {"z", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,z), 0, 0, 0, 0},
@@ -69,14 +69,14 @@ IGL_INLINE bool igl::readPLY(
     {"t", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,t), 0, 0, 0, 0},
   };
 
-  external::ply::PlyProperty face_props[] = { /* list of property information for a face */
+  igl::ply::PlyProperty face_props[] = { /* list of property information for a face */
     {"vertex_indices", PLY_INT, PLY_INT, offsetof(Face,verts),
       1, PLY_UCHAR, PLY_UCHAR, offsetof(Face,nverts)},
   };
 
   int nelems;
   char ** elem_names;
-  external::ply::PlyFile * in_ply = external::ply::ply_read(ply_file,&nelems,&elem_names);
+  igl::ply::PlyFile * in_ply = igl::ply::ply_read(ply_file,&nelems,&elem_names);
   if(in_ply==NULL)
   {
     return false;
@@ -84,11 +84,11 @@ IGL_INLINE bool igl::readPLY(
 
   bool has_normals = false;
   bool has_texture_coords = false;
-  external::ply::PlyProperty **plist;
+  igl::ply::PlyProperty **plist;
   int nprops;
   int elem_count;
   plist = ply_get_element_description (in_ply,"vertex", &elem_count, &nprops);
-  int native_binary_type = external::ply::get_native_binary_type2();
+  int native_binary_type = igl::ply::get_native_binary_type2();
   if (plist != NULL)
   {
     /* set up for getting vertex elements */
@@ -97,18 +97,18 @@ IGL_INLINE bool igl::readPLY(
     ply_get_property (in_ply,"vertex",&vert_props[2]);
     for (int j = 0; j < nprops; j++)
     {
-      external::ply::PlyProperty * prop = plist[j];
-      if (external::ply::equal_strings ("nx", prop->name) 
-        || external::ply::equal_strings ("ny", prop->name)
-        || external::ply::equal_strings ("nz", prop->name))
+      igl::ply::PlyProperty * prop = plist[j];
+      if (igl::ply::equal_strings ("nx", prop->name) 
+        || igl::ply::equal_strings ("ny", prop->name)
+        || igl::ply::equal_strings ("nz", prop->name))
       {
         ply_get_property (in_ply,"vertex",&vert_props[3]);
         ply_get_property (in_ply,"vertex",&vert_props[4]);
         ply_get_property (in_ply,"vertex",&vert_props[5]);
         has_normals = true;
       }
-      if (external::ply::equal_strings ("s", prop->name) ||
-        external::ply::equal_strings ("t", prop->name))
+      if (igl::ply::equal_strings ("s", prop->name) ||
+        igl::ply::equal_strings ("t", prop->name))
       {
         ply_get_property(in_ply,"vertex",&vert_props[6]);
         ply_get_property(in_ply,"vertex",&vert_props[7]);

+ 5 - 5
include/igl/writePLY.cpp

@@ -56,7 +56,7 @@ IGL_INLINE bool igl::writePLY(
     FScalar *verts;              /* vertex index list */
   } Face;
 
-  external::ply::PlyProperty vert_props[] =
+  igl::ply::PlyProperty vert_props[] =
   { /* list of property information for a vertex */
     {"x", ply_type<VScalar>(), ply_type<VScalar>(),offsetof(Vertex,x),0,0,0,0},
     {"y", ply_type<VScalar>(), ply_type<VScalar>(),offsetof(Vertex,y),0,0,0,0},
@@ -68,7 +68,7 @@ IGL_INLINE bool igl::writePLY(
     {"t", ply_type<UVScalar>(),ply_type<UVScalar>(),offsetof(Vertex,t),0,0,0,0},
   };
 
-  external::ply::PlyProperty face_props[] =
+  igl::ply::PlyProperty face_props[] =
   { /* list of property information for a face */
     {"vertex_indices", ply_type<FScalar>(), ply_type<FScalar>(), 
       offsetof(Face,verts), 1, PLY_UCHAR, PLY_UCHAR, offsetof(Face,nverts)},
@@ -110,14 +110,14 @@ IGL_INLINE bool igl::writePLY(
   {
     return false;
   }
-  external::ply::PlyFile * ply = external::ply::ply_write(fp, 2,elem_names,
+  igl::ply::PlyFile * ply = igl::ply::ply_write(fp, 2,elem_names,
       (ascii ? PLY_ASCII : PLY_BINARY_LE));
   if(ply==NULL)
   {
     return false;
   }
 
-  std::vector<external::ply::PlyProperty> plist;
+  std::vector<igl::ply::PlyProperty> plist;
   plist.push_back(vert_props[0]);
   plist.push_back(vert_props[1]);
   plist.push_back(vert_props[2]);
@@ -137,7 +137,7 @@ IGL_INLINE bool igl::writePLY(
 
   ply_describe_element(ply, "face", F.rows(),1,&face_props[0]);
   ply_header_complete(ply);
-  int native_binary_type = external::ply::get_native_binary_type2();
+  int native_binary_type = igl::ply::get_native_binary_type2();
   ply_put_element_setup(ply, "vertex");
   for(const auto v : vlist)
   {