Blender  V2.59
BKE_displist.h
Go to the documentation of this file.
00001 /* 
00002         $Id: BKE_displist.h 37504 2011-06-15 10:17:06Z blendix $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028 
00029 */
00030 
00031 #ifndef BKE_DISPLIST_H
00032 #define BKE_DISPLIST_H
00033 
00038 #include "DNA_customdata_types.h"
00039 #include "BKE_customdata.h"
00040 
00041 /* dl->type */
00042 #define DL_POLY                 0
00043 #define DL_SEGM                 1
00044 #define DL_SURF                 2
00045 #define DL_INDEX3               4
00046 #define DL_INDEX4               5
00047 #define DL_VERTCOL              6
00048 #define DL_VERTS                                7
00049 
00050 /* dl->flag */
00051 #define DL_CYCL_U               1
00052 #define DL_CYCL_V               2
00053 #define DL_FRONT_CURVE  4
00054 #define DL_BACK_CURVE   8
00055 
00056 
00057 /* prototypes */
00058 
00059 struct Base;
00060 struct Scene;
00061 struct Object;
00062 struct Curve;
00063 struct ListBase;
00064 struct Material;
00065 struct Bone;
00066 struct Mesh;
00067 struct EditMesh;
00068 struct DerivedMesh;
00069 
00070 /* used for curves, nurbs, mball, importing */
00071 typedef struct DispList {
00072         struct DispList *next, *prev;
00073         short type, flag;
00074         int parts, nr;
00075         short col, rt;              /* rt used by initrenderNurbs */
00076         float *verts, *nors;
00077         int *index;
00078         unsigned int *col1, *col2;
00079         int charidx;
00080         int totindex;                           /* indexed array drawing surfaces */
00081 
00082         unsigned int *bevelSplitFlag;
00083 } DispList;
00084 
00085 extern void copy_displist(struct ListBase *lbn, struct ListBase *lb);
00086 extern void free_disp_elem(DispList *dl);
00087 extern DispList *find_displist_create(struct ListBase *lb, int type);
00088 extern DispList *find_displist(struct ListBase *lb, int type);
00089 extern void addnormalsDispList(struct ListBase *lb);
00090 extern void count_displist(struct ListBase *lb, int *totvert, int *totface);
00091 extern void freedisplist(struct ListBase *lb);
00092 extern int displist_has_faces(struct ListBase *lb);
00093 
00094 extern void makeDispListSurf(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forRender, int forOrco);
00095 extern void makeDispListCurveTypes(struct Scene *scene, struct Object *ob, int forOrco);
00096 extern void makeDispListCurveTypes_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forOrco);
00097 extern void makeDispListCurveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
00098 extern void makeDispListMBall(struct Scene *scene, struct Object *ob);
00099 extern void makeDispListMBall_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
00100 
00101 int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
00102 void filldisplist(struct ListBase *dispbase, struct ListBase *to, int flipnormal);
00103 
00104 float calc_taper(struct Scene *scene, struct Object *taperobj, int cur, int tot);
00105 
00106 /* add Orco layer to the displist object which has got derived mesh and return orco */
00107 float *makeOrcoDispList(struct Scene *scene, struct Object *ob, struct DerivedMesh *derivedFinal, int forRender);
00108 
00109 #endif
00110