Эх сурвалжийг харах

get modifiers, fit rigid 2d, templates

Former-commit-id: f11db38d3576a12b772937c7861ccfb67c0995d6
Alec Jacobson 10 жил өмнө
parent
commit
a60d9c69a1

+ 1 - 1
examples/multi-viewport/Makefile

@@ -13,7 +13,7 @@ LIBIGL_INC=-I$(LIBIGL)/include
 LIBIGL_LIB=-L$(LIBIGL)/lib -ligl -liglembree
 
 EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
-CFLAGS+=-std=c++11 -g
+CFLAGS+=-std=c++11 -g -Wno-deprecated-declarations
 
 ANTTWEAKBAR_INC=-I$(LIBIGL)/external/AntTweakBar/include
 ANTTWEAKBAR_LIB=-L$(LIBIGL)/external/AntTweakBar/lib -lAntTweakBar -framework AppKit

+ 17 - 27
examples/multi-viewport/example.cpp

@@ -49,7 +49,6 @@ int width,height;
 igl::Camera down_camera;
 bool trackball_on = false;
 int down_mouse_x,down_mouse_y,move_x,move_y;
-int down_vp;
 // Position of light
 float light_pos[4] = {0.1,0.1,-0.9,0};
 // Vertex positions, normals, colors and centroid
@@ -222,7 +221,7 @@ void display()
   // All smooth points
   glEnable( GL_POINT_SMOOTH );
 
-  // Flash lights
+  // Flashlights
   lights();
   for(int vp = 0;vp<NUM_VIEWPORTS;vp++)
   {
@@ -321,7 +320,6 @@ void display()
   report_gl_error();
 
   glutSwapBuffers();
-  glutPostRedisplay();
 }
 
 // Initialize colors to a boring green
@@ -332,24 +330,6 @@ void init_C()
   C.col(2).setConstant(0.3);
 }
 
-int in_viewport(const int x, const int y)
-{
-  int down_vp = -1;
-  for(int vp = 0;vp<NUM_VIEWPORTS;vp++)
-  {
-    if(
-      x >= viewports[vp].x &&
-      y >= viewports[vp].y &&
-      x <  viewports[vp].x+viewports[vp].width &&
-      y <  viewports[vp].y+viewports[vp].height)
-    {
-      down_vp = vp;
-      break;
-    }
-  }
-  return down_vp;
-}
-
 const double SNAP_DIST = 10;
 void mouse_move(int mouse_x, int mouse_y)
 {
@@ -359,8 +339,10 @@ void mouse_move(int mouse_x, int mouse_y)
   using namespace std;
   move_x = mouse_x;
   move_y = mouse_y;
-  const int in_vp = in_viewport(mouse_x,height-mouse_y);
-  if(in_vp >= 0)
+  const int in_vp = find_if(viewports,viewports+NUM_VIEWPORTS,
+    [&mouse_x,&mouse_y](const AugViewport & vp) -> bool
+    {return vp.inside(mouse_x,height-mouse_y);})-viewports;
+  if(in_vp < NUM_VIEWPORTS)
   {
     if(
       viewports[in_vp].width > 0 &&
@@ -391,6 +373,7 @@ void mouse_move(int mouse_x, int mouse_y)
   {
     glutSetCursor(GLUT_CURSOR_LEFT_ARROW);
   }
+  glutPostRedisplay();
 }
 
 void mouse(int glutButton, int glutState, int mouse_x, int mouse_y)
@@ -422,9 +405,11 @@ void mouse(int glutButton, int glutState, int mouse_x, int mouse_y)
         vert_on = true;
       } else
       {
-        down_vp = in_viewport(mouse_x,height-mouse_y);
+        down_vp = find_if(viewports,viewports+NUM_VIEWPORTS,
+          [&mouse_x,&mouse_y](const AugViewport & vp) -> bool
+          {return vp.inside(mouse_x,height-mouse_y);})-viewports;
         // down
-        if(down_vp >= 0)
+        if(down_vp < NUM_VIEWPORTS)
         {
           glutSetCursor(GLUT_CURSOR_CYCLE);
           // collect information for trackball
@@ -436,6 +421,7 @@ void mouse(int glutButton, int glutState, int mouse_x, int mouse_y)
       }
     break;
   }
+  glutPostRedisplay();
 }
 
 void mouse_drag(int mouse_x, int mouse_y)
