Blender V4.3
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
9#pragma once
10
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
29 /* All ID components has been built. */
32 };
33
34 /* Check whether given ID is already handled by builder (or if it's being handled). */
35 bool checkIsBuilt(ID *id, int tag = TAG_COMPLETE) const;
36
37 /* Tag given ID as handled/built. */
38 void tagBuild(ID *id, int tag = TAG_COMPLETE);
39
40 /* Combination of previous two functions, returns truth if ID was already handled, or tags is
41 * handled otherwise and return false. */
42 bool checkIsBuiltAndTag(ID *id, int tag = TAG_COMPLETE);
43
44 template<typename T> bool checkIsBuilt(T *datablock, int tag = TAG_COMPLETE) const
45 {
46 return checkIsBuilt(&datablock->id, tag);
47 }
48 template<typename T> void tagBuild(T *datablock, int tag = TAG_COMPLETE)
49 {
50 tagBuild(&datablock->id, tag);
51 }
52 template<typename T> bool checkIsBuiltAndTag(T *datablock, int tag = TAG_COMPLETE)
53 {
54 return checkIsBuiltAndTag(&datablock->id, tag);
55 }
56
57 protected:
58 int getIDTag(ID *id) const;
59
61};
62
63} // namespace blender::deg
int getIDTag(ID *id) const
bool checkIsBuiltAndTag(T *datablock, int tag=TAG_COMPLETE)
void tagBuild(ID *id, int tag=TAG_COMPLETE)
bool checkIsBuiltAndTag(ID *id, int tag=TAG_COMPLETE)
bool checkIsBuilt(T *datablock, int tag=TAG_COMPLETE) const
Map< ID *, int > id_tags_
void tagBuild(T *datablock, int tag=TAG_COMPLETE)
bool checkIsBuilt(ID *id, int tag=TAG_COMPLETE) const
Definition DNA_ID.h:413