Lagrange
InterpolatedAttributes Class Reference

Helper class to select which attributes to interpolate. More...

#include <lagrange/subdivision/mesh_subdivision.h>

Public Types

enum class  SelectionType { All , None , Selected }
 Selection tag.
 

Public Member Functions

void set_all ()
 Sets selection to all.
 
void set_none ()
 Sets selection to none.
 
void set_selected (std::vector< AttributeId > smooth, std::vector< AttributeId > linear={})
 Set selection to a specific list of attribte ids. More...
 

Static Public Member Functions

static InterpolatedAttributes all ()
 Interpolate all compatible attribute. More...
 
static InterpolatedAttributes none ()
 Do not interpolate any attribute. More...
 
static InterpolatedAttributes selected (std::vector< AttributeId > smooth, std::vector< AttributeId > linear={})
 Only interpolate the specified attributes. More...
 

Public Attributes

SelectionType selection_type = SelectionType::All
 Selection type.
 
std::vector< AttributeIdsmooth_attributes
 List of per-vertex or indexed attributes ids to smoothly interpolate (in OpenSubdiv terms, this corresponds to "vertex" weights for per-vertex attributes, and "face-varying" weights for indexed attributes). More...
 
std::vector< AttributeIdlinear_attributes
 List of per-vertex attributes ids to linearly interpolate (in OpenSubdiv terms, this corresponds to "varying" weights).
 

Detailed Description

Helper class to select which attributes to interpolate.

By default, all compatible attributes will be smoothly interpolated (i.e. using "vertex" weights for per-vertex attributes, and using "face-varying" weights for indexed attributes).

An attribute can be interpolated if:

  • Its value type is either float or double.
  • Its element type is either Vertex or Indexed.

Member Function Documentation

◆ all()

static InterpolatedAttributes all ( )
inlinestatic

Interpolate all compatible attribute.

Returns
The interpolated attributes configuration.

◆ none()

static InterpolatedAttributes none ( )
inlinestatic

Do not interpolate any attribute.

Returns
The interpolated attributes configuration.

◆ selected()

static InterpolatedAttributes selected ( std::vector< AttributeId smooth,
std::vector< AttributeId linear = {} 
)
inlinestatic

Only interpolate the specified attributes.

Will raise an error if a selected attribute cannot be interpolated (because of an incompatible value type or element type).

Parameters
[in]smoothPer-vertex or indexed attribute ids to smoothly interpolate.
[in]linearPer-vertex attribute ids to smoothly interpolate.
Returns
The interpolated attributes configuration.

◆ set_selected()

void set_selected ( std::vector< AttributeId smooth,
std::vector< AttributeId linear = {} 
)
inline

Set selection to a specific list of attribte ids.

Parameters
[in]smoothPer-vertex or indexed attribute ids to smoothly interpolate.
[in]linearPer-vertex attribute ids to smoothly interpolate.

Member Data Documentation

◆ smooth_attributes

std::vector<AttributeId> smooth_attributes

List of per-vertex or indexed attributes ids to smoothly interpolate (in OpenSubdiv terms, this corresponds to "vertex" weights for per-vertex attributes, and "face-varying" weights for indexed attributes).

If selection_type is All, all attributes not specifically present in linear_attributes are considered "smooth".


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