瀏覽代碼

Seam Face Edge Debug Info.

Former-commit-id: cfae8007dedd40ba2e83d11327b3c72d4a2f0733
wkevin 9 年之前
父節點
當前提交
f64d1e59e0
共有 2 個文件被更改,包括 39 次插入2 次删除
  1. 27 1
      include/igl/comiso/miq.cpp
  2. 12 1
      include/igl/comiso/miq.h

+ 27 - 1
include/igl/comiso/miq.cpp

@@ -52,7 +52,6 @@ using namespace Eigen;
 
 
 namespace igl {
 namespace igl {
 namespace comiso {
 namespace comiso {
-
   struct SeamInfo
   struct SeamInfo
   {
   {
     int v0,v0p,v1,v1p;
     int v0,v0p,v1,v1p;
@@ -107,6 +106,9 @@ namespace comiso {
     ///this handle for mesh TODO: move with the other global variables
     ///this handle for mesh TODO: move with the other global variables
     MeshSystemInfo Handle_SystemInfo;
     MeshSystemInfo Handle_SystemInfo;
 
 
+    //DEBUG
+    std::vector<DebugFaceEdgeInfo> DebugInfo;
+
     // internal
     // internal
     std::vector<std::vector<int> > VF, VFi;
     std::vector<std::vector<int> > VF, VFi;
 
 
@@ -318,6 +320,9 @@ namespace comiso {
     Eigen::PlainObjectBase<DerivedF> Fcut;
     Eigen::PlainObjectBase<DerivedF> Fcut;
     Eigen::MatrixXd UV_out;
     Eigen::MatrixXd UV_out;
     Eigen::PlainObjectBase<DerivedF> FUV_out;
     Eigen::PlainObjectBase<DerivedF> FUV_out;
+
+    //DEBUG
+    std::vector<DebugFaceEdgeInfo> debugFaceEdgeInfo_out;
     // internal
     // internal
     Eigen::PlainObjectBase<DerivedF> TT;
     Eigen::PlainObjectBase<DerivedF> TT;
     Eigen::PlainObjectBase<DerivedF> TTi;
     Eigen::PlainObjectBase<DerivedF> TTi;
@@ -353,6 +358,10 @@ namespace comiso {
     IGL_INLINE void extractUV(Eigen::PlainObjectBase<DerivedU> &UV_out,
     IGL_INLINE void extractUV(Eigen::PlainObjectBase<DerivedU> &UV_out,
                               Eigen::PlainObjectBase<DerivedF> &FUV_out);
                               Eigen::PlainObjectBase<DerivedF> &FUV_out);
 
 
+    //DEBUG
+
+    IGL_INLINE void extractDebugInfo(std::vector<igl::comiso::DebugFaceEdgeInfo>& debugFaceEdgeInfo);
+
   private:
   private:
     IGL_INLINE int NumFlips(const Eigen::MatrixXd& WUV);
     IGL_INLINE int NumFlips(const Eigen::MatrixXd& WUV);
 
 
@@ -598,6 +607,9 @@ IGL_INLINE void igl::comiso::VertexIndexing<DerivedV, DerivedF>::InitSeamInfo()
       Handle_SystemInfo.EdgeSeamInfo.push_back(SeamInfo(v0,v1,v0p,v1p,MM,integerVar));
       Handle_SystemInfo.EdgeSeamInfo.push_back(SeamInfo(v0,v1,v0p,v1p,MM,integerVar));
       connectingVertexCandidate0 = v0;
       connectingVertexCandidate0 = v0;
       connectingVertexCandidate1 = v1;
       connectingVertexCandidate1 = v1;
+
+      //DEBUG
+      DebugInfo.push_back(DebugFaceEdgeInfo(f,k,integerVar));
     }
     }
     integerVar++;
     integerVar++;
   }
   }
@@ -1358,6 +1370,7 @@ F(F_)
 
 
   UV_out = PSolver.UV_out;
   UV_out = PSolver.UV_out;
   FUV_out = PSolver.Fcut;
   FUV_out = PSolver.Fcut;
+  debugFaceEdgeInfo_out = VInd.DebugInfo;
   fflush(stdout);
   fflush(stdout);
 }
 }
 
 
@@ -1369,6 +1382,12 @@ IGL_INLINE void igl::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::extractUV(
   FUV_out = this->FUV_out;
   FUV_out = this->FUV_out;
 }
 }
 
 
+//DEBUG
+template <typename DerivedV, typename DerivedF, typename DerivedU>
+IGL_INLINE void igl::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::extractDebugInfo(std::vector<igl::comiso::DebugFaceEdgeInfo>& debugFaceEdgeInfo){
+  debugFaceEdgeInfo = this->debugFaceEdgeInfo_out;
+}
+
 template <typename DerivedV, typename DerivedF, typename DerivedU>
 template <typename DerivedV, typename DerivedF, typename DerivedU>
 IGL_INLINE int igl::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::NumFlips(const Eigen::MatrixXd& WUV)
 IGL_INLINE int igl::comiso::MIQ_class<DerivedV, DerivedF, DerivedU>::NumFlips(const Eigen::MatrixXd& WUV)
 {
 {
@@ -1559,6 +1578,8 @@ IGL_INLINE void igl::comiso::miq(
   const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_Seams,
   const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_Seams,
   Eigen::PlainObjectBase<DerivedU> &UV,
   Eigen::PlainObjectBase<DerivedU> &UV,
   Eigen::PlainObjectBase<DerivedF> &FUV,
   Eigen::PlainObjectBase<DerivedF> &FUV,
+  //DEBUG
+  std::vector<igl::comiso::DebugFaceEdgeInfo> &debugFaceEdgeInfo,
   double GradientSize,
   double GradientSize,
   double Stiffness,
   double Stiffness,
   bool DirectRound,
   bool DirectRound,
@@ -1594,6 +1615,7 @@ IGL_INLINE void igl::comiso::miq(
     hardFeatures);
     hardFeatures);
 
 
   miq.extractUV(UV,FUV);
   miq.extractUV(UV,FUV);
+  miq.extractDebugInfo(debugFaceEdgeInfo);
 }
 }
 
 
 template <typename DerivedV, typename DerivedF, typename DerivedU>
 template <typename DerivedV, typename DerivedF, typename DerivedU>
@@ -1604,6 +1626,8 @@ IGL_INLINE void igl::comiso::miq(
     const Eigen::PlainObjectBase<DerivedV> &PD2,
     const Eigen::PlainObjectBase<DerivedV> &PD2,
     Eigen::PlainObjectBase<DerivedU> &UV,
     Eigen::PlainObjectBase<DerivedU> &UV,
     Eigen::PlainObjectBase<DerivedF> &FUV,
     Eigen::PlainObjectBase<DerivedF> &FUV,
+    //DEBUG
+    std::vector<igl::comiso::DebugFaceEdgeInfo> &debugFaceEdgeInfo,
     double GradientSize,
     double GradientSize,
     double Stiffness,
     double Stiffness,
     bool DirectRound,
     bool DirectRound,
@@ -1652,6 +1676,8 @@ IGL_INLINE void igl::comiso::miq(
            Handle_Seams,
            Handle_Seams,
            UV,
            UV,
            FUV,
            FUV,
+           //DEBUG
+           debugFaceEdgeInfo,
            GradientSize,
            GradientSize,
            Stiffness,
            Stiffness,
            DirectRound,
            DirectRound,

+ 12 - 1
include/igl/comiso/miq.h

@@ -15,7 +15,14 @@ namespace igl
 {
 {
   namespace comiso
   namespace comiso
   {
   {
-    // Global seamless parametrization aligned with a given per-face jacobian (PD1,PD2).
+  //DEBUG
+  struct DebugFaceEdgeInfo
+  {
+	int f, e, integerVar;
+
+	IGL_INLINE DebugFaceEdgeInfo(int _f, int _e, int _integerVar) : f(_f), e(_e), integerVar(_integerVar){}
+  };
+  // Global seamless parametrization aligned with a given per-face jacobian (PD1,PD2).
     // The algorithm is based on
     // The algorithm is based on
     // "Mixed-Integer Quadrangulation" by D. Bommes, H. Zimmer, L. Kobbelt
     // "Mixed-Integer Quadrangulation" by D. Bommes, H. Zimmer, L. Kobbelt
     // ACM SIGGRAPH 2009, Article No. 77 (http://dl.acm.org/citation.cfm?id=1531383)
     // ACM SIGGRAPH 2009, Article No. 77 (http://dl.acm.org/citation.cfm?id=1531383)
@@ -52,6 +59,8 @@ namespace igl
       const Eigen::PlainObjectBase<DerivedV> &PD2,
       const Eigen::PlainObjectBase<DerivedV> &PD2,
       Eigen::PlainObjectBase<DerivedU> &UV,
       Eigen::PlainObjectBase<DerivedU> &UV,
       Eigen::PlainObjectBase<DerivedF> &FUV,
       Eigen::PlainObjectBase<DerivedF> &FUV,
+      //DEBUG
+      std::vector<DebugFaceEdgeInfo> &debugFaceEdgeInfo,
       double scale = 30.0,
       double scale = 30.0,
       double stiffness = 5.0,
       double stiffness = 5.0,
       bool direct_round = false,
       bool direct_round = false,
@@ -83,6 +92,8 @@ namespace igl
       const Eigen::Matrix<int, Eigen::Dynamic, 3> &Seams,
       const Eigen::Matrix<int, Eigen::Dynamic, 3> &Seams,
       Eigen::PlainObjectBase<DerivedU> &UV,
       Eigen::PlainObjectBase<DerivedU> &UV,
       Eigen::PlainObjectBase<DerivedF> &FUV,
       Eigen::PlainObjectBase<DerivedF> &FUV,
+      //DEBUG
+      std::vector<DebugFaceEdgeInfo> &debugFaceEdgeInfo,
       double GradientSize = 30.0,
       double GradientSize = 30.0,
       double Stiffness = 5.0,
       double Stiffness = 5.0,
       bool DirectRound = false,
       bool DirectRound = false,