[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37258] branches/soc-2011-avocado/blender: Removed BKE_demo.h and demo. c from blenkernel and added the codes of the file in autoseam_tools. h and autoseam_tools.cand some other minor changes

shuvro sarker shuvro05 at gmail.com
Mon Jun 6 19:23:24 CEST 2011


Revision: 37258
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37258
Author:   shuvro
Date:     2011-06-06 17:23:24 +0000 (Mon, 06 Jun 2011)
Log Message:
-----------
Removed BKE_demo.h and demo.c from blenkernel and added the codes of the file in autoseam_tools.h and autoseam_tools.cand some other minor changes

Modified Paths:
--------------
    branches/soc-2011-avocado/blender/CMakeLists.txt
    branches/soc-2011-avocado/blender/extern/Eigen3/Eigen/Sparse
    branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.cpp
    branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.h
    branches/soc-2011-avocado/blender/source/blender/blenkernel/CMakeLists.txt
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/CMakeLists.txt
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c

Added Paths:
-----------
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.h

Removed Paths:
-------------
    branches/soc-2011-avocado/blender/source/blender/blenkernel/BKE_demo.h
    branches/soc-2011-avocado/blender/source/blender/blenkernel/intern/demo.c

Modified: branches/soc-2011-avocado/blender/CMakeLists.txt
===================================================================
--- branches/soc-2011-avocado/blender/CMakeLists.txt	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/CMakeLists.txt	2011-06-06 17:23:24 UTC (rev 37258)
@@ -1112,7 +1112,7 @@
 	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
 	# disable because it gives warnings for printf() & friends.
 	# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
-	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
+	#ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
 
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
 	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)

Modified: branches/soc-2011-avocado/blender/extern/Eigen3/Eigen/Sparse
===================================================================
--- branches/soc-2011-avocado/blender/extern/Eigen3/Eigen/Sparse	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/extern/Eigen3/Eigen/Sparse	2011-06-06 17:23:24 UTC (rev 37258)
@@ -15,9 +15,9 @@
 #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
 #endif
 
