Blender V5.0
ED_pointcloud.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <limits>
12#include <optional>
13
14#include "BLI_index_mask_fwd.hh"
17#include "BLI_vector_set.hh"
18
20
21struct ARegion;
22struct bContext;
23struct PointCloud;
24struct rcti;
25struct UndoType;
26struct wmKeyConfig;
27struct wmOperator;
28struct wmOperatorType;
29namespace blender::bke {
30enum class AttrType : int16_t;
32} // namespace blender::bke
33namespace blender {
34class GMutableSpan;
35} // namespace blender
36enum eSelectOp : int8_t;
37
39
42void keymap_pointcloud(wmKeyConfig *keyconf);
44
46
47/* -------------------------------------------------------------------- */
59
61void fill_selection_false(GMutableSpan selection, const IndexMask &mask);
62void fill_selection_true(GMutableSpan selection, const IndexMask &mask);
63
68
75void select_all(PointCloud &pointcloud, int action);
76
81 bke::AttrType create_type);
82
84 const ARegion &region,
85 const float4x4 &projection,
86 const rcti &rect,
87 const eSelectOp sel_op);
88
90 const ARegion &region,
91 const float4x4 &projection,
92 const Span<int2> lasso_coords,
93 const eSelectOp sel_op);
94
96 const ARegion &region,
97 const float4x4 &projection,
98 const int2 coord,
99 const float radius,
100 const eSelectOp sel_op);
101
103 int index = -1;
104 float distance_sq = std::numeric_limits<float>::max();
105};
106
107std::optional<FindClosestData> find_closest_point_to_screen_co(
108 const ARegion &region,
109 const Span<float3> positions,
110 const float4x4 &projection,
111 const IndexMask &points_mask,
112 const float2 mouse_pos,
113 const float radius,
114 const FindClosestData &initial_closest);
115
117
119
120/* -------------------------------------------------------------------- */
123
130
132
133/* -------------------------------------------------------------------- */
136
138
140
141/* -------------------------------------------------------------------- */
144
148
150
152
153} // namespace blender::ed::pointcloud
eSelectOp
#define C
Definition RandGen.cpp:29
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
bool select_box(PointCloud &pointcloud, const ARegion &region, const float4x4 &projection, const rcti &rect, const eSelectOp sel_op)
Definition selection.cc:163
bool editable_pointcloud_in_edit_mode_poll(bContext *C)
Definition operators.cc:73
bool select_lasso(PointCloud &pointcloud, const ARegion &region, const float4x4 &projection, const Span< int2 > lasso_coords, const eSelectOp sel_op)
Definition selection.cc:182
bool select_circle(PointCloud &pointcloud, const ARegion &region, const float4x4 &projection, const int2 coord, const float radius, const eSelectOp sel_op)
Definition selection.cc:211
void fill_selection_true(GMutableSpan span)
Definition selection.cc:71
bool remove_selection(PointCloud &pointcloud)
Definition edit.cc:32
void POINTCLOUD_OT_duplicate(wmOperatorType *ot)
Definition duplicate.cc:60
PointCloud * copy_selection(const PointCloud &src, const IndexMask &mask)
Definition edit.cc:16
IndexMask retrieve_selected_points(const PointCloud &pointcloud, IndexMaskMemory &memory)
Definition selection.cc:279
void POINTCLOUD_OT_attribute_set(wmOperatorType *ot)
void keymap_pointcloud(wmKeyConfig *keyconf)
Definition operators.cc:265
bke::GSpanAttributeWriter ensure_selection_attribute(PointCloud &pointcloud, bke::AttrType create_type)
Definition selection.cc:31
void fill_selection_false(GMutableSpan selection, const IndexMask &mask)
Definition selection.cc:61
std::optional< FindClosestData > find_closest_point_to_screen_co(const ARegion &region, const Span< float3 > positions, const float4x4 &projection, const IndexMask &points_mask, const float2 mouse_pos, const float radius, const FindClosestData &initial_closest)
Definition selection.cc:241
bool has_anything_selected(const PointCloud &pointcloud)
Definition selection.cc:25
void undosys_type_register(UndoType *ut)
Definition undo.cc:158
void select_all(PointCloud &pointcloud, int action)
Definition selection.cc:128
VectorSet< PointCloud * > get_unique_editable_pointclouds(const bContext &C)
Definition operators.cc:78
void POINTCLOUD_OT_separate(wmOperatorType *ot)
wmOperatorStatus join_objects_exec(bContext *C, wmOperator *op)
MatBase< float, 4, 4 > float4x4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
wmOperatorType * ot
Definition wm_files.cc:4237