| OpenSubdiv

Loading...
Searching...
No Matches
StencilTableReal< REAL > Class Template Reference

Table of subdivision stencils. More...

`#include <stencilTable.h>`

Inheritance diagram for StencilTableReal< REAL >:

## Public Member Functions
virtual | ~StencilTableReal ()
int | GetNumStencils () const
| Returns the number of stencils in the table.
int | GetNumControlVertices () const
| Returns the number of control vertices indexed in the table.
StencilReal< REAL > | GetStencil (Index i) const
| Returns a Stencil at index i in the table.
std::vector< int > const & | GetSizes () const
| Returns the number of control vertices of each stencil in the table.
std::vector< Index > const & | GetOffsets () const
| Returns the offset to a given stencil (factory may leave empty)
std::vector< Index > const & | GetControlIndices () const
| Returns the indices of the control vertices.
std::vector< REAL > const & | GetWeights () const
| Returns the stencil interpolation weights.
StencilReal< REAL > | operator[] (Index index) const
| Returns the stencil at index i in the table.
template<class T, class U>
void | UpdateValues (T const &srcValues, U &dstValues, Index start=-1, Index end=-1) const
| Updates point values based on the control values.
template<class T1, class T2, class U>
void | UpdateValues (T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues, Index start=-1, Index end=-1) const
template<class T, class U>
void | UpdateValues (T const *src, U *dst, Index start=-1, Index end=-1) const
template<class T1, class T2, class U>
void | UpdateValues (T1 const *srcBase, int numBase, T2 const *srcRef, U *dst, Index start=-1, Index end=-1) const
void | Clear ()
| Clears the stencils from the table.

## Protected Member Functions
| StencilTableReal (int numControlVerts, std::vector< int > const &offsets, std::vector< int > const &sizes, std::vector< int > const &sources, std::vector< REAL > const &weights, bool includeCoarseVerts, size_t firstOffset)
template<class T, class U>
void | update (T const &srcValues, U &dstValues, std::vector< REAL > const &valueWeights, Index start, Index end) const
template<class T1, class T2, class U>
void | update (T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues, std::vector< REAL > const &valueWeights, Index start, Index end) const
void | generateOffsets ()
void | resize (int nstencils, int nelems)
void | reserve (int nstencils, int nelems)
void | shrinkToFit ()
void | finalize ()
| StencilTableReal ()
| StencilTableReal (int numControlVerts)

## Protected Attributes
int | _numControlVertices
std::vector< int > | _sizes
std::vector< Index > | _offsets
std::vector< Index > | _indices
std::vector< REAL > | _weights

## Friends
class | StencilTableFactoryReal< REAL >
class | Far::PatchTableBuilder

## Detailed Description

template<typename REAL>
class OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableReal< REAL >

Table of subdivision stencils.

Stencils are the most direct method of evaluation of locations on the limit of a surface. Every point of a limit surface can be computed by linearly blending a collection of coarse control vertices.

A stencil assigns a series of control vertex indices with a blending weight that corresponds to a unique parametric location of the limit surface. When the control vertices move in space, the limit location can be very efficiently recomputed simply by applying the blending weights to the series of coarse control vertices.

Definition at line 141 of file stencilTable.h.

## Constructor & Destructor Documentation

## ◆ StencilTableReal() [1/3]

template<typename REAL>

StencilTableReal | ( | int | numControlVerts,
|  | std::vector< int > const & | offsets,
|  | std::vector< int > const & | sizes,
|  | std::vector< int > const & | sources,
|  | std::vector< REAL > const & | weights,
|  | bool | includeCoarseVerts,
|  | size_t | firstOffset )
| protected

## ◆ ~StencilTableReal()

template<typename REAL>

virtual ~StencilTableReal | ( |  | ) |
| inline virtual

Definition at line 153 of file stencilTable.h.

## ◆ StencilTableReal() [2/3]

template<typename REAL>

StencilTableReal | ( |  | ) |
| inline protected

Definition at line 255 of file stencilTable.h.

## ◆ StencilTableReal() [3/3]

template<typename REAL>

StencilTableReal | ( | int | numControlVerts | ) |
| inline protected

Definition at line 256 of file stencilTable.h.

## Member Function Documentation

## ◆ Clear()

template<typename REAL>

void Clear | ( |  | ) |

Clears the stencils from the table.

## ◆ finalize()

template<typename REAL>

void finalize | ( |  | ) |
| inline protected

Definition at line 714 of file stencilTable.h.

## ◆ generateOffsets()

template<typename REAL>

void generateOffsets | ( |  | ) |
| inline protected

Definition at line 678 of file stencilTable.h.

## ◆ GetControlIndices()

template<typename REAL>

std::vector< Index > const & GetControlIndices | ( |  | ) | const
| inline

Returns the indices of the control vertices.

Definition at line 179 of file stencilTable.h.

## ◆ GetNumControlVertices()

template<typename REAL>

int GetNumControlVertices | ( |  | ) | const
| inline

Returns the number of control vertices indexed in the table.

Definition at line 161 of file stencilTable.h.

## ◆ GetNumStencils()

template<typename REAL>

int GetNumStencils | ( |  | ) | const
| inline

