Blender V5.3
blender::fn::multi_function::MultiFunction Class Referenceabstract

#include <FN_multi_function.hh>

Inherits blender::blender::NonCopyable, and blender::blender::NonMovable.

Inherited by blender::bke::SampleIndexFunction, blender::bke::mesh_surface_sample::BaryWeightSampleFn, blender::bke::mesh_surface_sample::NearestCornerFromPositionFn, blender::fn::multi_function::CustomMF_Constant< T >, blender::fn::multi_function::CustomMF_DefaultOutput, blender::fn::multi_function::CustomMF_GenericConstant, blender::fn::multi_function::CustomMF_GenericConstantArray, blender::fn::multi_function::CustomMF_GenericCopy, blender::fn::multi_function::DivideFunction, blender::fn::multi_function::PowFunction, blender::fn::multi_function::ProcedureExecutor, blender::fn::multi_function::build::detail::CustomMF< CallFn, ParamTags >, blender::fn::multi_function::tests::AddPrefixFunction, blender::fn::multi_function::tests::AppendFunction, blender::fn::multi_function::tests::ConcatVectorsFunction, blender::fn::multi_function::tests::CreateRangeFunction, blender::fn::multi_function::tests::GenericAppendFunction, blender::fn::multi_function::tests::OptionalOutputsFunction, blender::fn::multi_function::tests::SumVectorFunction, blender::fn::tests::TwoOutputFunction, blender::nodes::ClampWrapperFunction, blender::nodes::SampleIndexFunction, blender::nodes::node_composite_color_balance_cc::ColorBalanceFunction, blender::nodes::node_fn_align_euler_to_vector_cc::MF_AlignEulerToVector, blender::nodes::node_fn_align_rotation_to_vector_cc::AlignRotationToVectorFunction, blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction, blender::nodes::node_fn_combine_matrix_cc::CombineMatrixFunction, blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction, blender::nodes::node_fn_format_string_cc::FormatStringMultiFunction, blender::nodes::node_fn_input_special_characters_cc::MF_SpecialCharacters, blender::nodes::node_fn_invert_matrix_cc::InvertMatrixFunction, blender::nodes::node_fn_matrix_svd_cc::MatrixSVDFunction, blender::nodes::node_fn_rotation_to_axis_angle_cc::QuaterniontoAxisAngleFunction, blender::nodes::node_fn_rotation_to_quaternion_cc::SeparateQuaternionFunction, blender::nodes::node_fn_separate_color_cc::SeparateHSLAFunction, blender::nodes::node_fn_separate_color_cc::SeparateHSVAFunction, blender::nodes::node_fn_separate_color_cc::SeparateRGBAFunction, blender::nodes::node_fn_separate_matrix_cc::SeparateMatrixFunction, blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction, blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction, blender::nodes::node_geo_curve_sample_cc::SampleFloatSegmentsFunction, blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction, blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction, blender::nodes::node_geo_menu_switch_cc::MenuSwitchBoolsFn, blender::nodes::node_geo_menu_switch_cc::MenuSwitchFn, blender::nodes::node_geo_proximity_cc::ProximityFunction, blender::nodes::node_geo_raycast_cc::RaycastFunction, blender::nodes::node_geo_sample_nearest_cc::SampleNearestFunction, blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction, blender::nodes::node_geo_sample_sound_frequencies_cc::SampleSoundFunction, blender::nodes::node_geo_sample_uv_surface_cc::ReverseUVSampleFunction, blender::nodes::node_sh_mix_cc::MixColorFunction, blender::nodes::node_shader_color_ramp_cc::ColorBandFunction, blender::nodes::node_shader_curves_cc::flt::CurveFloatFunction, blender::nodes::node_shader_curves_cc::rgb::CurveRGBFunction, blender::nodes::node_shader_curves_cc::vec::CurveVecFunction, blender::nodes::node_shader_mix_rgb_cc::MixRGBFunction, blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction, blender::nodes::node_shader_sepcomb_xyz_cc::sep::MF_SeparateXYZ, blender::nodes::node_shader_tex_brick_cc::BrickFunction, blender::nodes::node_shader_tex_checker_cc::NodeTexChecker, blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction, blender::nodes::node_shader_tex_gradient_cc::GradientFunction, blender::nodes::node_shader_tex_magic_cc::MagicFunction, blender::nodes::node_shader_tex_noise_cc::NoiseFunction, blender::nodes::node_shader_tex_voronoi_cc::VoronoiDistToEdgeFunction, blender::nodes::node_shader_tex_voronoi_cc::VoronoiMetricFunction, blender::nodes::node_shader_tex_voronoi_cc::VoronoiNSphereFunction, blender::nodes::node_shader_tex_wave_cc::WaveFunction, and blender::nodes::node_shader_tex_white_noise_cc::WhiteNoiseFunction.

Classes

struct  ExecutionHints

Public Member Functions

virtual ~MultiFunction ()=default
void call_auto (const IndexMask &mask, Params params, Context context) const
virtual void call (const IndexMask &mask, Params params, Context context) const =0
virtual void hash_unique (UniqueHashBytes &hash) const
virtual bool equals (const MultiFunction &other) const
int param_amount () const
IndexRange param_indices () const
ParamType param_type (int param_index) const
StringRefNull param_name (int param_index) const
StringRefNull name () const
virtual std::string debug_name () const
const Signature & signature () const
ExecutionHints execution_hints () const
virtual void prepare_for_execution () const

Protected Member Functions

void set_signature (const Signature *signature)
virtual ExecutionHints get_execution_hints () const

Detailed Description

Definition at line 43 of file FN_multi_function.hh.

Constructor & Destructor Documentation

◆ ~MultiFunction()

virtual blender::fn::multi_function::MultiFunction::~MultiFunction ( )
virtualdefault

References call_auto().

Member Function Documentation

◆ call()

◆ call_auto()

void blender::fn::multi_function::MultiFunction::call_auto ( const IndexMask & mask,
Params params,
Context context ) const

The result is the same as using call directly but this method has some additional features.

  • Automatic multi-threading when possible and appropriate.
  • Automatic index mask offsetting to avoid large temporary intermediate arrays that are mostly unused.

Definition at line 130 of file multi_function.cc.

References blender::fn::multi_function::add_sliced_parameters(), call(), blender::fn::multi_function::compute_alignment(), blender::fn::multi_function::compute_grain_size(), execution_hints(), blender::if(), blender::threading::parallel_for_aligned(), and blender::fn::multi_function::supports_threading_by_slicing_params().

Referenced by ~MultiFunction().

◆ debug_name()

std::string blender::fn::multi_function::MultiFunction::debug_name ( ) const
virtual

Definition at line 177 of file multi_function.cc.

References debug_name().

Referenced by debug_name().

◆ equals()

bool blender::fn::multi_function::MultiFunction::equals ( const MultiFunction & other) const
virtual

◆ execution_hints()

ExecutionHints blender::fn::multi_function::MultiFunction::execution_hints ( ) const

Definition at line 28 of file multi_function.cc.

References get_execution_hints().

Referenced by call_auto().

◆ get_execution_hints()

◆ hash_unique()

void blender::fn::multi_function::MultiFunction::hash_unique ( UniqueHashBytes & hash) const
virtual

Reimplemented in blender::bke::mesh_surface_sample::BaryWeightSampleFn, blender::bke::mesh_surface_sample::NearestCornerFromPositionFn, blender::bke::SampleIndexFunction, blender::fn::multi_function::CustomMF_Constant< T >, blender::fn::multi_function::CustomMF_GenericConstant, blender::nodes::ClampWrapperFunction, blender::nodes::node_fn_align_rotation_to_vector_cc::AlignRotationToVectorFunction, blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction, blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction, blender::nodes::node_geo_menu_switch_cc::MenuSwitchBoolsFn, blender::nodes::node_geo_menu_switch_cc::MenuSwitchFn, blender::nodes::node_geo_proximity_cc::ProximityFunction, blender::nodes::node_geo_raycast_cc::RaycastFunction, blender::nodes::node_geo_sample_nearest_cc::SampleNearestFunction, blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction, blender::nodes::node_geo_sample_uv_surface_cc::ReverseUVSampleFunction, blender::nodes::node_sh_mix_cc::MixColorFunction, blender::nodes::node_shader_color_ramp_cc::ColorBandFunction, blender::nodes::node_shader_curves_cc::flt::CurveFloatFunction, blender::nodes::node_shader_curves_cc::rgb::CurveRGBFunction, blender::nodes::node_shader_curves_cc::vec::CurveVecFunction, blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction, blender::nodes::node_shader_tex_brick_cc::BrickFunction, blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction, blender::nodes::node_shader_tex_gradient_cc::GradientFunction, blender::nodes::node_shader_tex_magic_cc::MagicFunction, blender::nodes::node_shader_tex_noise_cc::NoiseFunction, blender::nodes::node_shader_tex_voronoi_cc::VoronoiDistToEdgeFunction, blender::nodes::node_shader_tex_voronoi_cc::VoronoiMetricFunction, blender::nodes::node_shader_tex_voronoi_cc::VoronoiNSphereFunction, blender::nodes::node_shader_tex_wave_cc::WaveFunction, blender::nodes::node_shader_tex_white_noise_cc::WhiteNoiseFunction, and blender::nodes::SampleIndexFunction.

Definition at line 18 of file multi_function.cc.

References hash.

Referenced by call().

◆ name()

StringRefNull blender::fn::multi_function::MultiFunction::name ( ) const
inline

◆ param_amount()

int blender::fn::multi_function::MultiFunction::param_amount ( ) const
inline

Definition at line 62 of file FN_multi_function.hh.

Referenced by blender::nodes::ClampWrapperFunction::call().

◆ param_indices()

IndexRange blender::fn::multi_function::MultiFunction::param_indices ( ) const
inline

◆ param_name()

StringRefNull blender::fn::multi_function::MultiFunction::param_name ( int param_index) const
inline

Definition at line 77 of file FN_multi_function.hh.

◆ param_type()

ParamType blender::fn::multi_function::MultiFunction::param_type ( int param_index) const
inline

◆ prepare_for_execution()

virtual void blender::fn::multi_function::MultiFunction::prepare_for_execution ( ) const
inlinevirtual

For performance reasons it might make sense to delay construction of data inside the node until we can be sure that the function will be evaluated. This method should be called before execution. The work must be protected by a lock though, since it may be called from multiple threads.

Reimplemented in blender::bke::mesh_surface_sample::BaryWeightSampleFn, blender::bke::SampleIndexFunction, blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction, blender::nodes::node_geo_proximity_cc::ProximityFunction, blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction, and blender::nodes::node_geo_sample_uv_surface_cc::ReverseUVSampleFunction.

Definition at line 126 of file FN_multi_function.hh.

◆ set_signature()

void blender::fn::multi_function::MultiFunction::set_signature ( const Signature * signature)
inlineprotected

Definition at line 133 of file FN_multi_function.hh.

References blender::BLI_assert(), and signature().

