Blender V5.0
paint_test.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "BKE_idtype.hh"
6#include "BKE_lib_id.hh"
7#include "BKE_paint_bvh.hh"
8
9#include "DNA_mesh_types.h"
10
12
13#include "CLG_log.h"
14
15#include "testing/testing.h"
16
17namespace blender::bke::tests {
18class PaintBVHTest : public testing::Test {
19 public:
21
22 static void SetUpTestSuite()
23 {
24 CLG_init();
26 }
27
28 static void TearDownTestSuite()
29 {
30 CLG_exit();
31 }
32
33 void SetUp() override
34 {
35 cube_mesh = geometry::create_cuboid_mesh(float3(1.0, 1.0, 1.0), 10, 10, 10);
36 }
37
38 void TearDown() override
39 {
40 BKE_id_free(nullptr, cube_mesh);
41 }
42};
43
45{
47 EXPECT_GT(tree.nodes<pbvh::MeshNode>().size(), 0)
48 << "Paint BVH should have some non zero amount of nodes";
49}
50} // namespace blender::bke::tests
void BKE_idtype_init()
Definition idtype.cc:121
void BKE_id_free(Main *bmain, void *idv)
A BVH for high poly meshes.
void CLG_exit()
Definition clog.cc:880
void CLG_init()
Definition clog.cc:873
static Tree from_mesh(const Mesh &mesh)
Definition pbvh.cc:306
KDTree_3d * tree
TEST_F(ArmatureDeformTest, MeshDeform)
Mesh * create_cuboid_mesh(const float3 &size, int verts_x, int verts_y, int verts_z, std::optional< StringRef > uv_id)
VecBase< float, 3 > float3