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