Blender V5.3
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
19namespace blender {
20
21/* TODO(sergey): Ideally we'll just use char* and statically allocated strings
22 * to avoid any possible overhead caused by string (re)allocation/formatting. */
23
25
26namespace deg {
27
28/* Source of the dependency graph node update tag.
29 *
30 * NOTE: This is a bit mask, so accumulation of sources is possible.
31 *
32 * TODO(sergey): Find a better place for this. */
34 /* Update is caused by a time change. */
36 /* Update caused by user directly or indirectly influencing the node. */
38 /* Update is happening as a special response for the relations update. */
40 /* Update is happening due to visibility change. */
48};
49
50/* C++ wrapper around DNA's CustomData_MeshMasks struct. */
57
61
62 explicit DEGCustomDataMeshMasks(const CustomData_MeshMasks *other);
63
65 {
66 this->vert_mask |= other.vert_mask;
67 this->edge_mask |= other.edge_mask;
68 this->face_mask |= other.face_mask;
69 this->loop_mask |= other.loop_mask;
70 this->poly_mask |= other.poly_mask;
71 return *this;
72 }
73
75 {
77 result.vert_mask = this->vert_mask | other.vert_mask;
78 result.edge_mask = this->edge_mask | other.edge_mask;
79 result.face_mask = this->face_mask | other.face_mask;
80 result.loop_mask = this->loop_mask | other.loop_mask;
81 result.poly_mask = this->poly_mask | other.poly_mask;
82 return result;
83 }
84
85 bool operator==(const DEGCustomDataMeshMasks &other) const
86 {
87 return (this->vert_mask == other.vert_mask && this->edge_mask == other.edge_mask &&
88 this->face_mask == other.face_mask && this->loop_mask == other.loop_mask &&
89 this->poly_mask == other.poly_mask);
90 }
91
92 bool operator!=(const DEGCustomDataMeshMasks &other) const
93 {
94 return !(*this == other);
95 }
96
98 {
100 result.vert_mask = vert_mask;
101 return result;
102 }
103
105 {
107 result.edge_mask = edge_mask;
108 return result;
109 }
110
112 {
114 result.face_mask = face_mask;
115 return result;
116 }
117
119 {
121 result.loop_mask = loop_mask;
122 return result;
123 }
124
126 {
128 result.poly_mask = poly_mask;
129 return result;
130 }
131};
132
133} // namespace deg
134} // namespace blender
@ DEG_UPDATE_SOURCE_SIDE_EFFECT_REQUEST
BMesh Iterators.
unsigned __int64 uint64_t
Definition BKE_text.h:91
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)