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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2006-02-05 17:12:45 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2006-02-05 17:12:45 +0300
commite66b5e5cd5758f1259ec5a22d47f58ec3e9e3536 (patch)
treef78c0dee14cb1cad78d7ec19bed39d2941f94732 /source/blender/src/parametrizer_intern.h
parent3c9494bbfda098474df7bb5944cf3fbde3d6af43 (diff)
UV Editor Tweaks:
- Set local sticky in the uv editor as default. - Don't do live unwrap on fully selected charts or charts with no pins selected. - Fixed bug with live unwrap not respecting transform cancel in some cases. - "View Home" didn't work without an image. - Move UV Calculation settings (cube size, cylinder radius, ..) into the scene toolsettings, instead of global variables - Remove the name LSCM from the UI (and python docs on seams), and replace it with 'Unwrap', with upcoming ABF this didn't make sense anymore. - Move the Old/New LSCM switch into the UV Calculation panel. New LSCM is the default now. Also renamed LSCM there to "Conformal". - Made some room in the UV Calculation panel by removing the buttons to execute the UV calculation, only leaving the settings. Fill Holes: - LSCM now has an option to fill holes in the chart before unwrapping. This on by default, and enables two things: - Prevent internal overlaps (e.g. eyes, mouth) for LSCM unwrapping. - Allow the internal boundaries to move freely during stretch minimize. - The possibility to switch it off is there because it is not always possible to define which the outer boundary is. For example with an open cylinder where there are two identical holes.
Diffstat (limited to 'source/blender/src/parametrizer_intern.h')
-rw-r--r--source/blender/src/parametrizer_intern.h149
1 files changed, 83 insertions, 66 deletions
diff --git a/source/blender/src/parametrizer_intern.h b/source/blender/src/parametrizer_intern.h
index f22a7e4ab66..3260be236dc 100644
--- a/source/blender/src/parametrizer_intern.h
+++ b/source/blender/src/parametrizer_intern.h
@@ -2,44 +2,25 @@
#ifndef __PARAMETRIZER_INTERN_H__
#define __PARAMETRIZER_INTERN_H__
-/* Hash:
- -----
- - insert only
- - elements are all stored in a flat linked list
-*/
-
-typedef long PHashKey;
-
-typedef struct PHashLink {
- struct PHashLink *next;
- PHashKey key;
-} PHashLink;
-
-typedef struct PHash {
- PHashLink *first;
- PHashLink **buckets;
- int size, cursize, cursize_id;
-} PHash;
-
-PHash *phash_new(int sizehint);
-void phash_delete_with_links(PHash *ph);
-void phash_delete(PHash *ph);
-
-int phash_size(PHash *ph);
-
-void phash_insert(PHash *ph, PHashLink *link);
-PHashLink *phash_lookup(PHash *ph, PHashKey key);
-PHashLink *phash_next(PHash *ph, PHashKey key, PHashLink *link);
+/* Utils */
#if 0
- #define param_assert(condition)
+ #define param_assert(condition);
#define param_warning(message);
+ #define param_test_equals_ptr(condition);
+ #define param_test_equals_int(condition);
#else
#define param_assert(condition) \
if (!(condition)) \
{ printf("Assertion %s:%d\n", __FILE__, __LINE__); abort(); }
#define param_warning(message) \
{ printf("Warning %s:%d: %s\n", __FILE__, __LINE__, message); }
+ #define param_test_equals_ptr(str, a, b) \
+ if (a != b) \
+ { printf("Equals %s => %p != %p\n", str, a, b); };
+ #define param_test_equals_int(str, a, b) \
+ if (a != b) \
+ { printf("Equals %s => %d != %d\n", str, a, b); };
#endif
typedef enum PBool {
@@ -47,6 +28,23 @@ typedef enum PBool {
P_FALSE = 0
} PBool;
+/* Special Purpose Hash */
+
+typedef long PHashKey;
+
+typedef struct PHashLink {
+ struct PHashLink *next;
+ PHashKey key;
+} PHashLink;
+
+typedef struct PHash {
+ PHashLink **list;
+ PHashLink **buckets;
+ int size, cursize, cursize_id;
+} PHash;
+
+
+
struct PVert;
struct PEdge;
struct PFace;
@@ -64,6 +62,8 @@ typedef struct PHeapLink {
typedef struct PHeap {
unsigned int size;
unsigned int bufsize;
+ MemArena *arena;
+ PHeapLink *freelinks;
PHeapLink *links;
PHeapLink **tree;
} PHeap;
@@ -71,58 +71,61 @@ typedef struct PHeap {
/* Simplices */
typedef struct PVert {
- struct PVertLink {
- struct PVert *next;
- PHashKey key;
- } link;
+ struct PVert *nextlink;
+
+ union PVertUnion {
+ PHashKey key; /* construct */
+ int id; /* abf/lscm matrix index */
+ float distortion; /* area smoothing */
+ PHeapLink *heaplink; /* edge collapsing */
+ } u;
struct PEdge *edge;
float *co;
float uv[2];
- int flag;
+ unsigned char flag;
- union PVertUnion {
- int index; /* lscm matrix index */
- float distortion; /* area smoothing */
- } u;
} PVert;
typedef struct PEdge {
- struct PEdgeLink {
- struct PEdge *next;
- PHashKey key;
- } link;
+ struct PEdge *nextlink;
+
+ union PEdgeUnion {
+ PHashKey key; /* construct */
+ int id; /* abf matrix index */
+ PHeapLink *heaplink; /* fill holes */
+ struct PEdge *nextcollapse; /* simplification */
+ } u;
struct PVert *vert;
struct PEdge *pair;
struct PEdge *next;
struct PFace *face;
float *orig_uv, old_uv[2];
- int flag;
+ unsigned short flag;
- union PEdgeUnion {
- PHeapLink *heaplink;
- } u;
} PEdge;
typedef struct PFace {
- struct PFaceLink {
- struct PFace *next;
- PHashKey key;
- } link;
-
- struct PEdge *edge;
- int flag;
+ struct PFace *nextlink;
union PFaceUnion {
- int chart; /* chart construction */
- float area3d; /* stretch */
+ PHashKey key; /* construct */
+ int chart; /* construct splitting*/
+ float area3d; /* stretch */
+ int id; /* abf matrix index */
} u;
+
+ struct PEdge *edge;
+ unsigned char flag;
+
} PFace;
enum PVertFlag {
PVERT_PIN = 1,
- PVERT_SELECT = 2
+ PVERT_SELECT = 2,
+ PVERT_INTERIOR = 4,
+ PVERT_COLLAPSE = 8
};
enum PEdgeFlag {
@@ -131,7 +134,10 @@ enum PEdgeFlag {
PEDGE_PIN = 4,
PEDGE_SELECT = 8,
PEDGE_DONE = 16,
- PEDGE_FILLED = 32
+ PEDGE_FILLED = 32,
+ PEDGE_COLLAPSE = 64,
+ PEDGE_COLLAPSE_EDGE = 128,
+ PEDGE_COLLAPSE_PAIR = 256
};
/* for flipping faces */
@@ -139,15 +145,21 @@ enum PEdgeFlag {
enum PFaceFlag {
PFACE_CONNECTED = 1,
- PFACE_FILLED = 2
+ PFACE_FILLED = 2,
+ PFACE_COLLAPSE = 4
};
/* Chart */
typedef struct PChart {
- PHash *verts;
- PHash *edges;
- PHash *faces;
+ PVert *verts;
+ PEdge *edges;
+ PFace *faces;
+ int nverts, nedges, nfaces;
+
+ PVert *collapsed_verts;
+ PEdge *collapsed_edges;
+ PFace *collapsed_faces;
union PChartUnion {
struct PChartLscm {
@@ -161,7 +173,7 @@ typedef struct PChart {
} pack;
} u;
- int flag;
+ unsigned char flag;
struct PHandle *handle;
} PChart;
@@ -173,16 +185,21 @@ enum PHandleState {
PHANDLE_STATE_ALLOCATED,
PHANDLE_STATE_CONSTRUCTED,
PHANDLE_STATE_LSCM,
- PHANDLE_STATE_STRETCH,
+ PHANDLE_STATE_STRETCH
};
typedef struct PHandle {
+ enum PHandleState state;
+ MemArena *arena;
+
PChart *construction_chart;
+ PHash *hash_verts;
+ PHash *hash_edges;
+ PHash *hash_faces;
+
PChart **charts;
int ncharts;
- enum PHandleState state;
- MemArena *arena;
- PBool implicit;
+
RNG *rng;
float blend;
} PHandle;