Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "MEM_guardedalloc.h"
#include "BKE_context.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_editVert.h"
#include "BLI_edgehash.h"
#include "BLI_ghash.h"
#include "BLI_heap.h"
#include "ONL_opennl.h"
#include "reeb.h"
Go to the source code of this file.
Classes | |
struct | VertexData |
struct | EdgeIndex |
Defines | |
#define | DEBUG_REEB |
#define | DEBUG_REEB_NODE |
Typedefs | |
typedef struct VertexData | VertexData |
typedef struct EdgeIndex | EdgeIndex |
Enumerations | |
enum | MergeDirection { MERGE_LOWER, MERGE_HIGHER, MERGE_APPEND } |
Functions | |
int | mergeArcs (ReebGraph *rg, ReebArc *a0, ReebArc *a1) |
void | mergeArcEdges (ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection direction) |
int | mergeConnectedArcs (ReebGraph *rg, ReebArc *a0, ReebArc *a1) |
EditEdge * | NextEdgeForVert (EdgeIndex *indexed_edges, int index) |
void | mergeArcFaces (ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc) |
void | addFacetoArc (ReebArc *arc, EditFace *efa) |
void | REEB_RadialSymmetry (BNode *root_node, RadialArc *ring, int count) |
void | REEB_AxialSymmetry (BNode *root_node, BNode *node1, BNode *node2, struct BArc *barc1, BArc *barc2) |
void | flipArcBuckets (ReebArc *arc) |
static VertexData * | allocVertexData (EditMesh *em) |
static int | indexData (EditVert *eve) |
static float | weightData (EditVert *eve) |
static void | weightSetData (EditVert *eve, float w) |
static ReebNode * | nodeData (EditVert *eve) |
static void | nodeSetData (EditVert *eve, ReebNode *n) |
void | REEB_freeArc (BArc *barc) |
void | REEB_freeGraph (ReebGraph *rg) |
ReebGraph * | newReebGraph (void) |
void | BIF_flagMultiArcs (ReebGraph *rg, int flag) |
static ReebNode * | addNode (ReebGraph *rg, EditVert *eve) |
static ReebNode * | copyNode (ReebGraph *rg, ReebNode *node) |
static void | relinkNodes (ReebGraph *low_rg, ReebGraph *high_rg) |
ReebNode * | BIF_otherNodeFromIndex (ReebArc *arc, ReebNode *node) |
ReebNode * | BIF_NodeFromIndex (ReebArc *arc, ReebNode *node) |
ReebNode * | BIF_lowestLevelNode (ReebNode *node) |
static ReebArc * | copyArc (ReebGraph *rg, ReebArc *arc) |
static ReebGraph * | copyReebGraph (ReebGraph *rg, int level) |
ReebGraph * | BIF_graphForMultiNode (ReebGraph *rg, ReebNode *node) |
static ReebEdge * | copyEdge (ReebEdge *edge) |
static void | printArc (ReebArc *arc) |
static void | flipArc (ReebArc *arc) |
static void | NodeDegreeDecrement (ReebGraph *UNUSED(rg), ReebNode *node) |
static void | NodeDegreeIncrement (ReebGraph *UNUSED(rg), ReebNode *node) |
void | repositionNodes (ReebGraph *rg) |
void | verifyNodeDegree (ReebGraph *rg) |
static void | verifyBucketsArc (ReebGraph *UNUSED(rg), ReebArc *arc) |
void | verifyBuckets (ReebGraph *rg) |
void | verifyFaces (ReebGraph *rg) |
void | verifyArcs (ReebGraph *rg) |
static void | verifyMultiResolutionLinks (ReebGraph *rg, int level) |
static void | addVertToBucket (EmbedBucket *b, float co[3]) |
static void | mergeBuckets (EmbedBucket *bDst, EmbedBucket *bSrc) |
static void | mergeArcBuckets (ReebArc *aDst, ReebArc *aSrc, float start, float end) |
static int | countArcBuckets (ReebArc *arc) |
static void | allocArcBuckets (ReebArc *arc) |
static void | resizeArcBuckets (ReebArc *arc) |
static void | reweightBuckets (ReebArc *arc) |
static void | interpolateBuckets (ReebArc *arc, float *start_p, float *end_p, int start_index, int end_index) |
static void | fillArcEmptyBuckets (ReebArc *arc) |
static void | ExtendArcBuckets (ReebArc *arc) |
static void | extendGraphBuckets (ReebGraph *rg) |
static void | calculateArcLength (ReebArc *arc) |
static void | calculateGraphLength (ReebGraph *rg) |
void | postprocessGraph (ReebGraph *rg, char mode) |
static int | compareNodesWeight (void *vnode1, void *vnode2) |
void | sortNodes (ReebGraph *rg) |
static int | compareArcsWeight (void *varc1, void *varc2) |
void | sortArcs (ReebGraph *rg) |
static void | reweightArc (ReebGraph *rg, ReebArc *arc, ReebNode *start_node, float start_weight) |
static void | reweightSubgraph (ReebGraph *rg, ReebNode *start_node, float start_weight) |
static int | joinSubgraphsEnds (ReebGraph *rg, float threshold, int nb_subgraphs) |
static void | fixSubgraphsOrientation (ReebGraph *rg, int nb_subgraphs) |
static int | joinSubgraphs (ReebGraph *rg, float threshold) |
static float | lengthArc (ReebArc *arc) |
static int | compareArcs (void *varc1, void *varc2) |
static void | filterArc (ReebGraph *rg, ReebNode *newNode, ReebNode *removedNode, ReebArc *srcArc, int merging) |
void | filterNullReebGraph (ReebGraph *rg) |
static int | filterInternalExternalReebGraph (ReebGraph *rg, float threshold_internal, float threshold_external) |
static int | filterCyclesReebGraph (ReebGraph *rg, float UNUSED(distance_threshold)) |
int | filterSmartReebGraph (ReebGraph *UNUSED(rg), float UNUSED(threshold)) |
static void | filterGraph (ReebGraph *rg, short options, float threshold_internal, float threshold_external) |
static void | finalizeGraph (ReebGraph *rg, char passes, char method) |
static int | compareVerts (const void *a, const void *b) |
static void | spreadWeight (EditMesh *em) |
static void | exportNode (FILE *f, const char *text, ReebNode *node) |
void | REEB_exportGraph (ReebGraph *rg, int count) |
static void | removeZeroNodes (ReebGraph *rg) |
void | removeNormalNodes (ReebGraph *rg) |
static int | edgeEquals (ReebEdge *e1, ReebEdge *e2) |
static ReebArc * | nextArcMappedToEdge (ReebArc *arc, ReebEdge *e) |
void | mergeArcFaces (ReebGraph *UNUSED(rg), ReebArc *aDst, ReebArc *aSrc) |
static void | glueByMergeSort (ReebGraph *rg, ReebArc *a0, ReebArc *a1, ReebEdge *e0, ReebEdge *e1) |
static void | mergePaths (ReebGraph *rg, ReebEdge *e0, ReebEdge *e1, ReebEdge *e2) |
static ReebEdge * | createArc (ReebGraph *rg, ReebNode *node1, ReebNode *node2) |
static void | addTriangleToGraph (ReebGraph *rg, ReebNode *n1, ReebNode *n2, ReebNode *n3, EditFace *efa) |
ReebGraph * | generateReebGraph (EditMesh *em, int subdivisions) |
void | renormalizeWeight (EditMesh *em, float newmax) |
int | weightFromLoc (EditMesh *em, int axis) |
static float | cotan_weight (float *v1, float *v2, float *v3) |
static void | addTriangle (EditVert *v1, EditVert *v2, EditVert *v3, int e1, int e2, int e3) |
int | weightToHarmonic (EditMesh *em, EdgeIndex *indexed_edges) |
static void | shortestPathsFromVert (EditMesh *em, EditVert *starting_vert, EdgeIndex *indexed_edges) |
static void | freeEdgeIndex (EdgeIndex *indexed_edges) |
static void | buildIndexedEdges (EditMesh *em, EdgeIndex *indexed_edges) |
int | weightFromDistance (EditMesh *em, EdgeIndex *indexed_edges) |
static void * | headNode (void *arg) |
static void * | tailNode (void *arg) |
static void * | nextBucket (void *arg) |
static void * | nextNBucket (void *arg, int n) |
static void * | peekBucket (void *arg, int n) |
static void * | previousBucket (void *arg) |
static int | iteratorStopped (void *arg) |
static void | initIteratorFct (ReebArcIterator *iter) |
static void | setIteratorValues (ReebArcIterator *iter, EmbedBucket *bucket) |
void | initArcIterator (BArcIterator *arg, ReebArc *arc, ReebNode *head) |
void | initArcIteratorStart (BArcIterator *arg, struct ReebArc *arc, struct ReebNode *head, int start) |
void | initArcIterator2 (BArcIterator *arg, ReebArc *arc, int start, int end) |
ReebGraph * | BIF_ReebGraphMultiFromEditMesh (bContext *C) |
Definition in file reeb.c.
typedef struct VertexData VertexData |
enum MergeDirection |
Definition at line 2181 of file reeb.c.
References BLI_ghash_insert(), and ReebArc::faces.
Referenced by addTriangleToGraph().
Definition at line 234 of file reeb.c.
References ReebNode::arcs, BLI_addtail(), EditVert::co, ReebNode::degree, ReebNode::flag, ReebNode::index, MEM_callocN(), ReebGraph::nodes, nodeSetData(), NULL, ReebNode::p, ReebNode::symmetry_level, ReebGraph::totnodes, VECCOPY, ReebNode::weight, and weightData().
Referenced by generateReebGraph().
static void addTriangle | ( | EditVert * | v1, |
EditVert * | v2, | ||
EditVert * | v3, | ||
int | e1, | ||
int | e2, | ||
int | e3 | ||
) | [static] |
Definition at line 2697 of file reeb.c.
References EditVert::co, cotan_weight(), indexData(), and nlMatrixAdd().
Referenced by weightToHarmonic().
static void addTriangleToGraph | ( | ReebGraph * | rg, |
ReebNode * | n1, | ||
ReebNode * | n2, | ||
ReebNode * | n3, | ||
EditFace * | efa | ||
) | [static] |
Definition at line 2504 of file reeb.c.
References addFacetoArc(), ReebEdge::arc, createArc(), fabs(), mergePaths(), ReebEdge::v1, and ReebNode::weight.
Referenced by generateReebGraph().
static void addVertToBucket | ( | EmbedBucket * | b, |
float | co[3] | ||
) | [static] |
Definition at line 623 of file reeb.c.
References interp_v3_v3v3(), EmbedBucket::nv, and EmbedBucket::p.
Referenced by createArc().
static void allocArcBuckets | ( | ReebArc * | arc | ) | [static] |
Definition at line 702 of file reeb.c.
References ReebArc::bcount, ReebArc::buckets, countArcBuckets(), ReebArc::head, i, MEM_callocN(), NULL, EmbedBucket::val, and ReebNode::weight.
Referenced by createArc(), and resizeArcBuckets().
static VertexData* allocVertexData | ( | EditMesh * | em | ) | [static] |
Definition at line 117 of file reeb.c.
References BLI_countlist(), data, ListBase::first, VertexData::i, MEM_callocN(), EditVert::next, EditVert::p, EditVert::tmp, EditMesh::verts, and VertexData::w.
Referenced by BIF_ReebGraphMultiFromEditMesh().
void BIF_flagMultiArcs | ( | ReebGraph * | rg, |
int | flag | ||
) |
Definition at line 226 of file reeb.c.
References BLI_flagArcs(), and ReebGraph::link_up.
Referenced by retargetGraphs().
Definition at line 398 of file reeb.c.
References ReebGraph::link_up, ReebGraph::multi_level, and ReebNode::multi_level.
Referenced by matchMultiResolutionArc(), and matchMultiResolutionNode().
Definition at line 313 of file reeb.c.
References ReebNode::link_down.
Definition at line 308 of file reeb.c.
References ReebArc::head, ReebNode::index, and ReebArc::tail.
Referenced by testFlipArc().
Definition at line 303 of file reeb.c.
References ReebArc::head, ReebNode::index, and ReebArc::tail.
Referenced by retargetSubgraph().
Definition at line 3378 of file reeb.c.
References allocVertexData(), BLI_buildAdjacencyList(), BLI_calcGraphLength(), BLI_markdownSymmetry(), buildIndexedEdges(), copyReebGraph(), CTX_data_edit_object(), CTX_data_scene(), data, Object::data, filterGraph(), filterNullReebGraph(), finalizeGraph(), ListBase::first, freeEdgeIndex(), generateReebGraph(), i, joinSubgraphs(), BGraph::length, MEM_freeN(), BGraph::nodes, NULL, REEB_MAX_MULTI_LEVEL, relinkNodes(), removeNormalNodes(), renormalizeWeight(), repositionNodes(), SKGEN_FILTER_SMART, SKGEN_HARMONIC, ToolSettings::skgen_options, ToolSettings::skgen_postpro, ToolSettings::skgen_postpro_passes, ToolSettings::skgen_resolution, ToolSettings::skgen_symmetry_limit, ToolSettings::skgen_threshold_external, ToolSettings::skgen_threshold_internal, Scene::toolsettings, verifyMultiResolutionLinks(), weightFromDistance(), and weightToHarmonic().
Referenced by BIF_retargetArmature().
Definition at line 2963 of file reeb.c.
References BLI_countlist(), simple_enum_gen::d, EdgeIndex::edges, EditMesh::edges, ListBase::first, EditVert::h, i, indexData(), MEM_callocN(), EditVert::next, EditEdge::next, NULL, EdgeIndex::offset, EditEdge::v1, EditEdge::v2, and EditMesh::verts.
Referenced by BIF_ReebGraphMultiFromEditMesh().
static void calculateArcLength | ( | ReebArc * | arc | ) | [static] |
Definition at line 922 of file reeb.c.
References ReebArc::head, initArcIterator(), IT_next(), len_v3v3(), ReebArc::length, BArcIterator::p, ReebNode::p, and ReebArc::tail.
Referenced by calculateGraphLength().
static void calculateGraphLength | ( | ReebGraph * | rg | ) | [static] |
Definition at line 947 of file reeb.c.
References ReebGraph::arcs, calculateArcLength(), ListBase::first, and ReebArc::next.
Referenced by filterGraph().
static int compareArcs | ( | void * | varc1, |
void * | varc2 | ||
) | [static] |
Definition at line 1475 of file reeb.c.
References lengthArc().
Referenced by filterInternalExternalReebGraph(), and filterSmartReebGraph().
static int compareArcsWeight | ( | void * | varc1, |
void * | varc2 | ||
) | [static] |
Definition at line 1226 of file reeb.c.
References ReebArc::head, and ReebNode::weight.
Referenced by sortArcs().
static int compareNodesWeight | ( | void * | vnode1, |
void * | vnode2 | ||
) | [static] |
static int compareVerts | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 323 of file reeb.c.
References ReebGraph::arcs, ReebArc::bcount, BLI_addtail(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), ReebArc::buckets, ReebArc::edges, ReebArc::faces, ListBase::first, ReebArc::head, ReebNode::index, ListBase::last, ReebArc::link_up, MEM_callocN(), mergeArcFaces(), ReebNode::next, ReebArc::next, ReebGraph::nodes, NULL, ReebArc::prev, and ReebArc::tail.
Referenced by copyReebGraph().
Definition at line 410 of file reeb.c.
References MEM_callocN(), ReebEdge::next, NULL, and ReebEdge::prev.
Referenced by mergeArcEdges().
Definition at line 259 of file reeb.c.
References ReebNode::arcs, BLI_addtail(), ReebNode::link_down, ReebNode::link_up, MEM_callocN(), ReebNode::next, ReebGraph::nodes, NULL, ReebNode::prev, and ReebGraph::totnodes.
Referenced by copyReebGraph().
Definition at line 369 of file reeb.c.
References ReebGraph::arcs, BLI_buildAdjacencyList(), copyArc(), copyNode(), ListBase::first, ReebGraph::length, ReebGraph::link_up, ReebNode::multi_level, ReebGraph::multi_level, newReebGraph(), ReebArc::next, ReebNode::next, ReebGraph::nodes, and ReebGraph::resolution.
Referenced by BIF_ReebGraphMultiFromEditMesh().
static float cotan_weight | ( | float * | v1, |
float * | v2, | ||
float * | v3 | ||
) | [static] |
Definition at line 2681 of file reeb.c.
References cross_v3_v3v3(), dot_v3v3(), len_v3(), and sub_v3_v3v3().
Referenced by addTriangle().
static int countArcBuckets | ( | ReebArc * | arc | ) | [static] |
Definition at line 697 of file reeb.c.
References ReebArc::head, ReebArc::tail, and ReebNode::weight.
Referenced by allocArcBuckets(), and resizeArcBuckets().
Definition at line 2422 of file reeb.c.
References addVertToBucket(), allocArcBuckets(), ReebEdge::arc, ReebGraph::arcs, ReebArc::bcount, BLI_addtail(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), ReebArc::buckets, co, ReebArc::edges, ReebGraph::emap, ReebArc::faces, ReebArc::flag, ReebArc::head, i, ReebNode::index, interp_v3_v3v3(), len(), MEM_callocN(), ReebEdge::nextEdge, NodeDegreeIncrement(), NULL, ReebNode::p, ReebArc::symmetry_level, ReebArc::tail, ReebEdge::v1, ReebEdge::v2, EmbedBucket::val, and ReebNode::weight.
Referenced by addTriangleToGraph().
Definition at line 2156 of file reeb.c.
References ReebEdge::v1, and ReebEdge::v2.
Referenced by nextArcMappedToEdge().
static void exportNode | ( | FILE * | f, |
const char * | text, | ||
ReebNode * | node | ||
) | [static] |
Definition at line 2025 of file reeb.c.
References ReebNode::degree, ReebNode::index, ReebNode::p, and ReebNode::weight.
Referenced by REEB_exportGraph().
static void ExtendArcBuckets | ( | ReebArc * | arc | ) | [static] |
Definition at line 844 of file reeb.c.
References ReebArc::bcount, ReebArc::buckets, ReebArc::head, initArcIterator(), interpolateBuckets(), IT_next(), IT_stopped(), len_v3v3(), length(), MEM_callocN(), MEM_freeN(), NULL, ReebNode::p, EmbedBucket::p, BArcIterator::p, and ReebArc::tail.
Referenced by extendGraphBuckets().
static void extendGraphBuckets | ( | ReebGraph * | rg | ) | [static] |
Definition at line 910 of file reeb.c.
References ReebGraph::arcs, ExtendArcBuckets(), ListBase::first, and ReebArc::next.
Referenced by finalizeGraph().
static void fillArcEmptyBuckets | ( | ReebArc * | arc | ) | [static] |
Definition at line 795 of file reeb.c.
References ReebArc::bcount, ReebArc::buckets, ReebArc::head, i, interpolateBuckets(), EmbedBucket::nv, EmbedBucket::p, ReebNode::p, and ReebArc::tail.
Referenced by joinSubgraphsEnds(), and reweightArc().
static void filterArc | ( | ReebGraph * | rg, |
ReebNode * | newNode, | ||
ReebNode * | removedNode, | ||
ReebArc * | srcArc, | ||
int | merging | ||
) | [static] |
Definition at line 1496 of file reeb.c.
References ReebGraph::arcs, BLI_remlink(), ListBase::first, flipArc(), ReebArc::head, ReebArc::length, mergeArcBuckets(), mergeArcFaces(), ReebArc::next, NodeDegreeDecrement(), NodeDegreeIncrement(), NULL, REEB_freeArc(), resizeArcBuckets(), ReebArc::tail, and ReebNode::weight.
Referenced by filterInternalExternalReebGraph(), filterNullReebGraph(), and filterSmartReebGraph().
static int filterCyclesReebGraph | ( | ReebGraph * | rg, |
float | UNUSEDdistance_threshold | ||
) | [static] |
Definition at line 1699 of file reeb.c.
References ReebGraph::arcs, BLI_remlink(), ListBase::first, ReebArc::head, MERGE_APPEND, mergeArcBuckets(), mergeArcEdges(), mergeArcFaces(), ReebArc::next, NodeDegreeDecrement(), REEB_freeArc(), ReebArc::tail, and ReebNode::weight.
Referenced by filterGraph().
static void filterGraph | ( | ReebGraph * | rg, |
short | options, | ||
float | threshold_internal, | ||
float | threshold_external | ||
) | [static] |
Definition at line 1906 of file reeb.c.
References calculateGraphLength(), filterCyclesReebGraph(), filterInternalExternalReebGraph(), filterSmartReebGraph(), removeNormalNodes(), repositionNodes(), SKGEN_FILTER_EXTERNAL, SKGEN_FILTER_INTERNAL, and SKGEN_FILTER_SMART.
Referenced by BIF_ReebGraphMultiFromEditMesh().
static int filterInternalExternalReebGraph | ( | ReebGraph * | rg, |
float | threshold_internal, | ||
float | threshold_external | ||
) | [static] |
Definition at line 1608 of file reeb.c.
References ReebGraph::arcs, BLI_remlink(), BLI_removeNode(), BLI_sortlist(), compareArcs(), ReebNode::degree, filterArc(), ListBase::first, ReebArc::head, lengthArc(), ReebArc::next, NodeDegreeDecrement(), ReebGraph::nodes, NULL, REEB_freeArc(), and ReebArc::tail.
Referenced by filterGraph().
void filterNullReebGraph | ( | ReebGraph * | rg | ) |
Definition at line 1574 of file reeb.c.
References ReebGraph::arcs, ReebArc::bcount, blend(), BLI_remlink(), BLI_removeNode(), ReebNode::degree, filterArc(), ListBase::first, ReebArc::head, interp_v3_v3v3(), ReebArc::next, NULL, ReebNode::p, REEB_freeArc(), and ReebArc::tail.
Referenced by BIF_ReebGraphMultiFromEditMesh().
int filterSmartReebGraph | ( | ReebGraph * | UNUSEDrg, |
float | UNUSEDthreshold | ||
) |
Definition at line 1730 of file reeb.c.
References add_v3_v3(), ReebArc::angle, angle(), ReebGraph::arcs, BLI_freelinkN(), BLI_ghash_size(), BLI_ghashIterator_getValue(), BLI_ghashIterator_init(), BLI_ghashIterator_isDone(), BLI_ghashIterator_step(), BLI_remlink(), BLI_sortlist(), EditFace::cent, compareArcs(), ReebNode::degree, distance(), dot_v3v3(), fabs(), ReebArc::faces, filterArc(), ListBase::first, EditFace::fp, G, ReebArc::head, initArcIterator(), len_v3v3(), mul_v3_fl(), EditFace::n, ReebArc::next, EditFace::next, nextBucket(), NodeDegreeDecrement(), ReebGraph::nodes, normalize_v3(), NULL, ReebNode::p, EmbedBucket::p, recalc_editnormals(), REEB_freeArc(), saacos(), sub_v3_v3v3(), ReebArc::tail, EditFace::tmp, and VECCOPY.
Referenced by filterGraph().
static void finalizeGraph | ( | ReebGraph * | rg, |
char | passes, | ||
char | method | ||
) | [static] |
Definition at line 1945 of file reeb.c.
References BLI_buildAdjacencyList(), extendGraphBuckets(), i, postprocessGraph(), sortArcs(), and sortNodes().
Referenced by BIF_ReebGraphMultiFromEditMesh().
static void fixSubgraphsOrientation | ( | ReebGraph * | rg, |
int | nb_subgraphs | ||
) | [static] |
Definition at line 1395 of file reeb.c.
References ListBase::first, ReebNode::next, ReebGraph::nodes, NULL, reweightSubgraph(), ReebNode::subgraph_index, and ReebNode::weight.
Referenced by joinSubgraphs().
static void flipArc | ( | ReebArc * | arc | ) | [static] |
Definition at line 436 of file reeb.c.
References flipArcBuckets(), ReebArc::head, and ReebArc::tail.
Referenced by filterArc(), and reweightArc().
void flipArcBuckets | ( | ReebArc * | arc | ) |
Definition at line 683 of file reeb.c.
References ReebArc::bcount, ReebArc::buckets, and i.
Referenced by flipArc().
static void freeEdgeIndex | ( | EdgeIndex * | indexed_edges | ) | [static] |
Definition at line 2957 of file reeb.c.
References EdgeIndex::edges, MEM_freeN(), and EdgeIndex::offset.
Referenced by BIF_ReebGraphMultiFromEditMesh().
Definition at line 2557 of file reeb.c.
References addNode(), addTriangleToGraph(), BLI_countlist(), EditVert::f2, EditMesh::faces, ListBase::first, EditVert::h, EditFace::h, newReebGraph(), EditFace::next, EditVert::next, nodeData(), removeNormalNodes(), removeZeroNodes(), renormalizeWeight(), ReebGraph::resolution, spreadWeight(), EditFace::v1, EditFace::v2, EditFace::v3, EditFace::v4, and EditMesh::verts.
Referenced by BIF_ReebGraphMultiFromEditMesh().
static void glueByMergeSort | ( | ReebGraph * | rg, |
ReebArc * | a0, | ||
ReebArc * | a1, | ||
ReebEdge * | e0, | ||
ReebEdge * | e1 | ||
) | [static] |
Definition at line 2390 of file reeb.c.
References mergeArcs(), nextArcMappedToEdge(), NULL, ReebArc::tail, and ReebNode::weight.
Referenced by mergePaths().
static void * headNode | ( | void * | arg | ) | [static] |
Definition at line 3256 of file reeb.c.
References ReebArcIterator::arc, ReebArcIterator::end, ReebArc::head, ReebNode::no, ReebArcIterator::no, ReebArcIterator::p, ReebNode::p, ReebArcIterator::size, ReebArcIterator::start, and ReebArc::tail.
Referenced by initIteratorFct().
static int indexData | ( | EditVert * | eve | ) | [static] |
Definition at line 137 of file reeb.c.
References EditVert::p, and EditVert::tmp.
Referenced by addTriangle(), buildIndexedEdges(), and shortestPathsFromVert().
void initArcIterator | ( | BArcIterator * | arg, |
ReebArc * | arc, | ||
ReebNode * | head | ||
) |
Definition at line 3177 of file reeb.c.
References ReebArcIterator::arc, ReebArc::bcount, ReebArcIterator::end, ReebArc::head, ReebArcIterator::index, initIteratorFct(), ReebArcIterator::length, ReebArcIterator::start, and ReebArcIterator::stride.
Referenced by calculateArcLength(), ExtendArcBuckets(), filterSmartReebGraph(), REEB_AxialSymmetry(), REEB_RadialSymmetry(), retargetArctoArcAggresive(), and retargetArctoArcLength().
void initArcIterator2 | ( | BArcIterator * | arg, |
ReebArc * | arc, | ||
int | start, | ||
int | end | ||
) |
Definition at line 3232 of file reeb.c.
References abs(), ReebArcIterator::arc, ReebArcIterator::end, ReebArcIterator::index, initIteratorFct(), ReebArcIterator::length, ReebArcIterator::start, and ReebArcIterator::stride.
void initArcIteratorStart | ( | BArcIterator * | arg, |
struct ReebArc * | arc, | ||
struct ReebNode * | head, | ||
int | start | ||
) |
Definition at line 3202 of file reeb.c.
References ReebArcIterator::arc, ReebArc::bcount, ReebArcIterator::end, ReebArc::head, ReebArcIterator::index, initIteratorFct(), ReebArcIterator::length, ReebArcIterator::start, and ReebArcIterator::stride.
static void initIteratorFct | ( | ReebArcIterator * | iter | ) | [static] |
Definition at line 3151 of file reeb.c.
References ReebArcIterator::head, headNode(), iteratorStopped(), ReebArcIterator::next, nextBucket(), ReebArcIterator::nextN, nextNBucket(), ReebArcIterator::peek, peekBucket(), ReebArcIterator::previous, previousBucket(), ReebArcIterator::stopped, ReebArcIterator::tail, and tailNode().
Referenced by initArcIterator(), initArcIterator2(), and initArcIteratorStart().
static void interpolateBuckets | ( | ReebArc * | arc, |
float * | start_p, | ||
float * | end_p, | ||
int | start_index, | ||
int | end_index | ||
) | [static] |
Definition at line 780 of file reeb.c.
References ReebArc::buckets, credits_svn_gen::empty, interp_v3_v3v3(), EmbedBucket::nv, and EmbedBucket::p.
Referenced by ExtendArcBuckets(), and fillArcEmptyBuckets().
static int iteratorStopped | ( | void * | arg | ) | [static] |
Definition at line 3362 of file reeb.c.
References ReebArcIterator::index, and ReebArcIterator::length.
Referenced by initIteratorFct().
static int joinSubgraphs | ( | ReebGraph * | rg, |
float | threshold | ||
) | [static] |
Definition at line 1422 of file reeb.c.
References BLI_buildAdjacencyList(), BLI_FlagSubgraphs(), BLI_isGraphCyclic(), fixSubgraphsOrientation(), joinSubgraphsEnds(), removeNormalNodes(), and sortNodes().
Referenced by BIF_ReebGraphMultiFromEditMesh().
static int joinSubgraphsEnds | ( | ReebGraph * | rg, |
float | threshold, | ||
int | nb_subgraphs | ||
) | [static] |
Definition at line 1313 of file reeb.c.
References ReebNode::arcs, BLI_rebuildAdjacencyListForNode(), BLI_ReflagSubgraph(), BLI_removeNode(), ReebNode::degree, distance(), fillArcEmptyBuckets(), ListBase::first, ReebNode::flag, FLT_MAX, ReebArc::head, len_v3v3(), ReebNode::next, NodeDegreeIncrement(), ReebGraph::nodes, NULL, ReebNode::p, resizeArcBuckets(), reweightSubgraph(), ReebNode::subgraph_index, ReebArc::tail, and ReebNode::weight.
Referenced by joinSubgraphs().
static float lengthArc | ( | ReebArc * | arc | ) | [static] |
Definition at line 1463 of file reeb.c.
References ReebArc::head, ReebArc::length, ReebArc::tail, and ReebNode::weight.
Referenced by compareArcs(), and filterInternalExternalReebGraph().
Definition at line 653 of file reeb.c.
References ReebArc::bcount, ReebArc::buckets, MAX3(), mergeBuckets(), and EmbedBucket::val.
Referenced by filterArc(), filterCyclesReebGraph(), mergeArcs(), and mergeConnectedArcs().
void mergeArcEdges | ( | ReebGraph * | rg, |
ReebArc * | aDst, | ||
ReebArc * | aSrc, | ||
MergeDirection | direction | ||
) |
Definition at line 2199 of file reeb.c.
References ReebEdge::arc, BLI_addtail(), BLI_edgehash_lookup_p(), BLI_movelisttolist(), copyEdge(), credits_svn_gen::e, ReebArc::edges, ReebGraph::emap, ListBase::first, ReebNode::index, MERGE_APPEND, MERGE_LOWER, ReebEdge::next, ReebEdge::nextEdge, NULL, p, ReebEdge::v1, and ReebEdge::v2.
Referenced by filterCyclesReebGraph(), mergeArcs(), and mergeConnectedArcs().
Referenced by copyArc(), filterArc(), filterCyclesReebGraph(), mergeArcs(), and mergeConnectedArcs().
Definition at line 2186 of file reeb.c.
References BLI_ghash_insert(), BLI_ghashIterator_getValue(), BLI_ghashIterator_init(), BLI_ghashIterator_isDone(), BLI_ghashIterator_step(), and ReebArc::faces.
Definition at line 2292 of file reeb.c.
References ReebGraph::arcs, BLI_remlink(), ReebArc::head, MERGE_APPEND, MERGE_HIGHER, MERGE_LOWER, mergeArcBuckets(), mergeArcEdges(), mergeArcFaces(), NodeDegreeDecrement(), NodeDegreeIncrement(), REEB_freeArc(), resizeArcBuckets(), ReebArc::tail, and ReebNode::weight.
Referenced by glueByMergeSort().
static void mergeBuckets | ( | EmbedBucket * | bDst, |
EmbedBucket * | bSrc | ||
) | [static] |
Definition at line 639 of file reeb.c.
References interp_v3_v3v3(), EmbedBucket::nv, EmbedBucket::p, and VECCOPY.
Referenced by mergeArcBuckets().
Definition at line 2256 of file reeb.c.
References ReebGraph::arcs, BLI_remlink(), BLI_removeNode(), ReebArc::head, ReebArc::length, MERGE_APPEND, mergeArcBuckets(), mergeArcEdges(), mergeArcFaces(), NULL, REEB_freeArc(), resizeArcBuckets(), ReebArc::tail, and ReebNode::weight.
Referenced by removeNormalNodes().
Definition at line 2411 of file reeb.c.
References ReebEdge::arc, and glueByMergeSort().
Referenced by addTriangleToGraph().
ReebGraph* newReebGraph | ( | void | ) |
Definition at line 209 of file reeb.c.
References ReebGraph::axial_symmetry, BLI_edgehash_new(), ReebGraph::emap, ReebGraph::free_arc, ReebGraph::free_node, MEM_callocN(), NULL, ReebGraph::radial_symmetry, REEB_AxialSymmetry(), REEB_freeArc(), REEB_RadialSymmetry(), and ReebGraph::totnodes.
Referenced by copyReebGraph(), and generateReebGraph().
Definition at line 2161 of file reeb.c.
References ReebEdge::arc, edgeEquals(), ReebArc::edges, ListBase::first, ReebEdge::next, ReebEdge::nextEdge, and NULL.
Referenced by glueByMergeSort().
static void * nextBucket | ( | void * | arg | ) | [static] |
Definition at line 3298 of file reeb.c.
References ReebArcIterator::arc, ReebArc::buckets, ReebArcIterator::index, ReebArcIterator::length, NULL, setIteratorValues(), ReebArcIterator::start, and ReebArcIterator::stride.
Referenced by filterSmartReebGraph(), and initIteratorFct().
Definition at line 2868 of file reeb.c.
References EdgeIndex::edges, NULL, and EdgeIndex::offset.
Referenced by shortestPathsFromVert(), and weightToHarmonic().
static void * nextNBucket | ( | void * | arg, |
int | n | ||
) | [static] |
Definition at line 3314 of file reeb.c.
References ReebArcIterator::arc, ReebArc::buckets, ReebArcIterator::index, ReebArcIterator::length, NULL, setIteratorValues(), ReebArcIterator::start, and ReebArcIterator::stride.
Referenced by initIteratorFct().
Definition at line 152 of file reeb.c.
References EditVert::p, and EditVert::tmp.
Referenced by generateReebGraph().
Definition at line 447 of file reeb.c.
References ReebNode::degree.
Referenced by filterArc(), filterCyclesReebGraph(), filterInternalExternalReebGraph(), filterSmartReebGraph(), and mergeArcs().
Definition at line 457 of file reeb.c.
References ReebNode::degree.
Referenced by createArc(), filterArc(), joinSubgraphsEnds(), and mergeArcs().
Definition at line 157 of file reeb.c.
References EditVert::p, and EditVert::tmp.
Referenced by addNode().
static void * peekBucket | ( | void * | arg, |
int | n | ||
) | [static] |
Definition at line 3331 of file reeb.c.
References ReebArcIterator::arc, ReebArc::buckets, ReebArcIterator::index, length(), NULL, setIteratorValues(), ReebArcIterator::start, and ReebArcIterator::stride.
Referenced by initIteratorFct().
void postprocessGraph | ( | ReebGraph * | rg, |
char | mode | ||
) |
Definition at line 1162 of file reeb.c.
References ReebGraph::arcs, ReebArc::bcount, ReebArc::buckets, ListBase::first, interp_v3_v3v3(), ReebArc::next, p, SKGEN_AVERAGE, SKGEN_SHARPEN, and SKGEN_SMOOTH.
Referenced by finalizeGraph().
static void * previousBucket | ( | void * | arg | ) | [static] |
Definition at line 3347 of file reeb.c.
References ReebArcIterator::arc, ReebArc::buckets, ReebArcIterator::index, NULL, setIteratorValues(), ReebArcIterator::start, and ReebArcIterator::stride.
Referenced by initIteratorFct().
static void printArc | ( | ReebArc * | arc | ) | [static] |
Definition at line 423 of file reeb.c.
References ReebArc::edges, ListBase::first, ReebArc::head, ReebNode::index, ReebEdge::next, ReebArc::tail, ReebEdge::v1, ReebEdge::v2, and ReebNode::weight.
Referenced by verifyBucketsArc(), and verifyMultiResolutionLinks().
void REEB_AxialSymmetry | ( | BNode * | root_node, |
BNode * | node1, | ||
BNode * | node2, | ||
struct BArc * | barc1, | ||
BArc * | barc2 | ||
) |
Definition at line 1090 of file reeb.c.
References add_v3_v3(), ReebArc::bcount, BLI_mirrorAlongAxis(), initArcIterator(), interp_v3_v3v3(), IT_next(), mul_v3_fl(), NULL, EmbedBucket::nv, EmbedBucket::p, ReebNode::p, BNode::p, p, BNode::symmetry_axis, EmbedBucket::val, and VECCOPY.
Referenced by newReebGraph().
void REEB_exportGraph | ( | ReebGraph * | rg, |
int | count | ||
) |
Definition at line 2030 of file reeb.c.
References add_v3_v3v3(), ReebArc::angle, ReebGraph::arcs, ReebArc::bcount, BLI_ghash_size(), ReebArc::buckets, exportNode(), ReebArc::faces, ListBase::first, ReebArc::head, i, mul_v3_fl(), ReebArc::next, EmbedBucket::nv, p, EmbedBucket::p, ReebNode::p, and ReebArc::tail.
void REEB_freeArc | ( | BArc * | barc | ) |
Definition at line 162 of file reeb.c.
References BLI_freelistN(), BLI_ghash_free(), ReebArc::buckets, ReebArc::edges, ReebArc::faces, MEM_freeN(), and NULL.
Referenced by filterArc(), filterCyclesReebGraph(), filterInternalExternalReebGraph(), filterNullReebGraph(), filterSmartReebGraph(), mergeArcs(), mergeConnectedArcs(), newReebGraph(), REEB_freeGraph(), and sk_retargetStroke().
void REEB_freeGraph | ( | ReebGraph * | rg | ) |
Definition at line 176 of file reeb.c.
References ReebGraph::arcs, BLI_edgehash_free(), BLI_freelistN(), BLI_freeNode(), ReebGraph::emap, ListBase::first, ReebGraph::link_up, MEM_freeN(), ReebArc::next, next, ReebNode::next, ReebGraph::nodes, NULL, REEB_freeArc(), and REEB_freeGraph().
Referenced by REEB_freeGraph(), and RIG_freeRigGraph().
Definition at line 959 of file reeb.c.
References add_v3_v3v3(), ReebArc::bcount, BLI_mirrorAlongAxis(), BLI_otherNode(), cross_v3_v3v3(), i, initArcIterator(), interp_v3_v3v3(), IT_next(), NULL, EmbedBucket::nv, EmbedBucket::p, BNode::p, ReebNode::p, BNode::symmetry_axis, EmbedBucket::val, and VECCOPY.
Referenced by newReebGraph().
Definition at line 280 of file reeb.c.
References ListBase::first, ReebNode::index, ReebNode::link_down, ReebNode::link_up, ReebNode::next, ReebGraph::nodes, and NULL.
Referenced by BIF_ReebGraphMultiFromEditMesh().
void removeNormalNodes | ( | ReebGraph * | rg | ) |
Definition at line 2085 of file reeb.c.
References ReebGraph::arcs, BLI_findConnectedArc(), ReebNode::degree, ListBase::first, ReebArc::head, mergeConnectedArcs(), ReebArc::next, ReebArc::tail, and ReebNode::weight.
Referenced by BIF_ReebGraphMultiFromEditMesh(), filterGraph(), generateReebGraph(), and joinSubgraphs().
static void removeZeroNodes | ( | ReebGraph * | rg | ) | [static] |
Definition at line 2070 of file reeb.c.
References BLI_removeNode(), ReebNode::degree, ListBase::first, ReebNode::next, and ReebGraph::nodes.
Referenced by generateReebGraph().
void renormalizeWeight | ( | EditMesh * | em, |
float | newmax | ||
) |
Definition at line 2636 of file reeb.c.
References BLI_countlist(), ListBase::first, MAX2, MIN2, EditVert::next, NULL, EditMesh::verts, weightData(), and weightSetData().
Referenced by BIF_ReebGraphMultiFromEditMesh(), and generateReebGraph().
void repositionNodes | ( | ReebGraph * | rg | ) |
Definition at line 472 of file reeb.c.
References add_v3_v3(), ReebGraph::arcs, ReebNode::degree, ListBase::first, ReebArc::head, mul_v3_fl(), BNode::next, BArc::next, ReebGraph::nodes, NULL, p, BNode::p, ReebNode::p, ReebArc::tail, and VECCOPY.
Referenced by BIF_ReebGraphMultiFromEditMesh(), and filterGraph().
static void resizeArcBuckets | ( | ReebArc * | arc | ) | [static] |
Definition at line 724 of file reeb.c.
References allocArcBuckets(), ReebArc::bcount, ReebArc::buckets, countArcBuckets(), len(), MEM_freeN(), MIN2, NULL, EmbedBucket::val, and simple_enum_gen::val.
Referenced by filterArc(), joinSubgraphsEnds(), mergeArcs(), mergeConnectedArcs(), and reweightArc().
static void reweightArc | ( | ReebGraph * | rg, |
ReebArc * | arc, | ||
ReebNode * | start_node, | ||
float | start_weight | ||
) | [static] |
Definition at line 1253 of file reeb.c.
References ABS, ReebNode::arcs, BLI_otherNode(), ReebNode::degree, fillArcEmptyBuckets(), ReebNode::flag, flipArc(), ReebArc::head, i, resizeArcBuckets(), reweightBuckets(), ReebArc::tail, and ReebNode::weight.
Referenced by reweightSubgraph().
static void reweightBuckets | ( | ReebArc * | arc | ) | [static] |
Definition at line 766 of file reeb.c.
References ReebArc::bcount, ReebArc::buckets, ReebArc::head, i, and EmbedBucket::val.
Referenced by reweightArc().
Definition at line 1298 of file reeb.c.
References ReebNode::arcs, BLI_flagNodes(), ReebNode::degree, i, reweightArc(), and ReebNode::weight.
Referenced by fixSubgraphsOrientation(), and joinSubgraphsEnds().
static void setIteratorValues | ( | ReebArcIterator * | iter, |
EmbedBucket * | bucket | ||
) | [static] |
Definition at line 3162 of file reeb.c.
References ReebArcIterator::no, EmbedBucket::no, NULL, ReebArcIterator::p, EmbedBucket::p, and ReebArcIterator::size.
Referenced by nextBucket(), nextNBucket(), peekBucket(), and previousBucket().
static void shortestPathsFromVert | ( | EditMesh * | em, |
EditVert * | starting_vert, | ||
EdgeIndex * | indexed_edges | ||
) | [static] |
Definition at line 2893 of file reeb.c.
References BLI_heap_free(), BLI_heap_insert(), BLI_heap_new(), BLI_heap_node_value(), BLI_heap_popmin(), BLI_heap_size(), BLI_heap_top(), EditMesh::edges, EditVert::f1, EditEdge::f1, ListBase::first, FLT_MAX, EditEdge::fp, indexData(), EditEdge::next, NextEdgeForVert(), NULL, EditEdge::tmp, EditEdge::v1, EditEdge::v2, weightData(), and weightSetData().
Referenced by weightFromDistance().
void sortArcs | ( | ReebGraph * | rg | ) |
Definition at line 1247 of file reeb.c.
References ReebGraph::arcs, BLI_sortlist(), and compareArcsWeight().
Referenced by finalizeGraph().
void sortNodes | ( | ReebGraph * | rg | ) |
Definition at line 1221 of file reeb.c.
References BLI_sortlist(), compareNodesWeight(), and ReebGraph::nodes.
Referenced by finalizeGraph(), and joinSubgraphs().
static void spreadWeight | ( | EditMesh * | em | ) | [static] |
Definition at line 1983 of file reeb.c.
References BLI_countlist(), compareVerts(), EditVert::f, ListBase::first, i, MEM_callocN(), MEM_freeN(), EditVert::next, EditMesh::verts, weightData(), and weightSetData().
Referenced by generateReebGraph().
static void * tailNode | ( | void * | arg | ) | [static] |
Definition at line 3277 of file reeb.c.
References ReebArcIterator::arc, ReebArcIterator::end, ReebArc::head, ReebNode::no, ReebArcIterator::no, ReebArcIterator::p, ReebNode::p, ReebArcIterator::size, ReebArcIterator::start, and ReebArc::tail.
Referenced by initIteratorFct().
void verifyArcs | ( | ReebGraph * | rg | ) |
Definition at line 582 of file reeb.c.
References ReebGraph::arcs, ListBase::first, ReebArc::head, ReebArc::next, ReebArc::tail, and ReebNode::weight.
void verifyBuckets | ( | ReebGraph * | rg | ) |
Definition at line 558 of file reeb.c.
References ReebGraph::arcs, ListBase::first, ReebArc::next, NULL, and verifyBucketsArc().
Definition at line 528 of file reeb.c.
References ReebArc::bcount, ReebArc::buckets, ceilf, floorf, ReebArc::head, i, EmbedBucket::nv, printArc(), ReebArc::tail, EmbedBucket::val, and ReebNode::weight.
Referenced by verifyBuckets().
void verifyFaces | ( | ReebGraph * | rg | ) |
Definition at line 569 of file reeb.c.
References ReebGraph::arcs, BLI_ghash_size(), ReebArc::faces, ListBase::first, ReebArc::next, and NULL.
static void verifyMultiResolutionLinks | ( | ReebGraph * | rg, |
int | level | ||
) | [static] |
Definition at line 595 of file reeb.c.
References ReebGraph::arcs, BLI_findindex(), ListBase::first, ReebArc::link_up, ReebGraph::link_up, ReebArc::next, NULL, and printArc().
Referenced by BIF_ReebGraphMultiFromEditMesh().
void verifyNodeDegree | ( | ReebGraph * | rg | ) |
Definition at line 500 of file reeb.c.
References ReebGraph::arcs, ReebNode::degree, ListBase::first, ReebArc::head, ReebNode::index, ReebNode::next, ReebArc::next, ReebGraph::nodes, NULL, ReebArc::tail, and ReebNode::weight.
static float weightData | ( | EditVert * | eve | ) | [static] |
Definition at line 142 of file reeb.c.
References EditVert::p, and EditVert::tmp.
Referenced by addNode(), compareVerts(), renormalizeWeight(), shortestPathsFromVert(), spreadWeight(), weightFromDistance(), and weightToHarmonic().
Definition at line 3027 of file reeb.c.
References BLI_countlist(), EditVert::co, distance(), EditMesh::edges, EditVert::f, EditVert::f1, ListBase::first, FLT_MAX, EditEdge::fp, EditVert::h, len_v3v3(), EditEdge::next, EditVert::next, NULL, SELECT, shortestPathsFromVert(), EditEdge::tmp, EditEdge::v1, EditEdge::v2, EditMesh::verts, weightData(), and weightSetData().
Referenced by BIF_ReebGraphMultiFromEditMesh().
int weightFromLoc | ( | EditMesh * | em, |
int | axis | ||
) |
Definition at line 2665 of file reeb.c.
References BLI_countlist(), EditVert::co, ListBase::first, EditVert::next, NULL, EditMesh::verts, and weightSetData().
static void weightSetData | ( | EditVert * | eve, |
float | w | ||
) | [static] |
Definition at line 147 of file reeb.c.
References EditVert::p, EditVert::tmp, and simple_enum_gen::w.
Referenced by renormalizeWeight(), shortestPathsFromVert(), spreadWeight(), weightFromDistance(), weightFromLoc(), and weightToHarmonic().
Definition at line 2726 of file reeb.c.
References addTriangle(), EditFace::e1, EditFace::e2, EditFace::e3, EditFace::e4, EditMesh::edges, EditVert::f1, EditMesh::faces, ListBase::first, EditVert::h, EditFace::h, EditEdge::l, EditEdge::next, EditFace::next, EditVert::next, NextEdgeForVert(), NL_MATRIX, NL_NB_VARIABLES, NL_SYSTEM, NL_TRUE, nlBegin(), nlDeleteContext(), nlEnd(), nlGetCurrent(), nlGetVariable(), nlLockVariable(), nlNewContext(), nlSetVariable(), nlSolveAdvanced(), nlSolverParameteri(), NULL, EditEdge::tmp, EditFace::v1, EditFace::v2, EditFace::v3, EditFace::v4, EditMesh::verts, simple_enum_gen::w, weightData(), and weightSetData().
Referenced by BIF_ReebGraphMultiFromEditMesh().