Parcourir la source

merger

Former-commit-id: cb00923d4a4f23be4fbb415dc47280bba324769f
Alec Jacobson (jalec il y a 12 ans
Parent
commit
8e9a234e4d

+ 1 - 1
include/igl/ReAntTweakBar.cpp

@@ -44,7 +44,7 @@ namespace igl
     const char * type_str;
   };
 
-  #define RETW_NUM_DEFAULT_TYPE_STRINGS 24
+  #define RETW_NUM_DEFAULT_TYPE_STRINGS 23
   ReTwTypeString ReTwDefaultTypeStrings[RETW_NUM_DEFAULT_TYPE_STRINGS] = 
   {
     {TW_TYPE_UNDEF,"TW_TYPE_UNDEF"},

+ 1 - 0
include/igl/diag.cpp

@@ -92,4 +92,5 @@ IGL_INLINE void igl::diag(
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
 template void igl::diag<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template void igl::diag<double>(Eigen::SparseMatrix<double, 0, int> const&, Eigen::SparseVector<double, 0, int>&);
 #endif

+ 169 - 0
include/igl/draw_mesh.cpp

@@ -0,0 +1,169 @@
+#include "draw_mesh.h"
+
+IGL_INLINE void igl::draw_mesh(
+  const Eigen::MatrixXd & V,
+  const Eigen::MatrixXi & F,
+  const Eigen::MatrixXd & N)
+{
+  glBegin(GL_TRIANGLES);
+  // loop over faces
+  for(int i = 0; i<F.rows();i++)
+  {
+    // loop over corners of triangle
+    for(int j = 0;j<3;j++)
+    {
+      glNormal3d(N(F(i,j),0),N(F(i,j),1),N(F(i,j),2));
+      glVertex3d(V(F(i,j),0),V(F(i,j),1),V(F(i,j),2));
+    }
+  }
+  glEnd();
+}
+
+IGL_INLINE void igl::draw_mesh(
+  const Eigen::MatrixXd & V,
+  const Eigen::MatrixXi & F,
+  const Eigen::MatrixXd & N,
+  const Eigen::MatrixXd & C)
+{
+  glBegin(GL_TRIANGLES);
+  // loop over faces
+  for(int i = 0; i<F.rows();i++)
+  {
+    // loop over corners of triangle
+    for(int j = 0;j<3;j++)
+    {
+      glColor3d(C(F(i,j),0),C(F(i,j),1),C(F(i,j),2));
+      glNormal3d(N(F(i,j),0),N(F(i,j),1),N(F(i,j),2));
+      glVertex3d(V(F(i,j),0),V(F(i,j),1),V(F(i,j),2));
+    }
+  }
+  glEnd();
+}
+
+IGL_INLINE void igl::draw_mesh(
+  const Eigen::MatrixXd & V,
+  const Eigen::MatrixXi & F,
+  const Eigen::MatrixXd & N,
+  const Eigen::MatrixXd & C,
+  const Eigen::MatrixXd & TC,
+  const Eigen::MatrixXd & W,
+  const GLuint W_index,
+  const Eigen::MatrixXi & WI,
+  const GLuint WI_index)
+{
+  using namespace std;
+  if(F.size() > 0)
+  {
+    assert(F.maxCoeff() < V.rows());
+    assert(V.cols() == 3);
+    assert(C.rows() == V.rows() || C.rows() == F.rows()*3 || C.size() == 0);
+    assert(TC.rows() == V.rows() || TC.rows() == F.rows()*3 || TC.size() == 0);
+    assert(C.cols() == 3 || C.size() == 0);
+    assert(
+      N.rows() == V.rows() || N.rows() == F.rows()*3 || N.rows() ==F.rows());
+    assert(N.cols() == 3);
+  }
+  if(W.size()>0)
+  {
+    assert(W.rows() == V.rows());
+    assert(WI.rows() == V.rows());
+    assert(W.cols() == WI.cols());
+  }
+
+  glBegin(GL_TRIANGLES);
+  // loop over faces
+  for(int i = 0; i<F.rows();i++)
+  {
+    // loop over corners of triangle
+    for(int j = 0;j<3;j++)
+    {
+      if(W.size()>0 && W_index !=0 && WI_index != 0)
+      {
+        int weights_left = W.cols();
+        while(weights_left != 0)
+        {
+          int pass_size = std::min(4,weights_left);
+          int weights_already_passed = W.cols()-weights_left;
+          // Get attribute location of next 4 weights
+          int pass_W_index = W_index + weights_already_passed/4;
+          int pass_WI_index = WI_index + weights_already_passed/4;
+          switch(pass_size)
+          {
+            case 1:
+              glVertexAttrib1d(
+                pass_W_index,
+                W(F(i,j),0+weights_already_passed));
+              glVertexAttrib1d(
+                pass_WI_index,
+                WI(F(i,j),0+weights_already_passed));
+              break;
+            case 2:
+              glVertexAttrib2d(
+                pass_W_index,
+                W(F(i,j),0+weights_already_passed),
+                W(F(i,j),1+weights_already_passed));
+              glVertexAttrib2d(
+                pass_WI_index,
+                WI(F(i,j),0+weights_already_passed),
+                WI(F(i,j),1+weights_already_passed));
+              break;
+            case 3:
+              glVertexAttrib3d(
+                pass_W_index,
+                W(F(i,j),0+weights_already_passed),
+                W(F(i,j),1+weights_already_passed),
+                W(F(i,j),2+weights_already_passed));
+              glVertexAttrib3d(
+                pass_WI_index,
+                WI(F(i,j),0+weights_already_passed),
+                WI(F(i,j),1+weights_already_passed),
+                WI(F(i,j),2+weights_already_passed));
+              break;
+            default:
+              glVertexAttrib4d(
+                pass_W_index,
+                W(F(i,j),0+weights_already_passed),
+                W(F(i,j),1+weights_already_passed),
+                W(F(i,j),2+weights_already_passed),
+                W(F(i,j),3+weights_already_passed));
+              glVertexAttrib4d(
+                pass_WI_index,
+                WI(F(i,j),0+weights_already_passed),
+                WI(F(i,j),1+weights_already_passed),
+                WI(F(i,j),2+weights_already_passed),
+                WI(F(i,j),3+weights_already_passed));
+              break;
+          }
+          weights_left -= pass_size;
+        }
+      }
+      if(TC.rows() == V.rows())
+      {
+        glTexCoord2d(TC(F(i,j),0),TC(F(i,j),1));
+      }else if(TC.rows() == F.rows()*3)
+      {
+        glTexCoord2d(TC(F(i,j),0),TC(F(i,j),1));
+      }
+      if(C.rows() == V.rows())
+      {
+        glColor3d(C(F(i,j),0),C(F(i,j),1),C(F(i,j),2));
+      }else if(C.rows() == F.rows()*3)
+      {
+        glColor3d(C(i*3+j,0), C(i*3+j,1), C(i*3+j,2));
+      }
+      if(N.rows() == V.rows())
+      {
+        glNormal3d(N(F(i,j),0),N(F(i,j),1),N(F(i,j),2));
+      }else if(N.rows() == F.rows()*3)
+      {
+        glNormal3d(N(i*3+j,0),N(i*3+j,1),N(i*3+j,2));
+      }else if(N.rows() == F.rows())
+      {
+        glNormal3d(N(i,0),N(i,1),N(i,2));
+      }
+      glVertex3d(V(F(i,j),0),V(F(i,j),1),V(F(i,j),2));
+    }
+  }
+  glEnd();
+}
+

+ 76 - 0
include/igl/draw_mesh.h

@@ -0,0 +1,76 @@
+#ifndef IGL_DRAW_MESH_H
+#define IGL_DRAW_MESH_H
+#include "igl_inline.h"
+
+#include <Eigen/Dense>
+
+#if __APPLE__
+#  include <OpenGL/gl.h>
+#else
+#  ifdef _WIN32
+#    define NOMINMAX
+#    include <Windows.h>
+#    undef NOMINMAX
+#  endif
+#  include <GL/gl.h>
+#endif
+
+namespace igl
+{
+  // Draw OpenGL commands needed to display a mesh with normals
+  //
+  // Inputs:
+  //   V  #V by 3 eigen Matrix of mesh vertex 3D positions
+  //   F  #F by 3 eigne Matrix of face (triangle) indices
+  //   N  #V by 3 eigen Matrix of mesh vertex 3D normals
+  IGL_INLINE void draw_mesh(
+    const Eigen::MatrixXd & V,
+    const Eigen::MatrixXi & F,
+    const Eigen::MatrixXd & N);
+  
+  // Draw OpenGL commands needed to display a mesh with normals and per-vertex
+  // colors
+  //
+  // Inputs:
+  //   V  #V by 3 eigen Matrix of mesh vertex 3D positions
+  //   F  #F by 3 eigne Matrix of face (triangle) indices
+  //   N  #V by 3 eigen Matrix of mesh vertex 3D normals
+  //   C  #V by 3 eigen Matrix of mesh vertex RGB colors
+  IGL_INLINE void draw_mesh(
+    const Eigen::MatrixXd & V,
+    const Eigen::MatrixXi & F,
+    const Eigen::MatrixXd & N,
+    const Eigen::MatrixXd & C);
+  
+  // Draw OpenGL commands needed to display a mesh with normals, per-vertex
+  // colors and LBS weights
+  //
+  // Inputs:
+  //   V  #V by 3 eigen Matrix of mesh vertex 3D positions
+  //   F  #F by 3 eigne Matrix of face (triangle) indices
+  //   N  #V by 3 eigen Matrix of mesh vertex 3D normals
+  //   TC  #V by 3 eigen Matrix of mesh vertex UC coorindates between 0 and 1
+  //   C  #V by 3 eigen Matrix of mesh vertex RGB colors
+  //   W  #V by #H eigen Matrix of per mesh vertex, per handle weights
+  //   W_index  Specifies the index of the "weight" vertex attribute: see
+  //     glBindAttribLocation, if W_index is 0 then weights are ignored
+  //   WI  #V by #H eigen Matrix of per mesh vertex, per handle weight ids
+  //   WI_index  Specifies the index of the "weight" vertex attribute: see
+  //     glBindAttribLocation, if WI_index is 0 then weight indices are ignored
+  IGL_INLINE void draw_mesh(
+    const Eigen::MatrixXd & V,
+    const Eigen::MatrixXi & F,
+    const Eigen::MatrixXd & N,
+    const Eigen::MatrixXd & C,
+    const Eigen::MatrixXd & TC,
+    const Eigen::MatrixXd & W,
+    const GLuint W_index,
+    const Eigen::MatrixXi & WI,
+    const GLuint WI_index);
+}
+
+#ifdef IGL_HEADER_ONLY
+#  include "draw_mesh.cpp"
+#endif
+
+#endif

+ 4 - 4
include/igl/is_border_vertex.cpp

@@ -3,10 +3,10 @@
 
 #include "tt.h"
 
-template<typename T, typename S>
-IGL_INLINE std::vector<bool> igl::is_border_vertex(const T& V, const Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic>& F)
+template <typename DerivedV, typename DerivedF>
+IGL_INLINE std::vector<bool> igl::is_border_vertex(const Eigen::PlainObjectBase<DerivedV> &V, const Eigen::PlainObjectBase<DerivedF> &F)
 {
-  Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> FF;
+  Eigen::PlainObjectBase<DerivedF> FF;
   igl::tt(V,F,FF);
   std::vector<bool> ret(V.rows());
   for(unsigned i=0; i<ret.size();++i)
@@ -17,7 +17,7 @@ IGL_INLINE std::vector<bool> igl::is_border_vertex(const T& V, const Eigen::Matr
       if(FF(i,j) == -1)
       {
         ret[F(i,j)]       = true;
-        ret[F(i,(j+1)%3)] = true;
+        ret[F(i,(j+1)%F.cols())] = true;
       }
   return ret;
 }

+ 3 - 3
include/igl/is_border_vertex.h

@@ -12,9 +12,9 @@
 
 namespace igl 
 {
-  template<typename T, typename S>
-  IGL_INLINE std::vector<bool> is_border_vertex(const T& V,
-                                                const Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic>& F);
+  template <typename DerivedV, typename DerivedF>
+  IGL_INLINE std::vector<bool> is_border_vertex(const Eigen::PlainObjectBase<DerivedV> &V,
+                                                const Eigen::PlainObjectBase<DerivedF> &F);
 }
 
 #ifdef IGL_HEADER_ONLY

+ 27 - 10
include/igl/per_corner_normals.cpp

@@ -6,10 +6,10 @@
 
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE void igl::per_corner_normals(
-                                   const Eigen::PlainObjectBase<DerivedV>& V,
-                                   const Eigen::PlainObjectBase<DerivedF>& F,
-                                   const double corner_threshold,
-                                   Eigen::PlainObjectBase<DerivedV> & CN)
+  const Eigen::PlainObjectBase<DerivedV>& V,
+  const Eigen::PlainObjectBase<DerivedF>& F,
+  const double corner_threshold,
+  Eigen::PlainObjectBase<DerivedV> & CN)
 {
   using namespace igl;
   using namespace Eigen;
@@ -21,14 +21,30 @@ IGL_INLINE void igl::per_corner_normals(
   return per_corner_normals(V,F,FN,VF,corner_threshold,CN);
 }
 
+template <typename DerivedV, typename DerivedF, typename DerivedFN, typename DerivedCN>
+IGL_INLINE void igl::per_corner_normals(
+  const Eigen::PlainObjectBase<DerivedV>& V,
+  const Eigen::PlainObjectBase<DerivedF>& F,
+  const Eigen::PlainObjectBase<DerivedFN>& FN,
+  const double corner_threshold,
+  Eigen::PlainObjectBase<DerivedCN> & CN)
+{
+  using namespace igl;
+  using namespace Eigen;
+  using namespace std;
+  vector<vector<int> > VF,VFi;
+  vf(V,F,VF,VFi);
+  return per_corner_normals(V,F,FN,VF,corner_threshold,CN);
+}
+
 template <typename DerivedV, typename DerivedF, typename IndexType>
 IGL_INLINE void igl::per_corner_normals(
-                                   const Eigen::PlainObjectBase<DerivedV>& /*V*/,
-                                   const Eigen::PlainObjectBase<DerivedF>& F,
-                                   const Eigen::PlainObjectBase<DerivedV>& FN,
-                                   const std::vector<std::vector<IndexType> >& VF,
-                                   const double corner_threshold,
-                                   Eigen::PlainObjectBase<DerivedV> & CN)
+  const Eigen::PlainObjectBase<DerivedV>& /*V*/,
+  const Eigen::PlainObjectBase<DerivedF>& F,
+  const Eigen::PlainObjectBase<DerivedV>& FN,
+  const std::vector<std::vector<IndexType> >& VF,
+  const double corner_threshold,
+  Eigen::PlainObjectBase<DerivedV> & CN)
 {
   using namespace igl;
   using namespace Eigen;
@@ -77,4 +93,5 @@ IGL_INLINE void igl::per_corner_normals(
 // generated by autoexplicit.sh
 template void igl::per_corner_normals<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&, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 template void igl::per_corner_normals<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1>, unsigned int>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, std::vector<std::vector<unsigned int, std::allocator<unsigned int> >, std::allocator<std::vector<unsigned int, std::allocator<unsigned int> > > > const&, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&);
+template void igl::per_corner_normals<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<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&, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif

+ 18 - 10
include/igl/per_corner_normals.h

@@ -16,21 +16,29 @@ namespace igl
   //     for corner F(i,j) is at CN(i*3+j,:) 
   template <typename DerivedV, typename DerivedF>
   IGL_INLINE void per_corner_normals(
-                                     const Eigen::PlainObjectBase<DerivedV>& V,
-                                     const Eigen::PlainObjectBase<DerivedF>& F,
-                                     const double corner_threshold,
-                                     Eigen::PlainObjectBase<DerivedV> & CN);
+    const Eigen::PlainObjectBase<DerivedV>& V,
+    const Eigen::PlainObjectBase<DerivedF>& F,
+    const double corner_threshold,
+    Eigen::PlainObjectBase<DerivedV> & CN);
   // Other Inputs:
   //   FN  #F by 3 eigen Matrix of face normals
+  template <typename DerivedV, typename DerivedF, typename DerivedFN, typename DerivedCN>
+  IGL_INLINE void per_corner_normals(
+    const Eigen::PlainObjectBase<DerivedV>& V,
+    const Eigen::PlainObjectBase<DerivedF>& F,
+    const Eigen::PlainObjectBase<DerivedFN>& FN,
+    const double corner_threshold,
+    Eigen::PlainObjectBase<DerivedCN> & CN);
+  // Other Inputs:
   //   VF  map from vertices to list of incident faces
   template <typename DerivedV, typename DerivedF, typename IndexType>
   IGL_INLINE void per_corner_normals(
-                                     const Eigen::PlainObjectBase<DerivedV>& V,
-                                     const Eigen::PlainObjectBase<DerivedF>& F,
-                                     const Eigen::PlainObjectBase<DerivedV>& FN,
-                                     const std::vector<std::vector<IndexType> >& VF,
-                                     const double corner_threshold,
-                                     Eigen::PlainObjectBase<DerivedV> & CN);
+    const Eigen::PlainObjectBase<DerivedV>& V,
+    const Eigen::PlainObjectBase<DerivedF>& F,
+    const Eigen::PlainObjectBase<DerivedV>& FN,
+    const std::vector<std::vector<IndexType> >& VF,
+    const double corner_threshold,
+    Eigen::PlainObjectBase<DerivedV> & CN);
 }
 
 #ifdef IGL_HEADER_ONLY

