Merge with trunk r37546
[blender-staging.git] / source / blender / blenkernel / BKE_dynamicpaint.h
1 /**
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * Contributor(s): Miika Hämäläinen
10  *
11  * ***** END GPL LICENSE BLOCK *****
12  */
13
14 #ifndef BKE_DYNAMIC_PAINT_H_
15 #define BKE_DYNAMIC_PAINT_H_
16
17 #include "DNA_dynamicpaint_types.h"
18
19 /* Actual surface point */
20 typedef struct PaintSurfaceData {
21         /* surface format data */
22         void *format_data;
23         /* surface type data */
24         void *type_data;
25
26         unsigned int total_points;
27         short samples;
28
29 } PaintSurfaceData;
30
31 /* Paint type surface point     */
32 typedef struct PaintPoint {
33
34         /* Wet paint is handled at effect layer only
35         *  and mixed to surface when drying */
36         float e_color[3];
37         float e_alpha;
38         float wetness;
39         short state;    /* -1 = doesn't exist (On UV mapped image
40                                         *           there can be points that doesn't exist on mesh surface)
41                                         *  0 = empty or dry
42                                         *  1 = wet paint
43                                         *  2 = new paint */
44         float color[3];
45         float alpha;
46 } PaintPoint;
47
48 /* iWave type surface point     */
49 typedef struct PaintIWavePoint {                
50
51         float source;
52         float obstruction;
53         float height, previousHeight;
54
55         float foam;
56
57         float verticalDerivative;
58
59 } PaintIWavePoint;
60
61 struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
62 void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
63 int dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
64 int dynamicPaint_surfaceHasPreview(DynamicPaintSurface *surface);
65 void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
66 void dynamicPaintSurface_setUniqueName(DynamicPaintSurface *surface, char *basename);
67 void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd);
68 void dynamicPaint_Modifier_createType(struct DynamicPaintModifierData *pmd);
69 void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tsmd);
70
71 #endif /* BKE_DYNAMIC_PAINT_H_ */