Blender  V2.59
uvedit_parametrizer.h
Go to the documentation of this file.
00001 
00005 #ifndef __PARAMETRIZER_H__
00006 #define __PARAMETRIZER_H__
00007 
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011         
00012 #include "BLO_sys_types.h" // for intptr_t support
00013 
00014 typedef void ParamHandle;       /* handle to a set of charts */
00015 typedef intptr_t ParamKey;              /* (hash) key for identifying verts and faces */
00016 typedef enum ParamBool {
00017         PARAM_TRUE = 1,
00018         PARAM_FALSE = 0
00019 } ParamBool;
00020 
00021 /* Chart construction:
00022    -------------------
00023    - faces and seams may only be added between construct_{begin|end}
00024    - the pointers to co and uv are stored, rather than being copied
00025    - vertices are implicitly created
00026    - in construct_end the mesh will be split up according to the seams
00027    - the resulting charts must be:
00028           - manifold, connected, open (at least one boundary loop)
00029    - output will be written to the uv pointers
00030 */
00031 
00032 ParamHandle *param_construct_begin(void);
00033 
00034 void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy);
00035 
00036 void param_face_add(ParamHandle *handle,
00037                                         ParamKey key,
00038                                         int nverts,     
00039                                         ParamKey *vkeys,
00040                                         float **co,
00041                                         float **uv,
00042                                         ParamBool *pin,
00043                                         ParamBool *select);
00044 
00045 void param_edge_set_seam(ParamHandle *handle,
00046                                                  ParamKey *vkeys);
00047 
00048 void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl);
00049 void param_delete(ParamHandle *chart);
00050 
00051 /* Least Squares Conformal Maps:
00052    -----------------------------
00053    - charts with less than two pinned vertices are assigned 2 pins
00054    - lscm is divided in three steps:
00055           - begin: compute matrix and it's factorization (expensive)
00056           - solve using pinned coordinates (cheap)
00057           - end: clean up 
00058         - uv coordinates are allowed to change within begin/end, for
00059           quick re-solving
00060 */
00061 
00062 void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf);
00063 void param_lscm_solve(ParamHandle *handle);
00064 void param_lscm_end(ParamHandle *handle);
00065 
00066 /* Stretch */
00067 
00068 void param_stretch_begin(ParamHandle *handle);
00069 void param_stretch_blend(ParamHandle *handle, float blend);
00070 void param_stretch_iter(ParamHandle *handle);
00071 void param_stretch_end(ParamHandle *handle);
00072 
00073 /* Area Smooth */
00074 
00075 void param_smooth_area(ParamHandle *handle);
00076 
00077 /* Packing */
00078 
00079 void param_pack(ParamHandle *handle, float margin);
00080 
00081 /* Average area for all charts */
00082 
00083 void param_average(ParamHandle *handle);
00084 
00085 /* Simple x,y scale */
00086 
00087 void param_scale(ParamHandle *handle, float x, float y);
00088 
00089 /* Flushing */
00090 
00091 void param_flush(ParamHandle *handle);
00092 void param_flush_restore(ParamHandle *handle);
00093 
00094 
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098 
00099 #endif /*__PARAMETRIZER_H__*/
00100