Blender V4.3
blender::bke::AttributeFilter Struct Reference

#include <BKE_attribute_filter.hh>

Inherited by blender::bke::AttributeFilterFromFunc< Fn >, blender::bke::ProcessAllAttributeExceptAnonymous, and blender::nodes::NodeAttributeFilter.

Public Types

enum class  Result { AllowSkip , Process }
 

Public Member Functions

virtual ~AttributeFilter ()=default
 
virtual Result filter (const StringRef) const
 
bool allow_skip (const StringRef name) const
 

Static Public Member Functions

static const AttributeFilterdefault_filter ()
 

Detailed Description

Many geometry algorithms need to deal with attributes. For example, the Subdivide Curves code has to properly interpolate attributes to the intermediate points. However, sometimes certain attributes are not necessary after the operation anymore, so they can just be skipped for optimization purposes. This is where #AttributeFilter comes in. It allows the caller to specify which attributes should be processed and which should be ignored.

Note
It depends on the algorithm whether the output of the filter is followed exactly. For example, some algorithm might not be able to propagate attributes on some domain, even if the filter says that the attribute should be propagated.

Definition at line 23 of file BKE_attribute_filter.hh.

Member Enumeration Documentation

◆ Result

Enumerator
AllowSkip 

The algorithm is allowed to skip processing the attribute.

Process 

The attribute should be processed/propagated if at all possible.

Definition at line 25 of file BKE_attribute_filter.hh.

Constructor & Destructor Documentation

◆ ~AttributeFilter()

virtual blender::bke::AttributeFilter::~AttributeFilter ( )
virtualdefault

Member Function Documentation

◆ allow_skip()

bool blender::bke::AttributeFilter::allow_skip ( const StringRef name) const
inline

◆ default_filter()

static const AttributeFilter & blender::bke::AttributeFilter::default_filter ( )
inlinestatic

Definition at line 51 of file BKE_attribute_filter.hh.

References filter().

◆ filter()

virtual Result blender::bke::AttributeFilter::filter ( const StringRef ) const
inlinevirtual

This function has different implementations in each derived class. By default, all attributes should be processed.

Reimplemented in blender::bke::AttributeFilterFromFunc< Fn >, blender::bke::ProcessAllAttributeExceptAnonymous, and blender::nodes::NodeAttributeFilter.

Definition at line 38 of file BKE_attribute_filter.hh.

References Process.

Referenced by allow_skip(), and default_filter().


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