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

#include <geometry.h>

Inherits Node.

Inherited by Hair, and Mesh.

Public Types

enum  Type { MESH , HAIR , VOLUME }
 

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, int n, int total)
 
virtual void pack_primitives (PackedBVH *pack, int object, uint visibility, PackFlags pack_flags)=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_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)
 
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 ()
 
void tag_modified ()
 
void clear_modified ()
 
void print_modified_sockets () const
 
const NodeOwnerget_owner () const
 
void set_owner (const NodeOwner *owner_)
 

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
 
size_t optix_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)
 
template<typename T >
void set_if_different (const SocketType &input, array< T > &value)
 
- 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
 
SocketModifiedFlags socket_modified
 

Detailed Description

Definition at line 68 of file geometry.h.

Member Enumeration Documentation

◆ Type

Enumerator
MESH 
HAIR 
VOLUME 

Definition at line 72 of file geometry.h.

Constructor & Destructor Documentation

◆ Geometry()

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

◆ ~Geometry()

Geometry::~Geometry ( )
virtual

Definition at line 86 of file geometry.cpp.

References bvh.

Member Function Documentation

◆ apply_transform()

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

Implemented in Mesh, and Hair.

◆ clear()

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

◆ compute_bounds()

virtual void Geometry::compute_bounds ( )
pure virtual

Implemented in Mesh, and Hair.

Referenced by compute_bvh().

◆ compute_bvh()

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

◆ get_uv_tiles()

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

Implemented in 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 177 of file geometry.cpp.

References has_surface_bssrdf, and transform_applied.

Referenced by GeometryManager::device_update_bvh(), and need_build_bvh().

◆ is_mesh()

bool Geometry::is_mesh ( ) const
inline

◆ is_volume()

bool Geometry::is_volume ( ) const
inline

Definition at line 180 of file geometry.h.

References geometry_type, and VOLUME.

◆ motion_step()

int Geometry::motion_step ( float  time) const

Definition at line 150 of file geometry.cpp.

References motion_time(), and time.

Referenced by Hair::copy_center_to_motion_step(), and Mesh::copy_center_to_motion_step().

◆ motion_time()

float Geometry::motion_time ( int  step) const

Definition at line 145 of file 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 119 of file geometry.cpp.

References Node::name, node, and shader().

◆ need_build_bvh()

bool Geometry::need_build_bvh ( BVHLayout  layout) const

◆ needed_attributes()

AttributeRequestSet Geometry::needed_attributes ( )

Definition at line 133 of file geometry.cpp.

References node, result, and shader().

◆ pack_primitives()

virtual void Geometry::pack_primitives ( PackedBVH pack,
int  object,
uint  visibility,
PackFlags  pack_flags 
)
pure virtual

Implemented in Mesh, and Hair.

Referenced by GeometryManager::device_update_bvh().

◆ tag_bvh_update()

void Geometry::tag_bvh_update ( bool  rebuild)

Definition at line 290 of file 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

◆ 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 107 of file geometry.h.

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

◆ has_volume

bool Geometry::has_volume

Definition at line 106 of file 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 97 of file geometry.h.

◆ need_update_bvh_for_offset

bool Geometry::need_update_bvh_for_offset

Definition at line 111 of file geometry.h.

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

◆ need_update_rebuild

bool Geometry::need_update_rebuild

◆ optix_prim_offset

size_t Geometry::optix_prim_offset

◆ 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: