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