Blender  V2.93
Public Member Functions | Friends | List of all members
GeometrySet Struct Reference

#include <BKE_geometry_set.hh>

Public Member Functions

template<typename Component >
Component & get_component_for_write ()
 
template<typename Component >
const Component * get_component_for_read () const
 
template<typename Component >
bool has () const
 
template<typename Component >
void remove ()
 

Friends

std::ostream & operator<< (std::ostream &stream, const GeometrySet &geometry_set)
 
bool operator== (const GeometrySet &a, const GeometrySet &b)
 

Geometry Set

GeometryComponentget_component_for_write (GeometryComponentType component_type)
 
const GeometryComponentget_component_for_read (GeometryComponentType component_type) const
 
bool has (const GeometryComponentType component_type) const
 
void remove (const GeometryComponentType component_type)
 
void add (const GeometryComponent &component)
 
blender::Vector< const GeometryComponent * > get_components_for_read () const
 
void compute_boundbox_without_instances (blender::float3 *r_min, blender::float3 *r_max) const
 
uint64_t hash () const
 
void clear ()
 
void ensure_owns_direct_data ()
 
bool has_mesh () const
 
bool has_pointcloud () const
 
bool has_instances () const
 
bool has_volume () const
 
const Meshget_mesh_for_read () const
 
const PointCloudget_pointcloud_for_read () const
 
const Volumeget_volume_for_read () const
 
Meshget_mesh_for_write ()
 
PointCloudget_pointcloud_for_write ()
 
Volumeget_volume_for_write ()
 
