54 switch (component_type) {
75 const int new_users = users_.fetch_sub(1) - 1;
109 return components_.add_or_modify(
118 if (value->is_mutable()) {
126 return *copied_component;
143 return components_.contains(component_type);
148 components_.remove(component_type);
156 components_.add_new(
component.type(), std::move(component_ptr));
174 if (pointcloud !=
nullptr) {
178 if (mesh !=
nullptr) {
182 if (volume !=
nullptr) {
189 stream <<
"<GeometrySet at " << &geometry_set <<
", " << geometry_set.components_.size()
205 return reinterpret_cast<uint64_t>(
this);
291 component.replace(pointcloud, ownership);
305 PointCloudComponent &pointcloud_component = this->get_component_for_write<PointCloudComponent>();
306 pointcloud_component.
replace(pointcloud, ownership);
Generic geometry attributes built on CustomData.
@ GEO_COMPONENT_TYPE_MESH
@ GEO_COMPONENT_TYPE_POINT_CLOUD
@ GEO_COMPONENT_TYPE_INSTANCES
@ GEO_COMPONENT_TYPE_VOLUME
bool BKE_mesh_wrapper_minmax(const struct Mesh *me, float min[3], float max[3])
General operations for point-clouds.
void BKE_pointcloud_minmax(const struct PointCloud *pointcloud, float r_min[3], float r_max[3])
#define BLI_assert_unreachable()
static uint8 component(Color32 c, uint i)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
virtual bool is_empty() const
virtual void ensure_owns_direct_data()=0
GeometryComponent(GeometryComponentType type)
static GeometryComponent * create(GeometryComponentType component_type)
GeometryComponentType type() const
virtual bool owns_direct_data() const =0
void replace(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void append(const T &value)
bool BKE_geometry_set_has_instances(const GeometrySet *geometry_set)
void BKE_geometry_set_free(GeometrySet *geometry_set)
std::ostream & operator<<(std::ostream &stream, const GeometrySet &geometry_set)
bool operator==(const GeometrySet &UNUSED(a), const GeometrySet &UNUSED(b))
unsigned __int64 uint64_t
const PointCloud * get_pointcloud_for_read() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
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)
const GeometryComponent * get_component_for_read(GeometryComponentType component_type) const
Component & get_component_for_write()
PointCloud * get_pointcloud_for_write()
const Mesh * get_mesh_for_read() const
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)
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
bool BKE_volume_min_max(const Volume *volume, float3 &r_min, float3 &r_max)