+ 1 - 0
include/igl/per_vertex_normals.cpp

@@ -55,4 +55,5 @@ IGL_INLINE void igl::per_vertex_normals(
 // generated by autoexplicit.sh
 template void igl::per_vertex_normals<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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 template void igl::per_vertex_normals<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&);
+template void igl::per_vertex_normals<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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif

+ 1 - 0
include/igl/readDMAT.cpp

@@ -164,4 +164,5 @@ IGL_INLINE bool igl::readDMAT(
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
 template bool igl::readDMAT<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::readDMAT<double>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&);
 #endif

+ 4 - 4
include/igl/tt.cpp

@@ -9,11 +9,11 @@ IGL_INLINE void igl::tt_preprocess(const Eigen::PlainObjectBase<DerivedV>& /*V*/
                                    std::vector<std::vector<int> >& TTT)
 {
   for(int f=0;f<F.rows();++f)
-    for (int i=0;i<3;++i)
+    for (int i=0;i<F.cols();++i)
     {
       // v1 v2 f ei 
       int v1 = F(f,i);
-      int v2 = F(f,(i+1)%3);
+      int v2 = F(f,(i+1)%F.cols());
       if (v1 > v2) std::swap(v1,v2);
       std::vector<int> r(4);
       r[0] = v1; r[1] = v2;
@@ -29,7 +29,7 @@ IGL_INLINE void igl::tt_extractTT(const Eigen::PlainObjectBase<DerivedF>& F,
                                   std::vector<std::vector<int> >& TTT,
                                   Eigen::PlainObjectBase<DerivedTT>& TT)
 {
-  TT = Eigen::PlainObjectBase<DerivedTT>::Constant((int)(F.rows()),3,-1);
+  TT = Eigen::PlainObjectBase<DerivedTT>::Constant((int)(F.rows()),F.cols(),-1);
   
   for(int i=1;i<(int)TTT.size();++i)
   {
@@ -49,7 +49,7 @@ IGL_INLINE void igl::tt_extractTTi(const Eigen::PlainObjectBase<DerivedF>& F,
                                    std::vector<std::vector<int> >& TTT,
                                    Eigen::PlainObjectBase<DerivedTT>& TTi)
 {
-  TTi = Eigen::PlainObjectBase<DerivedTT>::Constant((int)(F.rows()),3,-1);
+  TTi = Eigen::PlainObjectBase<DerivedTT>::Constant((int)(F.rows()),F.cols(),-1);
   
   for(int i=1;i<(int)TTT.size();++i)
   {

+ 4 - 3
include/igl/writeDMAT.cpp

@@ -46,8 +46,8 @@ IGL_INLINE bool igl::writeDMAT(
   {
     num_cols = W[0].size();
   }
-  // first line contains number of rows and number of columns
-  fprintf(fp,"%d %d\n",num_rows,num_cols);
+  // first line contains number of columns and number of rows
+  fprintf(fp,"%d %d\n",num_cols,num_rows);
   // Loop over columns slowly
   for(int j = 0;j < num_cols;j++)
   {
@@ -55,7 +55,7 @@ IGL_INLINE bool igl::writeDMAT(
     for(int i = 0;i < num_rows;i++)
     {
       // better be rectangular
-      assert(W[i].size() > j);
+      assert((int)W[i].size() > j);
       fprintf(fp,"%0.15lf\n",(double)W[i][j]);
     }
   }
@@ -67,4 +67,5 @@ IGL_INLINE bool igl::writeDMAT(
 // Explicit template specialization
 // generated by autoexplicit.sh
 template bool igl::writeDMAT<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&);
+template bool igl::writeDMAT<double>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >);
 #endif

+ 117 - 0
style.css

@@ -0,0 +1,117 @@
+table
+{
+  border-spacing: 0px;
+}
+tr.header th
+{
+  border-bottom: 1px solid; 
+  background-color: #ffb;
+  padding-left: 10px;
+  padding-right: 20px;
+}
+tr.d0 td 
+{
+  background-color: #EEE; 
+  color: black;
+  padding-left: 10px;
+  padding-right: 20px;
+  min-width: 200px;
+}
+tr.d1 td
+{
+  background-color: #bcf; 
+  color: black;
+  padding-left: 10px;
+  padding-right: 20px;
+  min-width: 200px;
+}
+
+tr.gotcha1 td
+{
+  background-color: #fcb;
+  color: black;
+  padding-left: 10px;
+  padding-right: 20px;
+  min-width: 200px;
+}
+
+tr.gotcha2 td
+{
+  background-color: #fed;
+  color: black;
+  padding-left: 10px;
+  padding-right: 20px;
+  min-width: 200px;
+}
+/* Don't color pre tag like a box when it shows up in table */
+tr pre
+{
+  background-color: inherit;
+  overflow: auto;
+  padding: none;
+  border: none;
+}
+
+.note:before
+{
+  font-style: normal;
+  content: "Note: ";
+}
+.note
+{
+  background-color: #ddd;
+  border: 1px solid #bbb;
+  margin-top: 2px;
+  margin-bottom: 2px;
+  font-style: italic;
+  padding-left: 4px;
+  padding-right: 4px;
+  padding-top: 2px;
+  padding-bottom: 2px;
+}
+span.highlight
+{
+  background-color: #4F5;
+}
+a 
+{
+  text-decoration:none;
+  border:none;
+  outline:none;
+  color:#0645AD;
+}
+a:hover 
+{
+  color:#0645AD;
+  text-decoration: underline;
+}
+a:visited
+{
+  color:#0b0080;
+}
+span.todo:before
+{
+  font-style: normal;
+  content: "TODO: ";
+}
+span.todo
+{
+  color: #F54;
+  font-style: italic;
+}
+pre
+{
+  background-color: #c3e0f0;
+  overflow: auto;
+  padding-left: 8px;
+  padding-right: 8px;
+  padding-top: 4px;
+  padding-bottom: 4px;
+  border: 1px solid #999;
+}
+img.center
+{
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+}