All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CpuEvalLimitController Class Reference

CPU controler for limit surface evaluation. More...

#include <cpuEvalLimitController.h>

Classes

struct  FacevaryingData
 
struct  FacevaryingData
 
struct  VaryingData
 
struct  VaryingData
 
struct  VertexData
 
struct  VertexData
 

Public Member Functions

 CpuEvalLimitController ()
 Constructor. More...
 
 ~CpuEvalLimitController ()
 Destructor. More...
 
template<class INPUT_BUFFER , class OUTPUT_BUFFER >
void BindVertexBuffers (VertexBufferDescriptor const &iDesc, INPUT_BUFFER *inQ, VertexBufferDescriptor const &oDesc, OUTPUT_BUFFER *outQ, OUTPUT_BUFFER *outdQu=0, OUTPUT_BUFFER *outdQv=0)
 Binds control vertex data buffer. More...
 
template<class INPUT_BUFFER , class OUTPUT_BUFFER >
void BindVaryingBuffers (VertexBufferDescriptor const &iDesc, INPUT_BUFFER *inQ, VertexBufferDescriptor const &oDesc, OUTPUT_BUFFER *outQ)
 Binds the varying-interpolated data streams. More...
 
template<class OUTPUT_BUFFER >
void BindFacevaryingBuffers (VertexBufferDescriptor const &iDesc, VertexBufferDescriptor const &oDesc, OUTPUT_BUFFER *outQ)
 Binds the face-varying-interpolated data streams. More...
 
int EvalLimitSample (EvalCoords const &coord, CpuEvalLimitContext *context, VertexBufferDescriptor const &outDesc, float *outQ, float *outDQU, float *outDQV) const
 Vertex interpolation of a single sample at the limit. More...
 
int EvalLimitSample (EvalCoords const &coords, CpuEvalLimitContext *context, unsigned int index) const
 Vertex interpolation of samples at the limit. More...
 
void Unbind ()
 

Detailed Description

CPU controler for limit surface evaluation.

A CPU-driven controller that can be called to evaluate samples on the limit surface for a given EvalContext.

Warning : this eval controller is re-entrant but it breaks the Osd API pattern by requiring client code to bind and unbind the data buffers to the Controller before calling evaluation methods.

Ex :

evalCtroller->BindVertexBuffers( ... );
evalCtroller->BindVaryingBuffers( ... );
evalCtroller->BindFacevaryingBuffers( ... );
parallel_for( int index=0; i<nsamples; ++index ) {
evalCtroller->EvalLimitSample( coord, evalCtxt, index );
}
evalCtroller->Unbind();

Definition at line 60 of file cpuEvalLimitController.h.

Constructor & Destructor Documentation

Constructor.

Destructor.

Member Function Documentation

void BindFacevaryingBuffers ( VertexBufferDescriptor const &  iDesc,
VertexBufferDescriptor const &  oDesc,
OUTPUT_BUFFER *  outQ 
)
inline

Binds the face-varying-interpolated data streams.

Note : currently we only support bilinear boundary interpolation rules for face-varying data. Although Hbr supports 3 addition smooth rule sets, the feature-adaptive patch interpolation code currently does not support them, and neither does this EvalContext

Parameters
iDescdata descriptor shared by all input data buffers
oDescdata descriptor shared by all output data buffers
outQoutput face-varying data

Definition at line 131 of file cpuEvalLimitController.h.

void BindVaryingBuffers ( VertexBufferDescriptor const &  iDesc,
INPUT_BUFFER *  inQ,
VertexBufferDescriptor const &  oDesc,
OUTPUT_BUFFER *  outQ 
)
inline

Binds the varying-interpolated data streams.

Parameters
iDescdata descriptor shared by all input data buffers
inQinput varying data
oDescdata descriptor shared by all output data buffers
outQoutput varying data

Definition at line 108 of file cpuEvalLimitController.h.

void BindVertexBuffers ( VertexBufferDescriptor const &  iDesc,
INPUT_BUFFER *  inQ,
VertexBufferDescriptor const &  oDesc,
OUTPUT_BUFFER *  outQ,
OUTPUT_BUFFER *  outdQu = 0,
OUTPUT_BUFFER *  outdQv = 0 
)
inline

Binds control vertex data buffer.

Parameters
iDescdata descriptor shared by all input data buffers
inQinput vertex data
oDescdata descriptor shared by all output data buffers
outQoutput vertex data
outdQuoutput derivative along "u" of the vertex data (optional)
outdQvoutput derivative along "v" of the vertex data (optional)

Definition at line 84 of file cpuEvalLimitController.h.

int EvalLimitSample ( EvalCoords const &  coord,
CpuEvalLimitContext context,
VertexBufferDescriptor const &  outDesc,
float *  outQ,
float *  outDQU,
float *  outDQV 
) const

Vertex interpolation of a single sample at the limit.

Evaluates "vertex" interpolation of a single sample on the surface limit.

This function is re-entrant but does not require binding the output vertex buffers. Pointers to memory where the data is output are explicitly passed to the function.

Parameters
coordlocation on the limit surface to be evaluated
contextthe EvalLimitContext that the controller will evaluate
outDescdata descriptor (offset, length, stride)
outQoutput vertex data
outDQUoutput derivative along "u" of the vertex data (optional)
outDQVoutput derivative along "v" of the vertex data (optional)
Returns
1 if the sample was found
int EvalLimitSample ( EvalCoords const &  coords,
CpuEvalLimitContext context,
unsigned int  index 
) const
inline

Vertex interpolation of samples at the limit.

Evaluates "vertex" interpolation of a sample on the surface limit.

Parameters
coordslocation on the limit surface to be evaluated
contextthe EvalLimitContext that the controller will evaluate
indexthe index of the vertex in the output buffers bound to the context
Returns
the number of samples found (0 if the location was tagged as a hole or the coordinate was invalid)

Definition at line 182 of file cpuEvalLimitController.h.

void Unbind ( )
inline

Definition at line 193 of file cpuEvalLimitController.h.


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