Blender V4.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
15#pragma once
16
17#include <functional>
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#include <algorithm>
22#include <deque>
23#include <map>
24#include <set>
25#include <string>
26#include <vector>
27
28#include "BLI_map.hh"
29#include "BLI_set.hh"
30#include "BLI_string_ref.hh"
31#include "BLI_vector.hh"
32#include "BLI_vector_set.hh"
33
34struct Depsgraph;
36
37namespace blender::deg {
38
39/* Commonly used types. */
40using std::deque;
41using std::optional;
42using std::pair;
43using std::string;
44using std::unique_ptr;
45
46/* Commonly used functions. */
47using std::make_pair;
48using std::max;
49using std::to_string;
50
51/* Function bindings. */
52using std::function;
53using namespace std::placeholders;
54#define function_bind std::bind
55
56/* Source of the dependency graph node update tag.
57 *
58 * NOTE: This is a bit mask, so accumulation of sources is possible.
59 *
60 * TODO(sergey): Find a better place for this. */
62 /* Update is caused by a time change. */
64 /* Update caused by user directly or indirectly influencing the node. */
66 /* Update is happening as a special response for the relations update. */
68 /* Update is happening due to visibility change. */
76};
77
78/* C++ wrapper around DNA's CustomData_MeshMasks struct. */
85
89
90 explicit DEGCustomDataMeshMasks(const CustomData_MeshMasks *other);
91
93 {
94 this->vert_mask |= other.vert_mask;
95 this->edge_mask |= other.edge_mask;
96 this->face_mask |= other.face_mask;
97 this->loop_mask |= other.loop_mask;
98 this->poly_mask |= other.poly_mask;
99 return *this;
100 }
101
103 {
105 result.vert_mask = this->vert_mask | other.vert_mask;
106 result.edge_mask = this->edge_mask | other.edge_mask;
107 result.face_mask = this->face_mask | other.face_mask;
108 result.loop_mask = this->loop_mask | other.loop_mask;
109 result.poly_mask = this->poly_mask | other.poly_mask;
110 return result;
111 }
112
113 bool operator==(const DEGCustomDataMeshMasks &other) const
114 {
115 return (this->vert_mask == other.vert_mask && this->edge_mask == other.edge_mask &&
116 this->face_mask == other.face_mask && this->loop_mask == other.loop_mask &&
117 this->poly_mask == other.poly_mask);
118 }
119
120 bool operator!=(const DEGCustomDataMeshMasks &other) const
121 {
122 return !(*this == other);
123 }
124
131
138
145
152
159};
160
161} // namespace blender::deg
@ DEG_UPDATE_SOURCE_SIDE_EFFECT_REQUEST
unsigned __int64 uint64_t
Definition stdint.h:90
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)