|
Blender V4.3
|
#include "BLI_sys_types.h"Go to the source code of this file.
Classes | |
| struct | GPencilUpdateCache |
| struct | GPencilUpdateCacheNode |
| struct | GPencilUpdateCacheTraverseSettings |
Typedefs | |
| typedef enum eGPUpdateCacheNodeFlag | eGPUpdateCacheNodeFlag |
| typedef struct GPencilUpdateCache | GPencilUpdateCache |
| typedef struct GPencilUpdateCacheNode | GPencilUpdateCacheNode |
| typedef bool(* | GPencilUpdateCacheIter_Cb) (GPencilUpdateCache *cache, void *user_data) |
| typedef struct GPencilUpdateCacheTraverseSettings | GPencilUpdateCacheTraverseSettings |
Enumerations | |
| enum | eGPUpdateCacheNodeFlag { GP_UPDATE_NODE_NO_COPY = 0 , GP_UPDATE_NODE_LIGHT_COPY = 1 , GP_UPDATE_NODE_FULL_COPY = 2 } |
Functions | |
| GPencilUpdateCache * | BKE_gpencil_create_update_cache (void *data, bool full_copy) |
| void | BKE_gpencil_traverse_update_cache (GPencilUpdateCache *cache, GPencilUpdateCacheTraverseSettings *ts, void *user_data) |
| void | BKE_gpencil_free_update_cache (struct bGPdata *gpd) |
| typedef struct GPencilUpdateCache GPencilUpdateCache |
Cache for what needs to be updated after bGPdata was modified.
Every node holds information about one element that was changed:
Additionally, nodes also hold other nodes that are one "level" below them. E.g. a node that represents a change on a bGPDframe could contain a set of nodes that represent a change on bGPDstrokes. These nodes are stored in a red-black tree so that they are sorted by their index to make sure they can be processed in the correct order.
| typedef bool(* GPencilUpdateCacheIter_Cb) (GPencilUpdateCache *cache, void *user_data) |
Callback that is called in BKE_gpencil_traverse_update_cache at each level. If the callback returns true, then the children will not be iterated over and instead continue.
| cache | The cache at this level. |
| user_data | Pointer to the user_data passed to BKE_gpencil_traverse_update_cache. |
Definition at line 78 of file BKE_gpencil_update_cache_legacy.h.
| typedef struct GPencilUpdateCacheNode GPencilUpdateCacheNode |
| typedef struct GPencilUpdateCacheTraverseSettings GPencilUpdateCacheTraverseSettings |
| Enumerator | |
|---|---|
| GP_UPDATE_NODE_NO_COPY | |
| GP_UPDATE_NODE_LIGHT_COPY | |
| GP_UPDATE_NODE_FULL_COPY | |
Definition at line 25 of file BKE_gpencil_update_cache_legacy.h.
| GPencilUpdateCache * BKE_gpencil_create_update_cache | ( | void * | data, |
| bool | full_copy ) |
Allocates a new GPencilUpdateCache and populates it.
| data | A data pointer to populate the initial cache with. |
| full_copy | If true, will mark this update cache as a full copy (GP_UPDATE_NODE_FULL_COPY). If false, it will be marked as a struct copy (GP_UPDATE_NODE_LIGHT_COPY). |
Definition at line 79 of file gpencil_update_cache_legacy.cc.
References data, GP_UPDATE_NODE_FULL_COPY, GP_UPDATE_NODE_LIGHT_COPY, and update_cache_alloc().
| void BKE_gpencil_free_update_cache | ( | struct bGPdata * | gpd | ) |
Frees the GPencilUpdateCache on the gpd->runtime. This will not free the data that the cache node might point to. It assumes that the cache does not own the data.
Definition at line 92 of file gpencil_update_cache_legacy.cc.
References bGPdata::runtime, bGPdata_Runtime::update_cache, and update_cache_free().
Referenced by BKE_gpencil_free_data().
| void BKE_gpencil_traverse_update_cache | ( | GPencilUpdateCache * | cache, |
| GPencilUpdateCacheTraverseSettings * | ts, | ||
| void * | user_data ) |
Traverses an update cache and executes callbacks at each level.
| cache | The update cache to traverse. |
| ts | The traversal settings. This stores the callbacks that are called at each level. |
| user_data | Custom data passed to each callback. |
Definition at line 85 of file gpencil_update_cache_legacy.cc.
References gpencil_traverse_update_cache_ex().