diff options
Diffstat (limited to 'source/blender/editors/armature/reeb.c')
-rw-r--r-- | source/blender/editors/armature/reeb.c | 234 |
1 files changed, 0 insertions, 234 deletions
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 63a255806b8..fda7012e955 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -3199,237 +3199,3 @@ ReebGraph *BIF_ReebGraphMultiFromEditMesh(bContext *C) return rg; #endif } - -#if 0 - -ReebGraph *BIF_ReebGraphFromEditMesh(void) -{ - EditMesh *em = G.editMesh; - EdgeIndex indexed_edges; - VertexData *data; - ReebGraph *rg = NULL; - - if (em == NULL) - return NULL; - - data = allocVertexData(em); - - buildIndexedEdges(em, &indexed_edges); - - if (weightFromDistance(em, &indexed_edges) == 0) - { - error("No selected vertex\n"); - freeEdgeIndex(&indexed_edges); - freeEdgeIndex(&indexed_edges); - return NULL; - } - - renormalizeWeight(em, 1.0f); - - if (G.scene->toolsettings->skgen_options & SKGEN_HARMONIC) - { - weightToHarmonic(em, &indexed_edges); - } - - freeEdgeIndex(&indexed_edges); - -#ifdef DEBUG_REEB -// weightToVCol(em, 1); -#endif - - rg = generateReebGraph(em, G.scene->toolsettings->skgen_resolution); - - - /* Remove arcs without embedding */ - filterNullReebGraph(rg); - - /* smart filter and loop filter on basic level */ - filterGraph(rg, SKGEN_FILTER_SMART, 0, 0); - - repositionNodes(rg); - - /* Filtering might have created degree 2 nodes, so remove them */ - removeNormalNodes(rg); - - joinSubgraphs(rg, 1.0); - - BLI_buildAdjacencyList((BGraph *)rg); - - /* calc length before copy, so we have same length on all levels */ - BLI_calcGraphLength((BGraph *)rg); - - filterGraph(rg, G.scene->toolsettings->skgen_options, G.scene->toolsettings->skgen_threshold_internal, G.scene->toolsettings->skgen_threshold_external); - - finalizeGraph(rg, G.scene->toolsettings->skgen_postpro_passes, G.scene->toolsettings->skgen_postpro); - -#ifdef DEBUG_REEB - REEB_exportGraph(rg, -1); - - arcToVCol(rg, em, 0); - //angleToVCol(em, 1); -#endif - - printf("DONE\n"); - printf("%i subgraphs\n", BLI_FlagSubgraphs((BGraph *)rg)); - - MEM_freeN(data); - - return rg; -} - -void BIF_GlobalReebFree() -{ - if (GLOBAL_RG != NULL) - { - REEB_freeGraph(GLOBAL_RG); - GLOBAL_RG = NULL; - } -} - -void BIF_GlobalReebGraphFromEditMesh(void) -{ - ReebGraph *rg; - - BIF_GlobalReebFree(); - - rg = BIF_ReebGraphMultiFromEditMesh(); - - GLOBAL_RG = rg; -} - -void REEB_draw() -{ - ReebGraph *rg; - ReebArc *arc; - int i = 0; - - if (GLOBAL_RG == NULL) - { - return; - } - - if (GLOBAL_RG->link_up && G.scene->toolsettings->skgen_options & SKGEN_DISP_ORIG) - { - for (rg = GLOBAL_RG; rg->link_up; rg = rg->link_up) ; - } - else { - i = G.scene->toolsettings->skgen_multi_level; - - for (rg = GLOBAL_RG; rg->multi_level != i && rg->link_up; rg = rg->link_up) ; - } - - glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); - - glDisable(GL_DEPTH_TEST); - for (arc = rg->arcs.first; arc; arc = arc->next, i++) - { - ReebArcIterator arc_iter; - BArcIterator *iter = (BArcIterator *)&arc_iter; - float vec[3]; - char text[128]; - char *s = text; - - glLineWidth(BIF_GetThemeValuef(TH_VERTEX_SIZE) + 2); - glColor3f(0, 0, 0); - glBegin(GL_LINE_STRIP); - glVertex3fv(arc->head->p); - - if (arc->bcount) - { - initArcIterator(iter, arc, arc->head); - for (IT_next(iter); IT_stopped(iter) == 0; IT_next(iter)) - { - glVertex3fv(iter->p); - } - } - - glVertex3fv(arc->tail->p); - glEnd(); - - glLineWidth(BIF_GetThemeValuef(TH_VERTEX_SIZE)); - - if (arc->symmetry_level == 1) - { - glColor3f(1, 0, 0); - } - else if (arc->symmetry_flag == SYM_SIDE_POSITIVE || arc->symmetry_flag == SYM_SIDE_NEGATIVE) - { - glColor3f(1, 0.5f, 0); - } - else if (arc->symmetry_flag >= SYM_SIDE_RADIAL) - { - glColor3f(0.5f, 1, 0); - } - else { - glColor3f(1, 1, 0); - } - glBegin(GL_LINE_STRIP); - glVertex3fv(arc->head->p); - - if (arc->bcount) - { - initArcIterator(iter, arc, arc->head); - for (iter->next(iter); IT_stopped(iter) == 0; iter->next(iter)) - { - glVertex3fv(iter->p); - } - } - - glVertex3fv(arc->tail->p); - glEnd(); - - - if (G.scene->toolsettings->skgen_options & SKGEN_DISP_EMBED) - { - glColor3f(1, 1, 1); - glBegin(GL_POINTS); - glVertex3fv(arc->head->p); - glVertex3fv(arc->tail->p); - - glColor3f(0.5f, 0.5f, 1); - if (arc->bcount) - { - initArcIterator(iter, arc, arc->head); - for (iter->next(iter); IT_stopped(iter) == 0; iter->next(iter)) - { - glVertex3fv(iter->p); - } - } - glEnd(); - } - - if (G.scene->toolsettings->skgen_options & SKGEN_DISP_INDEX) - { - mid_v3_v3v3(vec, arc->head->p, arc->tail->p); - s += sprintf(s, "%i (%i-%i-%i) ", i, arc->symmetry_level, arc->symmetry_flag, arc->symmetry_group); - - if (G.scene->toolsettings->skgen_options & SKGEN_DISP_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, "l:%0.3f", arc->length); - } - - glColor3f(0, 1, 0); - glRasterPos3fv(vec); - 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); -} - -#endif |