diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-18 01:08:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-18 01:08:25 +0400 |
commit | 0f28c1c27aec41dd22e31aac2c02cdfae785dd1b (patch) | |
tree | 1c41b37d29a56390d810846cd7fe8f1218e40576 /source/blender/editors/uvedit/uvedit_intern.h | |
parent | 9be40c026df54fee796c4073ebd4734c55ed5807 (diff) | |
parent | 408f7963c5cfd65792d826390b01896282de8e97 (diff) |
svn merge ^/trunk/blender -r43461:43472
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_intern.h')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_intern.h | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h index e7156c65491..58bdd8c3265 100644 --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@ -32,11 +32,15 @@ #ifndef ED_UVEDIT_INTERN_H #define ED_UVEDIT_INTERN_H -struct SpaceImage; +struct EditFace; +struct EditMesh; struct MTexPoly; -struct Scene; struct Image; +struct MTFace; struct Object; +struct Scene; +struct SpaceImage; +struct UvElementMap; struct wmOperatorType; struct BMEditMesh; struct BMFace; @@ -52,6 +56,7 @@ struct BMVert; int uvedit_face_visible_nolocal(struct Scene *scene, struct BMFace *efa); /* geometric utilities */ + void uv_center(float uv[][2], float cent[2], int quad); float uv_area(float uv[][2], int quad); void uv_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy); @@ -60,7 +65,55 @@ float poly_uv_area(float uv[][2], int len); void poly_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy, int len); void poly_uv_center(struct BMEditMesh *em, struct BMFace *f, float cent[2]); +/* find nearest */ + +typedef struct NearestHit { + struct BMFace *efa; + struct MTexPoly *tf; + struct BMLoop *l, *nextl; + struct MLoopUV *luv, *nextluv; + int lindex; //index of loop within face + int vert1, vert2; //index in mesh of edge vertices +} NearestHit; + +void uv_find_nearest_vert(struct Scene *scene, struct Image *ima, struct BMEditMesh *em, float co[2], float penalty[2], struct NearestHit *hit); +void uv_find_nearest_edge(struct Scene *scene, struct Image *ima, struct BMEditMesh *em, float co[2], struct NearestHit *hit); + +/* utility tool functions */ + +struct UvElement *ED_get_uv_element(struct UvElementMap *map, struct BMFace *efa, int index); +void uvedit_live_unwrap_update(struct SpaceImage *sima, struct Scene *scene, struct Object *obedit); + +/* smart stitch */ + +/* object that stores display data for previewing before accepting stitching */ +typedef struct StitchPreviewer { + /* OpenGL requires different calls for Triangles and Quads. + * here we'll store the quads of the mesh */ + float *preview_quads; + /* ...and here we'll store the triangles*/ + float *preview_tris; + /* preview data. These will be either the previewed vertices or edges depending on stitch mode settings */ + float *preview_stitchable; + float *preview_unstitchable; + /* here we'll store the number of triangles and quads to be drawn */ + unsigned int num_tris; + unsigned int num_quads; + unsigned int num_stitchable; + unsigned int num_unstitchable; + + /* store static island Quads */ + float *static_quads; + /* ...and here we'll store the triangles*/ + float *static_tris; + unsigned int num_static_tris; + unsigned int num_static_quads; +} StitchPreviewer; + +StitchPreviewer *uv_get_stitch_previewer(void); + /* operators */ + void UV_OT_average_islands_scale(struct wmOperatorType *ot); void UV_OT_cube_project(struct wmOperatorType *ot); void UV_OT_cylinder_project(struct wmOperatorType *ot); @@ -70,6 +123,7 @@ void UV_OT_pack_islands(struct wmOperatorType *ot); void UV_OT_reset(struct wmOperatorType *ot); void UV_OT_sphere_project(struct wmOperatorType *ot); void UV_OT_unwrap(struct wmOperatorType *ot); +void UV_OT_stitch(struct wmOperatorType *ot); #endif /* ED_UVEDIT_INTERN_H */ |