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

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/BKE_displist.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* display list (or rather multi purpose list) stuff */
2
2
/* 
3
 
        $Id: BKE_displist.h,v 1.10 2004/03/28 08:46:33 zuster Exp $
 
3
        $Id: BKE_displist.h,v 1.26 2005/05/27 09:51:06 ton Exp $
4
4
 *
5
5
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
6
6
 *
35
35
#ifndef BKE_DISPLIST_H
36
36
#define BKE_DISPLIST_H
37
37
 
 
38
/* dl->type */
38
39
#define DL_POLY                 0
39
40
#define DL_SEGM                 1
40
41
#define DL_SURF                 2
44
45
#define DL_VERTCOL              6
45
46
#define DL_VERTS                7
46
47
#define DL_NORS                 8
47
 
#define DL_MESH                                 9
48
 
 
49
 
/* EVIL: #define DL_SURFINDEX(cyclu, cyclv, sizeu, sizev) */
 
48
 
 
49
/* dl->flag */
 
50
#define DL_CYCL_U               1
 
51
#define DL_CYCL_V               2
 
52
#define DL_FRONT_CURVE  4
 
53
#define DL_BACK_CURVE   8
 
54
 
 
55
/* This should, of course, become a function */
 
56
#define DL_SURFINDEX(cyclu, cyclv, sizeu, sizev)            \
 
57
\
 
58
if( (cyclv)==0 && a==(sizev)-1) break;              \
 
59
if(cyclu) {                                                 \
 
60
        p1= sizeu*a;                                        \
 
61
                p2= p1+ sizeu-1;                                    \
 
62
                        p3= p1+ sizeu;                                      \
 
63
                                p4= p2+ sizeu;                                      \
 
64
                                        b= 0;                                               \
 
65
}                                                           \
 
66
else {                                              \
 
67
        p2= sizeu*a;                                        \
 
68
                p1= p2+1;                                           \
 
69
                        p4= p2+ sizeu;                                      \
 
70
                                p3= p1+ sizeu;                                      \
 
71
                                        b= 1;                                               \
 
72
}                                                           \
 
73
if( (cyclv) && a==sizev-1) {                        \
 
74
        p3-= sizeu*sizev;                                   \
 
75
                p4-= sizeu*sizev;                                   \
 
76
}
 
77
 
50
78
 
51
79
/* prototypes */
52
80
 
58
86
struct Mesh;
59
87
struct TFace;
60
88
struct EditMesh;
 
89
struct EditEdge;
 
90
struct EditFace;
61
91
 
62
92
typedef struct DispListMesh DispListMesh;
63
93
struct DispListMesh {
64
 
        int totvert, totface;
 
94
        int totvert, totedge, totface;
65
95
        struct MVert *mvert;
 
96
        struct MEdge *medge;
66
97
        struct MCol *mcol;
67
98
        struct MFace *mface;
68
99
        struct TFace *tface;
69
 
        int flag;
 
100
        float *nors; // facenormals
70
101
};
71
102
 
72
103
void displistmesh_free(DispListMesh *dlm);
73
 
void displistmesh_calc_vert_normals(DispListMesh *dlm);
 
104
void displistmesh_calc_normals(DispListMesh *dlm);
74
105
 
75
106
void displistmesh_to_mesh(DispListMesh *dlm, struct Mesh *me);
76
107
 
77
 
DispListMesh *displistmesh_from_editmesh(struct EditMesh *em);
78
 
DispListMesh *displistmesh_from_mesh(struct Mesh *mesh, float *extverts);
 
108
DispListMesh *displistmesh_copy(DispListMesh *odlm);
79
109
 
80
110
/*
81
111
 * All the different DispList.type's use the
97
127
        float *verts, *nors;
98
128
        int *index;
99
129
        unsigned int *col1, *col2;
100
 
        struct DispListMesh *mesh;
101
 
        
102
 
        /* Begin NASTY_NLA_STUFF */
103
 
//      int *offset, *run;      /* Used to index into the bone & weight lists */
104
 
//      struct Bone *bones;
105
 
//      float *weights;
106
 
        /* End NASTY_NLA_STUFF */
107
130
} DispList;
108
131
 
109
132
extern void copy_displist(struct ListBase *lbn, struct ListBase *lb);
110
133
extern void free_disp_elem(DispList *dl);
111
 
extern void free_displist_by_type(struct ListBase *lb, int type);
112
134
extern DispList *find_displist_create(struct ListBase *lb, int type);
113
135
extern DispList *find_displist(struct ListBase *lb, int type);
114
136
extern void addnormalsDispList(struct Object *ob, struct ListBase *lb);
115
137
extern void count_displist(struct ListBase *lb, int *totvert, int *totface);
116
 
extern void curve_to_filledpoly(struct Curve *cu, struct ListBase *dispbase);
 
138
extern void curve_to_filledpoly(struct Curve *cu, struct ListBase *nurb, struct ListBase *dispbase);
117
139
extern void freedisplist(struct ListBase *lb);
 
140
extern int displist_has_faces(struct ListBase *lb);
 
141
extern float calc_taper(struct Object *taperobj, int cur, int tot);
118
142
extern void makeDispList(struct Object *ob);
119
143
extern void set_displist_onlyzero(int val);
120
144
extern void shadeDispList(struct Object *ob);
123
147
void imagestodisplist(void);
124
148
void reshadeall_displist(void);
125
149
void test_all_displists(void);
 
150
void filldisplist(struct ListBase *dispbase, struct ListBase *to);
126
151
 
127
152
#endif
128
153