Blender V5.0
BKE_mesh_types.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2020 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
11#include <memory>
12#include <variant>
13
14#include "BLI_array.hh"
15#include "BLI_bit_vector.hh"
16#include "BLI_bounds_types.hh"
18#include "BLI_kdopbvh.hh"
20#include "BLI_mutex.hh"
21#include "BLI_shared_cache.hh"
22#include "BLI_vector.hh"
23#include "BLI_vector_set.hh"
25
27
28struct BMEditMesh;
29struct BVHTree;
30struct Mesh;
32struct SubdivCCG;
34namespace blender::bke {
35struct EditMeshData;
36} // namespace blender::bke
37namespace blender::bke::bake {
39}
40
50
51namespace blender::bke {
52
57enum class MeshNormalDomain : int8_t {
63 Face = 0,
69 Point = 1,
75 Corner = 2,
76};
77
91
95struct LooseEdgeCache : public LooseGeomCache {};
99struct LooseVertCache : public LooseGeomCache {};
100
103 public:
109 struct UseTrueCache {};
110 std::variant<UseTrueCache, Vector<float3>, Span<float3>> data;
111
113 Span<float3> get_span() const;
115 void store_varray(const VArray<float3> &data);
117};
118
121 bool frozen = false;
122 bool dirty_while_frozen = false;
123
125 void freeze();
127 void unfreeze();
129 void tag_dirty();
130};
131
149
157 Mesh *mesh_eval = nullptr;
159
162
173 std::shared_ptr<BMEditMesh> edit_mesh;
174
180
185 std::unique_ptr<EditMeshData> edit_data;
186
191 void *batch_cache = nullptr;
192
197
207
210
213
219 std::unique_ptr<Array<MeshGroup>> spatial_groups;
220
226 std::unique_ptr<SubdivCCG> subdiv_ccg;
228
230 bool deformed_only = false;
238 bool is_original_bmesh = false;
239
242
249
258
276
279
286
293
295 std::unique_ptr<bake::BakeMaterialsList> bake_materials;
296
298 ~MeshRuntime();
299};
300
301} // namespace blender::bke
eMeshWrapperType
@ ME_WRAPPER_TYPE_MDATA
@ ME_WRAPPER_TYPE_SUBD
@ ME_WRAPPER_TYPE_BMESH
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
void store_varray(const VArray< float3 > &data)
std::variant< UseTrueCache, Vector< float3 >, Span< float3 > > data
MutableSpan< float3 > ensure_vector_size(const int size)
Span< float3 > get_span() const
void store_vector(Vector< float3 > &&data)
std::mutex Mutex
Definition BLI_mutex.hh:47
blender::BitVector is_loose_bits
SharedCache< Bounds< float3 > > bounds_cache
SharedCache< LooseEdgeCache > loose_edges_cache
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_verts
std::unique_ptr< bake::BakeMaterialsList > bake_materials
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_edges_no_hidden
std::shared_ptr< BMEditMesh > edit_mesh
std::unique_ptr< EditMeshData > edit_data
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_corner_tris
SharedCache< NormalsCache > vert_normals_cache
SharedCache< Array< int > > vert_to_face_offset_cache
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_edges
SharedCache< Array< int > > corner_to_face_map_cache
SharedCache< NormalsCache > corner_normals_cache
SharedCache< NormalsCache > face_normals_cache
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_verts
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_verts_no_hidden
SharedCache< LooseVertCache > verts_no_face_cache
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_edges
std::unique_ptr< Array< MeshGroup > > spatial_groups
std::unique_ptr< SubdivCCG > subdiv_ccg
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_faces
SharedCache< Array< int > > corner_tri_faces_cache
SharedCache< LooseVertCache > loose_verts_cache
SharedCache< Vector< float3 > > face_normals_true_cache
eMeshWrapperType wrapper_type
SharedCache< VectorSet< int > > used_material_indices
SharedCache< Array< int > > vert_to_face_map_cache
SharedCache< Vector< float3 > > vert_normals_true_cache
SharedCache< ShrinkwrapBoundaryData > shrinkwrap_boundary_cache
SharedCache< std::optional< int > > max_material_index
SharedCache< Array< int > > vert_to_corner_map_cache
SubsurfRuntimeData * subsurf_runtime_data
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_corner_tris_no_hidden
CustomData_MeshMasks cd_mask_extra
const ImplicitSharingInfo * face_offsets_sharing_info
SharedCache< Array< int3 > > data