Przeglądaj źródła

comments and templates

Former-commit-id: cced612ab638d3e6d9c066d0f8b9d155b4c99c0e
Alec Jacobson 10 lat temu
rodzic
commit
ec1020c781
2 zmienionych plików z 10 dodań i 10 usunięć
  1. 4 4
      include/igl/boundary_facets.h
  2. 6 6
      include/igl/readPLY.cpp

+ 4 - 4
include/igl/boundary_facets.h

@@ -5,8 +5,8 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_BOUNDARY_FACES_H
-#define IGL_BOUNDARY_FACES_H
+#ifndef IGL_BOUNDARY_FACETS_H
+#define IGL_BOUNDARY_FACETS_H
 #include "igl_inline.h"
 #include "igl_inline.h"
 
 
 #ifndef IGL_NO_EIGEN
 #ifndef IGL_NO_EIGEN
@@ -17,8 +17,8 @@
 
 
 namespace igl
 namespace igl
 {
 {
-  // BOUNDARY_FACES Determine boundary faces (edges) of tetrahedra (triangles)
-  // stored in T
+  // BOUNDARY_FACETS Determine boundary faces (edges) of tetrahedra (triangles)
+  // stored in T (analogous to qptoolbox's `outline` and `boundary_faces`).
   //
   //
   // Templates:
   // Templates:
   //   IntegerT  integer-value: e.g. int
   //   IntegerT  integer-value: e.g. int

+ 6 - 6
include/igl/readPLY.cpp

@@ -24,7 +24,6 @@ IGL_INLINE bool igl::readPLY(
 {
 {
   using namespace std;
   using namespace std;
   // Largely follows ply2iv.c
   // Largely follows ply2iv.c
-  PlyOtherProp *vert_other,*face_other;
 
 
    typedef struct Vertex {
    typedef struct Vertex {
      double x,y,z;          /* position */
      double x,y,z;          /* position */
@@ -54,7 +53,6 @@ IGL_INLINE bool igl::readPLY(
     {"vertex_indices", PLY_INT, PLY_INT, offsetof(Face,verts),
     {"vertex_indices", PLY_INT, PLY_INT, offsetof(Face,verts),
       1, PLY_UCHAR, PLY_UCHAR, offsetof(Face,nverts)},
       1, PLY_UCHAR, PLY_UCHAR, offsetof(Face,nverts)},
   };
   };
-  char * elem_name;
   FILE * fp = fopen(filename.c_str(),"r");
   FILE * fp = fopen(filename.c_str(),"r");
   if(fp == NULL)
   if(fp == NULL)
   {
   {
@@ -80,7 +78,7 @@ IGL_INLINE bool igl::readPLY(
     ply_get_property (in_ply,"vertex",&vert_props[0]);
     ply_get_property (in_ply,"vertex",&vert_props[0]);
     ply_get_property (in_ply,"vertex",&vert_props[1]);
     ply_get_property (in_ply,"vertex",&vert_props[1]);
     ply_get_property (in_ply,"vertex",&vert_props[2]);
     ply_get_property (in_ply,"vertex",&vert_props[2]);
-    for (size_t j = 0; j < nprops; j++)
+    for (int j = 0; j < nprops; j++)
     {
     {
       PlyProperty * prop = plist[j];
       PlyProperty * prop = plist[j];
       if (equal_strings ("nx", prop->name) 
       if (equal_strings ("nx", prop->name) 
@@ -100,7 +98,8 @@ IGL_INLINE bool igl::readPLY(
         has_texture_coords = true;
         has_texture_coords = true;
       }
       }
     }
     }
-    vert_other = ply_get_other_properties(in_ply,"vertex",
+    // Is this call necessary?
+    ply_get_other_properties(in_ply,"vertex",
 				     offsetof(Vertex,other_props));
 				     offsetof(Vertex,other_props));
     V.resize(elem_count,std::vector<Vtype>(3));
     V.resize(elem_count,std::vector<Vtype>(3));
     if(has_normals)
     if(has_normals)
@@ -117,7 +116,7 @@ IGL_INLINE bool igl::readPLY(
     {
     {
       UV.resize(0);
       UV.resize(0);
     }
     }
-    for(size_t j = 0;j<elem_count;j++)
+    for(int j = 0;j<elem_count;j++)
     {
     {
       Vertex v;
       Vertex v;
       ply_get_element_setup(in_ply,"vertex",3,vert_props);
       ply_get_element_setup(in_ply,"vertex",3,vert_props);
@@ -143,7 +142,7 @@ IGL_INLINE bool igl::readPLY(
   {
   {
     F.resize(elem_count);
     F.resize(elem_count);
     ply_get_property(in_ply,"face",&face_props[0]);
     ply_get_property(in_ply,"face",&face_props[0]);
-    for (size_t j = 0; j < elem_count; j++) 
+    for (int j = 0; j < elem_count; j++) 
     {
     {
       Face f;
       Face f;
       ply_get_element(in_ply, (void *) &f);
       ply_get_element(in_ply, (void *) &f);
@@ -187,4 +186,5 @@ IGL_INLINE bool igl::readPLY(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
 // Explicit template specialization
+template bool igl::readPLY<double, int, double, double>(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&);
 #endif
 #endif