Returns the number of stencils in the table.

Definition at line 156 of file stencilTable.h.

## ◆ GetOffsets()

template<typename REAL>

std::vector< Index > const & GetOffsets | ( |  | ) | const
| inline

Returns the offset to a given stencil (factory may leave empty)

Definition at line 174 of file stencilTable.h.

## ◆ GetSizes()

template<typename REAL>

std::vector< int > const & GetSizes | ( |  | ) | const
| inline

Returns the number of control vertices of each stencil in the table.

Definition at line 169 of file stencilTable.h.

## ◆ GetStencil()

template<typename REAL>

StencilReal< REAL > GetStencil | ( | Index | i | ) | const
| inline

Returns a Stencil at index i in the table.

Definition at line 722 of file stencilTable.h.

## ◆ GetWeights()

template<typename REAL>

std::vector< REAL > const & GetWeights | ( |  | ) | const
| inline

Returns the stencil interpolation weights.

Definition at line 184 of file stencilTable.h.

## ◆ operator[]()

template<typename REAL>

StencilReal< REAL > operator[] | ( | Index | index | ) | const
| inline

Returns the stencil at index i in the table.

Definition at line 734 of file stencilTable.h.

## ◆ reserve()

template<typename REAL>

void reserve | ( | int | nstencils,
|  | int | nelems )
| inline protected

Definition at line 698 of file stencilTable.h.

## ◆ resize()

template<typename REAL>

void resize | ( | int | nstencils,
|  | int | nelems )
| inline protected

Definition at line 690 of file stencilTable.h.

## ◆ shrinkToFit()

template<typename REAL>

void shrinkToFit | ( |  | ) |
| inline protected

Definition at line 706 of file stencilTable.h.

## ◆ update() [1/2]

template<typename REAL>
template<class T, class U>

void update | ( | T const & | srcValues,
|  | U & | dstValues,
|  | std::vector< REAL > const & | valueWeights,
|  | Index | start,
|  | Index | end ) const
| protected

Definition at line 650 of file stencilTable.h.

## ◆ update() [2/2]

template<typename REAL>
template<class T1, class T2, class U>

void update | ( | T1 const & | srcBase,
|  | int | numBase,
|  | T2 const & | srcRef,
|  | U & | dstValues,
|  | std::vector< REAL > const & | valueWeights,
|  | Index | start,
|  | Index | end ) const
| protected

Definition at line 618 of file stencilTable.h.

## ◆ UpdateValues() [1/4]

template<typename REAL>
template<class T, class U>

void UpdateValues | ( | T const & | srcValues,
|  | U & | dstValues,
|  | Index | start = -1,
|  | Index | end = -1 ) const
| inline

Updates point values based on the control values.

Note
  The destination buffers are assumed to have allocated at least `GetNumStencils()` elements.

Parameters

  srcValues | Buffer with primvar data for the control vertices
  dstValues | Destination buffer for the interpolated primvar data
  start | Index of first destination value to update
  end | Index of last destination value to update

Definition at line 205 of file stencilTable.h.

## ◆ UpdateValues() [2/4]

template<typename REAL>
template<class T, class U>

void UpdateValues | ( | T const * | src,
|  | U * | dst,
|  | Index | start = -1,
|  | Index | end = -1 ) const
| inline

Definition at line 217 of file stencilTable.h.

## ◆ UpdateValues() [3/4]

template<typename REAL>
template<class T1, class T2, class U>

void UpdateValues | ( | T1 const & | srcBase,
|  | int | numBase,
|  | T2 const & | srcRef,
|  | U & | dstValues,
|  | Index | start = -1,
|  | Index | end = -1 ) const
| inline

Definition at line 210 of file stencilTable.h.

## ◆ UpdateValues() [4/4]

template<typename REAL>
template<class T1, class T2, class U>

void UpdateValues | ( | T1 const * | srcBase,
|  | int | numBase,
|  | T2 const * | srcRef,
|  | U * | dst,
|  | Index | start = -1,
|  | Index | end = -1 ) const
| inline

Definition at line 221 of file stencilTable.h.

## Friends And Related Symbol Documentation

## ◆ Far::PatchTableBuilder

template<typename REAL>

friend class Far::PatchTableBuilder
| friend

Definition at line 261 of file stencilTable.h.

## ◆ StencilTableFactoryReal< REAL >

template<typename REAL>

friend class StencilTableFactoryReal< REAL >
| friend

Definition at line 256 of file stencilTable.h.

## Member Data Documentation

## ◆ _indices

template<typename REAL>

std::vector<Index> _indices
| protected

Definition at line 267 of file stencilTable.h.

## ◆ _numControlVertices

template<typename REAL>

int _numControlVertices
| protected

Definition at line 263 of file stencilTable.h.

## ◆ _offsets

template<typename REAL>

std::vector<Index> _offsets
| protected

Definition at line 266 of file stencilTable.h.

## ◆ _sizes

template<typename REAL>

std::vector<int> _sizes
| protected

Definition at line 265 of file stencilTable.h.

## ◆ _weights

template<typename REAL>

std::vector<REAL> _weights
| protected

Definition at line 268 of file stencilTable.h.

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

- opensubdiv/far/stencilTable.h