Blender V4.3
Geometry Class Referenceabstract

#include <geometry.h>

Inherits Node.

Inherited by Hair, Mesh, and PointCloud.

Public Types

enum  Type { MESH , HAIR , VOLUME , POINTCLOUD }
 

Public Member Functions

 Geometry (const NodeType *node_type, const Type type)
 
virtual ~Geometry ()
 
virtual void clear (bool preserve_shaders=false)
 
virtual void compute_bounds ()=0
 
virtual void apply_transform (const Transform &tfm, const bool apply_to_motion)=0
 
bool need_attribute (Scene *scene, AttributeStandard std)
 
bool need_attribute (Scene *scene, ustring name)
 
AttributeRequestSet needed_attributes ()
 
virtual void get_uv_tiles (ustring map, unordered_set< int > &tiles)=0
 
float motion_time (int step) const
 
int motion_step (float time) const
 
void compute_bvh (Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, size_t n, size_t total)
 
virtual PrimitiveType primitive_type () const =0
 
bool need_build_bvh (BVHLayout layout) const
 
bool is_instanced () const
 
bool has_true_displacement () const
 
bool has_motion_blur () const
 
bool has_voxel_attributes () const
 
bool is_mesh () const
 
bool is_hair () const
 
bool is_pointcloud () const
 
bool is_volume () const
 
void tag_update (Scene *scene, bool rebuild)
 
void tag_bvh_update (bool rebuild)
 
- Public Member Functions inherited from Node
 Node (const NodeType *type, ustring name=ustring())
 
virtual ~Node ()=0
 
void set (const SocketType &input, bool value)
 
void set (const SocketType &input, int value)
 
void set (const SocketType &input, uint value)
 
void set (const SocketType &input, uint64_t value)
 
void set (const SocketType &input, float value)
 
void set (const SocketType &input, float2 value)
 
void set (const SocketType &input, float3 value)
 
void set (const SocketType &input, const char *value)
 
void set (const SocketType &input, ustring value)
 
void set (const SocketType &input, const Transform &value)
 
void set (const SocketType &input, Node *value)
 
template<class ValueType , std::enable_if_t< std::is_enum_v< ValueType >, bool > = true>
void set (const SocketType &input, const ValueType &value)
 
void set (const SocketType &input, array< bool > &value)
 
void set (const SocketType &input, array< int > &value)
 
void set (const SocketType &input, array< float > &value)
 
void set (const SocketType &input, array< float2 > &value)
 
void set (const SocketType &input, array< float3 > &value)
 
void set (const SocketType &input, array< ustring > &value)
 
void set (const SocketType &input, array< Transform > &value)
 
void set (const SocketType &input, array< Node * > &value)
 
bool get_bool (const SocketType &input) const
 
int get_int (const SocketType &input) const
 
uint get_uint (const SocketType &input) const
 
uint64_t get_uint64 (const SocketType &input) const
 
float get_float (const SocketType &input) const
 
float2 get_float2 (const SocketType &input) const
 
float3 get_float3 (const SocketType &input) const
 
ustring get_string (const SocketType &input) const
 
Transform get_transform (const SocketType &input) const
 
Nodeget_node (const SocketType &input) const
 
const array< bool > & get_bool_array (const SocketType &input) const
 
const array< int > & get_int_array (const SocketType &input) const
 
const array< float > & get_float_array (const SocketType &input) const
 
const array< float2 > & get_float2_array (const SocketType &input) const
 
const array< float3 > & get_float3_array (const SocketType &input) const
 
const array< ustring > & get_string_array (const SocketType &input) const
 
const array< Transform > & get_transform_array (const SocketType &input) const
 
const array< Node * > & get_node_array (const SocketType &input) const
 
bool has_default_value (const SocketType &input) const
 
void set_default_value (const SocketType &input)
 
bool equals_value (const Node &other, const SocketType &input) const
 
void copy_value (const SocketType &input, const Node &other, const SocketType &other_input)
 
void set_value (const SocketType &input, const Node &other, const SocketType &other_input)
 
bool equals (const Node &other) const
 
void hash (MD5Hash &md5)
 
size_t get_total_size_in_bytes () const
 
bool is_a (const NodeType *type)
 
bool socket_is_modified (const SocketType &input) const
 
bool is_modified () const
 
void tag_modified ()
 
void clear_modified ()
 
void print_modified_sockets () const
 
