2007-12-26 09:39:15 +00:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2007-12-26 09:39:15 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2007 by Nicholas Bishop
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2009-12-09 13:37:19 +00:00
|
|
|
#ifndef BKE_MULTIRES_H
|
|
|
|
#define BKE_MULTIRES_H
|
|
|
|
|
2009-01-06 18:59:03 +00:00
|
|
|
struct DerivedMesh;
|
2007-12-26 09:39:15 +00:00
|
|
|
struct Mesh;
|
2009-01-06 18:59:03 +00:00
|
|
|
struct MFace;
|
2009-12-09 13:37:19 +00:00
|
|
|
struct Multires;
|
2009-01-06 18:59:03 +00:00
|
|
|
struct MultiresModifierData;
|
2010-04-13 06:06:49 +00:00
|
|
|
struct ModifierData;
|
2007-12-26 09:39:15 +00:00
|
|
|
struct Object;
|
2010-11-04 16:00:28 +00:00
|
|
|
struct Scene;
|
|
|
|
struct MDisps;
|
2007-12-26 09:39:15 +00:00
|
|
|
|
2009-06-07 18:09:22 +00:00
|
|
|
void multires_mark_as_modified(struct Object *ob);
|
2007-12-26 09:39:15 +00:00
|
|
|
|
2009-01-06 18:59:03 +00:00
|
|
|
void multires_force_update(struct Object *ob);
|
2010-02-07 10:16:42 +00:00
|
|
|
void multires_force_render_update(struct Object *ob);
|
2010-06-01 19:26:35 +00:00
|
|
|
void multires_force_external_reload(struct Object *ob);
|
2007-12-26 09:39:15 +00:00
|
|
|
|
2010-09-09 00:14:51 +00:00
|
|
|
void multiresModifier_set_levels_from_disps(struct MultiresModifierData *mmd, struct Object *ob);
|
|
|
|
|
2009-12-09 13:37:19 +00:00
|
|
|
struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*,
|
|
|
|
int local_mmd, struct DerivedMesh*, struct Object *, int, int);
|
2007-12-26 09:39:15 +00:00
|
|
|
|
2010-07-05 12:20:49 +00:00
|
|
|
struct MultiresModifierData *find_multires_modifier_before(struct Scene *scene,
|
|
|
|
struct ModifierData *lastmd);
|
2011-01-31 20:02:51 +00:00
|
|
|
struct MultiresModifierData *get_multires_modifier(struct Scene *scene, struct Object *ob, int use_first);
|
2010-06-06 15:22:27 +00:00
|
|
|
struct DerivedMesh *get_multires_dm(struct Scene *scene, struct MultiresModifierData *mmd,
|
|
|
|
struct Object *ob);
|
2009-01-06 18:59:03 +00:00
|
|
|
void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
|
2011-01-07 21:12:47 +00:00
|
|
|
void multiresModifier_base_apply(struct MultiresModifierData *mmd, struct Object *ob);
|
2009-11-25 14:07:12 +00:00
|
|
|
void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob,
|
2009-01-06 18:59:03 +00:00
|
|
|
int updateblock, int simple);
|
2010-06-06 15:22:27 +00:00
|
|
|
int multiresModifier_reshape(struct Scene *scene, struct MultiresModifierData *mmd,
|
|
|
|
struct Object *dst, struct Object *src);
|
|
|
|
int multiresModifier_reshapeFromDM(struct Scene *scene, struct MultiresModifierData *mmd,
|
|
|
|
struct Object *ob, struct DerivedMesh *srcdm);
|
|
|
|
int multiresModifier_reshapeFromDeformMod(struct Scene *scene, struct MultiresModifierData *mmd,
|
|
|
|
struct Object *ob, struct ModifierData *md);
|
2009-01-06 18:59:03 +00:00
|
|
|
|
2009-12-09 13:37:19 +00:00
|
|
|
void multires_stitch_grids(struct Object *);
|
|
|
|
|
2009-01-06 18:59:03 +00:00
|
|
|
/* Related to the old multires */
|
2009-12-10 17:37:04 +00:00
|
|
|
void multires_free(struct Multires *mr);
|
|
|
|
void multires_load_old(struct Object *ob, struct Mesh *me);
|
|
|
|
void multires_load_old_250(struct Mesh *);
|
2009-12-09 13:37:19 +00:00
|
|
|
|
2010-10-25 08:03:05 +00:00
|
|
|
void multiresModifier_scale_disp(struct Scene *scene, struct Object *ob);
|
|
|
|
void multiresModifier_prepare_join(struct Scene *scene, struct Object *ob, struct Object *to_ob);
|
|
|
|
|
2010-11-04 16:00:28 +00:00
|
|
|
int multires_mdisp_corners(struct MDisps *s);
|
2010-12-13 21:22:30 +00:00
|
|
|
void multires_mdisp_smooth_bounds(struct MDisps *disps);
|
2010-11-04 16:00:28 +00:00
|
|
|
|
|
|
|
/* update multires data after topology changing */
|
2011-01-30 17:55:48 +00:00
|
|
|
void multires_topology_changed(struct Scene *scene, struct Object *ob);
|
2010-11-04 16:00:28 +00:00
|
|
|
|
2011-01-02 16:43:28 +00:00
|
|
|
/**** interpolation stuff ****/
|
2011-02-12 10:18:21 +00:00
|
|
|
void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v);
|
|
|
|
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);
|
|
|
|
int mdisp_rot_face_to_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y);
|
|
|
|
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);
|
|
|
|
void mdisp_flip_disp(const int S, const int corners, const float axis_x[2], const float axis_y[2], float disp[3]);
|
2011-01-02 17:38:22 +00:00
|
|
|
void mdisp_join_tris(struct MDisps *dst, struct MDisps *tri1, struct MDisps *tri2);
|
2011-01-02 16:43:28 +00:00
|
|
|
|
2011-02-12 10:18:21 +00:00
|
|
|
#endif // BKE_MULTIRES_H
|
2009-12-09 13:37:19 +00:00
|
|
|
|