Merged changes in the trunk up to revision 47056.
[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 #define FREESTYLE_ADVANCED_OPTIONS_FLAG     16
44
45 /* FreestyleConfig::mode */
46 #define FREESTYLE_CONTROL_SCRIPT_MODE  1
47 #define FREESTYLE_CONTROL_EDITOR_MODE  2
48
49 /* FreestyleLineSet::flags */
50 #define FREESTYLE_LINESET_CURRENT  1l
51 #define FREESTYLE_LINESET_ENABLED  2
52 #define FREESTYLE_LINESET_FE_NOT   4
53 #define FREESTYLE_LINESET_FE_AND   8
54 #define FREESTYLE_LINESET_GR_NOT   16
55 #define FREESTYLE_LINESET_FM_NOT   32
56 #define FREESTYLE_LINESET_FM_BOTH  64
57
58 /* FreestyleLineSet::selection */
59 #define FREESTYLE_SEL_VISIBILITY    1
60 #define FREESTYLE_SEL_EDGE_TYPES    2
61 #define FREESTYLE_SEL_GROUP         4
62 #define FREESTYLE_SEL_IMAGE_BORDER  8
63 #define FREESTYLE_SEL_FACE_MARK     16
64
65 /* FreestyleLineSet::edge_types, exclude_edge_types */
66 #define FREESTYLE_FE_SILHOUETTE          1
67 #define FREESTYLE_FE_BORDER              2
68 #define FREESTYLE_FE_CREASE              4
69 #define FREESTYLE_FE_RIDGE_VALLEY        8
70 /* Note: FREESTYLE_FE_VALLEY = 16 is no longer used */
71 #define FREESTYLE_FE_SUGGESTIVE_CONTOUR  32
72 #define FREESTYLE_FE_MATERIAL_BOUNDARY   64
73 #define FREESTYLE_FE_CONTOUR             128
74 #define FREESTYLE_FE_EXTERNAL_CONTOUR    512
75 #define FREESTYLE_FE_EDGE_MARK           1024
76
77 /* FreestyleLineSet::qi */
78 #define FREESTYLE_QI_VISIBLE  1
79 #define FREESTYLE_QI_HIDDEN   2
80 #define FREESTYLE_QI_RANGE    3
81
82 /* FreestyleConfig::raycasting_algorithm */
83 // Defines should be replaced with ViewMapBuilder::visibility_algo
84 #define FREESTYLE_ALGO_REGULAR                                  1
85 #define FREESTYLE_ALGO_FAST                                     2
86 #define FREESTYLE_ALGO_VERYFAST                                 3
87 #define FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL              4
88 #define FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL                     5
89 #define FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE               6
90 #define FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE                      7
91
92 typedef struct FreestyleLineSet {
93         struct FreestyleLineSet *next, *prev;
94
95         char name[32]; /* line set name */
96         int flags;
97
98         int selection; /* selection criteria */
99         short qi; /* quantitative invisibility */
100         short pad1;
101         int qi_start, qi_end;
102         int edge_types, exclude_edge_types; /* feature edge types */
103         int pad2;
104         struct Group *group; /* group of target objects */
105
106         struct FreestyleLineStyle *linestyle;
107
108 } FreestyleLineSet;
109
110 typedef struct FreestyleModuleConfig {
111         struct FreestyleModuleConfig *next, *prev;
112         
113         char module_path[256];
114         short is_displayed;
115         short pad[3];
116         
117 } FreestyleModuleConfig;
118
119 typedef struct FreestyleConfig {
120         ListBase modules;
121         
122         int mode; /* scripting, editor */
123         int raycasting_algorithm; /* regular, fast, very fast, etc. */
124         int flags; /* suggestive contours, ridges/valleys, material boundaries */
125         float sphere_radius;
126         float dkr_epsilon;
127         float crease_angle;
128
129         ListBase linesets;
130
131 } FreestyleConfig;
132
133 #endif