Blender V5.3
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"
15#include "BLI_vector.hh"
16
17#include "BKE_paint_bvh.hh"
18
20
21namespace blender {
22
23namespace gpu {
24class Batch;
25class IndexBuf;
26class VertBuf;
27} // namespace gpu
28struct Object;
29namespace bke {
30enum class AttrDomain : int8_t;
31namespace pbvh {
32class Node;
33class DrawCache;
34class Tree;
35} // namespace pbvh
36} // namespace bke
37
38namespace draw::pbvh {
39
40using GenericRequest = std::string;
41
48
49using AttributeRequest = std::variant<CustomRequest, GenericRequest>;
50
57
59 public:
60 ~DrawCache() override = default;
66 const ViewportRequest &request,
67 const IndexMask &nodes_to_update) = 0;
73 const ViewportRequest &request,
74 const IndexMask &nodes_to_update) = 0;
75
80 virtual Span<int> ensure_material_indices(const Object &object) = 0;
81};
82
83DrawCache &ensure_draw_data(std::unique_ptr<bke::pbvh::DrawCache> &ptr);
84
85} // namespace draw::pbvh
86} // namespace blender
A BVH for high poly meshes.
virtual Span< int > ensure_material_indices(const Object &object)=0
~DrawCache() override=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:254
std::string GenericRequest
Definition DRW_pbvh.hh:40
std::variant< CustomRequest, GenericRequest > AttributeRequest
Definition DRW_pbvh.hh:49
BMesh Iterators.
unsigned __int64 uint64_t
Definition BKE_text.h:91
signed char int8_t
Definition BKE_text.h:76
friend bool operator==(const ViewportRequest &a, const ViewportRequest &b)=default
Vector< AttributeRequest > attributes
Definition DRW_pbvh.hh:52