[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38057] branches/soc-2011-avocado/blender:
Andrea Weikert
elubie at gmx.net
Sun Jul 3 13:30:26 CEST 2011
Revision: 38057
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38057
Author: elubie
Date: 2011-07-03 11:30:26 +0000 (Sun, 03 Jul 2011)
Log Message:
-----------
Modified Paths:
--------------
branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.cpp
branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.h
branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.cpp
branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.h
branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.cpp
branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.h
branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c
Modified: branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.cpp
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.cpp 2011-07-03 11:28:40 UTC (rev 38056)
+++ branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.cpp 2011-07-03 11:30:26 UTC (rev 38057)
@@ -1,5 +1,6 @@
#include "AutoseamAdjacency.h"
#include <stdio.h>
+#include <fstream>
#define THRESHOLD_ZERO 0.0005
AutoseamAdjacency::AutoseamAdjacency(int dimension)
@@ -21,10 +22,10 @@
threshold_value = min_value;
}
+// TODO_SHUVRO: this should be renamed to is_adjacent to make the purpose clearer
int AutoseamAdjacency::get(int row, int col)
{
- //return m_adjacency(row, col) > THRESHOLD_ZERO ? 1 : 0;
- return m_adjacency(row, col);
+ return m_adjacency(row, col) > THRESHOLD_ZERO ? 1 : 0;
}
void AutoseamAdjacency::set_map_default()
@@ -189,3 +190,18 @@
}
return best;
}
+
+void AutoseamAdjacency::debug(std::ofstream& fout)
+{
+ fout << "Adjacency/Laplacian Matrix:" << std::endl;
+ fout << m_adjacency << std::endl;
+ fout << "Mapping" << std::endl;
+ for (int i=0; i< m_index_map_vector.size(); ++i) {
+ fout << m_index_map_vector[i] << " ";
+ }
+ fout << std::endl;
+ for (int i=0; i < m_eigenspaces.size(); ++i) {
+ AutoseamEigenspace* aes = m_eigenspaces[i];
+ aes->debug(fout);
+ }
+}
\ No newline at end of file
Modified: branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.h
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.h 2011-07-03 11:28:40 UTC (rev 38056)
+++ branches/soc-2011-avocado/blender/intern/autoseam/AutoseamAdjacency.h 2011-07-03 11:30:26 UTC (rev 38057)
@@ -29,6 +29,8 @@
//int is_adjacent(int index1, int index2);
float get_value(int row, int col);
+ void debug(std::ofstream& fout);
+
private:
Eigen::MatrixXd m_adjacency;
std::vector<AutoseamEigenspace*> m_eigenspaces;
Modified: branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.cpp
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.cpp 2011-07-03 11:28:40 UTC (rev 38056)
+++ branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.cpp 2011-07-03 11:30:26 UTC (rev 38057)
@@ -1,4 +1,5 @@
#include "AutoseamEigenspace.h"
+#include <fstream>
#define THRESHOLD_ZERO 0.0001
@@ -74,8 +75,8 @@
for (int n = 0; n < m_fminus.size(); ++n) {
if (adj( m_fplus[m], m_fminus[n] ) > THRESHOLD_ZERO ) {
/*an experimental change to see if this improves our result*/
- //count += adj(m_fplus[m], m_fminus[n]);
- count += 1;
+ count += adj(m_fplus[m], m_fminus[n]);
+ //count += 1;
break;
}
}
@@ -83,3 +84,8 @@
return count;
}
+void AutoseamEigenspace::debug(std::ofstream& fout)
+{
+ fout << "Eigenvalue: " << e << std::endl;
+ fout << "Eigenvector: " << (Eigen::VectorXd)v << std::endl;
+}
\ No newline at end of file
Modified: branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.h
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.h 2011-07-03 11:28:40 UTC (rev 38056)
+++ branches/soc-2011-avocado/blender/intern/autoseam/AutoseamEigenspace.h 2011-07-03 11:30:26 UTC (rev 38057)
@@ -13,7 +13,9 @@
void fill_adjacency(const Eigen::MatrixXd& adj, Eigen::MatrixXd& adj_plus, Eigen::MatrixXd& adj_minus);
void get(int *fplus, unsigned int* nplus, int* fminus, unsigned int* nminus);
float get_seam_length(const Eigen::MatrixXd& adj);
-
+
+ void debug(std::ofstream& fout);
+
private:
double e;
Eigen::VectorXd v;
Modified: branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.cpp
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.cpp 2011-07-03 11:28:40 UTC (rev 38056)
+++ branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.cpp 2011-07-03 11:30:26 UTC (rev 38057)
@@ -30,6 +30,8 @@
#include "autoseam_C_API.h"
#include "AutoseamAdjacency.h"
+#include <fstream>
+
AUTOSEAM_UtilityClassHandle autoseam_create_utility()
{
AutoseamUtility *utility = new AutoseamUtility();
@@ -130,4 +132,11 @@
{
AutoseamAdjacency *adj = reinterpret_cast<AutoseamAdjacency*>(handle);
adj->get_split(n, fplus,nplus, fminus,nminus);
+}
+
+void autoseam_debug(AUTOSEAM_Adjacency handle, const char *filename)
+{
+ std::ofstream fileout(filename);
+ AutoseamAdjacency *adj = reinterpret_cast<AutoseamAdjacency*>(handle);
+ adj->debug(fileout);
}
\ No newline at end of file
Modified: branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.h
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.h 2011-07-03 11:28:40 UTC (rev 38056)
+++ branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.h 2011-07-03 11:30:26 UTC (rev 38057)
@@ -61,6 +61,8 @@
float autoseam_get_value(AUTOSEAM_Adjacency handle, int row, int col);
void autoseam_set_map_default(AUTOSEAM_Adjacency handle);
+void autoseam_debug(AUTOSEAM_Adjacency handle, const char *filename);
+
#ifdef __cplusplus
}
#endif
Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c 2011-07-03 11:28:40 UTC (rev 38056)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c 2011-07-03 11:30:26 UTC (rev 38057)
@@ -28,7 +28,7 @@
#include "autoseam_tools.h"
-
+// TODO_SHUVRO: this should be removed since it is not used
int get_sign(float number){
return number > 0.0 ? 1 : 2;
}
More information about the Bf-blender-cvs
mailing list