浏览代码

added projection function typedef.

Former-commit-id: d10e9721470189bd56fb934277dc2308d60fc155
Amir Vaxman 7 年之前
父节点
当前提交
c7d21d14fa
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 2 0
      include/igl/shapeup_local_projections.h
  2. 3 3
      tutorial/801_ShapeUp/main.cpp

+ 2 - 0
include/igl/shapeup_local_projections.h

@@ -26,6 +26,8 @@ namespace igl
   //the projection assumes that the sets are vertices of polygons in order
   IGL_INLINE bool shapeup_regular_face_projection(const Eigen::PlainObjectBase<Eigen::MatrixXd>& P, const Eigen::PlainObjectBase<Eigen::VectorXi>& SC, const Eigen::PlainObjectBase<Eigen::MatrixXi>& S,  Eigen::PlainObjectBase<Eigen::MatrixXd>& projP);
   
+  typedef std::function<bool(const Eigen::PlainObjectBase<Eigen::MatrixXd>&, const Eigen::PlainObjectBase<Eigen::VectorXi>&, const Eigen::PlainObjectBase<Eigen::MatrixXi>&, Eigen::PlainObjectBase<Eigen::MatrixXd>&)> shapeup_projection_function;
+  
 }
 
 #ifndef IGL_STATIC_LIBRARY

+ 3 - 3
tutorial/801_ShapeUp/main.cpp

@@ -64,7 +64,7 @@ bool key_down(igl::viewer::Viewer& viewer, unsigned char key, int modifier)
     VectorXd angleRegularity(FQC.rows());
     quadAngleRegularity( VQC, FQC, angleRegularity);
     MatrixXd Ct;
-    igl::jet(angleRegularity, 0.0, 0.1, Ct);
+    igl::jet(angleRegularity, 0.0, 0.05, Ct);
     MatrixXd C(FQCtri.rows(),3);
     C << Ct, Ct;
     viewer.data.set_colors(C);
@@ -87,7 +87,7 @@ bool key_down(igl::viewer::Viewer& viewer, unsigned char key, int modifier)
     VectorXd angleRegularity(FQC.rows());
     quadAngleRegularity( VQCregular, FQC, angleRegularity);
     MatrixXd Ct;
-    igl::jet(angleRegularity, 0, 0.1, Ct);
+    igl::jet(angleRegularity, 0, 0.05, Ct);
     MatrixXd C(FQCtri.rows(),3);
     C << Ct, Ct;
     viewer.data.set_colors(C);
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
   MatrixXd bc(1,3); bc<<VQC.row(0);
   
   VectorXi array_of_fours=VectorXi::Constant(FQC.rows(),4);
-  std::function<bool(const Eigen::PlainObjectBase<MatrixXd>&, const Eigen::PlainObjectBase<VectorXi>&, const Eigen::PlainObjectBase<MatrixXi>&, Eigen::PlainObjectBase<MatrixXd>&)> localFunction(igl::shapeup_regular_face_projection);
+  igl::shapeup_projection_function localFunction(igl::shapeup_regular_face_projection);
   
   su_data.maxIterations=200;
   shapeup_precomputation(VQC, array_of_fours,FQC,E,b,wShape, wSmooth,su_data);