Blender  V3.3
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Geometry Class Referenceabstract

#include <geometry.h>

Inheritance diagram for Geometry:
Node Hair Mesh PointCloud Volume

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, 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 , typename std::enable_if_t< std::is_enum_v< ValueType >> * = nullptr>
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
 
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 37 of file scene/geometry.h.

Member Enumeration Documentation

◆ Type

Enumerator
MESH 
HAIR 
VOLUME 
POINTCLOUD 

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

Constructor & Destructor Documentation

◆ Geometry()

Geometry::Geometry ( const NodeType node_type,
const Type  type 
)
explicit

◆ ~Geometry()

Geometry::~Geometry ( )
virtual

Definition at line 67 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 PointCloud, Mesh, and Hair.

◆ clear()

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

◆ compute_bounds()

virtual void Geometry::compute_bounds ( )
pure virtual

Implemented in PointCloud, Mesh, and Hair.

Referenced by compute_bvh().

◆ compute_bvh()

void Geometry::compute_bvh ( Device device,
DeviceScene dscene,
SceneParams params,
Progress progress,
size_t  n,
size_t  total 
)

◆ get_uv_tiles()

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

Implemented in PointCloud, Mesh, and Hair.

Referenced by ImageTextureNode::cull_tiles().

◆ has_motion_blur()

bool Geometry::has_motion_blur ( ) const

◆ has_true_displacement()

bool Geometry::has_true_displacement ( ) const

◆ has_voxel_attributes()

bool Geometry::has_voxel_attributes ( ) const

◆ is_hair()

bool Geometry::is_hair ( ) const
inline

◆ is_instanced()

bool Geometry::is_instanced ( ) const

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

References has_surface_bssrdf, and transform_applied.

Referenced by need_build_bvh().

◆ is_mesh()

bool Geometry::is_mesh ( ) const
inline

◆ is_pointcloud()

bool Geometry::is_pointcloud ( ) const
inline

◆ is_volume()

bool Geometry::is_volume ( ) const
inline

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

References geometry_type, and VOLUME.

Referenced by ObjectManager::device_update_object_transform().

◆ motion_step()

int Geometry::motion_step ( float  time) const

◆ motion_time()

float Geometry::motion_time ( int  step) const

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

Referenced by motion_step().

◆ need_attribute() [1/2]

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

◆ need_attribute() [2/2]

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

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

References Shader::attributes, AttributeRequestSet::find(), Node::name, and node.

◆ need_build_bvh()

bool Geometry::need_build_bvh ( BVHLayout  layout) const

◆ needed_attributes()

AttributeRequestSet Geometry::needed_attributes ( )

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

References Shader::attributes, 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 284 of file scene/geometry.cpp.

References need_update_rebuild, and Node::tag_modified().

◆ tag_update()

void Geometry::tag_update ( Scene scene,
bool  rebuild 
)

Member Data Documentation

◆ attr_map_offset

size_t Geometry::attr_map_offset

◆ attributes

AttributeSet Geometry::attributes

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

Referenced by Mesh::add_face_normals(), 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_motion(), attr_create_pointiness(), attr_create_random_per_island(), attr_create_uv_map(), Mesh::clear(), Hair::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(), GeometryManager::create_volume_mesh(), GeometryManager::device_update_attributes(), ObjectManager::device_update_object_transform(), 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_motion(), ExportCurveSegments(), ExportCurveSegmentsMotion(), Hair::get_uv_tiles(), Mesh::get_uv_tiles(), PointCloud::get_uv_tiles(), has_motion_blur(), has_voxel_attributes(), mikk_compute_tangents(), MikkUserData::MikkUserData(), Mesh::pack_normals(), read_shader_output(), BVH2::refit_primitives(), EdgeDice::reserve(), PointCloud::reserve(), Hair::reserve_curves(), Mesh::reserve_mesh(), PointCloud::resize(), Hair::resize_curves(), Mesh::resize_mesh(), sync_smoke_volume(), sync_volume_object(), Hair::update_shadow_transparency(), and xml_read_mesh().

◆ bounds

BoundBox Geometry::bounds

◆ bvh

BVH* Geometry::bvh

◆ geometry_type

Type Geometry::geometry_type

◆ has_surface_bssrdf

bool Geometry::has_surface_bssrdf

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

Referenced by ObjectManager::apply_static_transforms(), Geometry(), and is_instanced().

◆ has_volume

bool Geometry::has_volume

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

Referenced by Object::compute_volume_step_size(), and Geometry().

◆ index

size_t Geometry::index

◆ MAX_MOTION_STEPS

const uint Geometry::MAX_MOTION_STEPS = 129
static

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

◆ need_update_bvh_for_offset

bool Geometry::need_update_bvh_for_offset

Definition at line 80 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

size_t Geometry::prim_offset

◆ transform_applied

bool Geometry::transform_applied

◆ transform_negative_scaled

bool Geometry::transform_negative_scaled

◆ transform_normal

Transform Geometry::transform_normal

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