Blender  V2.93
uvedit_parametrizer.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
23 #include "BLI_sys_types.h" /* for intptr_t support */
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 typedef void ParamHandle; /* handle to a set of charts */
30 typedef intptr_t ParamKey; /* (hash) key for identifying verts and faces */
31 typedef enum ParamBool {
35 
36 /* Chart construction:
37  * -------------------
38  * - faces and seams may only be added between construct_{begin|end}
39  * - the pointers to co and uv are stored, rather than being copied
40  * - vertices are implicitly created
41  * - in construct_end the mesh will be split up according to the seams
42  * - the resulting charts must be:
43  * - manifold, connected, open (at least one boundary loop)
44  * - output will be written to the uv pointers
45  */
46 
48 
49 void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy);
50 
51 void param_face_add(ParamHandle *handle,
52  ParamKey key,
53  int nverts,
54  ParamKey *vkeys,
55  float *co[4],
56  float *uv[4],
57  ParamBool *pin,
58  ParamBool *select);
59 
60 void param_edge_set_seam(ParamHandle *handle, ParamKey *vkeys);
61 
62 void param_construct_end(ParamHandle *handle,
63  ParamBool fill,
64  ParamBool topology_from_uvs,
65  int *count_fail);
66 void param_delete(ParamHandle *handle);
67 
68 /* Least Squares Conformal Maps:
69  * -----------------------------
70  * - charts with less than two pinned vertices are assigned 2 pins
71  * - lscm is divided in three steps:
72  * - begin: compute matrix and its factorization (expensive)
73  * - solve using pinned coordinates (cheap)
74  * - end: clean up
75  * - uv coordinates are allowed to change within begin/end, for
76  * quick re-solving
77  */
78 
79 void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf);
80 void param_lscm_solve(ParamHandle *handle, int *count_changed, int *count_failed);
81 void param_lscm_end(ParamHandle *handle);
82 
83 /* Stretch */
84 
85 void param_stretch_begin(ParamHandle *handle);
86 void param_stretch_blend(ParamHandle *handle, float blend);
87 void param_stretch_iter(ParamHandle *handle);
88 void param_stretch_end(ParamHandle *handle);
89 
90 /* Area Smooth */
91 
92 void param_smooth_area(ParamHandle *handle);
93 
94 /* Packing */
95 
96 void param_pack(ParamHandle *handle, float margin, bool do_rotate, bool ignore_pinned);
97 
98 /* Average area for all charts */
99 
100 void param_average(ParamHandle *handle, bool ignore_pinned);
101 
102 /* Simple x,y scale */
103 
104 void param_scale(ParamHandle *handle, float x, float y);
105 
106 /* Flushing */
107 
108 void param_flush(ParamHandle *handle);
109 void param_flush_restore(ParamHandle *handle);
110 
111 #ifdef __cplusplus
112 }
113 #endif
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_W64 int intptr_t
Definition: stdint.h:121
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: util_avxb.h:167
void param_stretch_begin(ParamHandle *handle)
void param_stretch_iter(ParamHandle *handle)
void param_stretch_end(ParamHandle *handle)
void param_delete(ParamHandle *handle)
void param_flush_restore(ParamHandle *handle)
void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy)
void param_flush(ParamHandle *handle)
ParamHandle * param_construct_begin(void)
void param_scale(ParamHandle *handle, float x, float y)
void param_average(ParamHandle *handle, bool ignore_pinned)
void param_face_add(ParamHandle *handle, ParamKey key, int nverts, ParamKey *vkeys, float *co[4], float *uv[4], ParamBool *pin, ParamBool *select)
void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf)
void param_pack(ParamHandle *handle, float margin, bool do_rotate, bool ignore_pinned)
void param_smooth_area(ParamHandle *handle)
void param_edge_set_seam(ParamHandle *handle, ParamKey *vkeys)
void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool topology_from_uvs, int *count_fail)
@ PARAM_TRUE
@ PARAM_FALSE
void param_lscm_solve(ParamHandle *handle, int *count_changed, int *count_failed)
void ParamHandle
intptr_t ParamKey
void param_lscm_end(ParamHandle *handle)
void param_stretch_blend(ParamHandle *handle, float blend)