Blender  V2.93
BKE_displist.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
26 #include "BKE_customdata.h"
27 #include "DNA_customdata_types.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
34 enum {
36  DL_POLY = 0,
38  DL_SEGM = 1,
40  DL_SURF = 2,
42  DL_INDEX3 = 4,
44  DL_INDEX4 = 5,
45  // DL_VERTCOL = 6, /* UNUSED */
47  DL_VERTS = 7,
48 };
49 
51 enum {
53  DL_CYCL_U = (1 << 0),
54  DL_CYCL_V = (1 << 1),
55 
56  DL_FRONT_CURVE = (1 << 2),
57  DL_BACK_CURVE = (1 << 3),
58 };
59 
60 /* prototypes */
61 
62 struct Depsgraph;
63 struct ListBase;
64 struct Mesh;
65 struct Object;
66 struct Scene;
67 
68 /* used for curves, nurbs, mball, importing */
69 typedef struct DispList {
70  struct DispList *next, *prev;
71  short type, flag;
72  int parts, nr;
73  short col, rt; /* rt used by initrenderNurbs */
74  float *verts, *nors;
75  int *index;
76  int charidx;
77  int totindex; /* indexed array drawing surfaces */
79 
80 void BKE_displist_copy(struct ListBase *lbn, const struct ListBase *lb);
83 DispList *BKE_displist_find(struct ListBase *lb, int type);
84 void BKE_displist_normals_add(struct ListBase *lb);
85 void BKE_displist_count(const struct ListBase *lb, int *totvert, int *totface, int *tottri);
86 void BKE_displist_free(struct ListBase *lb);
87 bool BKE_displist_has_faces(const struct ListBase *lb);
88 
90  const struct Scene *scene,
91  struct Object *ob,
92  struct ListBase *dispbase,
93  struct Mesh **r_final,
94  const bool for_render,
95  const bool for_orco);
97  const struct Scene *scene,
98  struct Object *ob,
99  const bool for_render,
100  const bool for_orco);
102  const struct Scene *scene,
103  struct Object *ob,
104  struct ListBase *dispbase,
105  struct Mesh **r_final,
106  const bool for_orco);
107 void BKE_displist_make_mball(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
109  struct Scene *scene,
110  struct Object *ob,
111  struct ListBase *dispbase);
112 
114  const struct Scene *scene,
115  struct Object *ob,
116  struct ListBase *source_nurb,
117  struct ListBase *target_nurb,
118  const bool for_render);
120  const struct DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
121 
122 void BKE_displist_fill(const struct ListBase *dispbase,
123  struct ListBase *to,
124  const float normal_proj[3],
125  const bool flip_normal);
126 
128  const struct Scene *scene,
129  struct Object *taperobj,
130  int cur,
131  int tot);
132 
133 void BKE_displist_minmax(const struct ListBase *dispbase, float min[3], float max[3]);
134 
135 #ifdef __cplusplus
136 }
137 #endif
CustomData interface, see also DNA_customdata_types.h.
void BKE_displist_make_curveTypes(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const bool for_render, const bool for_orco)
void BKE_displist_copy(struct ListBase *lbn, const struct ListBase *lb)
bool BKE_displist_has_faces(const struct ListBase *lb)
bool BKE_displist_surfindex_get(const struct DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4)
void BKE_displist_free(struct ListBase *lb)
Definition: displist.c:81
@ DL_CYCL_V
Definition: BKE_displist.h:54
@ DL_BACK_CURVE
Definition: BKE_displist.h:57
@ DL_FRONT_CURVE
Definition: BKE_displist.h:56
@ DL_CYCL_U
Definition: BKE_displist.h:53
void BKE_displist_make_surf(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct Mesh **r_final, const bool for_render, const bool for_orco)
DispList * BKE_displist_find(struct ListBase *lb, int type)
Definition: displist.c:105
void BKE_displist_make_curveTypes_forRender(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct Mesh **r_final, const bool for_orco)
@ DL_SURF
Definition: BKE_displist.h:40
@ DL_INDEX4
Definition: BKE_displist.h:44
@ DL_INDEX3
Definition: BKE_displist.h:42
@ DL_POLY
Definition: BKE_displist.h:36
@ DL_SEGM
Definition: BKE_displist.h:38
@ DL_VERTS
Definition: BKE_displist.h:47
bool BKE_curve_calc_modifiers_pre(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, struct ListBase *source_nurb, struct ListBase *target_nurb, const bool for_render)
void BKE_displist_normals_add(struct ListBase *lb)
Definition: displist.c:140
float BKE_displist_calc_taper(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *taperobj, int cur, int tot)
void BKE_displist_elem_free(DispList *dl)
Definition: displist.c:65
void BKE_displist_fill(const struct ListBase *dispbase, struct ListBase *to, const float normal_proj[3], const bool flip_normal)
void BKE_displist_minmax(const struct ListBase *dispbase, float min[3], float max[3])
void BKE_displist_make_mball(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
Definition: displist.c:685
void BKE_displist_count(const struct ListBase *lb, int *totvert, int *totface, int *tottri)
struct DispList DispList
DispList * BKE_displist_find_or_create(struct ListBase *lb, int type)
Definition: displist.c:90
void BKE_displist_make_mball_forRender(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct ListBase *dispbase)
Definition: displist.c:709
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Scene scene
const Depsgraph * depsgraph
static unsigned a[3]
Definition: RandGen.cpp:92
#define min(a, b)
Definition: sort.c:51
short type
Definition: BKE_displist.h:71
int totindex
Definition: BKE_displist.h:77
short col
Definition: BKE_displist.h:73
float * verts
Definition: BKE_displist.h:74
int * index
Definition: BKE_displist.h:75
struct DispList * prev
Definition: BKE_displist.h:70
short rt
Definition: BKE_displist.h:73
struct DispList * next
Definition: BKE_displist.h:70
float * nors
Definition: BKE_displist.h:74
short flag
Definition: BKE_displist.h:71
int charidx
Definition: BKE_displist.h:76
float max