const NodeOwnerget_owner () const
 
void set_owner (const NodeOwner *owner_)
 
int reference_count () const
 
void reference ()
 
void dereference ()
 
void clear_reference_count ()
 

Public Attributes

Type geometry_type
 
AttributeSet attributes
 
BoundBox bounds
 
bool transform_applied
 
bool transform_negative_scaled
 
Transform transform_normal
 
BVHbvh
 
size_t attr_map_offset
 
size_t prim_offset
 
bool has_volume
 
bool has_surface_bssrdf
 
bool need_update_rebuild
 
bool need_update_bvh_for_offset
 
size_t index
 
- Public Attributes inherited from Node
ustring name
 
const NodeTypetype
 
InternalNode internal
 
LeafNode leaf
 

Static Public Attributes

static const uint MAX_MOTION_STEPS = 129
 

Additional Inherited Members

- Protected Member Functions inherited from Node
template<typename T >
void set_if_different (const SocketType &input, T value)
 
void set_if_different (const SocketType &input, Node *value)
 
template<typename T >
void set_if_different (const SocketType &input, array< T > &value)
 
void set_if_different (const SocketType &input, array< Node * > &value)
 
void dereference_all_used_nodes ()
 
- Static Protected Member Functions inherited from Node
template<typename T >
static Tget_socket_value (const Node *node, const SocketType &socket)
 
- Protected Attributes inherited from Node
const NodeOwnerowner
 
int ref_count {0}
 
SocketModifiedFlags socket_modified
 

Detailed Description

Definition at line 70 of file scene/geometry.h.

Member Enumeration Documentation

◆ Type

Enumerator
MESH 
HAIR 
VOLUME 
POINTCLOUD 

Definition at line 74 of file scene/geometry.h.

Constructor & Destructor Documentation

◆ Geometry()

◆ ~Geometry()

Geometry::~Geometry ( )
virtual

Definition at line 71 of file scene/geometry.cpp.

References bvh, and Node::dereference_all_used_nodes().

Member Function Documentation

◆ apply_transform()

virtual void Geometry::apply_transform ( const Transform & tfm,
const bool apply_to_motion )
pure virtual

Implemented in Hair, Mesh, and PointCloud.

◆ clear()

void Geometry::clear ( bool preserve_shaders = false)
virtual

◆ compute_bounds()

virtual void Geometry::compute_bounds ( )
pure virtual

Implemented in Hair, Mesh, and PointCloud.

Referenced by compute_bvh().

◆ compute_bvh()

◆ get_uv_tiles()

virtual void Geometry::get_uv_tiles ( ustring map,
unordered_set< int > & tiles )
pure virtual

Implemented in Hair, Mesh, and PointCloud.

Referenced by ImageTextureNode::cull_tiles().

◆ has_motion_blur()

◆ has_true_displacement()

bool Geometry::has_true_displacement ( ) const

Definition at line 135 of file scene/geometry.cpp.

References DISPLACE_BUMP, and node.

Referenced by ObjectManager::apply_static_transforms().

◆ has_voxel_attributes()

bool Geometry::has_voxel_attributes ( ) const

Definition at line 84 of file geometry_attributes.cpp.

References ATTR_ELEMENT_VOXEL, and Attribute::element.

◆ is_hair()

◆ is_instanced()

bool Geometry::is_instanced ( ) const

Definition at line 125 of file scene/geometry.cpp.

References has_surface_bssrdf, and transform_applied.

Referenced by need_build_bvh().

◆ is_mesh()

◆ is_pointcloud()

bool Geometry::is_pointcloud ( ) const
inline

◆ is_volume()

bool Geometry::is_volume ( ) const
inline

◆ motion_step()

int Geometry::motion_step ( float time) const

◆ motion_time()

float Geometry::motion_time ( int step) const

Definition at line 89 of file scene/geometry.cpp.

Referenced by motion_step().

◆ need_attribute() [1/2]

CCL_NAMESPACE_BEGIN bool Geometry::need_attribute ( Scene * scene,
AttributeStandard std )

Definition at line 36 of file geometry_attributes.cpp.

References ATTR_STD_NONE, and node.

Referenced by export_pointcloud().

◆ need_attribute() [2/2]

bool Geometry::need_attribute ( Scene * scene,
ustring name )

Definition at line 56 of file geometry_attributes.cpp.

References node.

◆ need_build_bvh()

