diff options
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_intern.h')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_intern.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h index 37f8dfd9b6b..77bd00da50a 100644 --- a/source/blender/blenkernel/intern/pbvh_intern.h +++ b/source/blender/blenkernel/intern/pbvh_intern.h @@ -6,6 +6,10 @@ * \ingroup bke */ +#ifdef __cplusplus +extern "C" { +#endif + /* Axis-aligned bounding box */ typedef struct { float bmin[3], bmax[3]; @@ -32,13 +36,18 @@ struct PBVHNode { * 'nodes' array. */ int children_offset; - /* Pointer into the PBVH prim_indices array and the number of - * primitives used by this leaf node. + /* List of primitives for this node. Semantics depends on + * PBVH type: + * + * - PBVH_FACES: Indices into the PBVH.looptri array. + * - PBVH_GRIDS: Multires grid indices. + * - PBVH_BMESH: Unused. See PBVHNode.bm_faces. * - * Used for leaf nodes in both mesh- and multires-based PBVHs. + * NOTE: This is a pointer inside of PBVH.prim_indices; it + * is not allocated separately per node. */ int *prim_indices; - unsigned int totprim; + unsigned int totprim; /* Number of primitives inside prim_indices. */ /* Array of indices into the mesh's MVert array. Contains the * indices of all vertices used by faces that are within this @@ -63,9 +72,8 @@ struct PBVHNode { unsigned int uniq_verts, face_verts; /* Array of indices into the Mesh's MLoop array. - * PBVH_FACES only. The first part of the array - * are loops unique to this node, see comment for - * vert_indices for more details.*/ + * PBVH_FACES only. + */ int *loop_indices; unsigned int loop_indices_num; @@ -93,6 +101,11 @@ struct PBVHNode { PBVHProxyNode *proxies; /* Dyntopo */ + + /* GSet of pointers to the BMFaces used by this node. + * NOTE: PBVH_BMESH only. Faces are always triangles + * (dynamic topology forcibly triangulates the mesh). + */ GSet *bm_faces; GSet *bm_unique_verts; GSet *bm_other_verts; @@ -102,6 +115,7 @@ struct PBVHNode { /* Used to store the brush color during a stroke and composite it over the original color */ PBVHColorBufferNode color_buffer; + PBVHPixelsNode pixels; }; typedef enum { @@ -117,6 +131,7 @@ struct PBVH { PBVHNode *nodes; int node_mem_count, totnode; + /* Memory backing for PBVHNode.prim_indices. */ int *prim_indices; int totprim; int totvert; @@ -250,3 +265,11 @@ bool pbvh_bmesh_node_nearest_to_ray(PBVHNode *node, bool use_original); void pbvh_bmesh_normals_update(PBVHNode **nodes, int totnode); + +/* pbvh_pixels.hh */ +void pbvh_pixels_free(PBVHNode *node); +void pbvh_pixels_free_brush_test(PBVHNode *node); + +#ifdef __cplusplus +} +#endif |