Blender V5.0
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#ifdef __cplusplus
16# include <optional>
17
18# include "BLI_bounds_types.hh"
21# include "BLI_span.hh"
23#endif
24
25#ifdef __cplusplus
26namespace blender {
27template<typename T> class Span;
28namespace bke {
33} // namespace bke
34} // namespace blender
36#else
38#endif
39
40typedef struct PointCloud {
41#ifdef __cplusplus
43 static constexpr ID_Type id_type = ID_PT;
44#endif
45
47 struct AnimData *adt; /* animation data (must be immediately after id) */
48
49 int flag;
50
51 /* Geometry */
53
56
57 /* Custom Data */
61 int _pad4;
62
63 /* Material */
64 struct Material **mat;
65 short totcol;
66 short _pad3[3];
67
68#ifdef __cplusplus
69 blender::Span<blender::float3> positions() const;
70 blender::MutableSpan<blender::float3> positions_for_write();
71
72 blender::VArray<float> radius() const;
73 blender::MutableSpan<float> radius_for_write();
74
76 blender::bke::MutableAttributeAccessor attributes_for_write();
77
78 void tag_positions_changed();
79 void tag_radii_changed();
80
81 std::optional<blender::Bounds<blender::float3>> bounds_min_max(bool use_radius = true) const;
82
84 std::optional<int> material_index_max() const;
85
87
88 void count_memory(blender::MemoryCounter &memory) const;
89#endif
90
92
93 /* Draw Cache */
96
98enum {
99 PT_DS_EXPAND = (1 << 0),
100};
101
102/* Only one material supported currently. */
103#define POINTCLOUD_MATERIAL_NR 1
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_PT
struct PointCloudRuntimeHandle PointCloudRuntimeHandle
@ PT_DS_EXPAND
AttributeSet attributes
Definition DNA_ID.h:414
struct Material ** mat
PointCloudRuntimeHandle * runtime
struct AttributeStorage attribute_storage
struct AnimData * adt
struct CustomData pdata_legacy