diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/depsgraph/intern/depsgraph_type.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_type.h')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_type.h | 187 |
1 files changed, 90 insertions, 97 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_type.h b/source/blender/depsgraph/intern/depsgraph_type.h index d96c621f4b2..51ed31b8e25 100644 --- a/source/blender/depsgraph/intern/depsgraph_type.h +++ b/source/blender/depsgraph/intern/depsgraph_type.h @@ -46,16 +46,16 @@ struct CustomData_MeshMasks; namespace DEG { /* Commonly used types. */ -using std::string; -using std::vector; using std::map; using std::pair; +using std::string; using std::unordered_map; +using std::vector; /* Commonly used functions. */ +using std::make_pair; using std::max; using std::to_string; -using std::make_pair; /* Function bindings. */ using std::function; @@ -68,104 +68,97 @@ using namespace std::placeholders; * * TODO(sergey): Find a better place for this. */ enum eUpdateSource { - /* Update is caused by a time change. */ - DEG_UPDATE_SOURCE_TIME = (1 << 0), - /* Update caused by user directly or indirectly influencing the node. */ - DEG_UPDATE_SOURCE_USER_EDIT = (1 << 1), - /* Update is happening as a special response for the relations update. */ - DEG_UPDATE_SOURCE_RELATIONS = (1 << 2), - /* Update is happening due to visibility change. */ - DEG_UPDATE_SOURCE_VISIBILITY = (1 << 3), + /* Update is caused by a time change. */ + DEG_UPDATE_SOURCE_TIME = (1 << 0), + /* Update caused by user directly or indirectly influencing the node. */ + DEG_UPDATE_SOURCE_USER_EDIT = (1 << 1), + /* Update is happening as a special response for the relations update. */ + DEG_UPDATE_SOURCE_RELATIONS = (1 << 2), + /* Update is happening due to visibility change. */ + DEG_UPDATE_SOURCE_VISIBILITY = (1 << 3), }; /* C++ wrapper around DNA's CustomData_MeshMasks struct. */ struct DEGCustomDataMeshMasks { - uint64_t vert_mask; - uint64_t edge_mask; - uint64_t face_mask; - uint64_t loop_mask; - uint64_t poly_mask; - - DEGCustomDataMeshMasks() - : vert_mask(0), - edge_mask(0), - face_mask(0), - loop_mask(0), - poly_mask(0) - { - } - - explicit DEGCustomDataMeshMasks(const CustomData_MeshMasks *other); - - DEGCustomDataMeshMasks& operator|=(const DEGCustomDataMeshMasks& other) - { - this->vert_mask |= other.vert_mask; - this->edge_mask |= other.edge_mask; - this->face_mask |= other.face_mask; - this->loop_mask |= other.loop_mask; - this->poly_mask |= other.poly_mask; - return *this; - } - - DEGCustomDataMeshMasks operator|(const DEGCustomDataMeshMasks& other) const - { - DEGCustomDataMeshMasks result; - result.vert_mask = this->vert_mask | other.vert_mask; - result.edge_mask = this->edge_mask | other.edge_mask; - result.face_mask = this->face_mask | other.face_mask; - result.loop_mask = this->loop_mask | other.loop_mask; - result.poly_mask = this->poly_mask | other.poly_mask; - return result; - } - - bool operator==(const DEGCustomDataMeshMasks& other) const - { - return (this->vert_mask == other.vert_mask && - this->edge_mask == other.edge_mask && - this->face_mask == other.face_mask && - this->loop_mask == other.loop_mask && - this->poly_mask == other.poly_mask); - } - - bool operator!=(const DEGCustomDataMeshMasks& other) const - { - return !(*this == other); - } - - static DEGCustomDataMeshMasks MaskVert(const uint64_t vert_mask) - { - DEGCustomDataMeshMasks result; - result.vert_mask = vert_mask; - return result; - } - - static DEGCustomDataMeshMasks MaskEdge(const uint64_t edge_mask) - { - DEGCustomDataMeshMasks result; - result.edge_mask = edge_mask; - return result; - } - - static DEGCustomDataMeshMasks MaskFace(const uint64_t face_mask) - { - DEGCustomDataMeshMasks result; - result.face_mask = face_mask; - return result; - } - - static DEGCustomDataMeshMasks MaskLoop(const uint64_t loop_mask) - { - DEGCustomDataMeshMasks result; - result.loop_mask = loop_mask; - return result; - } - - static DEGCustomDataMeshMasks MaskPoly(const uint64_t poly_mask) - { - DEGCustomDataMeshMasks result; - result.poly_mask = poly_mask; - return result; - } + uint64_t vert_mask; + uint64_t edge_mask; + uint64_t face_mask; + uint64_t loop_mask; + uint64_t poly_mask; + + DEGCustomDataMeshMasks() : vert_mask(0), edge_mask(0), face_mask(0), loop_mask(0), poly_mask(0) + { + } + + explicit DEGCustomDataMeshMasks(const CustomData_MeshMasks *other); + + DEGCustomDataMeshMasks &operator|=(const DEGCustomDataMeshMasks &other) + { + this->vert_mask |= other.vert_mask; + this->edge_mask |= other.edge_mask; + this->face_mask |= other.face_mask; + this->loop_mask |= other.loop_mask; + this->poly_mask |= other.poly_mask; + return *this; + } + + DEGCustomDataMeshMasks operator|(const DEGCustomDataMeshMasks &other) const + { + DEGCustomDataMeshMasks result; + result.vert_mask = this->vert_mask | other.vert_mask; + result.edge_mask = this->edge_mask | other.edge_mask; + result.face_mask = this->face_mask | other.face_mask; + result.loop_mask = this->loop_mask | other.loop_mask; + result.poly_mask = this->poly_mask | other.poly_mask; + return result; + } + + bool operator==(const DEGCustomDataMeshMasks &other) const + { + return (this->vert_mask == other.vert_mask && this->edge_mask == other.edge_mask && + this->face_mask == other.face_mask && this->loop_mask == other.loop_mask && + this->poly_mask == other.poly_mask); + } + + bool operator!=(const DEGCustomDataMeshMasks &other) const + { + return !(*this == other); + } + + static DEGCustomDataMeshMasks MaskVert(const uint64_t vert_mask) + { + DEGCustomDataMeshMasks result; + result.vert_mask = vert_mask; + return result; + } + + static DEGCustomDataMeshMasks MaskEdge(const uint64_t edge_mask) + { + DEGCustomDataMeshMasks result; + result.edge_mask = edge_mask; + return result; + } + + static DEGCustomDataMeshMasks MaskFace(const uint64_t face_mask) + { + DEGCustomDataMeshMasks result; + result.face_mask = face_mask; + return result; + } + + static DEGCustomDataMeshMasks MaskLoop(const uint64_t loop_mask) + { + DEGCustomDataMeshMasks result; + result.loop_mask = loop_mask; + return result; + } + + static DEGCustomDataMeshMasks MaskPoly(const uint64_t poly_mask) + { + DEGCustomDataMeshMasks result; + result.poly_mask = poly_mask; + return result; + } }; } // namespace DEG |