32class AttributeAccessor;
33struct AttributeMetaData;
34class ComponentAttributeProviders;
37class GeometryComponent;
38class GreasePencilEditHints;
39class MutableAttributeAccessor;
46#define GEO_COMPONENT_TYPE_ENUM_SIZE 7
96 virtual std::optional<AttributeAccessor>
attributes()
const;
120 void delete_self()
override;
121 void delete_data_only()
override;
149 std::array<GeometryComponentPtr, GEO_COMPONENT_TYPE_ENUM_SIZE> components_;
187 return static_cast<const Component *
>(
get_component(Component::static_type));
191 template<
typename Component>
bool has()
const
194 return this->
has(Component::static_type);
200 return components_[
int(Component::static_type)];
204 template<
typename Component>
void remove()
207 return this->
remove(Component::static_type);
255 bool include_instances,
265 bool include_instances,
270 bool ignore_empty)
const;
446 return Span(a.components_) ==
Span(
b.components_) && a.name ==
b.name;
463 template<
typename Component> Component *get_component_ptr()
466 return static_cast<Component *
>(get_component_ptr(Component::static_type));
476 Mesh *mesh_ =
nullptr;
485 void clear()
override;
517 std::optional<AttributeAccessor>
attributes() const final;
543 void clear()
override;
544 bool has_pointcloud()
const;
576 std::optional<AttributeAccessor>
attributes()
const final;
589 Curves *curves_ =
nullptr;
597 mutable Curve *curve_for_render_ =
nullptr;
598 mutable std::mutex curve_for_render_mutex_;
606 void clear()
override;
607 bool has_curves()
const;
614 const Curves *get()
const;
617 bool is_empty()
const final;
619 bool owns_direct_data()
const override;
620 void ensure_owns_direct_data()
override;
628 const Curve *get_curve_for_render()
const;
630 std::optional<AttributeAccessor> attributes()
const final;
631 std::optional<MutableAttributeAccessor> attributes_for_write()
final;
651 void clear()
override;
659 bool is_empty()
const final;
663 bool owns_direct_data()
const override;
664 void ensure_owns_direct_data()
override;
668 std::optional<AttributeAccessor> attributes()
const final;
669 std::optional<MutableAttributeAccessor> attributes_for_write()
final;
681 Volume *volume_ =
nullptr;
689 void clear()
override;
690 bool has_volume()
const;
705 const Volume *get()
const;
713 bool owns_direct_data()
const override;
714 void ensure_owns_direct_data()
override;
749 bool owns_direct_data() const final;
750 void ensure_owns_direct_data() final;
760 static
void remember_deformed_positions_if_necessary(
GeometrySet &geometry);
780 void clear()
override;
781 bool has_grease_pencil()
const;
796 bool is_empty()
const final;
798 bool owns_direct_data()
const override;
799 void ensure_owns_direct_data()
override;
803 std::optional<AttributeAccessor> attributes() const final;
#define BLI_STATIC_ASSERT(a, msg)
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 ~GeometryComponent()=default
GeometryComponent(Type type)
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
virtual bool owns_direct_data() const =0
virtual GeometryComponentPtr copy() const =0
static GeometryComponentPtr create(Type component_type)
static constexpr GeometryComponent::Type static_type
void ensure_owns_direct_data() override
bool is_empty() const final
void replace(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GeometryComponentPtr copy() const override
bool owns_direct_data() const override
void count_memory(MemoryCounter &memory) const override
std::optional< AttributeAccessor > attributes() const final
std::optional< MutableAttributeAccessor > attributes_for_write() final
local_group_size(16, 16) .push_constant(Type b
DEGForeachIDComponentCallback callback
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
static void clear(Message &msg)
constexpr bool is_geometry_component_v
uint64_t get_default_hash(const T &v)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
unsigned __int64 uint64_t
GeometrySet & operator=(GeometrySet &&other)
bool owns_direct_data() const
void ensure_owns_all_data()
void replace_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void keep_only(Span< GeometryComponent::Type > component_types)
const CurvesEditHints * get_curve_edit_hints() const
GeometrySet & operator=(const GeometrySet &other)
static GeometrySet from_instances(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static GeometrySet from_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
bool has_component() const
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
bool has_pointcloud() const
const Component * get_component() const
Component & get_component_for_write()
const GizmoEditHints * get_gizmo_edit_hints() const
Vector< const GeometryComponent * > get_components() const
const Volume * get_volume() const
static GeometrySet from_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
friend std::ostream & operator<<(std::ostream &stream, const GeometrySet &geometry_set)
void gather_attributes_for_propagation(Span< GeometryComponent::Type > component_types, GeometryComponent::Type dst_component_type, bool include_instances, const AttributeFilter &attribute_filter, Map< StringRef, AttributeKind > &r_attributes) const
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Curves * get_curves_for_write()
void keep_only_during_modify(Span< GeometryComponent::Type > component_types)
bool has_realized_data() const
const Curves * get_curves() const
static GeometrySet from_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Instances * get_instances() const
bool has_grease_pencil() const
static GeometrySet from_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
bool has_instances() const
static void propagate_attributes_from_layer_to_instances(const AttributeAccessor src_attributes, MutableAttributeAccessor dst_attributes, const AttributeFilter &attribute_filter)
GeometrySet(const GeometrySet &other)
void ensure_owns_direct_data()
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
CurvesEditHints * get_curve_edit_hints_for_write()
friend bool operator==(const GeometrySet &a, const GeometrySet &b)
void count_memory(MemoryCounter &memory) const
const PointCloud * get_pointcloud() const
const Mesh * get_mesh() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GreasePencil * get_grease_pencil_for_write()
std::optional< Bounds< float3 > > compute_boundbox_without_instances() const
Vector< GeometryComponent::Type > gather_component_types(bool include_instances, bool ignore_empty) const
Volume * get_volume_for_write()
void remove_geometry_during_modify()
void attribute_foreach(Span< GeometryComponent::Type > component_types, bool include_instances, AttributeForeachCallback callback) const
Mesh * get_mesh_for_write()
void add(const GeometryComponent &component)
void replace_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GeometrySet(GeometrySet &&other)