Browse Source

Merge commit '101530fe1747ca75aa9e4af7e0aa6e21c84af3af [formerly d3a6db8e55aafd00c3e13d37c0b66c0c74d1322f]'

Conflicts:
	include/igl/slice.cpp

Former-commit-id: 84da7b985a6032f1738afa0df56ac21a9107347c
Daniele Panozzo 10 years ago
parent
commit
03fcfb23e5

+ 2 - 0
.gitignore

@@ -73,3 +73,5 @@ external/libpng/build
 external/tinyxml2/build
 external/tinyxml2/build
 optional/build
 optional/build
 lib
 lib
+tutorial/XXX_test/CMakeLists.txt
+tutorial/XXX_test/main.cpp

+ 1 - 0
include/igl/slice.cpp

@@ -251,6 +251,7 @@ template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > igl::sl
 template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > igl::slice<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > igl::slice<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > igl::slice<Eigen::Matrix<double, 1, -1, 1, 1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > igl::slice<Eigen::Matrix<double, 1, -1, 1, 1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > igl::slice<Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > igl::slice<Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
+template void igl::slice<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
 template void igl::slice<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 template void igl::slice<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 template void igl::slice<Eigen::SparseMatrix<double, 0, int>, Eigen::SparseMatrix<double, 0, int> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::SparseMatrix<double, 0, int>&);
 template void igl::slice<Eigen::SparseMatrix<double, 0, int>, Eigen::SparseMatrix<double, 0, int> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::SparseMatrix<double, 0, int>&);
 template void igl::slice<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::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template void igl::slice<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::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);

+ 1 - 1
tutorial/705_Integrable/CMakeLists.txt → tutorial/510_Integrable/CMakeLists.txt

@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.6)
 cmake_minimum_required(VERSION 2.6)
-project(705_Integrable)
+project(510_Integrable)
 
 
 include("../CMakeLists.shared")
 include("../CMakeLists.shared")
 
 

+ 23 - 14
tutorial/705_Integrable/main.cpp → tutorial/510_Integrable/main.cpp

@@ -238,15 +238,14 @@ void drawCuts(igl::viewer::Viewer& viewer,
 }
 }
 
 
 void drawField(igl::viewer::Viewer &viewer,
 void drawField(igl::viewer::Viewer &viewer,
-               const Eigen::MatrixXd &field)
+               const Eigen::MatrixXd &field,
+               const Eigen::RowVector3d &color)
 {
 {
   for (int n=0; n<2; ++n)
   for (int n=0; n<2; ++n)
   {
   {
     Eigen::MatrixXd VF = field.block(0,n*3,F.rows(),3);
     Eigen::MatrixXd VF = field.block(0,n*3,F.rows(),3);
     Eigen::VectorXd c = VF.rowwise().norm();
     Eigen::VectorXd c = VF.rowwise().norm();
-    Eigen::MatrixXd C2;
-    igl::jet(c,1,1+rand_factor,C2);
-    viewer.data.add_edges(B - global_scale*VF, B + global_scale*VF , C2);
+    viewer.data.add_edges(B - global_scale*VF, B + global_scale*VF , color);
   }
   }
 }
 }
 
 
@@ -335,7 +334,8 @@ void update_display(igl::viewer::Viewer& viewer)
     drawConstraints(viewer);
     drawConstraints(viewer);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv_ori);
+    Eigen::RowVector3d color; color<<0,0,1;
+    drawField(viewer,two_pv_ori,color);
 
 
     // Draw Cuts
     // Draw Cuts
     drawCuts(viewer,cuts_ori);
     drawCuts(viewer,cuts_ori);
@@ -362,7 +362,8 @@ void update_display(igl::viewer::Viewer& viewer)
     drawConstraints(viewer);
     drawConstraints(viewer);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv);
+    Eigen::RowVector3d color; color<<0,0,1;
+    drawField(viewer,two_pv,color);
 
 
     // Draw Cuts
     // Draw Cuts
     drawCuts(viewer,cuts);
     drawCuts(viewer,cuts);
