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;
543 void clear()
override;
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;
630 std::optional<AttributeAccessor>
attributes()
const final;
651 void clear()
override;
668 std::optional<AttributeAccessor>
attributes()
const final;
681 Volume *volume_ =
nullptr;
689 void clear()
override;
780 void clear()
override;
#define BLI_STATIC_ASSERT(a, msg)
void ensure_owns_direct_data() override
const Curve * get_curve_for_render() const
void count_memory(MemoryCounter &memory) const override
static constexpr GeometryComponent::Type static_type
void replace(Curves *curve, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Curves * get() const
bool is_empty() const final
std::optional< AttributeAccessor > attributes() const final
std::optional< MutableAttributeAccessor > attributes_for_write() final
bool owns_direct_data() const override
std::unique_ptr< GreasePencilEditHints > grease_pencil_edit_hints_
std::unique_ptr< GizmoEditHints > gizmo_edit_hints_
bool owns_direct_data() const final
void ensure_owns_direct_data() final
static constexpr GeometryComponent::Type static_type
std::unique_ptr< CurvesEditHints > curves_edit_hints_
static void remember_deformed_positions_if_necessary(GeometrySet &geometry)
GeometryComponentEditData()
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)
bool has_grease_pencil() const
std::optional< AttributeAccessor > attributes() const final
static constexpr GeometryComponent::Type static_type
std::optional< MutableAttributeAccessor > attributes_for_write() final
const GreasePencil * get() const
bool owns_direct_data() const override
GreasePencil * get_for_write()
void ensure_owns_direct_data() override
bool is_empty() const final
void replace(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
std::optional< MutableAttributeAccessor > attributes_for_write() final
static constexpr GeometryComponent::Type static_type
void ensure_owns_direct_data() override
void count_memory(MemoryCounter &memory) const override
Instances * get_for_write()
const Instances * get() const
bool is_empty() const final
bool owns_direct_data() const override
std::optional< AttributeAccessor > attributes() const final
void replace(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
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
static constexpr GeometryComponent::Type static_type
bool has_pointcloud() const
void count_memory(MemoryCounter &memory) const override
void ensure_owns_direct_data() override
static constexpr GeometryComponent::Type static_type
bool owns_direct_data() const override
void replace(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Volume * get() const
local_group_size(16, 16) .push_constant(Type b
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)
ImplicitSharingPtr< GeometryComponent > GeometryComponentPtr
constexpr bool is_geometry_component_v
bool attribute_is_builtin_on_component_type(const GeometryComponent::Type type, StringRef name)
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)
FunctionRef< void(StringRef attribute_id, const AttributeMetaData &meta_data, const GeometryComponent &component)> AttributeForeachCallback
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()
FunctionRef< void(GeometrySet &geometry_set)> ForeachSubGeometryCallback
void add(const GeometryComponent &component)
void replace_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GeometrySet(GeometrySet &&other)