diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-12-01 05:09:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-12-01 05:09:21 +0300 |
commit | d6feeb6b22cf8533d40a04f754e3acafa6e0dd1e (patch) | |
tree | 144f2e608f2e3de02882b11eb64bb0ce64b0ebcb /source/blender/src/parametrizer.h | |
parent | 1eab492c4ba988b1d27d5719c231e6ebf385f45c (diff) |
Orange branch commit.
This commit adds new underlying uv unwrapper code, intended to be
more extensible. At the moment this has a re-implementation of LSCM.
This has not been activated yet, since it doesn't add anything new.
What's new is the stretch minimize tool from tuhopuu. It works by
selecting some some uv's in the uv editor window, and then pressing
ctrl+V. The uv's on the boundary stay fixed.
More stuff will follow as I port it over & fix it.
Diffstat (limited to 'source/blender/src/parametrizer.h')
-rw-r--r-- | source/blender/src/parametrizer.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/source/blender/src/parametrizer.h b/source/blender/src/parametrizer.h new file mode 100644 index 00000000000..a3904af83b9 --- /dev/null +++ b/source/blender/src/parametrizer.h @@ -0,0 +1,73 @@ + +#ifndef __PARAMETRIZER_H__ +#define __PARAMETRIZER_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void ParamHandle; /* handle to a set of charts */ +typedef long ParamKey; /* (hash) key for identifying verts and faces */ +typedef enum ParamBool { + PARAM_TRUE = 1, + PARAM_FALSE = 0 +} ParamBool; + +/* Chart construction: + ------------------- + - faces and seams may only be added between construct_{begin|end} + - the pointers to co and uv are stored, rather than being copied + - vertices are implicitly created + - in construct_end the mesh will be split up according to the seams + - the resulting charts must be: + - manifold, connected, open (at least one boundary loop) + - output will be written to the uv pointers +*/ + +ParamHandle *param_construct_begin(); + +void param_face_add(ParamHandle *handle, + ParamKey key, + int nverts, + ParamKey *vkeys, + float **co, + float **uv, + ParamBool *pin, + ParamBool *select); + +void param_edge_set_seam(ParamHandle *handle, + ParamKey *vkeys); + +void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl); +void param_delete(ParamHandle *chart); + +/* Least Squares Conformal Maps: + ----------------------------- + - charts with less than two pinned vertices are assigned 2 pins + - lscm is divided in three steps: + - begin: compute matrix and it's factorization (expensive) + - solve using pinned coordinates (cheap) + - end: clean up + - uv coordinates are allowed to change within begin/end, for + quick re-solving +*/ + +void param_lscm_begin(ParamHandle *handle); +void param_lscm_solve(ParamHandle *handle); +void param_lscm_end(ParamHandle *handle); + +/* Stretch */ + +void param_stretch_begin(ParamHandle *handle); +void param_stretch_iter(ParamHandle *handle); +void param_stretch_end(ParamHandle *handle, ParamBool restore); + +/* Packing */ +void param_pack(ParamHandle *handle); + +#ifdef __cplusplus +} +#endif + +#endif /*__PARAMETRIZER_H__*/ + |