Blender V2.61 - r43446

meshlaplacian.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  * BIF_meshlaplacian.h: Algorithms using the mesh laplacian.
00027  */
00028 
00034 #ifndef BIF_MESHLAPLACIAN_H
00035 #define BIF_MESHLAPLACIAN_H
00036 
00037 //#define RIGID_DEFORM
00038 
00039 struct Scene;
00040 struct Object;
00041 struct Mesh;
00042 struct bDeformGroup;
00043 struct MeshDeformModifierData;
00044 
00045 #ifdef RIGID_DEFORM
00046 struct EditMesh;
00047 #endif
00048 
00049 /* Laplacian System */
00050 
00051 struct LaplacianSystem;
00052 typedef struct LaplacianSystem LaplacianSystem;
00053 
00054 LaplacianSystem *laplacian_construct_begin(int totvert, int totface, int lsq);
00055 
00056 void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned);
00057 void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3);
00058 
00059 void laplacian_construct_end(LaplacianSystem *sys);
00060 void laplacian_delete(LaplacianSystem *sys);
00061 
00062 void laplacian_begin_solve(LaplacianSystem *sys, int index);
00063 void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value);
00064 int laplacian_system_solve(LaplacianSystem *sys);
00065 float laplacian_system_get_solution(int v);
00066 
00067 /* Heat Weighting */
00068 
00069 void heat_bone_weighting(struct Object *ob, struct Mesh *me, float (*verts)[3],
00070     int numbones, struct bDeformGroup **dgrouplist,
00071     struct bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3],
00072     int *selected, const char **error);
00073 
00074 #ifdef RIGID_DEFORM
00075 /* As-Rigid-As-Possible Deformation */
00076 
00077 void rigid_deform_begin(struct EditMesh *em);
00078 void rigid_deform_iteration(void);
00079 void rigid_deform_end(int cancel);
00080 #endif
00081 
00082 /* Harmonic Coordinates */
00083 
00084 /* mesh_deform_bind(...) defined in ED_armature.h */
00085 
00086 #endif
00087