Blender V5.0
depsgraph_type.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
14
15#pragma once
16
17#include <cstdint>
18
19/* TODO(sergey): Ideally we'll just use char* and statically allocated strings
20 * to avoid any possible overhead caused by string (re)allocation/formatting. */
21
23
24namespace blender::deg {
25
26/* Source of the dependency graph node update tag.
27 *
28 * NOTE: This is a bit mask, so accumulation of sources is possible.
29 *
30 * TODO(sergey): Find a better place for this. */
32 /* Update is caused by a time change. */
34 /* Update caused by user directly or indirectly influencing the node. */
36 /* Update is happening as a special response for the relations update. */
38 /* Update is happening due to visibility change. */
46};
47
48/* C++ wrapper around DNA's CustomData_MeshMasks struct. */
55
59
60 explicit DEGCustomDataMeshMasks(const CustomData_MeshMasks *other);
61
63 {
64 this->vert_mask |= other.vert_mask;
65 this->edge_mask |= other.edge_mask;
66 this->face_mask |= other.face_mask;
67 this->loop_mask |= other.loop_mask;
68 this->poly_mask |= other.poly_mask;
69 return *this;
70 }
71
73 {
75 result.vert_mask = this->vert_mask | other.vert_mask;
76 result.edge_mask = this->edge_mask | other.edge_mask;
77 result.face_mask = this->face_mask | other.face_mask;
78 result.loop_mask = this->loop_mask | other.loop_mask;
79 result.poly_mask = this->poly_mask | other.poly_mask;
80 return result;
81 }
82
83 bool operator==(const DEGCustomDataMeshMasks &other) const
84 {
85 return (this->vert_mask == other.vert_mask && this->edge_mask == other.edge_mask &&
86 this->face_mask == other.face_mask && this->loop_mask == other.loop_mask &&
87 this->poly_mask == other.poly_mask);
88 }
89
90 bool operator!=(const DEGCustomDataMeshMasks &other) const
91 {
92 return !(*this == other);
93 }
94
96 {
98 result.vert_mask = vert_mask;
99 return result;
100 }
101
103 {
105 result.edge_mask = edge_mask;
106 return result;
107 }
108
110 {
112 result.face_mask = face_mask;
113 return result;
114 }
115
117 {
119 result.loop_mask = loop_mask;
120 return result;
121 }
122
124 {
126 result.poly_mask = poly_mask;
127 return result;
128 }
129};
130
131} // namespace blender::deg
unsigned long long int uint64_t
@ DEG_UPDATE_SOURCE_SIDE_EFFECT_REQUEST
static DEGCustomDataMeshMasks MaskVert(const uint64_t vert_mask)
static DEGCustomDataMeshMasks MaskFace(const uint64_t face_mask)
static DEGCustomDataMeshMasks MaskLoop(const uint64_t loop_mask)
DEGCustomDataMeshMasks & operator|=(const DEGCustomDataMeshMasks &other)
static DEGCustomDataMeshMasks MaskEdge(const uint64_t edge_mask)
bool operator==(const DEGCustomDataMeshMasks &other) const
bool operator!=(const DEGCustomDataMeshMasks &other) const
DEGCustomDataMeshMasks operator|(const DEGCustomDataMeshMasks &other) const
static DEGCustomDataMeshMasks MaskPoly(const uint64_t poly_mask)