Blender V2.61 - r43446

BKE_displist.h

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