25 #ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H
26 #define OPENSUBDIV3_FAR_PATCH_TABLE_H
28 #include "../version.h"
30 #include "../far/patchDescriptor.h"
31 #include "../far/patchParam.h"
32 #include "../far/stencilTable.h"
34 #include "../sdc/options.h"
40 namespace OPENSUBDIV_VERSION {
86 return (
int)_patchVerts.size();
172 template <
class T>
void
177 return _localPointStencils;
183 return _localPointVaryingStencils;
203 return _vertexValenceTable;
279 return _quadOffsetsTable;
308 void EvaluateBasis(PatchHandle
const & handle,
float s,
float t,
309 float wP[],
float wDs[],
float wDt[])
const;
336 PatchArray & getPatchArray(
Index arrayIndex);
337 PatchArray
const & getPatchArray(
Index arrayIndex)
const;
339 void reservePatchArrays(
int numPatchArrays);
343 IndexArray getPatchArrayVertices(
int arrayIndex);
352 struct FVarPatchChannel;
353 typedef std::vector<FVarPatchChannel> FVarPatchChannelVector;
355 FVarPatchChannel & getFVarPatchChannel(
int channel);
356 FVarPatchChannel
const & getFVarPatchChannel(
int channel)
const;
358 void allocateFVarPatchChannels(
int numChannels);
359 void allocateFVarPatchChannelValues(
360 int numPatches,
int numVerticesTotal,
int channel);
362 void setFVarPatchChannelLinearInterpolation(
382 PatchArrayVector _patchArrays;
384 std::vector<Index> _patchVerts;
394 QuadOffsetsTable _quadOffsetsTable;
395 VertexValenceTable _vertexValenceTable;
403 FVarPatchChannelVector _fvarChannels;
409 std::vector<Index> _sharpnessIndices;
410 std::vector<float> _sharpnessValues;
416 if (_localPointStencils) {
425 using namespace OPENSUBDIV_VERSION;
std::vector< Index > VertexValenceTable
Local patch parameterization descriptor.
void ComputeLocalPointValues(T const *src, T *dst) const
Updates local point values based on the refined values.
void print() const
debug helper
PatchParam GetPatchParam(PatchHandle const &handle) const
Returns a PatchParam for the patch identified by 'handle'.
std::vector< Index > const & GetSharpnessIndexTable() const
Returns a sharpness index table for each patch (if exists)
int GetMaxValence() const
Returns max vertex valence.
float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const
Returns the crease sharpness for the patch identified by 'handle' if it is a single-crease patch...
std::vector< PatchArray > PatchArrayVector
int GetNumPatchArrays() const
Returns the number of patch arrays in the table.
void UpdateValues(T const *controlValues, T *values, Index start=-1, Index end=-1) const
Updates point values based on the control values.
PatchVertsTable const & GetPatchControlVerticesTable() const
Get the table of patch control vertices.
PatchParamTable const & GetPatchParamTable() const
Returns the PatchParamTable (PatchParams order matches patch array sorting)
QuadOffsetsTable const & GetQuadOffsetsTable() const
Returns the quad-offsets table.
StencilTable const * GetLocalPointVaryingStencilTable() const
Returns the varying stencil table for the change of basis patch points.
float * getSharpnessValues(Index arrayIndex)
std::vector< unsigned int > QuadOffsetsTable
ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const
Returns the 'QuadOffsets' for the Gregory patch identified by 'handle'.
int GetNumFVarChannels() const
Returns the number of face-varying channels.
PatchDescriptor GetPatchArrayDescriptor(int array) const
Returns the PatchDescriptor for the patches in array 'array'.
Describes the type of a patch.
PatchTable(PatchTable const &src)
Copy constructor.
int GetNumControlVertices(int array) const
Returns the number of control vertices in patch array 'array'.
VertexValenceTable const & GetVertexValenceTable() const
Returns the 'VertexValences' table (vertex neighborhoods table)
std::vector< Index > PatchVertsTable
Table of subdivision stencils.
int GetNumPatches(int array) const
Returns the number of patches in patch array 'array'.
int GetNumControlVerticesTotal() const
Returns the total number of control vertex indices in the table.
ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in a channel.
ConstIndexArray GetPatchVertices(PatchHandle const &handle) const
Returns the control vertex indices for the patch identified by 'handle'.
StencilTable const * GetLocalPointStencilTable() const
Returns the stencil table to get change of basis patch points.
An quadtree-based map connecting coarse faces to their sub-patches.
ConstPatchParamArray const GetPatchParams(int array) const
Returns the PatchParams for the patches in array 'array'.
Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray
Accessors for the gregory patch evaluation buffers. These methods will be deprecated.
Index getPatchIndex(int array, int patch) const
std::vector< PatchParam > PatchParamTable
ConstIndexArray GetFVarValues(int channel=0) const
Returns an array of value indices for the patches in a channel.
Container for arrays of parametric patches.
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel=0) const
Returns the interpolation mode for a given channel.
bool IsFeatureAdaptive() const
True if the patches are of feature adaptive types.
PatchParamArray getPatchParams(int arrayIndex)
int GetNumPatchesTotal() const
Returns the total number of patches stored in the table.
Handle that can be used as unique patch identifier within PatchTable.
std::vector< float > const & GetSharpnessValues() const
Returns sharpness values table.
int GetNumLocalPoints() const
Returns the number of points of the change of basis patches.
ConstIndexArray GetPatchArrayVertices(int array) const
Returns the control vertex indices for the patches in array 'array'.
void EvaluateBasis(PatchHandle const &handle, float s, float t, float wP[], float wDs[], float wDt[]) const
Evaluate basis functions for position and first derivatives at a given (s,t) parametric location of a...
Index * getSharpnessIndices(Index arrayIndex)
int GetNumPtexFaces() const
Returns the total number of ptex faces in the mesh.
PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const
Returns the PatchDescriptor for the patches in array 'array'.