HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CE_OSDPatchEval Namespace Reference

Functions

CE_API bool buildPatchCoords (const CE_OSDRefinement &topo, UT_Span< const int > faces, UT_Span< const float > u, UT_Span< const float > v, CE_OSDPatchCoords &patch_coords)
 
CE_API bool refine (const CE_OSDRefinement &topo, const CE_OSDEvaluator &eval, const cl::Buffer &coarse, CE_FloatArray &refined_data)
 
CE_API bool evaluate (const CE_OSDRefinement &topo, const CE_OSDEvaluator &eval, const cl::Buffer &coarse, const CE_OSDPatchCoords &patch_coords, const CE_FloatArray *refined_data, cl::Buffer &out, cl::Buffer *du, cl::Buffer *dv)
 

Function Documentation

CE_API bool CE_OSDPatchEval::buildPatchCoords ( const CE_OSDRefinement topo,
UT_Span< const int faces,
UT_Span< const float u,
UT_Span< const float v,
CE_OSDPatchCoords patch_coords 
)

Build patch coordinates from ptex face/u/v. Must be called successfully before evaluate(). faces/u/v must have identical lengths. Returns false if any entry is invalid (negative face or no patch hit) and clears patch_coords. For empty input, returns true and clears patch_coords.

CE_API bool CE_OSDPatchEval::evaluate ( const CE_OSDRefinement topo,
const CE_OSDEvaluator eval,
const cl::Buffer coarse,
const CE_OSDPatchCoords patch_coords,
const CE_FloatArray refined_data,
cl::Buffer out,
cl::Buffer du,
cl::Buffer dv 
)

Evaluate coarse data on limit patches. Call buildPatchCoords() before evaluate(). If topo has stencil refinement points (topo.numRefinedVerts() > 0 && topo.hasStencilCL()), refine() must be called successfully before evaluate(). If patch_coords is empty, evaluate() is a no-op and returns true. coarse/out/du/dv are caller-owned. out must be pre-allocated to at least tuple_size * patch_coords.size() floats. du/dv are optional; if provided, they must also be pre-allocated to at least tuple_size * patch_coords.size() floats. refined_data is ignored when no refinement is needed; otherwise it must be non-null and sized to tuple_size * topo.numRefinedVerts(). On failure, returns false.

Examples:
VEX/VEX_Example.C.
CE_API bool CE_OSDPatchEval::refine ( const CE_OSDRefinement topo,
const CE_OSDEvaluator eval,
const cl::Buffer coarse,
CE_FloatArray refined_data 
)

Optional pre-refinement step for patch evaluation inputs. Call before evaluate() when topo has stencil refinement points (topo.numRefinedVerts() > 0 && topo.hasStencilCL()). coarse is caller-owned and must contain at least tuple_size * topo.numCoarseVerts() floats. When refinement is needed, refined_data is caller-owned and must be pre-allocated to tuple_size * topo.numRefinedVerts() floats. When refinement is not needed, returns true and leaves refined_data unchanged. On failure, returns false.