MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ operator()() [4/4]

template<typename Network >
requires std::is_base_of_v<Nodes::Network::NodeNetwork, Network>
auto MayaFlux::Evolve::operator() ( const std::shared_ptr< Network > &  network,
const Nodes::Network::SpatialFieldConfig &  spatial,
const FieldBinder &  bind,
const RenderConfig &  render 
) -> std::shared_ptr<Network>
inline

Drive a network's vertices with fields and spatial stages, and attach rendering.

Template Parameters
NetworkA field-compatible NodeNetwork subclass, such as ParticleNetwork.
Parameters
networkUnregistered network.
spatialSpatial hash, claim, density and population configuration. Default constructed means field displacement only.
bindCalled with the GpuFieldOperator before the geometry buffer is registered. May be empty when the config alone is wanted.
renderRender target. target_window is required.
Returns
The network, or nullptr if it is null, has no primary GraphicsOperator to read a layout from, or the target window is null.

A ParticleNetwork with no primary operator and its default operator enabled receives a PhysicsOperator. The GpuFieldOperator is created with the primary operator's vertex layout and appended to the network's operator chain, or reused if the chain already holds one, in which case spatial is ignored. The network and its NetworkGeometryBuffer are then registered in the graphics domain and rendering is attached. Registering the buffer wires the field pass and every spatial stage the config selects.

Definition at line 233 of file Evolve.hpp.

239 {
240 if (!build_field(std::static_pointer_cast<Nodes::Network::NodeNetwork>(network), spatial, bind, render)) {
241 return nullptr;
242 }
244 return network;
245 }
Core::GlobalNetworkConfig network
Definition Config.cpp:43
#define MF_LIVE_EXPOSE_AUTO(ptr)
Auto-expose variant that deduces the key prefix from the shared_ptr element type.
bool build_field(const std::shared_ptr< Nodes::Network::NodeNetwork > &network, const Nodes::Network::SpatialFieldConfig &spatial, const FieldBinder &bind, const RenderConfig &render)
Create the field operator, bind, register the network and its buffer, and render.
Definition Evolve.cpp:297

References MF_LIVE_EXPOSE_AUTO, and network.