-#ifndef EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
+/*#ifndef EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
 #error The sparse module API is not stable yet. To use it anyway, please define the EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET preprocessor token.
-#endif
+#endif*/
 
 namespace Eigen {
 

Modified: branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.cpp
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.cpp	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.cpp	2011-06-06 17:23:24 UTC (rev 37258)
@@ -1,5 +1,3 @@
-#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET 
-
 #include <Eigen/Core>
 #include <Eigen/Dense>
 #include <Eigen/Eigenvalues> 
@@ -8,9 +6,9 @@
 #include "DummyClass.h"
 
 using Eigen::MatrixXd;
-using Eigen::SparseMatrix;
 
 
+
 DummyClass::DummyClass()
 {
 	m_A <<  1.0f, 2.0f, 0.0f,
@@ -74,9 +72,10 @@
 
 void DummyClass::calculate_eigen(float **dual_matrix, int num_row, int num_col)
 {
-    int r_index,c_index;
+    int i,l,r_index,c_index;
     dualMatrix.resize(num_row, num_col);
     
+    
     /* we can print the matrix here to have a look */
     
     /* the argument dual_matrix will not be provided as 2d array later, the data 
@@ -90,7 +89,7 @@
         }
     }
     
-    for(int l = 0; l < num_row; l++ ){
+    for( l = 0; l < num_row; l++ ){
         dualMatrix(l,l) = - row_sum(dualMatrix, num_row, l);
     }
     
@@ -100,7 +99,7 @@
     
    /* Now display the values. */
     
-    for(int i = 0; i < num_col; i++ )
+    for(i = 0; i < num_col; i++ )
     {
         std::cout << "Column "  << i << ": value " << es.eigenvalues()[i] << std::endl;
         std::cout << "Column "  << i << ": vector " << es.eigenvectors().col(i) << std::endl;

Modified: branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.h
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.h	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/intern/autoseam/DummyClass.h	2011-06-06 17:23:24 UTC (rev 37258)
@@ -2,10 +2,8 @@
 #define DUMMY_CLASS_H_INCLUDED
 
 #include <Eigen/Core>
-#include <Eigen/Sparse>
 
 
-
 class DummyClass
 {
 	public:
@@ -14,12 +12,12 @@
 		void solve3x3(float *vec);
 		void get_solution(float *vec);
         void calculate_eigen(float **dual_matrix, int num_row, int num_col);
-	//private:
+
 		Eigen::Matrix3f m_A;
 		Eigen::Vector3f m_x;
         Eigen::MatrixXd dualMatrix;
         
-        //Eigen::SparseMatrix<double,RowMajor> m2(1000,2000);
+        
     
 
 };

Deleted: branches/soc-2011-avocado/blender/source/blender/blenkernel/BKE_demo.h
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/blenkernel/BKE_demo.h	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/source/blender/blenkernel/BKE_demo.h	2011-06-06 17:23:24 UTC (rev 37258)
@@ -1,10 +0,0 @@
-#ifndef BKE_DEMO_H
-#define BKE_DEMO_H
-
-#include "bmesh.h"
-
-void BKE_use_autoseam();
-void calculate_eigen(float **dual_graph, int dimension);
-
-
-#endif
\ No newline at end of file

Modified: branches/soc-2011-avocado/blender/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/blenkernel/CMakeLists.txt	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/source/blender/blenkernel/CMakeLists.txt	2011-06-06 17:23:24 UTC (rev 37258)
@@ -148,11 +148,11 @@
 	intern/writeavi.c
 	intern/writeffmpeg.c
 	intern/writeframeserver.c
-	intern/demo.c
+#	intern/demo.c
 	
 	BKE_DerivedMesh.h
-	BKE_demo.h
 	BKE_action.h
+#	BKE_demo.h
 	BKE_anim.h
 	BKE_animsys.h
 	BKE_armature.h

Deleted: branches/soc-2011-avocado/blender/source/blender/blenkernel/intern/demo.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/blenkernel/intern/demo.c	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/source/blender/blenkernel/intern/demo.c	2011-06-06 17:23:24 UTC (rev 37258)
@@ -1,46 +0,0 @@
-/* This is just a demo file to show usage of the autoseam library from within C
- - comment added for test commit*/
-
-#include "autoseam_C_API.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-
-void BKE_use_autoseam()
-{
-	float vec_in[3] = { 1.0f, 0.0f, 1.0f };
-	float vec_result[3];
-	AUTOSEAM_DummyClassHandle handle = autoseam_create_dummyclass();
-	autoseam_solve3x3(handle, vec_in);
-	autoseam_get_solution(handle, vec_result);
-	autoseam_delete_dummyclass(handle);
-
-}
-
-void calculate_eigen(float **dual_graph, int dimension)
-{
-    int i,j;
-    
-    int k;
-    
-    float **array = (float **) malloc(dimension* sizeof(float *));
-    
-    for(k = 0; k < dimension; k++ ){
-        array[k] = (float *) malloc(dimension * sizeof(float));
-    }
-
-    
-    for(i = 0; i < dimension; i++){
-        for(j = 0; j< dimension; j++){
-            array[i][j] = dual_graph[i][j];
-            printf("%.2f ",array[i][j]);
-        }
-        printf("\n");
-    }
-    AUTOSEAM_DummyClassHandle handle = autoseam_create_dummyclass();
-    autoseam_calculate_eigen(handle, array, dimension);
-}
-
-
-
-

Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/CMakeLists.txt
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/CMakeLists.txt	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/CMakeLists.txt	2011-06-06 17:23:24 UTC (rev 37258)
@@ -32,6 +32,7 @@
 	../../windowmanager
 	../../render/extern/include
 	../../../../intern/guardedalloc
+	../../../../intern/autoseam/
 	${GLEW_INCLUDE_PATH}
 )
 
@@ -48,9 +49,10 @@
 	bmesh_tools.c
 	knifetool.c
 	editface.c
-
 	editbmesh_bvh.h
 	mesh_intern.h
+	autoseam_tools.c
+	autoseam_tools.h
 )
 
 blender_add_lib(bf_editor_mesh "${SRC}" "${INC}")

Added: branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c	                        (rev 0)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c	2011-06-06 17:23:24 UTC (rev 37258)
@@ -0,0 +1,50 @@
+//
+//  autoseam_tools.c
+//  Blender
+//
+//  Created by Shuvro Sarker on 6/6/11.
+//  
+//
+
+#include "autoseam_tools.h"
+#include "autoseam_C_API.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+
+void BKE_use_autoseam()
+{
+	float vec_in[3] = { 1.0f, 0.0f, 1.0f };
+	float vec_result[3];
+	AUTOSEAM_DummyClassHandle handle = autoseam_create_dummyclass();
+	autoseam_solve3x3(handle, vec_in);
+	autoseam_get_solution(handle, vec_result);
+	autoseam_delete_dummyclass(handle);
+    
+}
+
+void calculate_eigen(float **dual_graph, int dimension)
+{
+    int i,j,k;
+    
+    float **array = (float **) malloc(dimension* sizeof(float *));
+    
+    for(k = 0; k < dimension; k++ ){
+        array[k] = (float *) malloc(dimension * sizeof(float));
+    }
+    
+    
+    for(i = 0; i < dimension; i++){
+        for(j = 0; j< dimension; j++){
+            array[i][j] = dual_graph[i][j];
+            printf("%.2f ",array[i][j]);
+        }
+        printf("\n");
+    }
+    AUTOSEAM_DummyClassHandle handle = autoseam_create_dummyclass();
+    autoseam_calculate_eigen(handle, array, dimension);
+}
+
+
+
+

Added: branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.h
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.h	                        (rev 0)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.h	2011-06-06 17:23:24 UTC (rev 37258)
@@ -0,0 +1,18 @@
+//
+//  autoseam_tools.h
+//  Blender
+//
+//  Created by Shuvro Sarker on 6/6/11.
+//  
+//
+
+#ifndef AUTOSEAM_TOOLS_H
+#define AUTOSEAM_TOOLS_H
+
+#include "bmesh.h"
+
+void BKE_use_autoseam();
+void calculate_eigen(float **dual_graph, int dimension);
+
+
+#endif
\ No newline at end of file

Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c	2011-06-06 17:12:58 UTC (rev 37257)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c	2011-06-06 17:23:24 UTC (rev 37258)
@@ -77,7 +77,7 @@
 #include "BKE_tessmesh.h"
 #include "BKE_texture.h"
 #include "BKE_main.h"
-#include "BKE_demo.h"
+//#include "BKE_demo.h"
 
 
 #include "BIF_gl.h"
@@ -101,6 +101,7 @@
 #include "bmesh.h"
 
 #include "editbmesh_bvh.h"
+#include "autoseam_tools.h"
 
 
 




More information about the Bf-blender-cvs mailing list