Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2008-08-16 00:55:38 +0400
committerMartin Poirier <theeth@yahoo.com>2008-08-16 00:55:38 +0400
commitcc3b41b3cd07152ab5f63ea4c6005cc3d11f2d2a (patch)
tree3db41797eb9b3247ccb289a2fc69742d143168f6
parent520e52d7d28b4bdb3dc1d3b854fcddcee67bf4f1 (diff)
Better logic to display symmetries
Add option to hide node and arc indexes (for cleaner screenshots)
-rw-r--r--source/blender/blenlib/BLI_graph.h1
-rw-r--r--source/blender/makesdna/DNA_scene_types.h1
-rw-r--r--source/blender/src/buttons_editing.c10
-rw-r--r--source/blender/src/reeb.c30
4 files changed, 26 insertions, 16 deletions
diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h
index 89f21b919e2..59e73004b8b 100644
--- a/source/blender/blenlib/BLI_graph.h
+++ b/source/blender/blenlib/BLI_graph.h
@@ -114,5 +114,6 @@ void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3]);
#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_*/
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 55d5a68662a..5acc4b4acbe 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -850,6 +850,7 @@ typedef struct Scene {
#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
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 906405344c4..98f20b94495 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -5048,10 +5048,12 @@ static void editing_panel_mesh_skgen_display(Object *ob, Mesh *me)
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");
diff --git a/source/blender/src/reeb.c b/source/blender/src/reeb.c
index 9938a8850cc..fa88d582a18 100644
--- a/source/blender/src/reeb.c
+++ b/source/blender/src/reeb.c
@@ -3515,11 +3515,11 @@ void REEB_draw()
{
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 @@ void REEB_draw()
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);