Blender V4.3
blender::nodes::LazyFunctionForRepeatZone Class Reference

Inherits blender::fn::lazy_function::LazyFunction.

Public Member Functions

 LazyFunctionForRepeatZone (const bNodeTree &btree, const bNodeTreeZone &zone, ZoneBuildInfo &zone_info, const ZoneBodyFunction &body_fn)
 
void * init_storage (LinearAllocator<> &allocator) const override
 
void destruct_storage (void *storage) const override
 
void execute_impl (lf::Params &params, const lf::Context &context) const override
 
void initialize_execution_graph (lf::Params &params, RepeatEvalStorage &eval_storage, const NodeGeometryRepeatOutput &node_storage, GeoNodesLFUserData &user_data, GeoNodesLFLocalUserData &local_user_data) const
 
std::string input_name (const int i) const override
 
std::string output_name (const int i) const override
 
- Public Member Functions inherited from blender::fn::lazy_function::LazyFunction
virtual ~LazyFunction ()=default
 
virtual std::string name () const
 
virtual void possible_output_dependencies (int output_index, FunctionRef< void(Span< int >)> fn) const
 
bool always_used_inputs_available (const Params &params) const
 
bool allow_missing_requested_inputs () const
 
Span< Inputinputs () const
 
Span< Outputoutputs () const
 
void execute (Params &params, const Context &context) const
 

Additional Inherited Members

- Protected Attributes inherited from blender::fn::lazy_function::LazyFunction
const char * debug_name_ = "unknown"
 
Vector< Inputinputs_
 
Vector< Outputoutputs_
 
bool allow_missing_requested_inputs_ = false
 

Detailed Description

Definition at line 1791 of file geometry_nodes_lazy_function.cc.

Constructor & Destructor Documentation

◆ LazyFunctionForRepeatZone()

blender::nodes::LazyFunctionForRepeatZone::LazyFunctionForRepeatZone ( const bNodeTree & btree,
const bNodeTreeZone & zone,
ZoneBuildInfo & zone_info,
const ZoneBodyFunction & body_fn )
inline

Member Function Documentation

◆ destruct_storage()

void blender::nodes::LazyFunctionForRepeatZone::destruct_storage ( void * storage) const
inlineoverridevirtual

Destruct the storage created in init_storage.

Reimplemented from blender::fn::lazy_function::LazyFunction.

Definition at line 1822 of file geometry_nodes_lazy_function.cc.

References blender::nodes::RepeatEvalStorage::graph_executor.

◆ execute_impl()

◆ init_storage()

void * blender::nodes::LazyFunctionForRepeatZone::init_storage ( LinearAllocator<> & allocator) const
inlineoverridevirtual

Allocates storage for this function. The storage will be passed to every call to execute. If the function does not keep track of any state, this does not have to be implemented.

Reimplemented from blender::fn::lazy_function::LazyFunction.

Definition at line 1817 of file geometry_nodes_lazy_function.cc.

References blender::LinearAllocator< Allocator >::construct().

◆ initialize_execution_graph()

void blender::nodes::LazyFunctionForRepeatZone::initialize_execution_graph ( lf::Params & params,
RepeatEvalStorage & eval_storage,
const NodeGeometryRepeatOutput & node_storage,
GeoNodesLFUserData & user_data,
GeoNodesLFLocalUserData & local_user_data ) const
inline

Generate a lazy-function graph that contains the loop body (body_fn_) as many times as there are iterations. Since this graph depends on the number of iterations, it can't be reused in general. We could consider caching a version of this graph per number of iterations, but right now that doesn't seem worth it. In practice, it takes much less time to create the graph than to execute it (for intended use cases of this generic implementation, more special case repeat loop evaluations could be implemented separately).

Definition at line 1873 of file geometry_nodes_lazy_function.cc.

References blender::nodes::ZoneFunctionIndices::border_links, blender::bke::SocketValueVariant::get(), blender::nodes::ZoneBodyFunction::indices, blender::nodes::ZoneBuildInfo::indices, blender::nodes::ZoneFunctionIndices::inputs, NodeGeometryRepeatOutput::inspection_index, NodeGeometryRepeatOutput::items_num, blender::nodes::ZoneFunctionIndices::main, params, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and blender::nodes::GeoNodesLFLocalUserData::try_get_tree_logger().

◆ input_name()

std::string blender::nodes::LazyFunctionForRepeatZone::input_name ( const int i) const
inlineoverridevirtual

◆ output_name()

std::string blender::nodes::LazyFunctionForRepeatZone::output_name ( const int i) const
inlineoverridevirtual

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