diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..68bc67bc2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,20 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.tex text +*.bib text +*.svg text +*.py text +*.vbs text +*.cpp text +*.hpp text +Makefile text + +# Declare files that will always have CRLF line endings on checkout. +*.sln text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary diff --git a/.gitignore b/.gitignore index 5dff39684..4d291e944 100644 --- a/.gitignore +++ b/.gitignore @@ -18,24 +18,7 @@ examples/*/*.rbr example_static example_header_only example1 -external/yimg/.git* -external/tinyxml2/CMakeFiles* -external/tinyxml2/CMakeCache.txt -external/tinyxml2/cmake_install.cmake -external/tinyxml2/Makefile -external/embree/build/* -external/embree/bin/* -external/embree/bin -external/embree/doc/html/* -external/embree/doc/latex/* -external/gmp -external/cgal -external/cork -external/mpfr -external/boost -external/.cache -external/build -external/pybind11 +/external .DS_Store libigl.zip *tags diff --git a/cmake/LibiglDownloadExternal.cmake b/cmake/LibiglDownloadExternal.cmake index 2a36ed469..73846c749 100644 --- a/cmake/LibiglDownloadExternal.cmake +++ b/cmake/LibiglDownloadExternal.cmake @@ -68,6 +68,14 @@ function(igl_download_embree) ) endfunction() +## glad +function(igl_download_glad) + igl_download_project(glad + GIT_REPOSITORY https://github.com/libigl/libigl-glad.git + GIT_TAG 71e35fe685a0cc160068a2f2f971c40b82d14af0 + ) +endfunction() + ## GLFW function(igl_download_glfw) igl_download_project(glfw @@ -78,13 +86,14 @@ endfunction() ## ImGui function(igl_download_imgui) - download_project( - PROJ imgui - SOURCE_DIR ${LIBIGL_EXTERNAL}/imgui/imgui - DOWNLOAD_DIR ${LIBIGL_EXTERNAL}/.cache/${name} + igl_download_project(imgui GIT_REPOSITORY https://github.com/ocornut/imgui.git GIT_TAG bc6ac8b2aee0614debd940e45bc9cd0d9b355c86 ) + igl_download_project(libigl-imgui + GIT_REPOSITORY https://github.com/libigl/libigl-imgui.git + GIT_TAG a37e6e59e72fb07bd787dc7e90f72b9e1928dae7 + ) endfunction() ## pybind11 @@ -95,6 +104,14 @@ function(igl_download_pybind11) ) endfunction() +## stb_image +function(igl_download_stb) + igl_download_project(stb + GIT_REPOSITORY https://github.com/libigl/libigl-stb.git + GIT_TAG e671ceb3def5e7029a23de14c55dc16301ad4dab + ) +endfunction() + ## TetGen function(igl_download_tetgen) igl_download_project(tetgen @@ -119,7 +136,6 @@ function(igl_download_triangle) ) endfunction() - ## Google test function(igl_download_googletest) igl_download_project(googletest @@ -128,8 +144,6 @@ function(igl_download_googletest) ) endfunction() - - ################################################################################ diff --git a/cmake/libigl.cmake b/cmake/libigl.cmake index 8250b498d..84e928527 100644 --- a/cmake/libigl.cmake +++ b/cmake/libigl.cmake @@ -324,6 +324,7 @@ if(LIBIGL_WITH_OPENGL) # glad module if(NOT TARGET glad) + igl_download_glad() add_subdirectory(${LIBIGL_EXTERNAL}/glad glad) endif() target_link_libraries(igl_opengl ${IGL_SCOPE} glad) @@ -355,7 +356,7 @@ if(LIBIGL_WITH_OPENGL_GLFW_IMGUI) compile_igl_module("opengl/glfw/imgui") if(NOT TARGET imgui) igl_download_imgui() - add_subdirectory(${LIBIGL_EXTERNAL}/imgui imgui) + add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui) endif() target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui) endif() @@ -367,9 +368,9 @@ if(LIBIGL_WITH_PNG) # png/ module is anomalous because it also depends on opengl it really should # be moved into the opengl/ directory and namespace ... if(TARGET igl_opengl) - set(STB_IMAGE_DIR "${LIBIGL_EXTERNAL}/stb_image") if(NOT TARGET stb_image) - add_subdirectory("${STB_IMAGE_DIR}" "stb_image") + igl_download_stb() + add_subdirectory(${LIBIGL_EXTERNAL}/stb stb_image) endif() compile_igl_module("png" "") target_link_libraries(igl_png ${IGL_SCOPE} igl_stb_image igl_opengl) diff --git a/include/igl/cat.cpp b/include/igl/cat.cpp index f297fc135..effa9e1b6 100644 --- a/include/igl/cat.cpp +++ b/include/igl/cat.cpp @@ -1,9 +1,9 @@ // This file is part of libigl, a simple c++ geometry processing library. -// +// // Copyright (C) 2013 Alec Jacobson -// -// 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 +// +// 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 "cat.h" @@ -14,14 +14,14 @@ #include -// Sparse matrices need to be handled carefully. Because C++ does not +// Sparse matrices need to be handled carefully. Because C++ does not // Template: // Scalar sparse matrix scalar type, e.g. double template IGL_INLINE void igl::cat( - const int dim, - const Eigen::SparseMatrix & A, - const Eigen::SparseMatrix & B, + const int dim, + const Eigen::SparseMatrix & A, + const Eigen::SparseMatrix & B, Eigen::SparseMatrix & C) { @@ -108,13 +108,13 @@ IGL_INLINE void igl::cat( } - C = SparseMatrix( + C = SparseMatrix( dim == 1 ? A.rows()+B.rows() : A.rows(), dim == 1 ? A.cols() : A.cols()+B.cols()); C.reserve(A.nonZeros() + B.nonZeros()); C.setFromTriplets(CIJV.begin(),CIJV.end()); #else - C = SparseMatrix( + C = SparseMatrix( dim == 1 ? A.rows()+B.rows() : A.rows(), dim == 1 ? A.cols() : A.cols()+B.cols()); Eigen::VectorXi per_col = Eigen::VectorXi::Zero(C.cols()); @@ -189,7 +189,7 @@ IGL_INLINE void igl::cat( template IGL_INLINE void igl::cat( const int dim, - const Eigen::MatrixBase & A, + const Eigen::MatrixBase & A, const Eigen::MatrixBase & B, MatC & C) { @@ -264,4 +264,5 @@ template Eigen::Matrix igl::cat igl::cat >(int, Eigen::Matrix const&, Eigen::Matrix const&); template void igl::cat, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix&); template void igl::cat, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix&); +template void igl::cat, Eigen::Matrix >(int, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix&); #endif