[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16126] branches/harmonic-skeleton/source/ blender: Better logic to display symmetries

Martin Poirier theeth at yahoo.com
Fri Aug 15 22:55:41 CEST 2008


Revision: 16126
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16126
Author:   theeth
Date:     2008-08-15 22:55:38 +0200 (Fri, 15 Aug 2008)

Log Message:
-----------
Better logic to display symmetries
Add option to hide node and arc indexes (for cleaner screenshots)

Modified Paths:
--------------
    branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h
    branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h
    branches/harmonic-skeleton/source/blender/src/buttons_editing.c
    branches/harmonic-skeleton/source/blender/src/reeb.c

Modified: branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h
===================================================================
--- branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h	2008-08-15 00:51:44 UTC (rev 16125)
+++ branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h	2008-08-15 20:55:38 UTC (rev 16126)
@@ -114,5 +114,6 @@
 #define SYM_SIDE_POSITIVE		1
 #define SYM_SIDE_NEGATIVE		2
 /* Anything higher is the order in radial symmetry */
+#define SYM_SIDE_RADIAL			3
 
 #endif /*BLI_GRAPH_H_*/

Modified: branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h	2008-08-15 00:51:44 UTC (rev 16125)
+++ branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h	2008-08-15 20:55:38 UTC (rev 16126)
@@ -850,6 +850,7 @@
 #define SKGEN_DISP_WEIGHT		(1 << 11)
 #define SKGEN_DISP_ORIG			(1 << 12)
 #define SKGEN_DISP_EMBED		(1 << 13)
+#define SKGEN_DISP_INDEX		(1 << 14)
 
 #define	SKGEN_SUB_LENGTH		0
 #define	SKGEN_SUB_ANGLE			1

Modified: branches/harmonic-skeleton/source/blender/src/buttons_editing.c
===================================================================
--- branches/harmonic-skeleton/source/blender/src/buttons_editing.c	2008-08-15 00:51:44 UTC (rev 16125)
+++ branches/harmonic-skeleton/source/blender/src/buttons_editing.c	2008-08-15 20:55:38 UTC (rev 16126)
@@ -5048,10 +5048,12 @@
 	skgen_graph_block(block);
 
 	uiBlockBeginAlign(block);
-	uiDefButBitS(block, TOG, SKGEN_DISP_LENGTH, REDRAWVIEW3D,	"Length",			1025, 40, 63,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Length");
-	uiDefButBitS(block, TOG, SKGEN_DISP_WEIGHT, REDRAWVIEW3D,	"Weight",			1088, 40, 63,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Weight");
-	uiDefButBitS(block, TOG, SKGEN_DISP_EMBED, REDRAWVIEW3D,	"Embed",			1151, 40, 62,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Arc Embedings");
-	uiDefButBitS(block, TOG, SKGEN_DISP_ORIG, REDRAWVIEW3D,		"Original",			1213, 40, 62,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Original Graph");
+	uiDefButBitS(block, TOG, SKGEN_DISP_LENGTH, REDRAWVIEW3D,	"Length",			1025, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Length");
+	uiDefButBitS(block, TOG, SKGEN_DISP_WEIGHT, REDRAWVIEW3D,	"Weight",			1075, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Weight");
+	uiDefButBitS(block, TOG, SKGEN_DISP_EMBED, REDRAWVIEW3D,	"Embed",			1125, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Arc Embedings");
+	uiDefButBitS(block, TOG, SKGEN_DISP_INDEX, REDRAWVIEW3D,	"Index",			1175, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Arc and Node indexes");
+	uiDefButBitS(block, TOG, SKGEN_DISP_ORIG, REDRAWVIEW3D,		"Original",			1225, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0,		"Show Original Graph");
+
 	uiBlockEndAlign(block);
 
 	uiDefButC(block, NUM, REDRAWVIEW3D, 						"Level:",			1025, 20, 125,19, &G.scene->toolsettings->skgen_multi_level, 0, REEB_MAX_MULTI_LEVEL, 1, 0,"Specify the level to draw");

Modified: branches/harmonic-skeleton/source/blender/src/reeb.c
===================================================================
--- branches/harmonic-skeleton/source/blender/src/reeb.c	2008-08-15 00:51:44 UTC (rev 16125)
+++ branches/harmonic-skeleton/source/blender/src/reeb.c	2008-08-15 20:55:38 UTC (rev 16126)
@@ -3515,11 +3515,11 @@
 		{
 			glColor3f(1, 0, 0);
 		}
-		else if (arc->head->symmetry_flag & SYM_AXIAL)
+		else if (arc->symmetry_flag == SYM_SIDE_POSITIVE || arc->symmetry_flag == SYM_SIDE_NEGATIVE)
 		{
 			glColor3f(1, 0.5f, 0);
 		}
-		else if (arc->head->symmetry_flag & SYM_RADIAL)
+		else if (arc->symmetry_flag >= SYM_SIDE_RADIAL)
 		{
 			glColor3f(0.5f, 1, 0);
 		}
@@ -3564,29 +3564,35 @@
 		
 		VecLerpf(vec, arc->head->p, arc->tail->p, 0.5f);
 		
-		s += sprintf(s, "%i", i);
+		if (G.scene->toolsettings->skgen_options & SKGEN_DISP_INDEX)
+		{
+			s += sprintf(s, "%i ", i);
+		}
 		
 		if (G.scene->toolsettings->skgen_options & SKGEN_DISP_WEIGHT)
 		{
-			s += sprintf(s, " - %0.3f", arc->tail->weight - arc->head->weight);
+			s += sprintf(s, "w:%0.3f ", arc->tail->weight - arc->head->weight);
 		}
 		
 		if (G.scene->toolsettings->skgen_options & SKGEN_DISP_LENGTH)
 		{
-			s += sprintf(s, " - %0.3f", arc->length);
+			s += sprintf(s, "l:%0.3f", arc->length);
 		}
 		
 		glColor3f(0, 1, 0);
 		glRasterPos3fv(vec);
 		BMF_DrawString( G.fonts, text);
 
-		sprintf(text, "%i", arc->head->index);
-		glRasterPos3fv(arc->head->p);
-		BMF_DrawString( G.fonts, text);
-
-		sprintf(text, "%i", arc->tail->index);
-		glRasterPos3fv(arc->tail->p);
-		BMF_DrawString( G.fonts, text);
+		if (G.scene->toolsettings->skgen_options & SKGEN_DISP_INDEX)
+		{
+			sprintf(text, "%i", arc->head->index);
+			glRasterPos3fv(arc->head->p);
+			BMF_DrawString( G.fonts, text);
+	
+			sprintf(text, "%i", arc->tail->index);
+			glRasterPos3fv(arc->tail->p);
+			BMF_DrawString( G.fonts, text);
+		}
 	}
 	glEnable(GL_DEPTH_TEST);
 	





More information about the Bf-blender-cvs mailing list