Blender V5.3
DNA_pointcloud_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_ID.h"
12#include "DNA_attribute_types.h"
14
15#include <optional>
16
17#include "BLI_bounds_types.hh"
18#include "BLI_enum_flags.hh"
22#include "BLI_span.hh"
24
25namespace blender {
26
27template<typename T> class Span;
28namespace bke {
32namespace bvh {
33class Tree;
34}
35} // namespace bke
36
37namespace draw {
39struct GSplatBatchCache;
40} // namespace draw
41
43enum ePointCloud_Flag : int {
44 PT_DS_EXPAND = (1 << 0),
45};
47
48enum class PointCloudType : short {
49 Points = 0,
50 GSplat = 1,
51};
52
53struct PointCloud {
54#ifdef __cplusplus
56 static constexpr ID_Type id_type = ID_PT;
57#endif
58
60 struct AnimData *adt = nullptr; /* animation data (must be immediately after id) */
61
63 short _pad1[3] = {};
64
66
67 /* Geometry */
68 int totpoint = 0;
69
72
73 /* Custom Data */
77 int _pad4 = {};
78
79 /* Material */
80 struct Material **mat = nullptr;
81 short totcol = 0;
82 short _pad3[3] = {};
83
84#ifdef __cplusplus
85 Span<float3> positions() const;
86 MutableSpan<float3> positions_for_write();
87
88 VArray<float> radius() const;
89 MutableSpan<float> radius_for_write();
90
91 bke::AttributeAccessor attributes() const;
92 bke::MutableAttributeAccessor attributes_for_write();
93
94 void tag_positions_changed();
95 void tag_radii_changed();
96
97 std::optional<Bounds<float3>> bounds_min_max(bool use_radius = true) const;
98
100 std::optional<int> material_index_max() const;
101
103 const bke::bvh::Tree &bvh_tree() const;
104
105 void count_memory(MemoryCounter &memory) const;
106#endif
107
109
110 /* Draw Caches */
113};
114
115/* Only one material supported currently. */
116#define POINTCLOUD_MATERIAL_NR 1
117
118} // namespace blender
#define ENUM_OPERATORS(_enum_type)
ID and Library types, which are fundamental for SDNA.
BMesh Iterators.
draw::GSplatBatchCache * gsplat_batch_cache
struct CustomData pdata_legacy
bke::PointCloudRuntime * runtime
struct Material ** mat
draw::PointCloudBatchCache * pointcloud_batch_cache
struct AttributeStorage attribute_storage