Blender V2.61 - r43446

sculpt_intern.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) 2006 by Nicholas Bishop
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  */
00027 
00033 #ifndef BDR_SCULPTMODE_H
00034 #define BDR_SCULPTMODE_H
00035 
00036 #include "DNA_listBase.h"
00037 #include "DNA_vec_types.h"
00038 #include "DNA_key_types.h"
00039 
00040 #include "BLI_pbvh.h"
00041 
00042 struct bContext;
00043 struct Brush;
00044 struct KeyBlock;
00045 struct Mesh;
00046 struct MultiresModifierData;
00047 struct Object;
00048 struct Scene;
00049 struct Sculpt;
00050 struct SculptStroke;
00051 
00052 /* Interface */
00053 void sculptmode_selectbrush_menu(void);
00054 void sculptmode_draw_mesh(int);
00055 void sculpt_paint_brush(char clear);
00056 void sculpt_stroke_draw(struct SculptStroke *);
00057 void sculpt_radialcontrol_start(int mode);
00058 struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct Object *ob);
00059 
00060 struct Brush *sculptmode_brush(void);
00061 
00062 void sculpt(Sculpt *sd);
00063 
00064 int sculpt_poll(struct bContext *C);
00065 void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, int need_fmap);
00066 
00067 /* Deformed mesh sculpt */
00068 void free_sculptsession_deformMats(struct SculptSession *ss);
00069 
00070 /* Stroke */
00071 struct SculptStroke *sculpt_stroke_new(const int max);
00072 void sculpt_stroke_free(struct SculptStroke *);
00073 void sculpt_stroke_add_point(struct SculptStroke *, const short x, const short y);
00074 void sculpt_stroke_apply(struct Sculpt *sd, struct SculptStroke *);
00075 void sculpt_stroke_apply_all(struct Sculpt *sd, struct SculptStroke *);
00076 int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float out[3], float mouse[2]);
00077 
00078 /* Undo */
00079 
00080 typedef struct SculptUndoNode {
00081     struct SculptUndoNode *next, *prev;
00082 
00083     char idname[MAX_ID_NAME];   /* name instead of pointer*/
00084     void *node;                 /* only during push, not valid afterwards! */
00085 
00086     float (*co)[3];
00087     float (*orig_co)[3];
00088     short (*no)[3];
00089     int totvert;
00090 
00091     /* non-multires */
00092     int maxvert;                /* to verify if totvert it still the same */
00093     int *index;                 /* to restore into right location */
00094 
00095     /* multires */
00096     int maxgrid;                /* same for grid */
00097     int gridsize;               /* same for grid */
00098     int totgrid;                /* to restore into right location */
00099     int *grids;                 /* to restore into right location */
00100 
00101     /* layer brush */
00102     float *layer_disp;
00103 
00104     /* shape keys */
00105     char shapeName[sizeof(((KeyBlock *)0))->name];
00106 } SculptUndoNode;
00107 
00108 SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node);
00109 SculptUndoNode *sculpt_undo_get_node(PBVHNode *node);
00110 void sculpt_undo_push_begin(const char *name);
00111 void sculpt_undo_push_end(void);
00112 
00113 void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]);
00114 
00115 #endif