Blender V5.0
DRW_pbvh.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <variant>
12
13#include "BLI_index_mask_fwd.hh"
14#include "BLI_string_ref.hh"
16#include "BLI_vector.hh"
17
18#include "BKE_paint_bvh.hh"
19
21
22namespace blender::gpu {
23class Batch;
24class IndexBuf;
25class VertBuf;
26} // namespace blender::gpu
27struct Object;
28namespace blender::bke {
29enum class AttrDomain : int8_t;
30namespace pbvh {
31class Node;
32class DrawCache;
33class Tree;
34} // namespace pbvh
35} // namespace blender::bke
36
38
39using GenericRequest = std::string;
40
41enum class CustomRequest : int8_t {
46};
47
48using AttributeRequest = std::variant<CustomRequest, GenericRequest>;
49
56
58 public:
59 virtual ~DrawCache() = default;
65 const ViewportRequest &request,
66 const IndexMask &nodes_to_update) = 0;
72 const ViewportRequest &request,
73 const IndexMask &nodes_to_update) = 0;
74
79 virtual Span<int> ensure_material_indices(const Object &object) = 0;
80};
81
82DrawCache &ensure_draw_data(std::unique_ptr<bke::pbvh::DrawCache> &ptr);
83
84} // namespace blender::draw::pbvh
A BVH for high poly meshes.
unsigned long long int uint64_t
virtual Span< int > ensure_material_indices(const Object &object)=0
virtual ~DrawCache()=default
virtual Span< gpu::Batch * > ensure_lines_batches(const Object &object, const ViewportRequest &request, const IndexMask &nodes_to_update)=0
virtual Span< gpu::Batch * > ensure_tris_batches(const Object &object, const ViewportRequest &request, const IndexMask &nodes_to_update)=0
DrawCache & ensure_draw_data(std::unique_ptr< bke::pbvh::DrawCache > &ptr)
Definition draw_pbvh.cc:250
std::string GenericRequest
Definition DRW_pbvh.hh:39
std::variant< CustomRequest, GenericRequest > AttributeRequest
Definition DRW_pbvh.hh:48
Vector< AttributeRequest > attributes
Definition DRW_pbvh.hh:51
BLI_STRUCT_EQUALITY_OPERATORS_2(ViewportRequest, attributes, use_coarse_grids)
PointerRNA * ptr
Definition wm_files.cc:4238