diff --git a/include/igl/null.cpp b/include/igl/null.cpp index b2291f454..971149266 100644 --- a/include/igl/null.cpp +++ b/include/igl/null.cpp @@ -19,3 +19,7 @@ IGL_INLINE void igl::null( svd.setThreshold(A.cols() * svd.singularValues().maxCoeff() * EPS()); N = svd.matrixV().rightCols(A.cols()-svd.rank()); } + +#ifdef IGL_STATIC_LIBRARY +template void igl::null, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +#endif diff --git a/include/igl/opengl/ViewerData.cpp b/include/igl/opengl/ViewerData.cpp index 8ee13210a..8bfc91fdd 100644 --- a/include/igl/opengl/ViewerData.cpp +++ b/include/igl/opengl/ViewerData.cpp @@ -19,21 +19,22 @@ IGL_INLINE igl::opengl::ViewerData::ViewerData() : dirty(MeshGL::DIRTY_ALL), - show_faces(true), - show_lines(true), - invert_normals(false), - show_overlay(true), - show_overlay_depth(true), - show_vertid(false), - show_faceid(false), - show_texture(false), + // UINT_MAX sets all bits to 1 so these defaults get applied to all view cores + show_faces (UINT_MAX), + show_lines (UINT_MAX), + invert_normals (false), + show_overlay (UINT_MAX), + show_overlay_depth(UINT_MAX), + show_vertid (false), + show_faceid (false), + show_texture (false), point_size(30), line_width(0.5f), line_color(0,0,0,1), label_color(0,0,0.04,1), shininess(35.0f), id(-1), - is_visible(1) + is_visible (UINT_MAX) { clear(); }; diff --git a/include/igl/opengl/ViewerData.h b/include/igl/opengl/ViewerData.h index cd053bfb7..4ce7255ee 100644 --- a/include/igl/opengl/ViewerData.h +++ b/include/igl/opengl/ViewerData.h @@ -97,7 +97,7 @@ public: const Eigen::Matrix& B, const Eigen::Matrix& A); - // Sets points given a list of point vertices. In constrast to `set_points` + // Sets points given a list of point vertices. In constrast to `add_points` // this will (purposefully) clober existing points. // // Inputs: diff --git a/include/igl/opengl/glfw/Viewer.cpp b/include/igl/opengl/glfw/Viewer.cpp index 59b71419c..dcce41a9c 100644 --- a/include/igl/opengl/glfw/Viewer.cpp +++ b/include/igl/opengl/glfw/Viewer.cpp @@ -211,7 +211,10 @@ namespace glfw highdpi = windowWidth/width_window; glfw_window_size(window,width_window,height_window); //opengl.init(); - core().align_camera_center(data().V,data().F); + for(int i=0;i, Eigen::GeneralProduct, Eigen::Matrix, 5> const, Eigen::Replicate, -1, 1> const>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase, Eigen::GeneralProduct, Eigen::Matrix, 5> const, Eigen::Replicate, -1, 1> const> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); // Nonsense template namespace igl{template<> void per_face_normals, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&){} } // generated by autoexplicit.sh diff --git a/include/igl/polar_svd.cpp b/include/igl/polar_svd.cpp index 962a754fb..adf50e8fc 100644 --- a/include/igl/polar_svd.cpp +++ b/include/igl/polar_svd.cpp @@ -16,12 +16,17 @@ template < typename DerivedR, typename DerivedT> IGL_INLINE void igl::polar_svd( - const Eigen::PlainObjectBase & A, + const Eigen::MatrixBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T) { - DerivedA U; - DerivedA V; + typedef + Eigen::Matrix + MatA; + MatA U; + MatA V; Eigen::Matrix S; return igl::polar_svd(A,R,T,U,S,V); } @@ -34,7 +39,7 @@ template < typename DerivedS, typename DerivedV> IGL_INLINE void igl::polar_svd( - const Eigen::PlainObjectBase & A, + const Eigen::MatrixBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T, Eigen::PlainObjectBase & U, @@ -42,7 +47,12 @@ IGL_INLINE void igl::polar_svd( Eigen::PlainObjectBase & V) { using namespace std; - Eigen::JacobiSVD svd; + typedef + Eigen::Matrix + MatA; + Eigen::JacobiSVD svd; svd.compute(A, Eigen::ComputeFullU | Eigen::ComputeFullV ); U = svd.matrixU(); V = svd.matrixV(); @@ -65,16 +75,18 @@ IGL_INLINE void igl::polar_svd( #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(Eigen::PlainObjectBase > const &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +// generated by autoexplicit.sh +template void igl::polar_svd >, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(Eigen::MatrixBase > const &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif diff --git a/include/igl/polar_svd.h b/include/igl/polar_svd.h index 13d3f3873..f0f38e7a1 100644 --- a/include/igl/polar_svd.h +++ b/include/igl/polar_svd.h @@ -33,7 +33,7 @@ namespace igl typename DerivedS, typename DerivedV> IGL_INLINE void polar_svd( - const Eigen::PlainObjectBase & A, + const Eigen::MatrixBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T, Eigen::PlainObjectBase & U, @@ -44,7 +44,7 @@ namespace igl typename DerivedR, typename DerivedT> IGL_INLINE void polar_svd( - const Eigen::PlainObjectBase & A, + const Eigen::MatrixBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T); } diff --git a/include/igl/project.cpp b/include/igl/project.cpp index b1c980b2c..b70a2f722 100644 --- a/include/igl/project.cpp +++ b/include/igl/project.cpp @@ -56,4 +56,6 @@ template Eigen::Matrix igl::project(Eigen::Matrix template Eigen::Matrix igl::project(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&); template void igl::project, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(const Eigen::MatrixBase>&, const Eigen::MatrixBase>&, const Eigen::MatrixBase>&, const Eigen::MatrixBase>&, Eigen::PlainObjectBase>&); template void igl::project, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(const Eigen::MatrixBase>&, const Eigen::MatrixBase>&, const Eigen::MatrixBase>&, const Eigen::MatrixBase>&, Eigen::PlainObjectBase>&); +template void igl::project, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::project, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); #endif diff --git a/include/igl/project.h b/include/igl/project.h index dbb0675e4..4586054d5 100644 --- a/include/igl/project.h +++ b/include/igl/project.h @@ -32,6 +32,10 @@ namespace igl // viewport viewport vector // Outputs: // P #V by 3 list of screen space points + // + // Known issue: + // The compiler will not complain if V and P are Vector3d, but the result + // will be incorrect. template IGL_INLINE void project( const Eigen::MatrixBase& V, diff --git a/include/igl/unproject.cpp b/include/igl/unproject.cpp index 702d77fee..968a44985 100644 --- a/include/igl/unproject.cpp +++ b/include/igl/unproject.cpp @@ -71,4 +71,5 @@ template Eigen::Matrix igl::unproject(Eigen::Matrix template Eigen::Matrix igl::unproject(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&); template void igl::unproject, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); template void igl::unproject, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); +template void igl::unproject, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); #endif diff --git a/include/igl/unproject.h b/include/igl/unproject.h index f34e87513..72b4808cf 100644 --- a/include/igl/unproject.h +++ b/include/igl/unproject.h @@ -20,6 +20,10 @@ namespace igl // viewport 4-long viewport vector // Outputs: // scene #P by 3 or 3-vector (#P=1) the unprojected x, y, and z coordinates + // + // Known issue: + // The compiler will not complain if V and P are Vector3d, but the result + // will be incorrect. template < typename Derivedwin, typename Derivedmodel,