53 class ComponentAttributeProviders;
88 return static_cast<bool>(attribute_);
105 return attribute_.
get();
133 mutable std::atomic<int> users_ = 1;
211 const void *default_value)
const;
218 const T &default_value)
const
228 const void *value)
const;
236 const void *value)
const;
241 const T &value)
const
261 const void *default_value =
nullptr);
299 template<
typename Component>
bool has()
const
302 return this->
has(Component::static_type);
306 template<
typename Component>
void remove()
309 return this->
remove(Component::static_type);
353 Mesh *mesh_ =
nullptr;
406 bool has_pointcloud()
const;
455 int instances_amount()
const;
470 Volume *volume_ =
nullptr;
479 bool has_volume()
const;
@ GEO_COMPONENT_TYPE_MESH
@ GEO_COMPONENT_TYPE_POINT_CLOUD
@ GEO_COMPONENT_TYPE_INSTANCES
@ GEO_COMPONENT_TYPE_VOLUME
constexpr bool is_geometry_component_v
#define BLI_STATIC_ASSERT(a, msg)
static uint8 component(Color32 c, uint i)
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
virtual blender::bke::ReadAttributePtr attribute_try_adapt_domain(blender::bke::ReadAttributePtr attribute, const AttributeDomain new_domain) const
virtual int attribute_domain_size(const AttributeDomain domain) const
virtual bool is_empty() const
virtual void ensure_owns_direct_data()=0
GeometryComponent(GeometryComponentType type)
blender::bke::WriteAttributePtr attribute_try_get_for_write(const blender::StringRef attribute_name)
bool attribute_exists(const blender::StringRef attribute_name) const
blender::bke::ReadAttributePtr attribute_get_constant_for_read(const AttributeDomain domain, const CustomDataType data_type, const void *value) const
virtual ~GeometryComponent()=default
blender::Set< std::string > attribute_names() const
static GeometryComponent * create(GeometryComponentType component_type)
bool attribute_try_delete(const blender::StringRef attribute_name)
blender::bke::ReadAttributePtr attribute_try_get_for_read(const blender::StringRef attribute_name) const
OutputAttributePtr attribute_try_get_for_output(const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type, const void *default_value=nullptr)
bool attribute_foreach(const AttributeForeachCallback callback) const
blender::bke::TypedReadAttribute< T > attribute_get_for_read(const blender::StringRef attribute_name, const AttributeDomain domain, const T &default_value) const
GeometryComponentType type() const
blender::bke::ReadAttributePtr attribute_get_constant_for_read_converted(const AttributeDomain domain, const CustomDataType in_data_type, const CustomDataType out_data_type, const void *value) const
blender::bke::TypedReadAttribute< T > attribute_get_constant_for_read(const AttributeDomain domain, const T &value) const
blender::bke::ReadAttributePtr attribute_get_for_read(const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type, const void *default_value) const
virtual GeometryComponent * copy() const =0
virtual bool owns_direct_data() const =0
bool attribute_try_create(const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type)
bool attribute_domain_supported(const AttributeDomain domain) const
~InstancesComponent()=default
const Mesh * get_for_read() const
void replace_mesh_but_keep_vertex_group_names(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
bool is_empty() const final
void replace(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void copy_vertex_group_names_from_object(const struct Object &object)
GeometryComponent * copy() const override
bool owns_direct_data() const override
void ensure_owns_direct_data() override
static constexpr GeometryComponentType static_type
blender::bke::ReadAttributePtr attribute_try_adapt_domain(blender::bke::ReadAttributePtr attribute, const AttributeDomain new_domain) const final
const blender::Map< std::string, int > & vertex_group_names() const
int attribute_domain_size(const AttributeDomain domain) const final
blender::bke::WriteAttribute * operator->()
void apply_span_and_save()
OutputAttributePtr()=default
OutputAttributePtr(blender::bke::WriteAttributePtr attribute)
blender::bke::WriteAttribute & get()
blender::bke::WriteAttribute & operator*()
void get(const int64_t index, void *r_value) const
DEGForeachIDComponentCallback callback
CustomDataType cpp_type_to_custom_data_type(const CPPType &type)
std::unique_ptr< WriteAttribute > WriteAttributePtr
std::unique_ptr< ReadAttribute > ReadAttributePtr
unsigned __int64 uint64_t
const PointCloud * get_pointcloud_for_read() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
blender::Vector< const GeometryComponent * > get_components_for_read() const
void compute_boundbox_without_instances(blender::float3 *r_min, blender::float3 *r_max) const
void ensure_owns_direct_data()
const Volume * get_volume_for_read() const
static GeometrySet create_with_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Component & get_component_for_write()
PointCloud * get_pointcloud_for_write()
const Mesh * get_mesh_for_read() const
friend std::ostream & operator<<(std::ostream &stream, const GeometrySet &geometry_set)
Mesh * get_mesh_for_write()
void add(const GeometryComponent &component)
bool has_instances() const
static GeometrySet create_with_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
friend bool operator==(const GeometrySet &a, const GeometrySet &b)
Volume * get_volume_for_write()
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Component * get_component_for_read() const
bool has_pointcloud() const