3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL > Class Template Reference

Applies refinement operations to generic primvar data. More...

#include <primvarRefiner.h>

Public Member Functions

Primvar data interpolation

Note
Interpolation methods template both the source and destination data buffer classes. Client-code is expected to provide interfaces that implement the functions specific to its primitive variable data layout. Template APIs must implement the following:

class MySource {
MySource & operator[](int index);
};
class MyDestination {
void Clear();
void AddWithWeight(MySource const & value, float weight);
void AddWithWeight(MyDestination const & value, float weight);
};

It is possible to implement a single interface only and use it as both source and destination.

Primitive variable buffers are expected to be arrays of instances, passed either as direct pointers or with a container (ex. std::vector<MyVertex>). Some interpolation methods however allow passing the buffers by reference: this allows to work transparently with arrays and containers (or other schemes that overload the '[]' operator)

See the Far tutorials for code examples.
template<class T , class U >
void Interpolate (int level, T const &src, U &dst) const
 Apply vertex interpolation weights to a primvar buffer for a single level of refinement. More...
 
template<class T , class U >
void InterpolateVarying (int level, T const &src, U &dst) const
 Apply only varying interpolation weights to a primvar buffer for a single level of refinement. More...
 
template<class T , class U >
void InterpolateFaceUniform (int level, T const &src, U &dst) const
 Refine uniform (per-face) primvar data between levels. More...
 
template<class T , class U >
void InterpolateFaceVarying (int level, T const &src, U &dst, int channel=0) const
 Apply face-varying interpolation weights to a primvar buffer associated with a particular face-varying channel. More...
 
template<class T , class U >
void Limit (T const &src, U &dstPos) const
 Apply limit weights to a primvar buffer. More...
 
template<class T , class U , class U1 , class U2 >
void Limit (T const &src, U &dstPos, U1 &dstTan1, U2 &dstTan2) const
 Apply vertex interpolation weights to a primvar buffer for a single level of refinement. More...
 
template<class T , class U >
void LimitFaceVarying (T const &src, U &dst, int channel=0) const
 Apply vertex interpolation weights to a primvar buffer for a single level of refinement. More...
 

Detailed Description

template<typename REAL>
class OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >

Applies refinement operations to generic primvar data.

Member Function Documentation

template<typename REAL >
template<class T , class U >
void OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >::Interpolate ( int  level,
T const &  src,
U &  dst 
) const
inline

Apply vertex interpolation weights to a primvar buffer for a single level of refinement.

The destination buffer must allocate an array of data for all the refined vertices, i.e. at least refiner.GetLevel(level).GetNumVertices()

Parameters
levelThe refinement level
srcSource primvar buffer (templating control vertex data)
dstDestination primvar buffer (templating refined vertex data)
template<typename REAL >
template<class T , class U >
void OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >::InterpolateFaceUniform ( int  level,
T const &  src,
U &  dst 
) const
inline

Refine uniform (per-face) primvar data between levels.

Data is simply copied from a parent face to its child faces and does not involve any weighting. Setting the source primvar data for the base level to be the index of each face allows the propagation of the base face to primvar data for child faces in all levels.

The destination buffer must allocate an array of data for all the refined faces, i.e. at least refiner.GetLevel(level).GetNumFaces()

Parameters
levelThe refinement level
srcSource primvar buffer
dstDestination primvar buffer
template<typename REAL >
template<class T , class U >
void OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >::InterpolateFaceVarying ( int  level,
T const &  src,
U &  dst,
int  channel = 0 
) const
inline

Apply face-varying interpolation weights to a primvar buffer associated with a particular face-varying channel.

Unlike vertex and varying primvar buffers, there is not a 1-to-1 correspondence between vertices and face-varying values – typically there are more face-varying values than vertices. Each face-varying channel is also independent in how its values relate to the vertices.

The destination buffer must allocate an array of data for all the refined values, i.e. at least refiner.GetLevel(level).GetNumFVarValues(channel).

template<typename REAL >
template<class T , class U >
void OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >::InterpolateVarying ( int  level,
T const &  src,
U &  dst 
) const
inline

Apply only varying interpolation weights to a primvar buffer for a single level of refinement.

This method can useful if the varying primvar data does not need to be re-computed over time.

The destination buffer must allocate an array of data for all the refined vertices, i.e. at least refiner.GetLevel(level).GetNumVertices()

Parameters
levelThe refinement level
srcSource primvar buffer (templating control vertex data)
dstDestination primvar buffer (templating refined vertex data)
template<typename REAL >
template<class T , class U >
void OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >::Limit ( T const &  src,
U &  dstPos 
) const
inline

Apply limit weights to a primvar buffer.

The source buffer must refer to an array of previously interpolated vertex data for the last refinement level. The destination buffer must allocate an array for all vertices at the last refinement level, i.e. at least refiner.GetLevel(refiner.GetMaxLevel()).GetNumVertices()

Parameters
srcSource primvar buffer (refined data) for last level
dstPosDestination primvar buffer (data at the limit)
template<typename REAL >
template<class T , class U , class U1 , class U2 >
void OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >::Limit ( T const &  src,
U &  dstPos,
U1 &  dstTan1,
U2 &  dstTan2 
) const
inline

Apply vertex interpolation weights to a primvar buffer for a single level of refinement.

The destination buffer must allocate an array of data for all the refined vertices, i.e. at least refiner.GetLevel(level).GetNumVertices()

Parameters
levelThe refinement level
srcSource primvar buffer (templating control vertex data)
dstDestination primvar buffer (templating refined vertex data)
template<typename REAL >
template<class T , class U >
void OpenSubdiv::v3_4_3::Far::PrimvarRefinerReal< REAL >::LimitFaceVarying ( T const &  src,
U &  dst,
int  channel = 0 
) const
inline

Apply vertex interpolation weights to a primvar buffer for a single level of refinement.

The destination buffer must allocate an array of data for all the refined vertices, i.e. at least refiner.GetLevel(level).GetNumVertices()

Parameters
levelThe refinement level
srcSource primvar buffer (templating control vertex data)
dstDestination primvar buffer (templating refined vertex data)

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