Blender V4.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
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_pbvh_api.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
40 public:
41 std::string name;
44 GenericRequest(const StringRef name, const eCustomDataType type, const bke::AttrDomain domain)
45 : name(name), type(type), domain(domain)
46 {
47 }
49};
50
51enum class CustomRequest : int8_t {
53 Normal,
54 Mask,
55 FaceSet,
56};
57
58using AttributeRequest = std::variant<CustomRequest, GenericRequest>;
59
66
68 public:
69 virtual ~DrawCache() = default;
75 const ViewportRequest &request,
76 const IndexMask &nodes_to_update) = 0;
82 const ViewportRequest &request,
83 const IndexMask &nodes_to_update) = 0;
84
89 virtual Span<int> ensure_material_indices(const Object &object) = 0;
90};
91
92DrawCache &ensure_draw_data(std::unique_ptr<bke::pbvh::DrawCache> &ptr);
93
94} // namespace blender::draw::pbvh
A BVH for high poly meshes.
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
GenericRequest(const StringRef name, const eCustomDataType type, const bke::AttrDomain domain)
Definition DRW_pbvh.hh:44
BLI_STRUCT_EQUALITY_OPERATORS_3(GenericRequest, type, domain, name)
DrawCache & ensure_draw_data(std::unique_ptr< bke::pbvh::DrawCache > &ptr)
Definition draw_pbvh.cc:247
unsigned __int64 uint64_t
Definition stdint.h:90
signed char int8_t
Definition stdint.h:75
Vector< AttributeRequest > attributes
Definition DRW_pbvh.hh:61
BLI_STRUCT_EQUALITY_OPERATORS_2(ViewportRequest, attributes, use_coarse_grids)
PointerRNA * ptr
Definition wm_files.cc:4126