Blender  V2.59
BKE_multires.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BKE_multires.h 37225 2011-06-05 20:54:04Z nazgul $
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) 2007 by Nicholas Bishop
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  */ 
00029 
00030 #ifndef BKE_MULTIRES_H
00031 #define BKE_MULTIRES_H
00032 
00037 struct DerivedMesh;
00038 struct Mesh;
00039 struct MFace;
00040 struct Multires;
00041 struct MultiresModifierData;
00042 struct ModifierData;
00043 struct Object;
00044 struct Scene;
00045 struct MDisps;
00046 
00047 void multires_mark_as_modified(struct Object *ob);
00048 
00049 void multires_force_update(struct Object *ob);
00050 void multires_force_render_update(struct Object *ob);
00051 void multires_force_external_reload(struct Object *ob);
00052 
00053 void multiresModifier_set_levels_from_disps(struct MultiresModifierData *mmd, struct Object *ob);
00054 
00055 struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*,
00056         int local_mmd, struct DerivedMesh*, struct Object *, int, int);
00057 
00058 struct MultiresModifierData *find_multires_modifier_before(struct Scene *scene,
00059         struct ModifierData *lastmd);
00060 struct MultiresModifierData *get_multires_modifier(struct Scene *scene, struct Object *ob, int use_first);
00061 struct DerivedMesh *get_multires_dm(struct Scene *scene, struct MultiresModifierData *mmd,
00062                                 struct Object *ob);
00063 void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
00064 void multiresModifier_base_apply(struct MultiresModifierData *mmd, struct Object *ob);
00065 void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob,
00066                                 int updateblock, int simple);
00067 int multiresModifier_reshape(struct Scene *scene, struct MultiresModifierData *mmd,
00068                                 struct Object *dst, struct Object *src);
00069 int multiresModifier_reshapeFromDM(struct Scene *scene, struct MultiresModifierData *mmd,
00070                                 struct Object *ob, struct DerivedMesh *srcdm);
00071 int multiresModifier_reshapeFromDeformMod(struct Scene *scene, struct MultiresModifierData *mmd,
00072                                 struct Object *ob, struct ModifierData *md);
00073 
00074 void multires_stitch_grids(struct Object *);
00075 
00076 /* Related to the old multires */
00077 void multires_free(struct Multires *mr);
00078 void multires_load_old(struct Object *ob, struct Mesh *me);
00079 void multires_load_old_250(struct Mesh *);
00080 
00081 void multiresModifier_scale_disp(struct Scene *scene, struct Object *ob);
00082 void multiresModifier_prepare_join(struct Scene *scene, struct Object *ob, struct Object *to_ob);
00083 
00084 int multires_mdisp_corners(struct MDisps *s);
00085 void multires_mdisp_smooth_bounds(struct MDisps *disps);
00086 
00087 /* update multires data after topology changing */
00088 void multires_topology_changed(struct Scene *scene, struct Object *ob);
00089 
00090 /**** interpolation stuff ****/
00091 void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v);
00092 void mdisp_rot_crn_to_face(const int S, const int corners, const int face_side, const float x, const float y, float *u, float *v);
00093 int mdisp_rot_face_to_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y);
00094 int mdisp_rot_face_to_quad_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y);
00095 void mdisp_apply_weight(const int S, const int corners, int x, int y, const int face_side, float crn_weight[4][2], float *u_r, float *v_r);
00096 void mdisp_flip_disp(const int S, const int corners, const float axis_x[2], const float axis_y[2], float disp[3]);
00097 void mdisp_join_tris(struct MDisps *dst, struct MDisps *tri1, struct MDisps *tri2);
00098 
00099 #endif // BKE_MULTIRES_H
00100