Quellcode durchsuchen

Merge branch 'master' of https://github.com/libigl/libigl

Former-commit-id: 712845e0d4c30c55dca72b6436dff331ccda2cdc
Daniele Panozzo vor 11 Jahren
Ursprung
Commit
084a82810f

+ 3 - 3
include/igl/embree/unproject_in_mesh.cpp

@@ -112,11 +112,11 @@ IGL_INLINE int igl::unproject_in_mesh(
   return hits.size();
 }
 
-#ifndef IGL_OPENLGL_4
 
 #ifdef IGL_STATIC_LIBRARY
+#  ifndef IGL_OPENLGL_4
 template int igl::unproject_in_mesh<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(int, int, igl::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&, std::vector<igl::Hit, std::allocator<igl::Hit> >&);
 template int igl::unproject_in_mesh<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(int, int, igl::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&);
-#endif
-
+#  endif
+template int igl::unproject_in_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::Matrix<float, 2, 1, 0, 2, 1> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, igl::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::vector<igl::Hit, std::allocator<igl::Hit> >&);
 #endif

+ 2 - 1
include/igl/embree/unproject_onto_mesh.cpp

@@ -26,6 +26,7 @@ IGL_INLINE bool igl::unproject_onto_mesh(
   MatrixXd obj;
   vector<igl::Hit> hits;
 
+  // This is lazy, it will find more than just the first hit
   unproject_in_mesh(pos,model,proj,viewport,ei,obj,hits);
 
   if (hits.size()> 0)
@@ -44,5 +45,5 @@ IGL_INLINE bool igl::unproject_onto_mesh(
 
 
 #ifdef IGL_STATIC_LIBRARY
-
+// Explicit template instanciation
 #endif

+ 26 - 25
include/igl/embree/unproject_onto_mesh.h

@@ -17,31 +17,32 @@ namespace igl
 {
   // Forward define
   class EmbreeIntersector;
-
-// Unproject a screen location (using the given model, proj and viewport) to find
-// the first face on the mesh and the closest vertex
-//
-// Inputs:
-//    pos        screen space coordinates
-//    F          #F by 3 face matrix
-//    model      model matrix
-//    proj       projection matrix
-//    viewport   vieweport vector
-//    ei         EmbreeIntersector containing (V,F)
-// Outputs:
-//    fid        id of the first face hit
-//    vid        vertex id of the closest vertex hit
-// Returns true if there is a hit
-IGL_INLINE bool unproject_onto_mesh(
-  const Eigen::Vector2f& pos,
-  const Eigen::MatrixXi& F,
-  const Eigen::Matrix4f& model,
-  const Eigen::Matrix4f& proj,
-  const Eigen::Vector4f& viewport,
-  const igl::EmbreeIntersector & ei,
-  int& fid,
-  int& vid);
-
+  // Unproject a screen location (using the given model, proj and viewport) to find
+  // the first face on the mesh and the closest vertex
+  //
+  // Inputs:
+  //    pos        screen space coordinates
+  //    F          #F by 3 face matrix
+  //    model      model matrix
+  //    proj       projection matrix
+  //    viewport   vieweport vector
+  //    ei         EmbreeIntersector containing (V,F)
+  // Outputs:
+  //    fid        id of the first face hit
+  //    vid        vertex id of the closest vertex hit
+  // Returns true if there is a hit
+  //
+  // Known bugs: This should return the barycentric coordinates in F(fid,:)
+  // rather than vid.
+  IGL_INLINE bool unproject_onto_mesh(
+    const Eigen::Vector2f& pos,
+    const Eigen::MatrixXi& F,
+    const Eigen::Matrix4f& model,
+    const Eigen::Matrix4f& proj,
+    const Eigen::Vector4f& viewport,
+    const igl::EmbreeIntersector & ei,
+    int& fid,
+    int& vid);
 }
 #ifndef IGL_STATIC_LIBRARY
 #  include "unproject_onto_mesh.cpp"

+ 3 - 0
include/igl/lim/lim.h

@@ -13,6 +13,9 @@
 
 namespace igl
 {
+  // Known issues: energy type should be a readable enum rather than magic
+  // ints.
+  //
   // Computes a locally injective mapping of a triangle or tet-mesh based on a deformation energy
   // subject to some provided linear positional constraints Cv-d.
   //

+ 5 - 3
tutorial/602_Matlab/CMakeLists.txt

@@ -10,9 +10,11 @@ set(SOURCES
 ${PROJECT_SOURCE_DIR}/main.cpp
 )
 
-if(APPLE)
-  set(CMAKE_EXE_LINKER_FLAGS "-rpath ${MATLAB_INCLUDE_DIR}/../../bin/maci64"})
-endif (APPLE) #APPLE
+# Alec: This seems like a clang specific thing and also seems to have an extra
+# bracket.
+# if(APPLE)
+#   set(CMAKE_EXE_LINKER_FLAGS "-rpath ${MATLAB_INCLUDE_DIR}/../../bin/maci64"})
+# endif (APPLE) #APPLE
 
 add_executable(${PROJECT_NAME}_bin ${SOURCES} ${SHARED_SOURCES})
 target_link_libraries(${PROJECT_NAME}_bin ${SHARED_LIBRARIES} ${MATLAB_LIBRARIES})

+ 1 - 0
tutorial/602_Matlab/main.cpp

@@ -3,6 +3,7 @@
 #include <igl/viewer/Viewer.h>
 #include <igl/jet.h>
 #include <igl/cotmatrix.h>
+#include <iostream>
 
 // Base mesh
 Eigen::MatrixXd V;

+ 1 - 0
tutorial/CMakeLists.shared

@@ -19,6 +19,7 @@ endif(NOT APPLE)
 
 if(APPLE)
 	set(CMAKE_CXX_LINK_FLAGS "-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
 endif (APPLE) #APPLE
 
 if(UNIX AND NOT APPLE)

+ 1 - 1
tutorial/tutorial.html.REMOVED.git-id

@@ -1 +1 @@
-6715fd5db9f0031963b472976ffb954b743fa68a
+e9a05f57f3704632186380348623deacd0199161