Merged changes in the trunk up to revision 43881.
[blender.git] / source / blender / makesdna / DNA_freestyle_types.h
1 /* DNA_freestyle_types.h
2  *
3  * $Id$
4  *
5  * ***** BEGIN GPL LICENSE BLOCK *****
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  * The Original Code is Copyright (C) 2010 Blender Foundation.
22  * All rights reserved.
23  *
24  * The Original Code is: all of this file.
25  *
26  * Contributor(s): none yet.
27  *
28  * ***** END GPL LICENSE BLOCK *****
29  */
30
31 #ifndef DNA_FREESTYLE_TYPES_H
32 #define DNA_FREESTYLE_TYPES_H
33
34 #include "DNA_listBase.h"
35
36 struct FreestyleLineStyle;
37
38 /* FreestyleConfig::flags */
39 #define FREESTYLE_SUGGESTIVE_CONTOURS_FLAG  1
40 #define FREESTYLE_RIDGES_AND_VALLEYS_FLAG   2
41 #define FREESTYLE_MATERIAL_BOUNDARIES_FLAG  4
42 #define FREESTYLE_FACE_SMOOTHNESS_FLAG      8
43
44 /* FreestyleConfig::mode */
45 #define FREESTYLE_CONTROL_SCRIPT_MODE  1
46 #define FREESTYLE_CONTROL_EDITOR_MODE  2
47
48 /* FreestyleLineSet::flags */
49 #define FREESTYLE_LINESET_CURRENT  1
50 #define FREESTYLE_LINESET_ENABLED  2
51 #define FREESTYLE_LINESET_FE_NOT   4
52 #define FREESTYLE_LINESET_FE_AND   8
53 #define FREESTYLE_LINESET_GR_NOT   16
54 #define FREESTYLE_LINESET_FM_NOT   32
55 #define FREESTYLE_LINESET_FM_BOTH  64
56
57 /* FreestyleLineSet::selection */
58 #define FREESTYLE_SEL_VISIBILITY    1
59 #define FREESTYLE_SEL_EDGE_TYPES    2
60 #define FREESTYLE_SEL_GROUP         4
61 #define FREESTYLE_SEL_IMAGE_BORDER  8
62 #define FREESTYLE_SEL_FACE_MARK     16
63
64 /* FreestyleLineSet::edge_types, exclude_edge_types */
65 #define FREESTYLE_FE_SILHOUETTE          1
66 #define FREESTYLE_FE_BORDER              2
67 #define FREESTYLE_FE_CREASE              4
68 #define FREESTYLE_FE_RIDGE               8
69 #define FREESTYLE_FE_VALLEY              16
70 #define FREESTYLE_FE_SUGGESTIVE_CONTOUR  32
71 #define FREESTYLE_FE_MATERIAL_BOUNDARY   64
72 #define FREESTYLE_FE_CONTOUR             128
73 #define FREESTYLE_FE_EXTERNAL_CONTOUR    512
74 #define FREESTYLE_FE_EDGE_MARK           1024
75
76 /* FreestyleLineSet::qi */
77 #define FREESTYLE_QI_VISIBLE  1
78 #define FREESTYLE_QI_HIDDEN   2
79 #define FREESTYLE_QI_RANGE    3
80
81 /* FreestyleConfig::raycasting_algorithm */
82 // Defines should be replaced with ViewMapBuilder::visibility_algo
83 #define FREESTYLE_ALGO_REGULAR                                  1
84 #define FREESTYLE_ALGO_FAST                                     2
85 #define FREESTYLE_ALGO_VERYFAST                                 3
86 #define FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL              4
87 #define FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL                     5
88 #define FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE               6
89 #define FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE                      7
90
91 typedef struct FreestyleLineSet {
92         struct FreestyleLineSet *next, *prev;
93
94         char name[32]; /* line set name */
95         int flags;
96
97         int selection; /* selection criteria */
98         short qi; /* quantitative invisibility */
99         short pad1;
100         int qi_start, qi_end;
101         int edge_types, exclude_edge_types; /* feature edge types */
102         int pad2;
103         struct Group *group; /* group of target objects */
104
105         struct FreestyleLineStyle *linestyle;
106
107 } FreestyleLineSet;
108
109 typedef struct FreestyleModuleConfig {
110         struct FreestyleModuleConfig *next, *prev;
111         
112         char module_path[256];
113         short is_displayed;
114         short pad[3];
115         
116 } FreestyleModuleConfig;
117
118 typedef struct FreestyleConfig {
119         ListBase modules;
120         
121         int mode; /* scripting, editor */
122         int raycasting_algorithm; /* regular, fast, very fast, etc. */
123         int flags; /* suggestive contours, ridges/valleys, material boundaries */
124         float sphere_radius;
125         float dkr_epsilon;
126         float crease_angle;
127
128         ListBase linesets;
129
130 } FreestyleConfig;
131
132 #endif