@@ -476,6 +462,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       viewports[down_vp].mouse_y(mouse_y,height),
       viewports[down_vp].camera.m_rotation_conj.coeffs().data());
   }
+  glutPostRedisplay();
 }
 
 
@@ -490,8 +477,10 @@ void key(unsigned char key, int mouse_x, int mouse_y)
       exit(0);
     case 'Z':
     {
-      const int in_vp = in_viewport(mouse_x,height-mouse_y);
-      if(in_vp >= 0)
+      const int in_vp = find_if(viewports,viewports+NUM_VIEWPORTS,
+          [&mouse_x,&mouse_y](const AugViewport & vp) -> bool
+          {return vp.inside(mouse_x,height-mouse_y);})-viewports;
+      if(in_vp < NUM_VIEWPORTS)
       {
         igl::snap_to_canonical_view_quat(
           viewports[in_vp].camera.m_rotation_conj.coeffs().data(),
@@ -504,6 +493,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
       cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
   }
 
+  glutPostRedisplay();
 }
 
 int main(int argc, char * argv[])

+ 2 - 0
include/igl/RotateWidget.h

@@ -70,6 +70,8 @@ namespace igl
       inline bool is_down() const;
       inline void draw() const;
       inline void draw_guide() const;
+    public:
+        EIGEN_MAKE_ALIGNED_OPERATOR_NEW
   };
 }
 

+ 7 - 0
include/igl/Viewport.h

@@ -55,6 +55,13 @@ namespace igl
     {
       return mx - x;
     }
+    // Returns whether point (mx,my) is in extend of Viewport
+    bool inside(const int mx, const int my) const
+    {
+      return 
+        mx >= x && my >= y && 
+        mx < x+width && my < y+height;
+    }
   };
 }
 

+ 8 - 1
include/igl/draw_point.cpp

@@ -87,11 +87,18 @@ IGL_INLINE void igl::draw_point(
   const double requested_r,
   const bool selected)
 {
-  return draw_point(P(0),P(1),P(2),requested_r,selected);
+  switch(P.size())
+  {
+    case 2:
+      return draw_point(P(0),P(1),0,requested_r,selected);
+    default:
+      return draw_point(P(0),P(1),P(2),requested_r,selected);
+  }
 }
 
 #ifdef IGL_STATIC_LIBRARY
 template void igl::draw_point<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&, double, bool);
+template void igl::draw_point<Eigen::Matrix<double, 2, 1, 0, 2, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&, double, bool); 
 #endif
 
 #endif

+ 2 - 2
include/igl/file_exists.cpp

@@ -9,8 +9,8 @@
 
 #include <sys/stat.h>
 
-IGL_INLINE bool igl::file_exists(const char* filename)
+IGL_INLINE bool igl::file_exists(const std::string filename)
 {
   struct stat status;
-  return (stat(filename,&status)==0);
+  return (stat(filename.c_str(),&status)==0);
 }

+ 2 - 1
include/igl/file_exists.h

@@ -8,6 +8,7 @@
 #ifndef IGL_FILE_EXISTS_H
 #define IGL_FILE_EXISTS_H
 #include "igl_inline.h"
+#include <string>
 namespace igl
 {
   // Check if a file or directory exists like PHP's file_exists function:
@@ -16,7 +17,7 @@ namespace igl
   //   filename  path to file
   // Returns true if file exists and is readable and false if file doesn't
   // exist or *is not readable*
-  IGL_INLINE bool file_exists(const char * filename);
+  IGL_INLINE bool file_exists(const std::string filename);
 }
 
 #ifndef IGL_STATIC_LIBRARY

+ 25 - 0
include/igl/fit_rigid.cpp