◆ needed_attributes()

AttributeRequestSet Geometry::needed_attributes ( )

Definition at line 72 of file geometry_attributes.cpp.

References node, and result.

◆ primitive_type()

virtual PrimitiveType Geometry::primitive_type ( ) const
pure virtual

◆ tag_bvh_update()

void Geometry::tag_bvh_update ( bool rebuild)

Definition at line 171 of file scene/geometry.cpp.

References need_update_rebuild, and Node::tag_modified().

◆ tag_update()

Member Data Documentation

◆ attr_map_offset

size_t Geometry::attr_map_offset

◆ attributes

AttributeSet Geometry::attributes

Definition at line 84 of file scene/geometry.h.

Referenced by BVHBuild::add_reference_points(), blender::ed::spreadsheet::GeometryDataSource::apply_selection_filter(), attr_create_motion_from_velocity(), blender::bke::GeometryFieldContext::attributes(), BKE_mesh_calc_loop_tangents(), blender::ed::spreadsheet::MeshDomainViewItem::build_row(), blender::io::obj::OBJMesh::calc_face_order(), blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::io::obj::OBJMesh::calc_smooth_groups(), blender::bke::compare_meshes::compare_meshes(), copy_attributes(), GeometryManager::device_update_attributes(), GeometryManager::device_update_volume_images(), blender::draw::draw_subdiv_cache_ensure_mat_offsets(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_pointcloud(), EdgeDice::EdgeDice(), blender::ed::sculpt_paint::expand::enabled_state_to_bitmap(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), export_pointcloud(), export_pointcloud_motion(), blender::draw::extract_attr_viewer(), blender::geometry::extract_pointcloud_points(), blender::draw::extract_sculpt_data_subdiv(), blender::bke::pbvh::Tree::from_grids(), blender::geometry::gather_vert_attributes(), blender::ed::sculpt_paint::auto_mask::init_face_sets_masking(), blender::ed::sculpt_paint::expand::init_from_face_set_boundary(), blender::geometry::mesh_copy_selection(), blender::geometry::mesh_copy_selection_keep_edges(), blender::geometry::mesh_copy_selection_keep_verts(), mesh_merge_transform(), blender::bke::mesh_remesh_reproject_attributes(), blender::draw::overlay::Sculpts::mesh_sync(), multires_reshape_context_create_from_object(), multires_reshape_context_create_from_subdiv(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), blender::io::obj::OBJMesh::OBJMesh(), OVERLAY_sculpt_cache_populate(), OVERLAY_viewer_attribute_text(), blender::geometry::point_merge_by_distance(), blender::draw::pointcloud_extract_attribute(), blender::draw::pointcloud_extract_position_and_radius(), populate_cache_for_geometry(), blender::geometry::preprocess_pointclouds(), BVH2::refit_primitives(), blender::geometry::reorder_mesh_edges_exec(), blender::geometry::reorder_mesh_faces_exec(), blender::geometry::reorder_mesh_verts_exec(), blender::geometry::reorder_points_exec(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), blender::geometry::separate_point_cloud_selection(), blender::bke::bake::serialize_geometry_set(), blender::ed::curves::snap_curves_to_surface::snap_curves_to_surface_exec_object(), and blender::io::obj::OBJWriter::write_face_elements().

◆ bounds

◆ bvh

BVH* Geometry::bvh

◆ geometry_type

◆ has_surface_bssrdf

bool Geometry::has_surface_bssrdf

◆ has_volume

bool Geometry::has_volume

Definition at line 108 of file scene/geometry.h.

Referenced by Geometry().

◆ index

size_t Geometry::index

◆ MAX_MOTION_STEPS

const uint Geometry::MAX_MOTION_STEPS = 129
static

Definition at line 100 of file scene/geometry.h.

◆ need_update_bvh_for_offset

bool Geometry::need_update_bvh_for_offset

Definition at line 113 of file scene/geometry.h.

Referenced by compute_bvh(), GeometryManager::geom_calc_offset(), and Geometry().

◆ need_update_rebuild

bool Geometry::need_update_rebuild

◆ prim_offset

◆ transform_applied

◆ transform_negative_scaled

bool Geometry::transform_negative_scaled

Definition at line 92 of file scene/geometry.h.

Referenced by Mesh::add_vertex_normals(), clear(), and Geometry().

◆ transform_normal

Transform Geometry::transform_normal

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