Blender V5.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
8
9#pragma once
10
11#include "BLI_map.hh"
12#include "BLI_set.hh"
13
14namespace blender {
15
16struct ID;
17
18namespace deg {
19
21 public:
22 enum {
23 TAG_ANIMATION = (1 << 0),
24 TAG_PARAMETERS = (1 << 1),
25 TAG_TRANSFORM = (1 << 2),
26 TAG_GEOMETRY = (1 << 3),
27
30 TAG_SCENE_AUDIO = (1 << 6),
31
38
40
41 /* All ID components has been built. */
45 };
46
47 /* Check whether given ID is already handled by builder (or if it's being handled). */
48 bool check_is_built(ID *id, int tag = TAG_COMPLETE) const;
49
50 /* Tag given ID as handled/built. */
51 void tag_built(ID *id, int tag = TAG_COMPLETE);
52
53 /* Combination of previous two functions, returns truth if ID was already handled, or tags is
54 * handled otherwise and return false. */
55 bool check_is_built_and_tag(ID *id, int tag = TAG_COMPLETE);
56
57 template<typename T> bool check_is_built(T *datablock, int tag = TAG_COMPLETE) const
58 {
59 return this->check_is_built(&datablock->id, tag);
60 }
61 template<typename T> void tag_built(T *datablock, int tag = TAG_COMPLETE)
62 {
63 this->tag_built(&datablock->id, tag);
64 }
65 template<typename T> bool check_is_built_and_tag(T *datablock, int tag = TAG_COMPLETE)
66 {
67 return this->check_is_built_and_tag(&datablock->id, tag);
68 }
69
71
72 protected:
73 int get_ID_tag(ID *id) const;
74
76};
77
78} // namespace deg
79} // namespace blender
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)
Set< const ID * > get_ids() const
#define T
BMesh Iterators.