Blender V2.61 - r43446
|
#include <float.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLI_graph.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
Go to the source code of this file.
Functions | |
static void | testRadialSymmetry (BGraph *graph, BNode *root_node, RadialArc *ring, int total, float axis[3], float limit, int group) |
static void | handleAxialSymmetry (BGraph *graph, BNode *root_node, int depth, float axis[3], float limit) |
static void | testAxialSymmetry (BGraph *graph, BNode *root_node, BNode *node1, BNode *node2, BArc *arc1, BArc *arc2, float axis[3], float limit, int group) |
static void | flagAxialSymmetry (BNode *root_node, BNode *end_node, BArc *arc, int group) |
void | BLI_freeNode (BGraph *graph, BNode *node) |
void | BLI_removeNode (BGraph *graph, BNode *node) |
BNode * | BLI_otherNode (BArc *arc, BNode *node) |
void | BLI_removeArc (BGraph *graph, BArc *arc) |
void | BLI_flagNodes (BGraph *graph, int flag) |
void | BLI_flagArcs (BGraph *graph, int flag) |
static void | addArcToNodeAdjacencyList (BNode *node, BArc *arc) |
void | BLI_buildAdjacencyList (BGraph *graph) |
void | BLI_rebuildAdjacencyListForNode (BGraph *graph, BNode *node) |
void | BLI_freeAdjacencyList (BGraph *graph) |
int | BLI_hasAdjacencyList (BGraph *graph) |
void | BLI_replaceNodeInArc (BGraph *graph, BArc *arc, BNode *node_src, BNode *node_replaced) |
void | BLI_replaceNode (BGraph *graph, BNode *node_src, BNode *node_replaced) |
void | BLI_removeDoubleNodes (BGraph *graph, float limit) |
BNode * | BLI_FindNodeByPosition (BGraph *graph, float *p, float limit) |
static void | flagSubgraph (BNode *node, int subgraph) |
int | BLI_FlagSubgraphs (BGraph *graph) |
void | BLI_ReflagSubgraph (BGraph *graph, int old_subgraph, int new_subgraph) |
static int | detectCycle (BNode *node, BArc *src_arc) |
int | BLI_isGraphCyclic (BGraph *graph) |
BArc * | BLI_findConnectedArc (BGraph *graph, BArc *arc, BNode *v) |
static int | subtreeShape (BNode *node, BArc *rootArc, int include_root) |
int | BLI_subtreeShape (BGraph *graph, BNode *node, BArc *rootArc, int include_root) |
float | BLI_subtreeLength (BNode *node) |
void | BLI_calcGraphLength (BGraph *graph) |
static void | markdownSymmetryArc (BGraph *graph, BArc *arc, BNode *node, int level, float limit) |
void | BLI_mirrorAlongAxis (float v[3], float center[3], float axis[3]) |
static void | handleRadialSymmetry (BGraph *graph, BNode *root_node, int depth, float axis[3], float limit) |
static void | markdownSecondarySymmetry (BGraph *graph, BNode *node, int depth, int level, float limit) |
void | BLI_markdownSymmetry (BGraph *graph, BNode *root_node, float limit) |
void * | IT_head (void *arg) |
void * | IT_tail (void *arg) |
void * | IT_peek (void *arg, int n) |
void * | IT_next (void *arg) |
void * | IT_nextN (void *arg, int n) |
void * | IT_previous (void *arg) |
int | IT_stopped (void *arg) |
Definition in file graph.c.
Definition at line 101 of file graph.c.
References BNode::arcs, and BNode::flag.
Referenced by BLI_buildAdjacencyList(), and BLI_rebuildAdjacencyListForNode().
void BLI_buildAdjacencyList | ( | BGraph * | graph | ) |
Definition at line 107 of file graph.c.
References addArcToNodeAdjacencyList(), BGraph::arcs, BNode::arcs, BNode::degree, ListBase::first, BNode::flag, BArc::head, MEM_callocN(), MEM_freeN(), BArc::next, BNode::next, BGraph::nodes, NULL, and BArc::tail.
Referenced by armatureSelectedToGraph(), BIF_ReebGraphMultiFromEditMesh(), BLI_FlagSubgraphs(), copyReebGraph(), finalizeGraph(), joinSubgraphs(), and RIG_graphFromArmature().
void BLI_calcGraphLength | ( | BGraph * | graph | ) |
Definition at line 498 of file graph.c.
References BLI_FlagSubgraphs(), BLI_subtreeLength(), BNode::degree, ListBase::first, i, BGraph::length, length(), MAX2, BNode::next, BGraph::nodes, and BNode::subgraph_index.
Referenced by BIF_ReebGraphMultiFromEditMesh().
Definition at line 414 of file graph.c.
References BGraph::arcs, ListBase::first, BArc::head, BArc::next, and BArc::tail.
Referenced by removeNormalNodes().
Definition at line 283 of file graph.c.
References distance(), ListBase::first, len_v3v3(), BGraph::nodes, and NULL.
Referenced by RIG_removeUneededOffsets().
void BLI_flagArcs | ( | BGraph * | graph, |
int | flag | ||
) |
Definition at line 91 of file graph.c.
References BGraph::arcs, ListBase::first, BArc::flag, and BArc::next.
Referenced by BIF_flagMultiArcs(), and BLI_markdownSymmetry().
void BLI_flagNodes | ( | BGraph * | graph, |
int | flag | ||
) |
Definition at line 81 of file graph.c.
References ListBase::first, BNode::flag, BNode::next, and BGraph::nodes.
Referenced by BLI_isGraphCyclic(), BLI_markdownSymmetry(), BLI_subtreeShape(), and reweightSubgraph().
int BLI_FlagSubgraphs | ( | BGraph * | graph | ) |
Definition at line 319 of file graph.c.
References BLI_buildAdjacencyList(), BLI_hasAdjacencyList(), ListBase::first, flagSubgraph(), BNode::next, BGraph::nodes, and BNode::subgraph_index.
Referenced by BLI_calcGraphLength(), and joinSubgraphs().
void BLI_freeAdjacencyList | ( | BGraph * | graph | ) |
Definition at line 172 of file graph.c.
References BNode::arcs, ListBase::first, MEM_freeN(), BNode::next, BGraph::nodes, and NULL.
Definition at line 47 of file graph.c.
References BNode::arcs, BGraph::free_node, and MEM_freeN().
Referenced by BLI_removeNode(), REEB_freeGraph(), and RIG_freeRigGraph().
int BLI_hasAdjacencyList | ( | BGraph * | graph | ) |
Definition at line 186 of file graph.c.
References BNode::arcs, ListBase::first, BNode::next, BGraph::nodes, and NULL.
Referenced by BLI_FlagSubgraphs().
int BLI_isGraphCyclic | ( | BGraph * | graph | ) |
Definition at line 391 of file graph.c.
References BLI_flagNodes(), detectCycle(), ListBase::first, BNode::flag, BNode::next, BGraph::nodes, and NULL.
Referenced by armatureSelectedToGraph(), BLI_markdownSymmetry(), joinSubgraphs(), and RIG_graphFromArmature().
Definition at line 1033 of file graph.c.
References BGraph::arcs, BNode::arcs, BLI_flagArcs(), BLI_flagNodes(), BLI_isGraphCyclic(), BNode::degree, ListBase::first, BArc::head, markdownSymmetryArc(), BArc::next, NULL, BNode::symmetry_level, BArc::symmetry_level, and BArc::tail.
Referenced by armatureSelectedToGraph(), BIF_ReebGraphMultiFromEditMesh(), and RIG_graphFromArmature().
void BLI_mirrorAlongAxis | ( | float | v[3], |
float | center[3], | ||
float | axis[3] | ||
) |
Definition at line 529 of file graph.c.
References add_v3_v3(), mul_v3_fl(), project_v3_v3v3(), and sub_v3_v3v3().
Referenced by REEB_AxialSymmetry(), REEB_RadialSymmetry(), testAxialSymmetry(), and testRadialSymmetry().
Definition at line 66 of file graph.c.
References BArc::head, and BArc::tail.
Referenced by BLI_subtreeLength(), detectCycle(), flagSubgraph(), handleAxialSymmetry(), handleRadialSymmetry(), markdownSymmetryArc(), REEB_RadialSymmetry(), retargetSubgraph(), reweightArc(), subtreeShape(), and testRadialSymmetry().
Definition at line 140 of file graph.c.
References addArcToNodeAdjacencyList(), BGraph::arcs, BNode::arcs, BNode::degree, ListBase::first, BNode::flag, BArc::head, MEM_callocN(), MEM_freeN(), BArc::next, NULL, and BArc::tail.
Referenced by joinSubgraphsEnds().
void BLI_ReflagSubgraph | ( | BGraph * | graph, |
int | old_subgraph, | ||
int | new_subgraph | ||
) |
Definition at line 346 of file graph.c.
References ListBase::first, BNode::flag, BNode::next, and BGraph::nodes.
Referenced by joinSubgraphsEnds().
Definition at line 71 of file graph.c.
References BGraph::arcs, BLI_freelinkN(), and BGraph::free_arc.
Referenced by RIG_joinArcs().
void BLI_removeDoubleNodes | ( | BGraph * | graph, |
float | limit | ||
) |
Definition at line 266 of file graph.c.
References BLI_replaceNode(), ListBase::first, len_v3v3(), BNode::next, BGraph::nodes, and BNode::p.
Referenced by armatureSelectedToGraph(), and RIG_graphFromArmature().
Definition at line 60 of file graph.c.
References BLI_freelinkN(), BLI_freeNode(), and BGraph::nodes.
Referenced by BLI_replaceNode(), BLI_replaceNodeInArc(), filterInternalExternalReebGraph(), filterNullReebGraph(), joinSubgraphsEnds(), mergeConnectedArcs(), removeZeroNodes(), and RIG_joinArcs().
Definition at line 229 of file graph.c.
References BGraph::arcs, BLI_freelinkN(), BLI_removeNode(), BNode::degree, ListBase::first, BGraph::free_arc, BArc::head, BArc::next, and BArc::tail.
Referenced by BLI_removeDoubleNodes().
Definition at line 201 of file graph.c.
References BGraph::arcs, BLI_freelinkN(), BLI_removeNode(), BNode::degree, BGraph::free_arc, BArc::head, and BArc::tail.
Referenced by RIG_removeUneededOffsets().
float BLI_subtreeLength | ( | BNode * | node | ) |
Definition at line 476 of file graph.c.
References BNode::arcs, BLI_otherNode(), BLI_subtreeLength(), BNode::degree, BNode::flag, i, length(), BArc::length, and MAX2.
Referenced by BLI_calcGraphLength(), and BLI_subtreeLength().
Definition at line 470 of file graph.c.
References BLI_flagNodes(), and subtreeShape().
Referenced by markdownSymmetryArc(), matchMultiResolutionArc(), matchMultiResolutionNode(), and matchMultiResolutionStartingNode().
Definition at line 361 of file graph.c.
References BNode::arcs, BLI_otherNode(), BNode::degree, BNode::flag, and i.
Referenced by BLI_isGraphCyclic().
static void flagAxialSymmetry | ( | BNode * | root_node, |
BNode * | end_node, | ||
BArc * | arc, | ||
int | group | ||
) | [static] |
Definition at line 781 of file graph.c.
References dot_v3v3(), BNode::p, sub_v3_v3v3(), SYM_SIDE_NEGATIVE, SYM_SIDE_POSITIVE, BNode::symmetry_axis, BArc::symmetry_flag, and BArc::symmetry_group.
Referenced by testAxialSymmetry().
static void flagSubgraph | ( | BNode * | node, |
int | subgraph | ||
) | [static] |
Definition at line 302 of file graph.c.
References BNode::arcs, BLI_otherNode(), BNode::degree, i, and BNode::subgraph_index.
Referenced by BLI_FlagSubgraphs().
static void handleAxialSymmetry | ( | BGraph * | graph, |
BNode * | root_node, | ||
int | depth, | ||
float | axis[3], | ||
float | limit | ||
) | [static] |
Definition at line 852 of file graph.c.
References BNode::arcs, BLI_otherNode(), BNode::degree, i, NULL, SYM_TOPOLOGICAL, BNode::symmetry_flag, BArc::symmetry_level, and testAxialSymmetry().
Referenced by markdownSecondarySymmetry().
static void handleRadialSymmetry | ( | BGraph * | graph, |
BNode * | root_node, | ||
int | depth, | ||
float | axis[3], | ||
float | limit | ||
) | [static] |
Definition at line 624 of file graph.c.
References RadialArc::arc, BNode::arcs, BLI_otherNode(), BNode::degree, fabsf, i, BArc::length, MEM_callocN(), MEM_freeN(), RadialArc::n, normalize_v3(), NULL, BNode::p, project_v3_v3v3(), sub_v3_v3v3(), SYM_TOPOLOGICAL, BNode::symmetry_flag, BArc::symmetry_level, testAxialSymmetry(), and testRadialSymmetry().
Referenced by markdownSecondarySymmetry().
void* IT_head | ( | void * | arg | ) |
Definition at line 1095 of file graph.c.
References BArcIterator::head.
Referenced by subdivideArcBy().
void* IT_next | ( | void * | arg | ) |
Definition at line 1125 of file graph.c.
References BArcIterator::next.
Referenced by calculateArcLength(), ExtendArcBuckets(), REEB_AxialSymmetry(), REEB_RadialSymmetry(), and retargetArctoArcLength().
void* IT_nextN | ( | void * | arg, |
int | n | ||
) |
Definition at line 1131 of file graph.c.
References BArcIterator::nextN.
void* IT_peek | ( | void * | arg, |
int | n | ||
) |
Definition at line 1107 of file graph.c.
References BArcIterator::head, BArcIterator::index, BArcIterator::length, BArcIterator::peek, and BArcIterator::tail.
Referenced by calcArcCorrelation(), costDistance(), nextAdaptativeSubdivision(), nextFixedSubdivision(), nextLengthSubdivision(), retargetArctoArcAggresive(), and subdivideArcBy().
void* IT_previous | ( | void * | arg | ) |
Definition at line 1137 of file graph.c.
References BArcIterator::previous.
int IT_stopped | ( | void * | arg | ) |
Definition at line 1143 of file graph.c.
References BArcIterator::stopped.
Referenced by ExtendArcBuckets().
void* IT_tail | ( | void * | arg | ) |
Definition at line 1101 of file graph.c.
References BArcIterator::tail.
static void markdownSecondarySymmetry | ( | BGraph * | graph, |
BNode * | node, | ||
int | depth, | ||
int | level, | ||
float | limit | ||
) | [static] |
Definition at line 891 of file graph.c.
References add_v3_v3(), BNode::arcs, BNode::degree, handleAxialSymmetry(), handleRadialSymmetry(), BArc::head, i, markdownSymmetryArc(), normalize_v3(), BNode::p, sub_v3_v3v3(), BArc::symmetry_level, and BArc::tail.
Referenced by markdownSymmetryArc().
static void markdownSymmetryArc | ( | BGraph * | graph, |
BArc * | arc, | ||
BNode * | node, | ||
int | level, | ||
float | limit | ||
) | [static] |
Definition at line 942 of file graph.c.
References BNode::arcs, BLI_otherNode(), BLI_subtreeShape(), BNode::degree, i, markdownSecondarySymmetry(), NULL, and BArc::symmetry_level.
Referenced by BLI_markdownSymmetry(), and markdownSecondarySymmetry().
Definition at line 431 of file graph.c.
References BNode::arcs, BLI_otherNode(), BNode::degree, BNode::flag, i, NULL, and SHAPE_RADIX.
Referenced by BLI_subtreeShape().
static void testAxialSymmetry | ( | BGraph * | graph, |
BNode * | root_node, | ||
BNode * | node1, | ||
BNode * | node2, | ||
BArc * | arc1, | ||
BArc * | arc2, | ||
float | axis[3], | ||
float | limit, | ||
int | group | ||
) | [static] |
Definition at line 799 of file graph.c.
References abs(), add_v3_v3(), BGraph::axial_symmetry, BLI_mirrorAlongAxis(), copy_v3_v3(), cross_v3_v3v3(), flagAxialSymmetry(), len_v3v3(), negate_v3(), p, BNode::p, sub_v3_v3v3(), SYM_AXIAL, SYM_PHYSICAL, BNode::symmetry_axis, and BNode::symmetry_flag.
Referenced by handleAxialSymmetry(), and handleRadialSymmetry().
static void testRadialSymmetry | ( | BGraph * | graph, |
BNode * | root_node, | ||
RadialArc * | ring, | ||
int | total, | ||
float | axis[3], | ||
float | limit, | ||
int | group | ||
) | [static] |
Definition at line 539 of file graph.c.
References add_v3_v3v3(), angle(), RadialArc::arc, BLI_mirrorAlongAxis(), BLI_otherNode(), copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), FLT_MAX, i, len_v3v3(), p, BNode::p, BGraph::radial_symmetry, SYM_PHYSICAL, SYM_RADIAL, SYM_SIDE_RADIAL, BNode::symmetry_axis, BArc::symmetry_flag, BNode::symmetry_flag, and BArc::symmetry_group.
Referenced by handleRadialSymmetry().