@@ -0,0 +1,25 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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 
+// obtain one at http://mozilla.org/MPL/2.0/.
+#include "fit_rigid.h"
+#include "polar_svd.h"
+
+IGL_INLINE void igl::fit_rigid(
+  const Eigen::MatrixXd & A,
+  const Eigen::MatrixXd & B,
+  Eigen::Rotation2Dd & R,
+  Eigen::RowVector2d & t)
+{
+  // build covariance matrix
+  const auto & Amean = A.colwise().mean();
+  const auto & Bmean = B.colwise().mean();
+  const auto & S = (B.rowwise() - Bmean).transpose() * (A.rowwise() - Amean);
+  Eigen::Matrix2d Rm,Tm;
+  polar_svd(S.eval(),Rm,Tm);
+  R.fromRotationMatrix(Rm);
+  t = Amean - Bmean*Rm;
+}

+ 30 - 0
include/igl/fit_rigid.h

@@ -0,0 +1,30 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
+// 
+// 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 
+// obtain one at http://mozilla.org/MPL/2.0/.
+#ifndef IGL_FIT_RIGID_H
+#define IGL_FIT_RIGID_H
+
+#include "igl_inline.h"
+#include <Eigen/Core>
+#include <Eigen/Geometry>
+
+namespace igl
+{
+  // Fit a rigid 
+  IGL_INLINE void fit_rigid(
+    const Eigen::MatrixXd & A,
+    const Eigen::MatrixXd & B,
+    Eigen::Rotation2Dd & R,
+    Eigen::RowVector2d & t);
+}
+
+#ifndef IGL_STATIC_LIBRARY
+#  include "fit_rigid.cpp"
+#endif
+
+#endif
+

+ 42 - 0
include/igl/get_modifiers.cpp

@@ -0,0 +1,42 @@
+#include "get_modifiers.h"
+
+/* glutGetModifiers return mask. */
+#ifndef GLUT_ACTIVE_SHIFT
+#  define GLUT_ACTIVE_SHIFT 1
+#endif
+#ifndef GLUT_ACTIVE_CTRL
+#  define GLUT_ACTIVE_CTRL 2
+#endif
+#ifndef GLUT_ACTIVE_ALT
+#  define GLUT_ACTIVE_ALT 4
+#endif
+#ifndef GLUT_ACTIVE_COMMAND
+#  define GLUT_ACTIVE_COMMAND 8
+#endif
+
+#ifdef __APPLE__
+#include <Carbon/Carbon.h>
+#endif
+
+IGL_INLINE int igl::get_modifiers()
+{
+  int mod = 0;
+#ifdef __APPLE__
+  // http://stackoverflow.com/a/18082326/148668
+  KeyMap keyStates;
+  const auto & carbon_is_keydown = [&keyStates]( uint16_t vKey )->bool
+  {
+    uint8_t index = vKey / 32 ;
+    uint8_t shift = vKey % 32 ;
+    return keyStates[index].bigEndianValue & (1 << shift) ;
+  };
+  GetKeys(keyStates) ;
+  mod |= (carbon_is_keydown(kVK_Command)?GLUT_ACTIVE_COMMAND:0);
+  mod |= (carbon_is_keydown(kVK_Shift)?GLUT_ACTIVE_SHIFT:0);
+  mod |= (carbon_is_keydown(kVK_Option)?GLUT_ACTIVE_ALT:0);
+  mod |= (carbon_is_keydown(kVK_Control)?GLUT_ACTIVE_CTRL:0);
+#else
+#  error "Not supported.
+#endif
+  return mod;
+}

+ 22 - 0
include/igl/get_modifiers.h

@@ -0,0 +1,22 @@
+#ifndef GET_MODIFIERS_H
+#define GET_MODIFIERS_H
+#include "igl_inline.h"
+namespace igl
+{
+  enum Modifier
+  {
+    MODIFIER_OPTION = 1,
+    MODIFIER_SHIFT = 3,
+    MODIFIER_CONTROL = 5,
+    MODIFIER_COMMAND = 9,
+    NUM_MODIFIERS = 4,
+  };
+  // Retrieve current modifier constellation. 
+  //
+  // Returns int that's an "or" of the active modifiers above.
+  IGL_INLINE int get_modifiers();
+}
+#ifndef IGL_STATIC_LIBRARY
+#include "get_modifiers.cpp"
+#endif
+#endif

+ 1 - 0
include/igl/per_face_normals.cpp

