[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37422] branches/soc-2011-avocado/blender: Code Review Commit:

Andrea Weikert elubie at gmx.net
Sat Jun 11 22:58:03 CEST 2011


Revision: 37422
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37422
Author:   elubie
Date:     2011-06-11 20:58:03 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
Code Review Commit:
* removed last traces of the 'dummy' name
* renamed operator MESH_OT_generate to MESH_OT_generate_seam to make purpose of the operator clear
* small fix for memory leak - AutoseamUtility needs to be deleted
* removed some superfluous comments to make code neater

Modified Paths:
--------------
    branches/soc-2011-avocado/blender/intern/autoseam/AutoseamUtility.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/release/scripts/startup/bl_ui/space_view3d.py
    branches/soc-2011-avocado/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_intern.h
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_ops.c

Modified: branches/soc-2011-avocado/blender/intern/autoseam/AutoseamUtility.h
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/AutoseamUtility.h	2011-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/intern/autoseam/AutoseamUtility.h	2011-06-11 20:58:03 UTC (rev 37422)
@@ -31,22 +31,16 @@
 
 #include <Eigen/Core>
 
-// XXXXX TODO_SHUVRO: Shouldn't we find a better name for this?
 class AutoseamUtility
 {
 	public:
         AutoseamUtility();
-		
-		// XXXXX TODO_SHUVRO: remove the functions below that are not needed anymore
 
         void calculate_eigen(float **dual_matrix, int num_row, int num_col);
 
 		Eigen::Matrix3f m_A;
 		Eigen::Vector3f m_x;
         Eigen::MatrixXd dualMatrix;
-        
-        
-    
 
 };
 

Modified: branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.cpp
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.cpp	2011-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.cpp	2011-06-11 20:58:03 UTC (rev 37422)
@@ -29,13 +29,13 @@
 #include "AutoseamUtility.h"
 #include "autoseam_C_API.h"
 
-AUTOSEAM_UtilityClassHandle autoseam_create_dummyclass()
+AUTOSEAM_UtilityClassHandle autoseam_create_utility()
 {
 	AutoseamUtility *utility = new AutoseamUtility();
 	return (AUTOSEAM_UtilityClassHandle) utility;
 }
 
-void autoseam_delete_dummyclass(AUTOSEAM_UtilityClassHandle handle)
+void autoseam_delete_utility(AUTOSEAM_UtilityClassHandle handle)
 {
 	AutoseamUtility *utility = reinterpret_cast<AutoseamUtility*>(handle);
 	delete utility;

Modified: branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.h
===================================================================
--- branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.h	2011-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/intern/autoseam/autoseam_C_API.h	2011-06-11 20:58:03 UTC (rev 37422)
@@ -38,11 +38,9 @@
 #define AUTOSEAM_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
 AUTOSEAM_DECLARE_HANDLE(AUTOSEAM_UtilityClassHandle);
 
-AUTOSEAM_UtilityClassHandle autoseam_create_dummyclass();
-void autoseam_delete_dummyclass(AUTOSEAM_UtilityClassHandle handle);
+AUTOSEAM_UtilityClassHandle autoseam_create_utility();
+void autoseam_delete_utility(AUTOSEAM_UtilityClassHandle handle);
 
-// XXXXX TODO_SHUVRO: remove the functions below that are not needed anymore
-
 void autoseam_calculate_eigen(AUTOSEAM_UtilityClassHandle handle, float** vec, int dimension);
 
 #ifdef __cplusplus

Modified: branches/soc-2011-avocado/blender/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- branches/soc-2011-avocado/blender/release/scripts/startup/bl_ui/space_view3d.py	2011-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/release/scripts/startup/bl_ui/space_view3d.py	2011-06-11 20:58:03 UTC (rev 37422)
@@ -1592,7 +1592,7 @@
 
         layout.separator()
         
-        layout.operator("mesh.generate")
+        layout.operator("mesh.generate_seam")
         layout.separator()
 
         layout.operator("mesh.mark_sharp")

Modified: branches/soc-2011-avocado/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2011-avocado/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-06-11 20:58:03 UTC (rev 37422)
@@ -154,7 +154,7 @@
         col.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"
         col.operator("mesh.mark_seam")
         col.operator("mesh.mark_seam", text="Clear Seam").clear = True
-        col.operator("mesh.generate")
+        col.operator("mesh.generate_seam")
 
         col = layout.column(align=True)
         col.label(text="Shading:")

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-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c	2011-06-11 20:58:03 UTC (rev 37422)
@@ -130,13 +130,11 @@
     return 0;
 }
 
-
-/* XXXXX TODO_SHUVRO: name this MESH_OT_generate */
-void MESH_OT_generate(wmOperatorType *ot)
+void MESH_OT_generate_seam(wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Generate Seam";
-	ot->idname= "MESH_OT_generate";
+	ot->idname= "MESH_OT_generate_seam";
 	ot->description= "generate seams automatically for a selected mesh.";
 	
 	/* api callbacks */
@@ -152,9 +150,11 @@
 
 void calculate_eigen(float **dual_graph, int dimension)
 {
-    AUTOSEAM_UtilityClassHandle handle = autoseam_create_dummyclass();
+    AUTOSEAM_UtilityClassHandle handle = autoseam_create_utility();
     
     autoseam_calculate_eigen(handle, dual_graph, dimension);
+
+	autoseam_delete_utility(handle);
 }
 
 

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-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c	2011-06-11 20:58:03 UTC (rev 37422)
@@ -101,7 +101,6 @@
 #include "bmesh.h"
 
 #include "editbmesh_bvh.h"
-//#include "autoseam_tools.h"
 
 
 
@@ -1267,9 +1266,6 @@
 		}
 	}
 
-    /* just as a demo to show call to autoseam */
-    //BKE_use_autoseam();
-    //compute_dual_graph(bm);
 
 	DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
 	WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);

Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_intern.h
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_intern.h	2011-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_intern.h	2011-06-11 20:58:03 UTC (rev 37422)
@@ -225,7 +225,7 @@
 void MESH_OT_select_random(struct wmOperatorType *ot);
 void MESH_OT_loop_multi_select(struct wmOperatorType *ot);
 void MESH_OT_mark_seam(struct wmOperatorType *ot);
-void MESH_OT_generate(struct wmOperatorType *ot);
+void MESH_OT_generate_seam(struct wmOperatorType *ot);
 void MESH_OT_mark_sharp(struct wmOperatorType *ot);
 void MESH_OT_vertices_smooth(struct wmOperatorType *ot);
 void MESH_OT_noise(struct wmOperatorType *ot);

Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_ops.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_ops.c	2011-06-11 20:57:48 UTC (rev 37421)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/mesh_ops.c	2011-06-11 20:58:03 UTC (rev 37422)
@@ -130,7 +130,7 @@
 	WM_operatortype_append(MESH_OT_select_similar);
 	WM_operatortype_append(MESH_OT_loop_multi_select);
 	WM_operatortype_append(MESH_OT_mark_seam);
-    WM_operatortype_append(MESH_OT_generate);
+    WM_operatortype_append(MESH_OT_generate_seam);
 	WM_operatortype_append(MESH_OT_mark_sharp);
 	WM_operatortype_append(MESH_OT_vertices_smooth);
 	WM_operatortype_append(MESH_OT_noise);




More information about the Bf-blender-cvs mailing list