Blender V5.3
Geometry Class Referenceabstract

#include <geometry.h>

Inherits Node.

Inherited by Hair, Light, Mesh, and PointCloud.

Public Types

enum  Type {
  MESH , HAIR , VOLUME , POINTCLOUD ,
  AREA_LIGHT , BACKGROUND_LIGHT , POINT_LIGHT , SPOT_LIGHT ,
  SUN_LIGHT
}

Public Member Functions

const packed_float3 * get_position () const
packed_float3 * get_position_for_write ()
void tag_position_modified ()
bool position_is_modified () const
const float * get_radius () const
float * get_radius_for_write ()
void tag_radius_modified ()
bool radius_is_modified () const
 Geometry (const NodeType *node_type, const Type type)
 ~Geometry () override
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 (const 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 (const int step) const
int motion_step (const float time) const
void compute_bvh (Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, const 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
virtual 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
bool is_light () const
void tag_update (Scene *scene, 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, const int value)
void set (const SocketType &input, const uint value)
void set (const SocketType &input, const uint64_t value)
void set (const SocketType &input, const float value)
void set (const SocketType &input, const float2 value)
void set (const SocketType &input, const 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< packed_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
Node * get_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< packed_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 &socket) const
void copy_value (const SocketType &socket, const Node &other, const SocketType &other_socket)
void set_value (const SocketType &socket, const Node &other, const SocketType &other_socket)
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 NodeOwner * get_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
unique_ptr< BVH > bvh
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 NodeType * type
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 T & get_socket_value (const Node *node, const SocketType &socket)
Protected Attributes inherited from Node
const NodeOwner * owner
int ref_count {0}
SocketModifiedFlags socket_modified

Detailed Description

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

Member Enumeration Documentation

◆ Type

Enumerator
MESH 
HAIR 
VOLUME 
POINTCLOUD 
AREA_LIGHT 
BACKGROUND_LIGHT 
POINT_LIGHT 
SPOT_LIGHT 
SUN_LIGHT 

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

Constructor & Destructor Documentation

◆ Geometry()

◆ ~Geometry()

Geometry::~Geometry ( )
override

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

References 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

◆ clear()

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

◆ compute_bounds()

virtual void Geometry::compute_bounds ( )
pure virtual

Implemented in Hair, Light, Mesh, and PointCloud.

References compute_bounds().

Referenced by compute_bounds(), and compute_bvh().

◆ compute_bvh()

◆ get_position()

◆ get_position_for_write()

◆ get_radius()

◆ get_radius_for_write()

◆ get_uv_tiles()

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

◆ has_motion_blur()

bool Geometry::has_motion_blur ( ) const
virtual

◆ has_true_displacement()

bool Geometry::has_true_displacement ( ) const

◆ has_voxel_attributes()

bool Geometry::has_voxel_attributes ( ) const

◆ is_hair()

◆ is_instanced()

bool Geometry::is_instanced ( ) const

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

References has_surface_bssrdf, and transform_applied.

Referenced by need_build_bvh(), and primitive_type().

◆ is_light()

bool Geometry::is_light ( ) const
inline

◆ is_mesh()

◆ is_pointcloud()

◆ is_volume()

◆ motion_step()

◆ motion_time()

float Geometry::motion_time ( const int step) const

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

References step.

Referenced by get_uv_tiles(), and motion_step().

◆ need_attribute() [1/2]

◆ need_attribute() [2/2]

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

◆ need_build_bvh()

◆ needed_attributes()

AttributeRequestSet Geometry::needed_attributes ( )

Definition at line 69 of file geometry_attributes.cpp.

References Shader::attributes, Node::Node(), and node.

Referenced by apply_transform().

◆ position_is_modified()

bool Geometry::position_is_modified ( ) const

◆ primitive_type()

◆ radius_is_modified()

bool Geometry::radius_is_modified ( ) const

◆ tag_position_modified()

◆ tag_radius_modified()

◆ tag_update()

Member Data Documentation

◆ attr_map_offset

size_t Geometry::attr_map_offset

◆ attributes

AttributeSet Geometry::attributes

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

Referenced by Mesh::add_builtin_attributes(), AttributeTableBuilder::add_position_radius(), BVHBuild::add_reference_curves(), BVHBuild::add_reference_points(), BVHBuild::add_reference_triangles(), Mesh::add_undisplaced(), Mesh::add_vertex_normals(), Hair::apply_transform(), Mesh::apply_transform(), PointCloud::apply_transform(), attr_create_generic(), attr_create_generic(), attr_create_motion_from_velocity(), attr_create_motion_from_velocity(), attr_create_motion_from_velocity(), attr_create_pointiness(), attr_create_random_per_island(), attr_create_uv_map(), Hair::clear(), Mesh::clear(), PointCloud::clear(), Hair::compute_bounds(), Mesh::compute_bounds(), PointCloud::compute_bounds(), Object::compute_volume_step_size(), copy_attributes(), Hair::copy_center_to_motion_step(), Mesh::copy_center_to_motion_step(), PointCloud::copy_center_to_motion_step(), create_mesh(), PointCloud::create_missing_gsplat_attributes(), GeometryManager::create_volume_mesh(), GeometryManager::device_update_attributes(), ObjectManager::device_update_object_transform(), GeometryManager::device_update_preprocess(), GeometryManager::device_update_volume_images(), GeometryManager::displace(), EdgeDice::EdgeDice(), export_hair_curves(), export_hair_curves_motion(), export_hair_motion_validate_attribute(), export_pointcloud(), export_pointcloud_gsplat_attributes(), export_pointcloud_motion(), ExportCurveSegments(), ExportCurveSegmentsMotion(), Geometry(), get_position(), get_position_for_write(), get_radius(), get_radius_for_write(), Hair::get_uv_tiles(), Mesh::get_uv_tiles(), PointCloud::get_uv_tiles(), has_motion_blur(), Mesh::has_motion_blur(), has_voxel_attributes(), mikk_compute_tangents(), Hair::need_update_shadow_transparency(), Hair::num_keys(), PointCloud::num_points(), Mesh::num_verts(), Mesh::pack_shaders(), position_is_modified(), PointCloud::primitive_type(), radius_is_modified(), read_shader_output(), recompute_displaced_corner_normals(), recompute_displaced_vertex_normals(), BVH2::refit_primitives(), PointCloud::resize(), Hair::resize_curves(), Mesh::resize_mesh(), save_pre_displacement_normals(), SubdAttributeInterpolation::setup(), sync_smoke_volume(), sync_volume_object(), tag_position_modified(), tag_radius_modified(), Mesh::update_generated(), PointCloud::update_gsplat_radii(), update_gsplat_std_point_attribute_offset_and_flag(), Hair::update_shadow_transparency(), Mesh::update_tangents(), and xml_read_mesh().

◆ bounds

◆ bvh

unique_ptr<BVH> Geometry::bvh

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

Referenced by MultiDevice::build_bvh(), compute_bvh(), and BVH2::pack_instances().

◆ geometry_type

Type Geometry::geometry_type

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

Referenced by Geometry(), is_hair(), is_light(), is_mesh(), is_pointcloud(), and is_volume().

◆ has_surface_bssrdf

bool Geometry::has_surface_bssrdf

◆ has_volume

bool Geometry::has_volume

◆ index

◆ MAX_MOTION_STEPS

const uint Geometry::MAX_MOTION_STEPS = 129
static

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

◆ need_update_bvh_for_offset

bool Geometry::need_update_bvh_for_offset

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

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

◆ need_update_rebuild

◆ prim_offset

◆ transform_applied

◆ transform_negative_scaled

bool Geometry::transform_negative_scaled

◆ transform_normal

Transform Geometry::transform_normal

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

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


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