@@ -52,4 +52,5 @@ IGL_INLINE void igl::per_face_normals(
 template void igl::per_face_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_face_normals<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 3, 1, 0, 3, 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, 3, 1, 0, 3, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 template void igl::per_face_normals<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template void igl::per_face_normals<Eigen::Matrix<float, -1, -1, 1, -1, -1>, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1>, Eigen::Matrix<float, -1, -1, 1, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 1, -1, -1> >&);
 #endif

+ 6 - 2
include/igl/png/render_to_png_async.cpp

@@ -39,7 +39,9 @@ static IGL_INLINE bool render_to_png_async_helper(
     }
   }
 
-  return img->save(png_file.c_str(),fast);
+  bool ret = img->save(png_file.c_str(),fast);
+  delete img;
+  return ret;
 }
 
 IGL_INLINE std::thread igl::render_to_png_async(
@@ -61,5 +63,7 @@ IGL_INLINE std::thread igl::render_to_png_async(
     GL_UNSIGNED_BYTE,
     img->data());
   // Part that should be asynchronous  
-  return std::thread(render_to_png_async_helper,img,png_file,alpha,fast);
+  std::thread t(render_to_png_async_helper,img,png_file,alpha,fast);
+  t.detach();
+  return t;
 }

+ 1 - 0
include/igl/polar_svd.cpp

@@ -69,4 +69,5 @@ template void igl::polar_svd<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Ma
 template void igl::polar_svd<Eigen::Matrix<double, 2, 2, 0, 2, 2>, Eigen::Matrix<double, 2, 2, 0, 2, 2>, Eigen::Matrix<double, 2, 2, 0, 2, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >&);
 template void igl::polar_svd<Eigen::Matrix<double, 3, 3, 0, 3, 3>, Eigen::Matrix<double, 3, 3, 0, 3, 3>, Eigen::Matrix<double, 3, 3, 0, 3, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >&);
 template void igl::polar_svd<Eigen::Matrix<float, 2, 2, 0, 2, 2>, Eigen::Matrix<float, 2, 2, 0, 2, 2>, Eigen::Matrix<float, 2, 2, 0, 2, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<float, 2, 2, 0, 2, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 2, 2, 0, 2, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, 2, 2, 0, 2, 2> >&);
+template void igl::polar_svd<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 2, 2, 0, 2, 2>, Eigen::Matrix<double, 2, 2, 0, 2, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >&);
 #endif

+ 2 - 0
include/igl/project.cpp

@@ -147,6 +147,8 @@ template Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > igl::proje
 template Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > igl::project<Eigen::Matrix<double, 1, -1, 1, 1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > const&);
 template int igl::project<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > igl::project<Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&);
+template Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > igl::project<Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&);
+template Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > igl::project<Eigen::Matrix<double, 2, 1, 0, 2, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&);
 #endif
 #endif
 

+ 1 - 0
include/igl/project_to_line.cpp

@@ -123,4 +123,5 @@ template void igl::project_to_line<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eig
 template void igl::project_to_line<double>(double, double, double, double, double, double, double, double, double, double&, double&);
 template void igl::project_to_line<double>(double, double, double, double, double, double, double, double, double, double&, double&,double&,double&, double&);
 template void igl::project_to_line<Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> > >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
+template void igl::project_to_line<Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> > >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
 #endif

+ 1 - 0
include/igl/project_to_line_segment.cpp

@@ -44,4 +44,5 @@ IGL_INLINE void igl::project_to_line_segment(
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
 template void igl::project_to_line_segment<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 1, 0, 1, 1>, Eigen::Matrix<double, 1, 1, 0, 1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
+template void igl::project_to_line_segment<Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, 1, 1, 0, 1, 1>, Eigen::Matrix<double, 1, 1, 0, 1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
 #endif

+ 1 - 0
include/igl/readDMAT.cpp

@@ -205,4 +205,5 @@ template bool igl::readDMAT<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_s
 template bool igl::readDMAT<Eigen::Matrix<double, 4, 1, 0, 4, 1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 1, 0, 4, 1> >&);
 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<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template bool igl::readDMAT<Eigen::Matrix<int, -1, 2, 0, -1, 2> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&);
 #endif