Files
test/source/blender/blenkernel/BKE_editmesh_cache.hh
Hans Goudey 695e626d3f Cleanup: Store more mesh runtime data with unique_ptr
Convert shrinkwrap data arrays to use C++ arrays and BitVector,
use references in "EditMeshData" code, and store both structs
with `std::unique_ptr` instead of a raw allocation.
2023-12-04 15:23:24 -05:00

39 lines
1.0 KiB
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bke
*/
#include "BLI_array.hh"
#include "BLI_bounds_types.hh"
#include "BLI_math_vector_types.hh"
struct BMEditMesh;
namespace blender::bke {
struct EditMeshData {
/** when set, \a vertexNos, faceNos are lazy initialized */
Array<float3> vertexCos;
/** lazy initialize (when \a vertexCos is set) */
Array<float3> vertexNos;
Array<float3> faceNos;
/** also lazy init but don't depend on \a vertexCos */
Array<float3> faceCos;
};
} // namespace blender::bke
void BKE_editmesh_cache_ensure_face_normals(BMEditMesh &em, blender::bke::EditMeshData &emd);
void BKE_editmesh_cache_ensure_vert_normals(BMEditMesh &em, blender::bke::EditMeshData &emd);
void BKE_editmesh_cache_ensure_face_centers(BMEditMesh &em, blender::bke::EditMeshData &emd);
std::optional<blender::Bounds<blender::float3>> BKE_editmesh_cache_calc_minmax(
const BMEditMesh &em, const blender::bke::EditMeshData &emd);