Part of #118145. These days we aren't really benefiting from making PBVH an opaque type. As we remove its responsibilities to focus it on being a BVH tree and look to improve performance with data-oriented design, that will only become more true. There are some other future developments the current header structure makes difficult: - Storing selections of nodes with `IndexMask` for simpler iteration, etc. - Specialization of node type for each PBVH type - Reducing overhead of access to node data as nodes get smaller - General C++ cleanliness and consistency This PR moves `PBVH` to `blender::bke::pbvh::Tree` and moves `PBVHNode` to `blender::bke::pbvh::Node`. Both are classes visible to elsewhere in Blender but with private data fields. The difficult part about the change is that we're in the middle of a transition removing data from PBVH. Rather than making some data truly private I chose to just give it the `_` suffix, since it will ideally be removed later. Other things should be class methods or implemented as part of friend classes. But the "fake" private status is much simpler for now and avoids increasing the scope of this PR too much. Though that's a bit ugly, there's a straightforward way to resolve these issues-- it just looks like the sort of inconsistency you'd expect in the middle of a large refactor. Pull Request: https://projects.blender.org/blender/blender/pulls/124919
25 lines
576 B
C++
25 lines
576 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "BLI_math_vector_types.hh"
|
|
#include "BLI_vector.hh"
|
|
|
|
#include "IMB_imbuf.hh"
|
|
#include "IMB_imbuf_types.hh"
|
|
|
|
#include "BKE_image_wrappers.hh"
|
|
#include "BKE_pbvh.hh"
|
|
#include "BKE_pbvh_pixels.hh"
|
|
|
|
#include "pbvh_uv_islands.hh"
|
|
|
|
namespace blender::bke::pbvh::pixels {
|
|
|
|
void copy_update(Tree &pbvh,
|
|
Image &image,
|
|
ImageUser &image_user,
|
|
const uv_islands::MeshData &mesh_data);
|
|
|
|
} // namespace blender::bke::pbvh::pixels
|