Referenced by blender::fn::multi_function::tests::AddPrefixFunction::AddPrefixFunction(), blender::nodes::node_fn_align_rotation_to_vector_cc::AlignRotationToVectorFunction::AlignRotationToVectorFunction(), blender::fn::multi_function::tests::AppendFunction::AppendFunction(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::AxesToRotationFunction(), blender::nodes::node_shader_tex_brick_cc::BrickFunction::BrickFunction(), blender::nodes::ClampWrapperFunction::ClampWrapperFunction(), blender::nodes::node_composite_color_balance_cc::ColorBalanceFunction::ColorBalanceFunction(), blender::nodes::node_shader_color_ramp_cc::ColorBandFunction::ColorBandFunction(), blender::nodes::node_fn_combine_matrix_cc::CombineMatrixFunction::CombineMatrixFunction(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::CombineTransformFunction(), blender::fn::multi_function::tests::ConcatVectorsFunction::ConcatVectorsFunction(), blender::fn::multi_function::tests::CreateRangeFunction::CreateRangeFunction(), blender::nodes::node_shader_curves_cc::flt::CurveFloatFunction::CurveFloatFunction(), blender::nodes::node_shader_curves_cc::rgb::CurveRGBFunction::CurveRGBFunction(), blender::nodes::node_shader_curves_cc::vec::CurveVecFunction::CurveVecFunction(), blender::fn::multi_function::build::detail::CustomMF< CallFn, ParamTags >::CustomMF(), blender::fn::multi_function::CustomMF_Constant< T >::CustomMF_Constant(), blender::fn::multi_function::CustomMF_DefaultOutput::CustomMF_DefaultOutput(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_GenericConstant(), blender::fn::multi_function::CustomMF_GenericConstantArray::CustomMF_GenericConstantArray(), blender::fn::multi_function::CustomMF_GenericCopy::CustomMF_GenericCopy(), blender::fn::multi_function::DivideFunction::DivideFunction(), blender::nodes::node_fn_format_string_cc::FormatStringMultiFunction::FormatStringMultiFunction(), blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction::GaborNoiseFunction(), blender::fn::multi_function::tests::GenericAppendFunction::GenericAppendFunction(), blender::nodes::node_shader_tex_gradient_cc::GradientFunction::GradientFunction(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction::IndexSwitchFunction(), blender::nodes::node_fn_invert_matrix_cc::InvertMatrixFunction::InvertMatrixFunction(), blender::nodes::node_shader_tex_magic_cc::MagicFunction::MagicFunction(), blender::nodes::node_fn_matrix_svd_cc::MatrixSVDFunction::MatrixSVDFunction(), blender::nodes::node_fn_align_euler_to_vector_cc::MF_AlignEulerToVector::MF_AlignEulerToVector(), blender::nodes::node_shader_sepcomb_xyz_cc::sep::MF_SeparateXYZ::MF_SeparateXYZ(), blender::nodes::node_fn_input_special_characters_cc::MF_SpecialCharacters::MF_SpecialCharacters(), blender::nodes::node_sh_mix_cc::MixColorFunction::MixColorFunction(), blender::nodes::node_shader_mix_rgb_cc::MixRGBFunction::MixRGBFunction(), blender::bke::mesh_surface_sample::NearestCornerFromPositionFn::NearestCornerFromPositionFn(), blender::nodes::node_shader_tex_checker_cc::NodeTexChecker::NodeTexChecker(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::NoiseFunction(), blender::fn::multi_function::tests::OptionalOutputsFunction::OptionalOutputsFunction(), blender::fn::multi_function::PowFunction::PowFunction(), blender::fn::multi_function::ProcedureExecutor::ProcedureExecutor(), blender::nodes::node_geo_proximity_cc::ProximityFunction::ProximityFunction(), blender::nodes::node_fn_rotation_to_axis_angle_cc::QuaterniontoAxisAngleFunction::QuaterniontoAxisAngleFunction(), blender::nodes::node_geo_raycast_cc::RaycastFunction::RaycastFunction(), blender::nodes::node_geo_sample_uv_surface_cc::ReverseUVSampleFunction::ReverseUVSampleFunction(), blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction::RoundedPolygonFunction(), blender::nodes::node_geo_curve_sample_cc::SampleFloatSegmentsFunction::SampleFloatSegmentsFunction(), blender::nodes::node_geo_sample_nearest_cc::SampleNearestFunction::SampleNearestFunction(), blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction::SampleNearestSurfaceFunction(), blender::nodes::node_geo_sample_sound_frequencies_cc::SampleSoundFunction::SampleSoundFunction(), blender::nodes::node_fn_separate_color_cc::SeparateHSLAFunction::SeparateHSLAFunction(), blender::nodes::node_fn_separate_color_cc::SeparateHSVAFunction::SeparateHSVAFunction(), blender::nodes::node_fn_separate_matrix_cc::SeparateMatrixFunction::SeparateMatrixFunction(), blender::nodes::node_fn_rotation_to_quaternion_cc::SeparateQuaternionFunction::SeparateQuaternionFunction(), blender::nodes::node_fn_separate_color_cc::SeparateRGBAFunction::SeparateRGBAFunction(), blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::SeparateTransformFunction(), blender::fn::multi_function::tests::SumVectorFunction::SumVectorFunction(), blender::fn::tests::TwoOutputFunction::TwoOutputFunction(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiDistToEdgeFunction::VoronoiDistToEdgeFunction(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiMetricFunction::VoronoiMetricFunction(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiNSphereFunction::VoronoiNSphereFunction(), blender::nodes::node_shader_tex_wave_cc::WaveFunction::WaveFunction(), and blender::nodes::node_shader_tex_white_noise_cc::WhiteNoiseFunction::WhiteNoiseFunction().

◆ signature()

const Signature & blender::fn::multi_function::MultiFunction::signature ( ) const
inline

Definition at line 89 of file FN_multi_function.hh.

References blender::BLI_assert().

Referenced by blender::fn::multi_function::tests::AddPrefixFunction::AddPrefixFunction(), blender::nodes::node_fn_align_rotation_to_vector_cc::AlignRotationToVectorFunction::AlignRotationToVectorFunction(), blender::fn::multi_function::tests::AppendFunction::AppendFunction(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::AxesToRotationFunction(), blender::nodes::node_shader_tex_brick_cc::BrickFunction::BrickFunction(), blender::nodes::node_composite_color_balance_cc::ColorBalanceFunction::ColorBalanceFunction(), blender::nodes::node_shader_color_ramp_cc::ColorBandFunction::ColorBandFunction(), blender::nodes::node_fn_combine_matrix_cc::CombineMatrixFunction::CombineMatrixFunction(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::CombineTransformFunction(), blender::fn::multi_function::tests::ConcatVectorsFunction::ConcatVectorsFunction(), blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction::create_signature(), blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction::create_signature(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::create_signature(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiDistToEdgeFunction::create_signature(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiMetricFunction::create_signature(), blender::nodes::node_shader_tex_voronoi_cc::VoronoiNSphereFunction::create_signature(), blender::nodes::node_shader_tex_white_noise_cc::WhiteNoiseFunction::create_signature(), blender::fn::multi_function::tests::CreateRangeFunction::CreateRangeFunction(), blender::nodes::node_shader_curves_cc::flt::CurveFloatFunction::CurveFloatFunction(), blender::nodes::node_shader_curves_cc::rgb::CurveRGBFunction::CurveRGBFunction(), blender::nodes::node_shader_curves_cc::vec::CurveVecFunction::CurveVecFunction(), blender::fn::multi_function::DivideFunction::DivideFunction(), blender::nodes::node_shader_tex_gradient_cc::GradientFunction::GradientFunction(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), blender::nodes::node_fn_invert_matrix_cc::InvertMatrixFunction::InvertMatrixFunction(), blender::nodes::node_shader_tex_magic_cc::MagicFunction::MagicFunction(), blender::nodes::node_fn_align_euler_to_vector_cc::MF_AlignEulerToVector::MF_AlignEulerToVector(), blender::nodes::node_shader_sepcomb_xyz_cc::sep::MF_SeparateXYZ::MF_SeparateXYZ(), blender::nodes::node_fn_input_special_characters_cc::MF_SpecialCharacters::MF_SpecialCharacters(), blender::nodes::node_sh_mix_cc::MixColorFunction::MixColorFunction(), blender::nodes::node_shader_mix_rgb_cc::MixRGBFunction::MixRGBFunction(), blender::bke::mesh_surface_sample::NearestCornerFromPositionFn::NearestCornerFromPositionFn(), blender::nodes::node_shader_tex_checker_cc::NodeTexChecker::NodeTexChecker(), blender::fn::multi_function::tests::OptionalOutputsFunction::OptionalOutputsFunction(), blender::fn::multi_function::PowFunction::PowFunction(), blender::nodes::node_geo_proximity_cc::ProximityFunction::ProximityFunction(), blender::nodes::node_geo_raycast_cc::RaycastFunction::RaycastFunction(), blender::nodes::node_geo_sample_uv_surface_cc::ReverseUVSampleFunction::ReverseUVSampleFunction(), blender::nodes::node_geo_curve_sample_cc::SampleFloatSegmentsFunction::SampleFloatSegmentsFunction(), blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction::SampleNearestSurfaceFunction(), blender::nodes::node_geo_sample_sound_frequencies_cc::SampleSoundFunction::SampleSoundFunction(), blender::nodes::node_fn_separate_color_cc::SeparateHSLAFunction::SeparateHSLAFunction(), blender::nodes::node_fn_separate_color_cc::SeparateHSVAFunction::SeparateHSVAFunction(), blender::nodes::node_fn_separate_matrix_cc::SeparateMatrixFunction::SeparateMatrixFunction(), blender::nodes::node_fn_separate_color_cc::SeparateRGBAFunction::SeparateRGBAFunction(), blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::SeparateTransformFunction(), set_signature(), blender::fn::multi_function::tests::SumVectorFunction::SumVectorFunction(), and blender::nodes::node_shader_tex_wave_cc::WaveFunction::WaveFunction().


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