Blender V5.3
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_index_mask.hh"
19#include "BLI_kdopbvh.hh"
22#include "BLI_mutex.hh"
23#include "BLI_shared_cache.hh"
24#include "BLI_vector.hh"
25#include "BLI_vector_set.hh"
27
28#include "BKE_bvh.hh"
29
31
32namespace blender {
33
34struct BMEditMesh;
35struct BVHTree;
36struct Mesh;
38struct SubdivCCG;
40namespace bke {
41struct EditMeshData;
42} // namespace bke
43namespace bke::bake {
45}
46namespace draw {
47struct MeshBatchCache;
48}
49
59
60namespace bke {
61
72 Face = 0,
78 Point = 1,
84 Corner = 2,
85};
86
91
94 public:
100 struct UseTrueCache {};
101 std::variant<UseTrueCache, Vector<float3>, Span<float3>> data;
102
104 Span<float3> get_span() const;
106 void store_varray(const VArray<float3> &data);
108};
109
112 bool frozen = false;
113 bool dirty_while_frozen = false;
114
116 void freeze();
118 void unfreeze();
120 void tag_dirty();
121};
122
140
148 Mesh *mesh_eval = nullptr;
150
153
164 std::shared_ptr<BMEditMesh> edit_mesh;
165
171
176 std::unique_ptr<EditMeshData> edit_data;
177
183
188
197
201
204
207
213 std::unique_ptr<Array<MeshGroup>> spatial_groups;
214
220 std::unique_ptr<SubdivCCG> subdiv_ccg;
222
224 bool deformed_only = false;
232 bool is_original_bmesh = false;
233
236
243
252
274
277
284
291
293 std::unique_ptr<bake::BakeMaterialsList> bake_materials;
294
296 ~MeshRuntime();
297};
298
299} // namespace bke
300} // namespace blender
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)
BMesh Iterators.
std::mutex Mutex
Definition BLI_mutex.hh:51
@ ME_WRAPPER_TYPE_SUBD
@ ME_WRAPPER_TYPE_MDATA
@ ME_WRAPPER_TYPE_BMESH
signed char int8_t
Definition BKE_text.h:76
SharedCache< Bounds< float3 > > bounds_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
SharedCache< LooseGeomCache > verts_no_face_cache
std::shared_ptr< BMEditMesh > edit_mesh
std::unique_ptr< EditMeshData > edit_data
SharedCache< bke::bvh::Tree > bvh_embree_tris_cache
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_corner_tris
SharedCache< NormalsCache > vert_normals_cache
SharedCache< Array< int > > vert_to_face_offset_cache
SharedCache< Array< int > > edge_to_corner_map_cache
SharedCache< bke::bvh::Tree > bvh_embree_edges_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< Array< int > > edge_to_corner_offset_cache
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_verts_no_hidden
SharedCache< bke::bvh::Tree > bvh_embree_verts_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< LooseGeomCache > loose_edges_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
draw::MeshBatchCache * batch_cache
SubsurfRuntimeData * subsurf_runtime_data
SharedCache< LooseGeomCache > loose_verts_cache
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