Blender V4.5
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
59
60 /* Custom Data */
64 int _pad4;
65
66 /* Material */
67 struct Material **mat;
68 short totcol;
69 short _pad3[3];
70
71#ifdef __cplusplus
72 blender::Span<blender::float3> positions() const;
73 blender::MutableSpan<blender::float3> positions_for_write();
74
75 blender::VArray<float> radius() const;
76 blender::MutableSpan<float> radius_for_write();
77
79 blender::bke::MutableAttributeAccessor attributes_for_write();
80
81 void tag_positions_changed();
82 void tag_radii_changed();
83
84 std::optional<blender::Bounds<blender::float3>> bounds_min_max(bool use_radius = true) const;
85
87 std::optional<int> material_index_max() const;
88
90
91 void count_memory(blender::MemoryCounter &memory) const;
92#endif
93
95
96 /* Draw Cache */
99
101enum {
102 PT_DS_EXPAND = (1 << 0),
103};
104
105/* Only one material supported currently. */
106#define POINTCLOUD_MATERIAL_NR 1
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_PT
struct PointCloudRuntimeHandle PointCloudRuntimeHandle
AttributeSet attributes
Definition DNA_ID.h:404
struct Material ** mat
PointCloudRuntimeHandle * runtime
struct AttributeStorage attribute_storage
struct AnimData * adt
struct CustomData pdata