@@ -382,7 +383,8 @@ void update_display(igl::viewer::Viewer& viewer)
     viewer.data.set_colors(C);
     viewer.data.set_colors(C);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv_ori);
+    Eigen::RowVector3d color; color<<1,1,1;
+    drawField(viewer,two_pv_ori,color);
 
 
   }
   }
 
 
@@ -396,7 +398,8 @@ void update_display(igl::viewer::Viewer& viewer)
     viewer.data.set_colors(C);
     viewer.data.set_colors(C);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv);
+    Eigen::RowVector3d color; color<<1,1,1;
+    drawField(viewer,two_pv,color);
   }
   }
 
 
   if (display_mode == 5)
   if (display_mode == 5)
@@ -409,7 +412,8 @@ void update_display(igl::viewer::Viewer& viewer)
     viewer.data.set_colors(C);
     viewer.data.set_colors(C);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv_poisson_ori);
+    Eigen::RowVector3d color; color<<1,1,1;
+    drawField(viewer,two_pv_poisson_ori,color);
   }
   }
 
 
   if (display_mode == 6)
   if (display_mode == 6)
@@ -422,7 +426,8 @@ void update_display(igl::viewer::Viewer& viewer)
     viewer.data.set_colors(C);
     viewer.data.set_colors(C);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv_poisson);
+    Eigen::RowVector3d color; color<<1,1,1;
+    drawField(viewer,two_pv_poisson,color);
   }
   }
 
 
   if (display_mode == 7)
   if (display_mode == 7)
@@ -477,10 +482,12 @@ void update_display(igl::viewer::Viewer& viewer)
     viewer.data.set_colors(C);
     viewer.data.set_colors(C);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv_ori);
+    Eigen::RowVector3d color; color<<0,0,1;
+    drawField(viewer,two_pv_ori,color);
 
 
     // Draw Integrated Field
     // Draw Integrated Field
-    drawField(viewer,two_pv_poisson_ori);
+    color<<.2,.2,.2;
+    drawField(viewer,two_pv_poisson_ori,color);
 
 
   }
   }
 
 
@@ -497,10 +504,12 @@ void update_display(igl::viewer::Viewer& viewer)
     viewer.data.set_colors(C);
     viewer.data.set_colors(C);
 
 
     // Draw Field
     // Draw Field
-    drawField(viewer,two_pv);
+    Eigen::RowVector3d color; color<<0,0,1;
+    drawField(viewer,two_pv,color);
 
 
     // Draw Integrated Field
     // Draw Integrated Field
-    drawField(viewer,two_pv_poisson);
+    color<<.2,.2,.2;
+    drawField(viewer,two_pv_poisson,color);
   }
   }
 
 
 }
 }

+ 1 - 1
tutorial/CMakeLists.txt

@@ -101,6 +101,7 @@ endif(LIBCOMISO_FOUND)
 add_subdirectory("507_PolyVectorField")
 add_subdirectory("507_PolyVectorField")
 add_subdirectory("508_ConjugateField")
 add_subdirectory("508_ConjugateField")
 add_subdirectory("509_Planarization")
 add_subdirectory("509_Planarization")
+add_subdirectory("510_Integrable")
 
 
 # Chapter 6
 # Chapter 6
 if(TINYXML2_FOUND)
 if(TINYXML2_FOUND)
@@ -125,4 +126,3 @@ add_subdirectory("701_Statistics")
 add_subdirectory("702_WindingNumber")
 add_subdirectory("702_WindingNumber")
 add_subdirectory("703_Decimation")
 add_subdirectory("703_Decimation")
 add_subdirectory("704_SignedDistance")
 add_subdirectory("704_SignedDistance")
-add_subdirectory("705_Integrable")

+ 1 - 0
tutorial/images/510_Integrable.png.REMOVED.git-id

@@ -0,0 +1 @@
+3a795cc747818088e17608f2efb62bc8e3a482cf

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

@@ -1 +1 @@
-328d256a34556697a10edf5a15290e499bf4e861
+cd78fbdfaabe2bb0f16f246756308ec90dc8128a