Blender V5.3
geometry_set.cc
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#include <fmt/format.h>
10
11#include "BLI_bounds.hh"
12#include "BLI_map.hh"
13#include "BLI_memory_counter.hh"
14#include "BLI_task.hh"
15
16#include "BKE_attribute.hh"
17#include "BKE_curves.hh"
18#include "BKE_geometry_set.hh"
20#include "BKE_grease_pencil.hh"
21#include "BKE_instances.hh"
22#include "BKE_mesh.hh"
23#include "BKE_modifier.hh"
24#include "BKE_object_types.hh"
26#include "BKE_volume.hh"
27
29
30#include "DNA_object_types.h"
32
33namespace blender::bke {
34
35/* -------------------------------------------------------------------- */
38
40
42{
43 switch (component_type) {
44 case Type::Mesh:
48 case Type::Instance:
50 case Type::Volume:
52 case Type::Curve:
54 case Type::Edit:
58 }
60 return {};
61}
62
64{
65 if (this->is_empty()) {
66 return 0;
67 }
68 const std::optional<AttributeAccessor> attributes = this->attributes();
69 if (attributes.has_value()) {
70 return attributes->domain_size(domain);
71 }
72 return 0;
73}
74
75std::optional<AttributeAccessor> GeometryComponent::attributes() const
76{
77 return std::nullopt;
78};
79std::optional<MutableAttributeAccessor> GeometryComponent::attributes_for_write()
80{
81 return std::nullopt;
82}
83
85
87{
88 return type_;
89}
90
92{
93 return false;
94}
95
96void GeometryComponent::delete_self()
97{
98 delete this;
99}
100
101void GeometryComponent::delete_data_only()
102{
103 this->clear();
104}
105
107
108/* -------------------------------------------------------------------- */
111
112GeometrySet::GeometrySet() = default;
113GeometrySet::GeometrySet(const GeometrySet &other) = default;
114GeometrySet::GeometrySet(GeometrySet &&other) = default;
115GeometrySet::~GeometrySet() = default;
116GeometrySet &GeometrySet::operator=(const GeometrySet &other) = default;
117GeometrySet &GeometrySet::operator=(GeometrySet &&other) = default;
118
120{
121 GeometryComponentPtr &component_ptr = components_[size_t(component_type)];
122 if (!component_ptr) {
123 /* If the component did not exist before, create a new one. */
124 component_ptr = GeometryComponent::create(component_type);
125 }
126 return component_ptr.ensure_mutable_inplace();
127}
128
129GeometryComponent *GeometrySet::get_component_for_write_ptr(GeometryComponent::Type type)
130{
131 if (this->has(type)) {
132 return &this->get_component_for_write(type);
133 }
134 return nullptr;
135}
136
138{
139 return components_[size_t(component_type)].get();
140}
141
142bool GeometrySet::has(const GeometryComponent::Type component_type) const
143{
144 const GeometryComponentPtr &component = components_[size_t(component_type)];
145 return component.has_value() && !component->is_empty();
146}
147
149{
150 components_[size_t(component_type)].reset();
151}
152
154{
155 for (GeometryComponentPtr &component_ptr : components_) {
156 if (component_ptr) {
157 if (!component_types.contains(component_ptr->type())) {
158 component_ptr.reset();
159 }
160 }
161 }
162}
163
165{
166 BLI_assert(!components_[size_t(component.type())]);
167 component.add_user();
168 components_[size_t(component.type())] = GeometryComponentPtr(
169 const_cast<GeometryComponent *>(&component));
170}
171
173{
175 for (const GeometryComponentPtr &component_ptr : components_) {
176 if (component_ptr) {
177 components.append(component_ptr.get());
178 }
179 }
180 return components;
181}
182
184 const bool use_radius, const bool use_subdiv) const
185{
186 std::optional<Bounds<float3>> bounds;
187 if (const PointCloud *pointcloud = this->get_pointcloud()) {
188 bounds = bounds::merge(bounds, pointcloud->bounds_min_max(use_radius));
189 }
190 if (const Mesh *mesh = this->get_mesh()) {
191 /* Use tessellated subdivision mesh if it exists. */
192 if (use_subdiv && mesh->runtime->mesh_eval) {
193 bounds = bounds::merge(bounds, mesh->runtime->mesh_eval->bounds_min_max());
194 }
195 else {
196 bounds = bounds::merge(bounds, mesh->bounds_min_max());
197 }
198 }
199 if (const Volume *volume = this->get_volume()) {
201 }
202 if (const Curves *curves_id = this->get_curves()) {
203 bounds = bounds::merge(bounds, curves_id->geometry.wrap().bounds_min_max(use_radius));
204 }
205 if (const GreasePencil *grease_pencil = this->get_grease_pencil()) {
206 bounds = bounds::merge(bounds, grease_pencil->bounds_min_max_eval(use_radius));
207 }
208 return bounds;
209}
210
211std::ostream &operator<<(std::ostream &stream, const GeometrySet &geometry_set)
212{
214 if (!geometry_set.name().is_empty()) {
215 parts.append(fmt::format("\"{}\"", geometry_set.name()));
216 }
217 if (const Mesh *mesh = geometry_set.get_mesh()) {
218 parts.append(std::to_string(mesh->verts_num) + " verts");
219 parts.append(std::to_string(mesh->edges_num) + " edges");
220 parts.append(std::to_string(mesh->faces_num) + " faces");
221 parts.append(std::to_string(mesh->corners_num) + " corners");
222 if (mesh->runtime->subsurf_runtime_data) {
223 const int resolution = mesh->runtime->subsurf_runtime_data->resolution;
224 if (is_power_of_2_i(resolution - 1)) {
225 /* Display the resolution as subdiv levels if possible because that's more common. */
226 const int level = log2_floor(resolution - 1);
227 parts.append(std::to_string(level) + " subdiv levels");
228 }
229 else {
230 parts.append(std::to_string(resolution) + " subdiv resolution");
231 }
232 }
233 }
234 if (const Curves *curves = geometry_set.get_curves()) {
235 parts.append(std::to_string(curves->geometry.point_num) + " control points");
236 parts.append(std::to_string(curves->geometry.curve_num) + " curves");
237 }
238 if (const GreasePencil *grease_pencil = geometry_set.get_grease_pencil()) {
239 parts.append(std::to_string(grease_pencil->layers().size()) + " Grease Pencil layers");
240 }
241 if (const PointCloud *pointcloud = geometry_set.get_pointcloud()) {
242 parts.append(std::to_string(pointcloud->totpoint) + " points");
243 }
244 if (const Volume *volume = geometry_set.get_volume()) {
245 parts.append(std::to_string(BKE_volume_num_grids(volume)) + " volume grids");
246 }
247 if (geometry_set.has_instances()) {
248 parts.append(std::to_string(geometry_set.get_instances()->instances_num()) + " instances");
249 }
250 if (geometry_set.get_curve_edit_hints()) {
251 parts.append("curve edit hints");
252 }
253
254 stream << "<GeometrySet: ";
255 for (const int i : parts.index_range()) {
256 stream << parts[i];
257 if (i < parts.size() - 1) {
258 stream << ", ";
259 }
260 }
261 stream << ">";
262 return stream;
263}
264
266{
267 for (GeometryComponentPtr &component_ptr : components_) {
268 component_ptr.reset();
269 }
270}
271
273{
274 for (GeometryComponentPtr &component_ptr : components_) {
275 if (!component_ptr) {
276 continue;
277 }
278 if (component_ptr->owns_direct_data()) {
279 continue;
280 }
281 GeometryComponent &component_for_write = this->get_component_for_write(component_ptr->type());
282 component_for_write.ensure_owns_direct_data();
283 }
284}
285
287{
288 if (Instances *instances = this->get_instances_for_write()) {
289 instances->ensure_geometry_instances();
290 }
292}
293
295{
296 for (const GeometryComponentPtr &component_ptr : components_) {
297 if (component_ptr) {
298 if (!component_ptr->owns_direct_data()) {
299 return false;
300 }
301 }
302 }
303 return true;
304}
305
307{
308 for (const int i : IndexRange(this->components_.size())) {
309 if (components_[i]) {
311 }
312 }
313}
314
316{
317 const MeshComponent *component = this->get_component<MeshComponent>();
318 return (component == nullptr) ? nullptr : component->get();
319}
320
322{
323 const MeshComponent *component = this->get_component<MeshComponent>();
324 return component != nullptr && component->has_mesh();
325}
326
328{
330 return (component == nullptr) ? nullptr : component->get();
331}
332
334{
335 const VolumeComponent *component = this->get_component<VolumeComponent>();
336 return (component == nullptr) ? nullptr : component->get();
337}
338
340{
341 const CurveComponent *component = this->get_component<CurveComponent>();
342 return (component == nullptr) ? nullptr : component->get();
343}
344
346{
347 const InstancesComponent *component = this->get_component<InstancesComponent>();
348 return (component == nullptr) ? nullptr : component->get();
349}
350
352{
354 return (component == nullptr) ? nullptr : component->curves_edit_hints_.get();
355}
356
358{
360 return (component == nullptr) ? nullptr : component->grease_pencil_edit_hints_.get();
361}
362
364{
366 return (component == nullptr) ? nullptr : component->gizmo_edit_hints_.get();
367}
368
370{
372 return (component == nullptr) ? nullptr : component->get();
373}
374
376{
378 return component != nullptr && component->has_pointcloud();
379}
380
382{
383 const InstancesComponent *component = this->get_component<InstancesComponent>();
384 return component != nullptr && component->get() != nullptr &&
385 component->get()->instances_num() >= 1;
386}
387
389{
390 const VolumeComponent *component = this->get_component<VolumeComponent>();
391 return component != nullptr && component->has_volume();
392}
393
395{
396 const CurveComponent *component = this->get_component<CurveComponent>();
397 return component != nullptr && component->has_curves();
398}
399
401{
402 for (const GeometryComponentPtr &component_ptr : components_) {
403 if (component_ptr) {
404 if (!ELEM(component_ptr->type(),
407 {
408 return true;
409 }
410 }
411 }
412 return false;
413}
414
416{
418 return component != nullptr && component->has_grease_pencil();
419}
420
422{
423 return !(this->has_mesh() || this->has_curves() || this->has_pointcloud() ||
424 this->has_volume() || this->has_instances() || this->has_grease_pencil());
425}
426
428{
429 GeometrySet geometry_set;
430 geometry_set.replace_mesh(mesh, ownership);
431 return geometry_set;
432}
433
435{
436 GeometrySet geometry_set;
437 geometry_set.replace_volume(volume, ownership);
438 return geometry_set;
439}
440
442{
443 GeometrySet geometry_set;
444 geometry_set.replace_pointcloud(pointcloud, ownership);
445 return geometry_set;
446}
447
449{
450 GeometrySet geometry_set;
451 geometry_set.replace_curves(curves, ownership);
452 return geometry_set;
453}
454
456{
457 GeometrySet geometry_set;
458 geometry_set.replace_instances(instances, ownership);
459 return geometry_set;
460}
461
462GeometrySet GeometrySet::from_instances(std::unique_ptr<Instances> instances)
463{
464 GeometrySet geometry_set;
465 geometry_set.replace_instances(instances.release(), GeometryOwnershipType::Owned);
466 return geometry_set;
467}
468
470 GeometryOwnershipType ownership)
471{
472 GeometrySet geometry_set;
473 geometry_set.replace_grease_pencil(grease_pencil, ownership);
474 return geometry_set;
475}
476
478{
479 if (mesh == nullptr) {
480 this->remove<MeshComponent>();
481 return;
482 }
483 if (mesh == this->get_mesh()) {
484 return;
485 }
486 this->remove<MeshComponent>();
488 component.replace(mesh, ownership);
489}
490
492{
493 if (curves == nullptr) {
495 return;
496 }
497 if (curves == this->get_curves()) {
498 return;
499 }
502 component.replace(curves, ownership);
503}
504
506{
507 if (instances == nullptr) {
509 return;
510 }
511 if (instances == this->get_instances()) {
512 return;
513 }
516 component.replace(instances, ownership);
517}
518
520{
521 if (pointcloud == nullptr) {
523 return;
524 }
525 if (pointcloud == this->get_pointcloud()) {
526 return;
527 }
530 component.replace(pointcloud, ownership);
531}
532
534{
535 if (volume == nullptr) {
537 return;
538 }
539 if (volume == this->get_volume()) {
540 return;
541 }
544 component.replace(volume, ownership);
545}
546
548 GeometryOwnershipType ownership)
549{
550 if (grease_pencil == nullptr) {
552 return;
553 }
554 if (grease_pencil == this->get_grease_pencil()) {
555 return;
556 }
559 component.replace(grease_pencil, ownership);
560}
561
563{
564 MeshComponent *component = this->get_component_for_write_ptr<MeshComponent>();
565 return component == nullptr ? nullptr : component->get_for_write();
566}
567
569{
570 PointCloudComponent *component = this->get_component_for_write_ptr<PointCloudComponent>();
571 return component == nullptr ? nullptr : component->get_for_write();
572}
573
575{
576 VolumeComponent *component = this->get_component_for_write_ptr<VolumeComponent>();
577 return component == nullptr ? nullptr : component->get_for_write();
578}
579
581{
582 CurveComponent *component = this->get_component_for_write_ptr<CurveComponent>();
583 return component == nullptr ? nullptr : component->get_for_write();
584}
585
587{
588 InstancesComponent *component = this->get_component_for_write_ptr<InstancesComponent>();
589 return component == nullptr ? nullptr : component->get_for_write();
590}
591
601
611
613{
614 if (!this->has<GeometryComponentEditData>()) {
615 return nullptr;
616 }
617 GeometryComponentEditData &component =
619 return component.gizmo_edit_hints_.get();
620}
621
623{
624 GreasePencilComponent *component = this->get_component_for_write_ptr<GreasePencilComponent>();
625 return component == nullptr ? nullptr : component->get_for_write();
626}
627
629{
630 for (const GeometryComponentPtr &component : components_) {
631 if (component) {
632 memory.add_shared(component.get(), [&](MemoryCounter &shared_memory) {
633 component->count_memory(shared_memory);
634 });
635 }
636 }
637}
638
640 const bool include_instances,
641 const AttributeForeachCallback callback) const
642{
643 for (const GeometryComponent::Type component_type : component_types) {
644 if (!this->has(component_type)) {
645 continue;
646 }
647 const GeometryComponent &component = *this->get_component(component_type);
648 const std::optional<AttributeAccessor> attributes = component.attributes();
649 if (attributes.has_value()) {
650 attributes->foreach_attribute([&](const AttributeIter &iter) {
651 callback(iter.name, {iter.domain, iter.data_type}, component);
652 });
653 }
654 /* For Grease Pencil, we also need to iterate over the attributes of the evaluated drawings. */
655 if (component_type == GeometryComponent::Type::GreasePencil) {
657 for (const bke::greasepencil::Layer *layer : grease_pencil.layers()) {
658 if (const bke::greasepencil::Drawing *drawing = grease_pencil.get_eval_drawing(*layer)) {
659 const AttributeAccessor attributes = drawing->strokes().attributes();
660 attributes.foreach_attribute([&](const AttributeIter &iter) {
661 callback(iter.name, {iter.domain, iter.data_type}, component);
662 });
663 }
664 }
665 }
666 }
667 if (include_instances && this->has_instances()) {
668 const Instances &instances = *this->get_instances();
669 instances.foreach_referenced_geometry([&](const GeometrySet &instance_geometry_set) {
670 instance_geometry_set.attribute_foreach(component_types, include_instances, callback);
671 });
672 }
673}
674
676 const StringRef name)
677{
678 switch (type) {
680 static auto component = GeometryComponent::create(type);
681 return component->attributes()->is_builtin(name);
682 }
684 static auto component = GeometryComponent::create(type);
685 return component->attributes()->is_builtin(name);
686 }
688 static auto component = GeometryComponent::create(type);
689 return component->attributes()->is_builtin(name);
690 }
692 static auto component = GeometryComponent::create(type);
693 return component->attributes()->is_builtin(name);
694 }
696 static auto grease_pencil_component = GeometryComponent::create(
698 static auto curves_component = GeometryComponent::create(GeometryComponent::Type::Curve);
699 return grease_pencil_component->attributes()->is_builtin(name) ||
700 curves_component->attributes()->is_builtin(name);
701 }
704 return false;
705 }
706 }
708 return false;
709}
710
712{
713 const int index = this->names.index_of_or_add(name);
714 if (index >= this->kinds.size()) {
715 this->kinds.append(AttributeDomainAndType{kind.domain, kind.data_type});
716 }
717 else {
719 {this->kinds[index].domain, kind.domain});
721 {this->kinds[index].data_type, kind.data_type});
722 }
723}
724
725static void gather_component_types_recursive(const GeometrySet &geometry_set,
726 const bool include_instances,
727 const bool ignore_empty,
729{
730 for (const GeometryComponent *component : geometry_set.get_components()) {
731 if (ignore_empty) {
732 if (component->is_empty()) {
733 continue;
734 }
735 }
736 r_types.append_non_duplicates(component->type());
737 }
738 if (!include_instances) {
739 return;
740 }
741 const Instances *instances = geometry_set.get_instances();
742 if (instances == nullptr) {
743 return;
744 }
745 instances->foreach_referenced_geometry([&](const GeometrySet &instance_geometry_set) {
747 instance_geometry_set, include_instances, ignore_empty, r_types);
748 });
749}
750
752 bool ignore_empty) const
753{
755 gather_component_types_recursive(*this, include_instances, ignore_empty, types);
756 return types;
757}
758
760{
761 return bundle_;
762}
763
765{
766 return bundle_.get();
767}
768
770{
771 return bundle_;
772}
773
775{
776 return bundle_;
777}
778
780{
781 if (!bundle_) {
782 bundle_ = nodes::Bundle::create();
783 }
784 return bundle_.ensure_mutable_inplace();
785}
786
788{
789 bundle_ = other.bundle_;
790}
791
793{
794 if (!other.has_bundle()) {
795 return;
796 }
797 if (bundle_) {
798 this->bundle_for_write().merge(*other.bundle());
799 }
800 else {
801 this->copy_bundle_from(other);
802 }
803}
804
806{
807 name_ = std::move(name);
808}
809
811{
812 return name_;
813}
814
816{
817 const GeometrySet *geometry_set = object.runtime->geometry_set_eval;
818 if (geometry_set == nullptr) {
819 return false;
820 }
821 if (geometry_set->has_component<InstancesComponent>()) {
822 return true;
823 }
824 if (object.type != OB_MESH && geometry_set->has_component<MeshComponent>()) {
825 return true;
826 }
827 if (object.type != OB_POINTCLOUD && geometry_set->has_component<PointCloudComponent>()) {
828 return true;
829 }
830 if (object.type != OB_VOLUME && geometry_set->has_component<VolumeComponent>()) {
831 return true;
832 }
833 if (!ELEM(object.type, OB_CURVES_LEGACY, OB_FONT) &&
834 geometry_set->has_component<CurveComponent>())
835 {
836 return true;
837 }
838 if (object.type != OB_GREASE_PENCIL && geometry_set->has_component<GreasePencilComponent>()) {
839 return true;
840 }
841 return false;
842}
843
845
846} // namespace blender::bke
Low-level operations for curves.
Low-level operations for grease pencil.
Volume data-block.
Object is a sort of wrapper for general info.
#define BLI_assert_unreachable()
#define ELEM(...)
constexpr IndexRange()=default
constexpr bool contains(const T &value) const
Definition BLI_span.hh:281
void append(const T &value)
IndexRange index_range() const
void append_non_duplicates(const T &value)
void foreach_attribute(const FunctionRef< void(const AttributeIter &)> fn) const
void replace(Curves *curve, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
std::unique_ptr< GreasePencilEditHints > grease_pencil_edit_hints_
std::unique_ptr< GizmoEditHints > gizmo_edit_hints_
std::unique_ptr< CurvesEditHints > curves_edit_hints_
int attribute_domain_size(AttrDomain domain) const
virtual std::optional< AttributeAccessor > attributes() const
virtual std::optional< MutableAttributeAccessor > attributes_for_write()
virtual bool is_empty() const
virtual void count_memory(MemoryCounter &memory) const
virtual void ensure_owns_direct_data()=0
static GeometryComponentPtr create(Type component_type)
void replace(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void replace(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void foreach_referenced_geometry(FunctionRef< void(const GeometrySet &geometry_set)> callback) const
int instances_num() const
Definition instances.cc:408
void replace(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void replace(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void replace(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
constexpr bool is_empty() const
void add_shared(const ImplicitSharingInfo *sharing_info, const FunctionRef< void(MemoryCounter &shared_memory)> count_fn)
void merge(const Bundle &other)
#define layer
ImplicitSharingPtr< GeometryComponent > GeometryComponentPtr
static void gather_component_types_recursive(const GeometrySet &geometry_set, const bool include_instances, const bool ignore_empty, Vector< GeometryComponent::Type > &r_types)
bool attribute_is_builtin_on_component_type(const GeometryComponent::Type type, StringRef name)
AttrType attribute_data_type_highest_complexity(Span< AttrType > data_types)
AttrDomain attribute_domain_highest_priority(Span< AttrDomain > domains)
bool object_has_geometry_set_instances(const Object &object)
Bounds< T > merge(const Bounds< T > &a, const Bounds< T > &b)
Definition BLI_bounds.hh:27
ImplicitSharingPtr< Bundle > BundlePtr
constexpr int64_t log2_floor(const int64_t x)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
std::optional< Bounds< float3 > > BKE_volume_min_max(const Volume *volume)
int BKE_volume_num_grids(const Volume *volume)
MINLINE int is_power_of_2_i(int n)
void add(const StringRef name, const AttributeDomainAndType &kind)
Vector< AttributeDomainAndType, 16 > kinds
void merge_bundle_from(const GeometrySet &other)
void replace_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void keep_only(Span< GeometryComponent::Type > component_types)
const CurvesEditHints * get_curve_edit_hints() const
GeometryComponent & get_component_for_write(GeometryComponent::Type component_type)
GeometrySet & operator=(const GeometrySet &other)
StringRefNull name() const
void set_name(std::string name)
FunctionRef< void( StringRef name, const AttributeMetaData &meta_data, const GeometryComponent &component)> AttributeForeachCallback
static GeometrySet from_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
PointCloud * get_pointcloud_for_write()
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GizmoEditHints * get_gizmo_edit_hints_for_write()
void replace_instances(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Instances * get_instances_for_write()
const GreasePencil * get_grease_pencil() const
nodes::Bundle & bundle_for_write()
const Component * get_component() const
const GizmoEditHints * get_gizmo_edit_hints() const
Vector< const GeometryComponent * > get_components() const
const Volume * get_volume() const
std::optional< Bounds< float3 > > compute_boundbox_without_instances(bool use_radius=true, bool use_subdiv=false) const
static GeometrySet from_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
friend std::ostream & operator<<(std::ostream &stream, const GeometrySet &geometry_set)
bool has(const GeometryComponent::Type component_type) const
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const nodes::Bundle * bundle() const
static GeometrySet from_instances(std::unique_ptr< Instances > instances)
const GeometryComponent * get_component(GeometryComponent::Type component_type) const
const Curves * get_curves() const
static GeometrySet from_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Instances * get_instances() const
static GeometrySet from_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void copy_bundle_from(const GeometrySet &other)
GreasePencilEditHints * get_grease_pencil_edit_hints_for_write()
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
CurvesEditHints * get_curve_edit_hints_for_write()
void count_memory(MemoryCounter &memory) const
const GreasePencilEditHints * get_grease_pencil_edit_hints() const
const PointCloud * get_pointcloud() const
const Mesh * get_mesh() const
void remove(const GeometryComponent::Type component_type)
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GreasePencil * get_grease_pencil_for_write()
Vector< GeometryComponent::Type > gather_component_types(bool include_instances, bool ignore_empty) const
const nodes::BundlePtr & bundle_ptr() const
void attribute_foreach(Span< GeometryComponent::Type > component_types, bool include_instances, AttributeForeachCallback callback) const
void add(const GeometryComponent &component)
void replace_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)