Blender V5.0
deg_builder_map.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2018 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_map.hh"
12
13struct ID;
14
15namespace blender::deg {
16
18 public:
19 enum {
20 TAG_ANIMATION = (1 << 0),
21 TAG_PARAMETERS = (1 << 1),
22 TAG_TRANSFORM = (1 << 2),
23 TAG_GEOMETRY = (1 << 3),
24
27 TAG_SCENE_AUDIO = (1 << 6),
28
35
36 /* All ID components has been built. */
39 };
40
41 /* Check whether given ID is already handled by builder (or if it's being handled). */
42 bool check_is_built(ID *id, int tag = TAG_COMPLETE) const;
43
44 /* Tag given ID as handled/built. */
45 void tag_built(ID *id, int tag = TAG_COMPLETE);
46
47 /* Combination of previous two functions, returns truth if ID was already handled, or tags is
48 * handled otherwise and return false. */
49 bool check_is_built_and_tag(ID *id, int tag = TAG_COMPLETE);
50
51 template<typename T> bool check_is_built(T *datablock, int tag = TAG_COMPLETE) const
52 {
53 return this->check_is_built(&datablock->id, tag);
54 }
55 template<typename T> void tag_built(T *datablock, int tag = TAG_COMPLETE)
56 {
57 this->tag_built(&datablock->id, tag);
58 }
59 template<typename T> bool check_is_built_and_tag(T *datablock, int tag = TAG_COMPLETE)
60 {
61 return this->check_is_built_and_tag(&datablock->id, tag);
62 }
63
64 protected:
65 int get_ID_tag(ID *id) const;
66
68};
69
70} // namespace blender::deg
int get_ID_tag(ID *id) const
bool check_is_built_and_tag(T *datablock, int tag=TAG_COMPLETE)
bool check_is_built(ID *id, int tag=TAG_COMPLETE) const
bool check_is_built(T *datablock, int tag=TAG_COMPLETE) const
Map< ID *, int > id_tags_
bool check_is_built_and_tag(ID *id, int tag=TAG_COMPLETE)
void tag_built(T *datablock, int tag=TAG_COMPLETE)
void tag_built(ID *id, int tag=TAG_COMPLETE)
#define T
Definition DNA_ID.h:414