~ubuntu-branches/ubuntu/lucid/blender/lucid

« back to all changes in this revision

Viewing changes to source/blender/include/reeb.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2009-08-06 22:32:19 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806223219-8z4eej1u8levu4pz
Tags: 2.49a+dfsg-0ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: Build-depend on python-2.6 rather than python-2.5.
  - debian/misc/*.desktop: Add Spanish translation to .desktop 
    files.
  - debian/pyversions: 2.6.
  - debian/rules: Clean *.o of source/blender/python/api2_2x/
* New upstream release (LP: #382153).
* Refreshed patches:
  - 01_sanitize_sys.patch
  - 02_tmp_in_HOME
  - 10_use_systemwide_ftgl
  - 70_portability_platform_detection
* Removed patches merged upstream:
  - 30_fix_python_syntax_warning
  - 90_ubuntu_ffmpeg_52_changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#ifndef REEB_H_
29
29
#define REEB_H_
30
30
 
 
31
#define WITH_BF_REEB
 
32
 
31
33
#include "DNA_listBase.h"
32
34
 
 
35
#include "BLI_graph.h"
 
36
 
 
37
struct GHash;
33
38
struct EdgeHash;
34
39
struct ReebArc;
35
40
struct ReebEdge;
36
41
struct ReebNode;
37
42
 
38
43
typedef struct ReebGraph {
39
 
        ListBase arcs;
40
 
        ListBase nodes;
 
44
        ListBase        arcs;
 
45
        ListBase        nodes;
 
46
        
 
47
        float length;
 
48
        
 
49
        FreeArc                 free_arc;
 
50
        FreeNode                free_node;
 
51
        RadialSymmetry  radial_symmetry;
 
52
        AxialSymmetry   axial_symmetry;
 
53
        /*********************************/
 
54
        
 
55
        int resolution;
41
56
        int totnodes;
42
57
        struct EdgeHash *emap;
 
58
        int multi_level;
 
59
        struct ReebGraph *link_up; /* for multi resolution filtering, points to higher levels */
43
60
} ReebGraph;
44
61
 
45
62
typedef struct EmbedBucket {
46
63
        float val;
47
64
        int       nv;
48
65
        float p[3];
 
66
        float no[3]; /* if non-null, normal of the bucket */
49
67
} EmbedBucket;
50
68
 
51
69
typedef struct ReebNode {
52
 
        struct ReebNode *next, *prev;
 
70
        void *next, *prev;
 
71
        float p[3];
 
72
        int flag;
 
73
 
 
74
        int degree;
53
75
        struct ReebArc **arcs;
 
76
 
 
77
        int subgraph_index;
 
78
 
 
79
        int symmetry_level;
 
80
        int symmetry_flag;
 
81
        float symmetry_axis[3];
 
82
        /*********************************/
 
83
        
 
84
        float no[3];
 
85
 
54
86
        int index;
55
 
        int degree;
56
87
        float weight;
57
 
        float p[3];
58
 
        int flags;
 
88
        int     multi_level;
 
89
        struct ReebNode *link_down; /* for multi resolution filtering, points to lower levels, if present */
 
90
        struct ReebNode *link_up;
59
91
} ReebNode;
60
92
 
61
93
typedef struct ReebEdge {
63
95
        struct ReebArc  *arc;
64
96
        struct ReebNode *v1, *v2;
65
97
        struct ReebEdge *nextEdge;
 
98
        int flag;
66
99
} ReebEdge;
67
100
 
68
101
typedef struct ReebArc {
69
 
        struct ReebArc *next, *prev;
 
102
        void *next, *prev;
 
103
        struct ReebNode *head, *tail;
 
104
        int flag;
 
105
 
 
106
        float length;
 
107
 
 
108
        int symmetry_level;
 
109
        int symmetry_group;
 
110
        int symmetry_flag;
 
111
        /*********************************/
 
112
 
70
113
        ListBase edges;
71
 
        struct ReebNode *v1, *v2;
 
114
        int bcount;
72
115
        struct EmbedBucket *buckets;
73
 
        int     bcount;
74
 
        int flags;
 
116
 
 
117
        struct GHash *faces;    
 
118
        float angle;
 
119
        struct ReebArc *link_up; /* for multi resolution filtering, points to higher levels */
75
120
} ReebArc;
76
121
 
77
122
typedef struct ReebArcIterator {
 
123
        HeadFct         head;
 
124
        TailFct         tail;
 
125
        PeekFct         peek;
 
126
        NextFct         next;
 
127
        NextNFct        nextN;
 
128
        PreviousFct     previous;
 
129
        StoppedFct      stopped;
 
130
        
 
131
        float *p, *no;
 
132
        
 
133
        int length;
 
134
        int index;
 
135
        /*********************************/
78
136
        struct ReebArc  *arc;
79
 
        int index;
80
137
        int start;
81
138
        int end;
82
139
        int stride;
83
140
} ReebArcIterator;
84
141
 
