[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49543] branches/soc-2012-bratwurst/source /blender/editors/uvedit: Comment cleanup

Antony Riakiotakis kalast at gmail.com
Sat Aug 4 00:52:59 CEST 2012


Revision: 49543
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49543
Author:   psy-fi
Date:     2012-08-03 22:52:59 +0000 (Fri, 03 Aug 2012)
Log Message:
-----------
Comment cleanup

Modified Paths:
--------------
    branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c
    branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer_isomap.cpp

Modified: branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c	2012-08-03 22:52:55 UTC (rev 49542)
+++ branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c	2012-08-03 22:52:59 UTC (rev 49543)
@@ -3082,7 +3082,6 @@
 
 		/* create matrix with squared edge distances */
 		float *dist_map = MEM_mallocN(sizeof(*dist_map)*nverts*nverts, "isomap_distance_map");
-		//float *init_map = MEM_mallocN(sizeof(*dist_map)*nverts*nverts, "isomap_distance_map");
 
 		param_isomap_new_solver(nverts);
 
@@ -3091,8 +3090,7 @@
 		 * large number instead */
 		for (i = 0; i < nverts; i++)
 			for (j = 0; j < nverts; j++) {
-				*(dist_map + i*nverts + j) = (i == j)? 0 : MAXFLOAT;
-				//*(init_map + i*nverts + j) = MAXFLOAT;
+				dist_map[i*nverts + j] = (i == j)? 0 : MAXFLOAT;
 			}
 
 		/* for each edge, put the squared distance to the appropriate matrix positions */
@@ -3103,8 +3101,10 @@
 			        p_edge_length(e);
 		}
 
-		/* now edge length has been computed. Now construct shortest paths
-		 * and put them to lower left of matrix. */
+		/* now edge length has been computed. Construct shortest paths
+		 * and run the algorithm nverts times to eventually calculate shortest
+		 * paths between all verts. This is a silly way to do this and will probably be optimized
+		 * if i go on working on this. */
 		for (l = 0; l < nverts; l++) {
 			for (i = 0; i < nverts; i++) {
 				for (j = 0; j < nverts; j++) {
@@ -3117,6 +3117,7 @@
 			}
 		}
 
+		/* square distances */
 		for (i = 0; i < nverts; i++) {
 			for (j = 0; j < nverts; j++) {
 				dist_map[i*nverts + j] *=  dist_map[i*nverts + j];
@@ -3128,7 +3129,6 @@
 
 			param_isomap_delete_solver();
 			MEM_freeN(dist_map);
-			//MEM_freeN(init_map);
 
 			return P_FALSE;
 		}
@@ -3140,7 +3140,6 @@
 		/* cleanup */
 		param_isomap_delete_solver();
 		MEM_freeN(dist_map);
-		//MEM_freeN(init_map);
 
 		return P_TRUE;
 	} else {

Modified: branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer_isomap.cpp
===================================================================
--- branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer_isomap.cpp	2012-08-03 22:52:55 UTC (rev 49542)
+++ branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer_isomap.cpp	2012-08-03 22:52:59 UTC (rev 49543)
@@ -68,21 +68,23 @@
 
 	eigensolver.compute(final);
 
-	cout << centering_transform << endl << endl;
+	#ifdef UNWRAP_DEBUG
 	cout << map_matrix << endl << endl;
 	cout << final << endl << endl;
+	#endif
 
 	if (eigensolver.info() != Success) {
 		cout << "isomap solver failure" << endl;
 		return false;
 	}
 
+	#ifdef UNWRAP_DEBUG
 	cout << eigensolver.eigenvectors() << endl << endl;
 
 
 	cout << endl << "eigenvalues" << endl << eigensolver.eigenvalues() << endl;
 	cout << endl << "UVs:" << endl;
-
+	#endif
 	return true;
 }
 
@@ -94,9 +96,11 @@
 	uv[0] = eigensolver.eigenvectors()(index, size - 1)*sqrtf(eigenvalue1);
 	uv[1] = eigensolver.eigenvectors()(index, size - 2)*sqrtf(eigenvalue2);
 
+	#ifdef UNWRAP_DEBUG
 	cout << index << ' ' << uv[0] << ' ' << uv[1] << endl;
 	cout << index << ' ' << eigensolver.eigenvectors()(index, size - 1)
 	     << ' ' << eigensolver.eigenvectors()(index, size - 2) << endl;
+	#endif
 }
 
 void param_isomap_new_solver(int nverts)




More information about the Bf-blender-cvs mailing list