void replace_mesh (Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 
void replace_pointcloud (PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 
static GeometrySet create_with_mesh (Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 
static GeometrySet create_with_pointcloud (PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 

Detailed Description

A geometry set contains zero or more geometry components. There is at most one component of each type. Individual components might be shared between multiple geometries. Shared components are copied automatically when write access is requested.

Copying a geometry set is a relatively cheap operation, because it does not copy the referenced geometry components.

Definition at line 278 of file BKE_geometry_set.hh.

Member Function Documentation

◆ add()

void GeometrySet::add ( const GeometryComponent component)

Definition at line 151 of file geometry_set.cc.

References BLI_assert, and component().

◆ clear()

void GeometrySet::clear ( )

Definition at line 209 of file geometry_set.cc.

Referenced by compute_geometry().

◆ compute_boundbox_without_instances()

void GeometrySet::compute_boundbox_without_instances ( blender::float3 r_min,
blender::float3 r_max 
) const

◆ create_with_mesh()

GeometrySet GeometrySet::create_with_mesh ( Mesh mesh,
GeometryOwnershipType  ownership = GeometryOwnershipType::Owned 
)
static

◆ create_with_pointcloud()

GeometrySet GeometrySet::create_with_pointcloud ( PointCloud pointcloud,
GeometryOwnershipType  ownership = GeometryOwnershipType::Owned 
)
static

◆ ensure_owns_direct_data()

void GeometrySet::ensure_owns_direct_data ( )

◆ get_component_for_read() [1/2]

template<typename Component >
const Component* GeometrySet::get_component_for_read ( ) const
inline

Definition at line 292 of file BKE_geometry_set.hh.

References BLI_STATIC_ASSERT.

Referenced by ensure_owns_direct_data().

◆ get_component_for_read() [2/2]

const GeometryComponent * GeometrySet::get_component_for_read ( GeometryComponentType  component_type) const

◆ get_component_for_write() [1/2]

template<typename Component >
Component& GeometrySet::get_component_for_write ( )
inline

Definition at line 285 of file BKE_geometry_set.hh.

References BLI_STATIC_ASSERT.

Referenced by ensure_owns_direct_data().

◆ get_component_for_write() [2/2]

GeometryComponent & GeometrySet::get_component_for_write ( GeometryComponentType  component_type)

Definition at line 107 of file geometry_set.cc.

References GeometryComponent::create().

Referenced by blender::bke::add_final_mesh_as_geometry_component(), create_with_mesh(), create_with_pointcloud(), blender::nodes::geo_node_align_rotation_to_vector_exec(), blender::nodes::geo_node_attribute_clamp_exec(), blender::nodes::geo_node_attribute_color_ramp_exec(), blender::nodes::geo_node_attribute_combine_xyz_exec(), blender::nodes::geo_node_attribute_compare_exec(), blender::nodes::geo_node_attribute_convert_exec(), blender::nodes::geo_node_attribute_fill_exec(), blender::nodes::geo_node_attribute_map_range_exec(), blender::nodes::geo_node_attribute_math_exec(), blender::nodes::geo_node_attribute_mix_exec(), blender::nodes::geo_node_attribute_proximity_exec(), blender::nodes::geo_node_attribute_remove_exec(), blender::nodes::geo_node_attribute_sample_texture_exec(), blender::nodes::geo_node_attribute_separate_xyz_exec(), blender::nodes::geo_node_attribute_vector_math_exec(), blender::nodes::geo_node_collection_info_exec(), blender::nodes::geo_node_object_info_exec(), blender::nodes::geo_node_point_distribute_exec(), blender::nodes::geo_node_point_rotate_exec(), blender::nodes::geo_node_point_scale_exec(), blender::nodes::geo_node_point_translate_exec(), blender::nodes::geo_node_random_attribute_exec(), blender::nodes::geo_node_subdivide_exec(), blender::nodes::geo_node_subdivision_surface_exec(), blender::nodes::geo_node_transform_exec(), blender::ed::spreadsheet::get_display_geometry_set(), mesh_build_data(), modifier_modify_mesh_and_geometry_set(), modifyMesh(), prepare_geometry_set_for_mesh_modifier(), blender::nodes::separate_geometry_set(), and take_pointcloud_ownership_from_geometry_set().

◆ get_components_for_read()

Vector< const GeometryComponent * > GeometrySet::get_components_for_read ( ) const

Get all geometry components in this geometry set for read-only access.

Definition at line 162 of file geometry_set.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and ptr.

Referenced by blender::bke::instances_attribute_foreach_recursive(), and blender::nodes::separate_geometry_set().

◆ get_mesh_for_read()

const Mesh * GeometrySet::get_mesh_for_read ( ) const

◆ get_mesh_for_write()

Mesh * GeometrySet::get_mesh_for_write ( )

◆ get_pointcloud_for_read()

const PointCloud * GeometrySet::get_pointcloud_for_read ( ) const

◆ get_pointcloud_for_write()

PointCloud * GeometrySet::get_pointcloud_for_write ( )

Definition at line 317 of file geometry_set.cc.

References component().

Referenced by blender::nodes::geo_node_transform_exec().

◆ get_volume_for_read()

const Volume * GeometrySet::get_volume_for_read ( ) const

Definition at line 249 of file geometry_set.cc.

References component().

Referenced by compute_boundbox_without_instances().

◆ get_volume_for_write()

Volume * GeometrySet::get_volume_for_write ( )

Definition at line 324 of file geometry_set.cc.

References component().

Referenced by blender::nodes::geo_node_transform_exec().

◆ has() [1/2]

template<typename Component >
bool GeometrySet::has ( ) const
inline

Definition at line 299 of file BKE_geometry_set.hh.

References BLI_STATIC_ASSERT.

◆ has() [2/2]

bool GeometrySet::has ( const GeometryComponentType  component_type) const

◆ has_instances()

bool GeometrySet::has_instances ( ) const

◆ has_mesh()

bool GeometrySet::has_mesh ( ) const

◆ has_pointcloud()

bool GeometrySet::has_pointcloud ( ) const

◆ has_volume()

bool GeometrySet::has_volume ( ) const

Definition at line 270 of file geometry_set.cc.

References component().

Referenced by blender::nodes::geo_node_transform_exec().

◆ hash()

uint64_t GeometrySet::hash ( ) const

Definition at line 203 of file geometry_set.cc.

◆ remove() [1/2]

template<typename Component >
void GeometrySet::remove ( )
inline

Definition at line 306 of file BKE_geometry_set.hh.

References BLI_STATIC_ASSERT.

◆ remove() [2/2]

void GeometrySet::remove ( const GeometryComponentType  component_type)

◆ replace_mesh()

void GeometrySet::replace_mesh ( Mesh mesh,
GeometryOwnershipType  ownership = GeometryOwnershipType::Owned 
)

◆ replace_pointcloud()

void GeometrySet::replace_pointcloud ( PointCloud pointcloud,
GeometryOwnershipType  ownership = GeometryOwnershipType::Owned 
)

Definition at line 303 of file geometry_set.cc.

References PointCloudComponent::replace().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const GeometrySet geometry_set 
)
friend

Definition at line 187 of file geometry_set.cc.

◆ operator==

bool operator== ( const GeometrySet a,
const GeometrySet b 
)
friend

The documentation for this struct was generated from the following files: