Blender  V3.3
BKE_gpencil_update_cache.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2022 Blender Foundation. */
3 
4 #pragma once
5 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include "BLI_sys_types.h" /* for bool */
15 
16 struct DLRBT_Tree;
17 struct GPencilUpdateCache;
18 struct bGPDframe;
19 struct bGPDlayer;
20 struct bGPDstroke;
21 struct bGPdata;
22 
24 typedef enum eGPUpdateCacheNodeFlag {
25  /* Node is a placeholder (e.g. when only an index is needed). */
27  /* Copy only element, not the content. */
29  /* Copy the element as well as all of its content. */
32 
46 typedef struct GPencilUpdateCache {
47  /* Mapping from index to a GPencilUpdateCache struct. */
49  /* eGPUpdateCacheNodeFlag */
50  int flag;
51  /* Index of the element in the linked-list. */
52  int index;
53  /* Pointer to one of bGPdata, bGPDLayer, bGPDFrame, bGPDStroke. */
54  void *data;
56 
57 /* Node structure in the DLRBT_Tree for GPencilUpdateCache mapping. */
58 typedef struct GPencilUpdateCacheNode {
59  /* DLRB tree capabilities. */
63  char tree_col;
64 
65  char _pad[7];
66  /* Content of DLRB tree node. */
69 
78 
80  /* Callbacks for the update cache traversal. Callback with index 0 is for layers, 1 for frames
81  * and 2 for strokes. */
84 
93 
102  void *user_data);
103 
111 void BKE_gpencil_tag_full_update(struct bGPdata *gpd,
112  struct bGPDlayer *gpl,
113  struct bGPDframe *gpf,
114  struct bGPDstroke *gps);
115 
124 void BKE_gpencil_tag_light_update(struct bGPdata *gpd,
125  struct bGPDlayer *gpl,
126  struct bGPDframe *gpf,
127  struct bGPDstroke *gps);
128 
133 void BKE_gpencil_free_update_cache(struct bGPdata *gpd);
134 
135 #ifdef __cplusplus
136 }
137 #endif
eGPUpdateCacheNodeFlag
@ GP_UPDATE_NODE_NO_COPY
@ GP_UPDATE_NODE_LIGHT_COPY
@ GP_UPDATE_NODE_FULL_COPY
struct GPencilUpdateCacheTraverseSettings GPencilUpdateCacheTraverseSettings
void BKE_gpencil_tag_full_update(struct bGPdata *gpd, struct bGPDlayer *gpl, struct bGPDframe *gpf, struct bGPDstroke *gps)
GPencilUpdateCache * BKE_gpencil_create_update_cache(void *data, bool full_copy)
bool(* GPencilUpdateCacheIter_Cb)(GPencilUpdateCache *cache, void *user_data)
void BKE_gpencil_tag_light_update(struct bGPdata *gpd, struct bGPDlayer *gpl, struct bGPDframe *gpf, struct bGPDstroke *gps)
void BKE_gpencil_free_update_cache(struct bGPdata *gpd)
struct GPencilUpdateCacheNode GPencilUpdateCacheNode
struct GPencilUpdateCache GPencilUpdateCache
void BKE_gpencil_traverse_update_cache(GPencilUpdateCache *cache, GPencilUpdateCacheTraverseSettings *ts, void *user_data)
void * user_data
struct GPencilUpdateCacheNode * next
struct GPencilUpdateCacheNode * parent
struct GPencilUpdateCacheNode * prev
struct GPencilUpdateCacheNode * left
struct GPencilUpdateCacheNode * right
GPencilUpdateCacheIter_Cb update_cache_cb[3]
struct DLRBT_Tree * children