85
142
struct EditMesh;
 
143
struct EdgeIndex;
86
144
 
87
 
int weightToHarmonic(struct EditMesh *em);
88
 
int weightFromDistance(struct EditMesh *em);
 
145
int weightToHarmonic(struct EditMesh *em, struct EdgeIndex *indexed_edges);
 
146
int weightFromDistance(struct EditMesh *em, struct EdgeIndex *indexed_edges);
89
147
int weightFromLoc(struct EditMesh *me, int axis);
90
 
void weightToVCol(struct EditMesh *em);
 
148
void weightToVCol(struct EditMesh *em, int index);
 
149
void arcToVCol(struct ReebGraph *rg, struct EditMesh *em, int index);
 
150
void angleToVCol(struct EditMesh *em, int index);
91
151
void renormalizeWeight(struct EditMesh *em, float newmax);
92
152
 
93
153
ReebGraph * generateReebGraph(struct EditMesh *me, int subdivisions);
94
 
void freeGraph(ReebGraph *rg);
95
 
void exportGraph(ReebGraph *rg, int count);
96
 
 
97
 
#define OTHER_NODE(arc, node) ((arc->v1 == node) ? arc->v2 : arc->v1)
98
 
 
99
 
void initArcIterator(struct ReebArcIterator *iter, struct ReebArc *arc, struct ReebNode *head);
100
 
void initArcIterator2(struct ReebArcIterator *iter, struct ReebArc *arc, int start, int end);
101
 
struct EmbedBucket * nextBucket(struct ReebArcIterator *iter);
 
154
ReebGraph * newReebGraph();
 
155
 
 
156
void initArcIterator(BArcIterator *iter, struct ReebArc *arc, struct ReebNode *head);
 
157
void initArcIterator2(BArcIterator *iter, struct ReebArc *arc, int start, int end);
 
158
void initArcIteratorStart(BArcIterator *iter, struct ReebArc *arc, struct ReebNode *head, int start);
102
159
 
103
160
/* Filtering */
104
161
void filterNullReebGraph(ReebGraph *rg);
 
162
int filterSmartReebGraph(ReebGraph *rg, float threshold);
105
163
int filterExternalReebGraph(ReebGraph *rg, float threshold);
106
164
int filterInternalReebGraph(ReebGraph *rg, float threshold);
107
165
 
110
168
void postprocessGraph(ReebGraph *rg, char mode);
111
169
void removeNormalNodes(ReebGraph *rg);
112
170
 
113
 
/* Graph processing */
114
 
void buildAdjacencyList(ReebGraph *rg);
115
 
 
116
171
void sortNodes(ReebGraph *rg);
117
172
void sortArcs(ReebGraph *rg);
118
173
 
119
 
int subtreeDepth(ReebNode *node, ReebArc *rootArc);
120
 
int countConnectedArcs(ReebGraph *rg, ReebNode *node);
121
 
int hasAdjacencyList(ReebGraph *rg); 
122
 
int     isGraphCyclic(ReebGraph *rg);
123
 
 
124
 
/* Sanity check */
 
174
/*------------ Sanity check ------------*/
125
175
void verifyBuckets(ReebGraph *rg);
 
176
void verifyFaces(ReebGraph *rg);
 
177
 
 
178
/*********************** PUBLIC *********************************/
 
179
 
 
180
#define REEB_MAX_MULTI_LEVEL    10
 
181
 
 
182
ReebGraph *BIF_ReebGraphFromEditMesh(void);
 
183
ReebGraph *BIF_ReebGraphMultiFromEditMesh(void);
 
184
void BIF_flagMultiArcs(ReebGraph *rg, int flag);
 
185
 
 
186
void BIF_GlobalReebGraphFromEditMesh(void);
 
187
void BIF_GlobalReebFree(void);
 
188
 
 
189
ReebNode *BIF_otherNodeFromIndex(ReebArc *arc, ReebNode *node);
 
190
ReebNode *BIF_NodeFromIndex(ReebArc *arc, ReebNode *node);
 
191
ReebNode *BIF_lowestLevelNode(ReebNode *node);
 
192
 
 
193
ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node);
 
194
 
 
195
void REEB_freeGraph(ReebGraph *rg);
 
196
void REEB_freeArc(BArc *barc);
 
197
void REEB_exportGraph(ReebGraph *rg, int count);
 
198
void REEB_draw();
 
199
 
126
200
 
127
201
#endif /*REEB_H_*/