1 /* display list (or rather multi purpose list) stuff */
5 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
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. The Blender
11 * Foundation also sells licenses for use in proprietary software under
12 * the Blender License. See http://www.blender.org/BL/ for information
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
25 * All rights reserved.
27 * The Original Code is: all of this file.
29 * Contributor(s): none yet.
31 * ***** END GPL/BL DUAL LICENSE BLOCK *****
35 #ifndef BKE_DISPLIST_H
36 #define BKE_DISPLIST_H
52 #define DL_FRONT_CURVE 4
53 #define DL_BACK_CURVE 8
55 /* This should, of course, become a function */
56 #define DL_SURFINDEX(cyclu, cyclv, sizeu, sizev) \
58 if( (cyclv)==0 && a==(sizev)-1) break; \
73 if( (cyclv) && a==sizev-1) { \
92 typedef struct DispListMesh DispListMesh;
94 int totvert, totedge, totface;
100 float *nors; // facenormals
103 void displistmesh_free(DispListMesh *dlm);
104 void displistmesh_calc_normals(DispListMesh *dlm);
106 void displistmesh_to_mesh(DispListMesh *dlm, struct Mesh *me);
108 DispListMesh *displistmesh_copy(DispListMesh *odlm);
111 * All the different DispList.type's use the
112 * data in the displist structure in fairly
113 * different ways which can be rather confusing,
114 * the best thing to do would be to make a structure
115 * for each displaylist type that has the fields
116 * needed w/ proper names, and then make the actual
117 * DispList structure a typed union.
121 /* needs splitting! */
122 typedef struct DispList {
123 struct DispList *next, *prev;
126 short col, rt; /* rt wordt gebruikt door initrenderNurbs */
129 unsigned int *col1, *col2;
134 extern void copy_displist(struct ListBase *lbn, struct ListBase *lb);
135 extern void free_disp_elem(DispList *dl);
136 extern DispList *find_displist_create(struct ListBase *lb, int type);
137 extern DispList *find_displist(struct ListBase *lb, int type);
138 extern void addnormalsDispList(struct Object *ob, struct ListBase *lb);
139 extern void count_displist(struct ListBase *lb, int *totvert, int *totface);
140 extern void curve_to_filledpoly(struct Curve *cu, struct ListBase *nurb, struct ListBase *dispbase);
141 extern void freedisplist(struct ListBase *lb);
142 extern int displist_has_faces(struct ListBase *lb);
143 extern float calc_taper(struct Object *taperobj, int cur, int tot);
144 extern void makeDispList(struct Object *ob);
145 extern void set_displist_onlyzero(int val);
146 extern void shadeDispList(struct Object *ob);
147 void freefastshade(void);
148 void boundbox_displist(struct Object *ob);
149 void imagestodisplist(void);
150 void reshadeall_displist(void);
151 void test_all_displists(void);
152 void filldisplist(struct ListBase *dispbase, struct ListBase *to);