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

#include <cpuSmoothNormalContext.h>

Inheritance diagram for CpuSmoothNormalContext:
NonCopyable< CpuSmoothNormalContext >

Public Member Functions

template<class VERTEX_BUFFER >
void Bind (VERTEX_BUFFER *in, int iOfs, VERTEX_BUFFER *out, int oOfs)
 
void Unbind ()
 Unbinds any previously bound vertex and varying data buffers. More...
 
const
Far::PatchTables::PatchArrayVector
GetPatchArrayVector () const
 Returns the vector of patch arrays. More...
 
const std::vector< unsigned int > & GetControlVertices () const
 The ordered array of control vertex indices for all the patches. More...
 
float const * GetCurrentInputVertexBuffer () const
 Returns a pointer to the data of the input buffer. More...
 
float * GetCurrentOutputVertexBuffer ()
 Returns a pointer to the data of the output buffer. More...
 
VertexBufferDescriptor const & GetInputVertexDescriptor () const
 Returns an VertexDescriptor for the input vertex data. More...
 
VertexBufferDescriptor const & GetOutputVertexDescriptor () const
 
int GetNumVertices () const
 Returns the number of vertices in output vertex buffer. More...
 
bool GetResetMemory () const
 
void SetResetMemory (bool resetMemory)
 

Static Public Member Functions

static CpuSmoothNormalContextCreate (Far::PatchTables const *patchTables, bool resetMemory=false)
 

Protected Member Functions

 CpuSmoothNormalContext (Far::PatchTables const *patchTables, bool resetMemory)
 

Additional Inherited Members

Detailed Description

Definition at line 41 of file cpuSmoothNormalContext.h.

Constructor & Destructor Documentation

CpuSmoothNormalContext ( Far::PatchTables const *  patchTables,
bool  resetMemory 
)
explicitprotected

Member Function Documentation

void Bind ( VERTEX_BUFFER *  in,
int  iOfs,
VERTEX_BUFFER *  out,
int  oOfs 
)
inline

Binds a vertex and a varying data buffers to the context. Binding ensures that data buffers are properly inter-operated between Contexts and Controllers operating across multiple devices.

Parameters
ina buffer containing input vertex-interpolated primvar data
iOfsoffset to the buffer element describing the vertex position
outa buffer where the smooth normals will be output
oOfsoffset to the buffer element describing the normal position

Definition at line 71 of file cpuSmoothNormalContext.h.

static CpuSmoothNormalContext* Create ( Far::PatchTables const *  patchTables,
bool  resetMemory = false 
)
static

Creates an CpuComputeContext instance

Parameters
patchTablesThe Far::PatchTables used for this Context.
resetMemorySet to true if the target vertex buffer needs its memory reset before accumulating the averaged normals. If the SmoothNormal Controller runs after a Computer Controller, then the vertex buffer will already have been reset and this step can be skipped to save time.
const std::vector<unsigned int>& GetControlVertices ( ) const
inline

The ordered array of control vertex indices for all the patches.

Definition at line 102 of file cpuSmoothNormalContext.h.

float const* GetCurrentInputVertexBuffer ( ) const
inline

Returns a pointer to the data of the input buffer.

Definition at line 107 of file cpuSmoothNormalContext.h.

float* GetCurrentOutputVertexBuffer ( )
inline

Returns a pointer to the data of the output buffer.

Definition at line 112 of file cpuSmoothNormalContext.h.

VertexBufferDescriptor const& GetInputVertexDescriptor ( ) const
inline

Returns an VertexDescriptor for the input vertex data.

Definition at line 117 of file cpuSmoothNormalContext.h.

int GetNumVertices ( ) const
inline

Returns the number of vertices in output vertex buffer.

Definition at line 128 of file cpuSmoothNormalContext.h.

VertexBufferDescriptor const& GetOutputVertexDescriptor ( ) const
inline

Returns an VertexDescriptor for the buffer where the normals data will be stored

Definition at line 123 of file cpuSmoothNormalContext.h.

const Far::PatchTables::PatchArrayVector& GetPatchArrayVector ( ) const
inline

Returns the vector of patch arrays.

Definition at line 97 of file cpuSmoothNormalContext.h.

bool GetResetMemory ( ) const
inline

Returns whether the controller needs to reset the vertex buffer before accumulating smooth normals

Definition at line 134 of file cpuSmoothNormalContext.h.

void SetResetMemory ( bool  resetMemory)
inline

Set to true if the controller needs to reset the vertex buffer before accumulating smooth normals

Definition at line 140 of file cpuSmoothNormalContext.h.

void Unbind ( )
inline

Unbinds any previously bound vertex and varying data buffers.

Definition at line 88 of file cpuSmoothNormalContext.h.


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