~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/makesdna/DNA_node_types.h

  • Committer: Bazaar Package Importer
  • Author(s): Lukas Fittl
  • Date: 2006-09-20 01:57:27 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060920015727-gmoqlxwstx9wwqs3
Tags: 2.42a-1ubuntu1
* Merge from Debian unstable (Closes: Malone #55903). Remaining changes:
  - debian/genpot: Add python scripts from Lee June <blender@eyou.com> to
    generate a reasonable PO template from the sources. Since gettext is used
    in a highly nonstandard way, xgettext does not work for this job.
  - debian/rules: Call the scripts, generate po/blender.pot, and clean it up
    in the clean target.
  - Add a proper header to the generated PO template.
* debian/control: Build depend on libavformat-dev >= 3:0.cvs20060823-3.1,
  otherwise this package will FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * $Id: DNA_node_types.h,v 1.12 2006/06/17 13:04:09 ton Exp $ 
 
3
 *
 
4
 * ***** BEGIN GPL LICENSE BLOCK *****
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version. 
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software Foundation,
 
18
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 *
 
20
 * The Original Code is Copyright (C) 2005 Blender Foundation.
 
21
 * All rights reserved.
 
22
 *
 
23
 * The Original Code is: all of this file.
 
24
 *
 
25
 * Contributor(s): none yet.
 
26
 *
 
27
 * ***** END GPL LICENSE BLOCK *****
 
28
 */
 
29
 
 
30
#ifndef DNA_NODE_TYPES_H
 
31
#define DNA_NODE_TYPES_H
 
32
 
 
33
#include "DNA_ID.h"
 
34
#include "DNA_vec_types.h"
 
35
#include "DNA_listBase.h"
 
36
 
 
37
 
 
38
struct SpaceNode;
 
39
struct bNodeLink;
 
40
struct bNodeType;
 
41
struct bNodeGroup;
 
42
 
 
43
#define NODE_MAXSTR 32
 
44
 
 
45
 
 
46
typedef struct bNodeStack {
 
47
        float vec[4];
 
48
        float min, max;                 /* min/max for values (UI writes it, execute might use it) */
 
49
        void *data;
 
50
        short hasinput;                 /* when input has link, tagged before executing */
 
51
        short hasoutput;                /* when output is linked, tagged before executing */
 
52
        short datatype;                 /* type of data pointer */
 
53
        short pad;
 
54
} bNodeStack;
 
55
 
 
56
/* ns->datatype, shadetree only */
 
57
#define NS_OSA_VECTORS          1
 
58
#define NS_OSA_VALUES           2
 
59
 
 
60
typedef struct bNodeSocket {
 
61
        struct bNodeSocket *next, *prev;
 
62
        
 
63
        char name[32];
 
64
        bNodeStack ns;                          /* custom data for inputs, only UI writes in this */
 
65
        
 
66
        short type, flag;                       /* type is copy from socket type struct */
 
67
        short limit, stack_index;       /* limit for dependency sort, stack_index for exec */
 
68
        short intern;                           /* intern = tag for group nodes */
 
69
        short stack_index_ext;          /* for groups, to find the caller stack index */
 
70
        int pad1;
 
71
        
 
72
        float locx, locy;
 
73
        
 
74
        /* internal data to retrieve relations and groups */
 
75
        
 
76
        int own_index, to_index;        /* group socket identifiers, to find matching pairs after reading files */
 
77
        
 
78
        struct bNodeSocket *tosock;     /* group-node sockets point to the internal group counterpart sockets, set after read file  */
 
79
        struct bNodeLink *link;         /* a link pointer, set in nodeSolveOrder() */
 
80
        
 
81
} bNodeSocket;
 
82
 
 
83
/* sock->type */
 
84
#define SOCK_VALUE              0
 
85
#define SOCK_VECTOR             1
 
86
#define SOCK_RGBA               2
 
87
 
 
88
/* sock->flag, first bit is select */
 
89
#define SOCK_HIDDEN                             2
 
90
                /* only used now for groups... */
 
91
#define SOCK_IN_USE                             4
 
92
 
 
93
#
 
94
#
 
95
typedef struct bNodePreview {
 
96
        float *rect;
 
97
        short xsize, ysize;
 
98
} bNodePreview;
 
99
 
 
100
 
 
101
/* limit data in bNode to what we want to see saved? */
 
102
typedef struct bNode {
 
103
        struct bNode *next, *prev, *new;
 
104
        
 
105
        char name[32];
 
106
        short type, flag;
 
107
        short done, level;              /* both for dependency and sorting */
 
108
        short lasty, menunr;    /* lasty: check preview render status, menunr: browse ID blocks */
 
109
        short stack_index;              /* for groupnode, offset in global caller stack */
 
110
        short nr;                               /* number of this node in list, used for UI exec events */
 
111
        
 
112
        ListBase inputs, outputs;
 
113
        struct ID *id;                  /* optional link to libdata */
 
114
        void *storage;                  /* custom data, must be struct, for storage in file */
 
115
        
 
116
        float locx, locy;               /* root offset for drawing */
 
117
        float width, miniwidth;                 
 
118
        short custom1, custom2; /* to be abused for buttons */
 
119
        
 
120
        short need_exec, exec;  /* need_exec is set as UI execution event, exec is flag during exec */
 
121
        
 
122
        rctf totr;                              /* entire boundbox */
 
123
        rctf butr;                              /* optional buttons area */
 
124
        rctf prvr;                              /* optional preview area */
 
125
        bNodePreview *preview;  /* optional preview image */
 
126
        
 
127
        struct bNodeType *typeinfo;     /* lookup of callbacks and defaults */
 
128
        
 
129
} bNode;
 
130
 
 
131
/* node->flag */
 
132
#define NODE_SELECT                     1
 
133
#define NODE_OPTIONS            2
 
134
#define NODE_PREVIEW            4
 
135
#define NODE_HIDDEN                     8
 
136
#define NODE_ACTIVE                     16
 
137
#define NODE_ACTIVE_ID          32
 
138
#define NODE_DO_OUTPUT          64
 
139
#define NODE_GROUP_EDIT         128
 
140
 
 
141
typedef struct bNodeLink {
 
142
        struct bNodeLink *next, *prev;
 
143
        
 
144
        bNode *fromnode, *tonode;
 
145
        bNodeSocket *fromsock, *tosock;
 
146
        
 
147
} bNodeLink;
 
148
 
 
149
/* the basis for a Node tree, all links and nodes reside internal here */
 
150
/* only re-usable node trees are in the library though, materials allocate own tree struct */
 
151
typedef struct bNodeTree {
 
152
        ID id;
 
153
        
 
154
        ListBase nodes, links;
 
155
        
 
156
        bNodeStack *stack;                              /* stack is only while executing, no read/write in file */
 
157
        bNodeStack *stack1;                             /* for other thread, easy to expand though... */
 
158
        
 
159
        int type, init;                                 /* set init on fileread */
 
160
        int stacksize;                                  /* amount of elements in stack */
 
161
        int cur_index;                                  /* sockets in groups have unique identifiers, adding new sockets always will increase this counter */
 
162
        struct bNodeType **alltypes;    /* type definitions, set on fileread, no read/write */
 
163
        struct bNodeType *owntype;              /* for groups or dynamic trees, no read/write */
 
164
        
 
165
        /* callbacks */
 
166
        void (*timecursor)(int nr);
 
167
        void (*stats_draw)(char *str);
 
168
        int (*test_break)(void);
 
169
} bNodeTree;
 
170
 
 
171
/* ntree->type, index */
 
172
#define NTREE_SHADER    0
 
173
#define NTREE_COMPOSIT  1
 
174
 
 
175
/* ntree->init, flag */
 
176
#define NTREE_TYPE_INIT 1
 
177
#define NTREE_EXEC_INIT 2
 
178
 
 
179
/* data structs, for node->storage */
 
180
 
 
181
typedef struct NodeImageAnim {
 
182
        int frames, sfra, nr;
 
183
        char cyclic, movie;
 
184
        short pad;
 
185
} NodeImageAnim;
 
186
 
 
187
typedef struct NodeBlurData {
 
188
        short sizex, sizey, samples, maxspeed, minspeed, pad1;
 
189
        float fac;
 
190
        short filtertype;
 
191
        char bokeh, gamma;
 
192
        int pad2;
 
193
} NodeBlurData;
 
194
 
 
195
typedef struct NodeHueSat {
 
196
        float hue, sat;
 
197
} NodeHueSat;
 
198
 
 
199
#endif
 
200