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" 39 namespace OPENSUBDIV_VERSION {
85 return (
int)_patchVerts.size();
172 template <
class T>
void 177 return _localPointStencils;
192 template <
class T>
void 197 return _localPointVaryingStencils;
214 template <
class T>
void 219 if (channel >= 0 && channel < (
int)_localPointFaceVaryingStencils.size()) {
220 return _localPointFaceVaryingStencils[channel];
242 return _vertexValenceTable;
358 return _quadOffsetsTable;
394 float wP[],
float wDu[] = 0,
float wDv[] = 0,
395 float wDuu[] = 0,
float wDuv[] = 0,
float wDvv[] = 0)
const;
420 float wP[],
float wDu[] = 0,
float wDv[] = 0,
421 float wDuu[] = 0,
float wDuv[] = 0,
float wDvv[] = 0)
const;
448 float wP[],
float wDu[] = 0,
float wDv[] = 0,
449 float wDuu[] = 0,
float wDuv[] = 0,
float wDvv[] = 0,
450 int channel = 0)
const;
479 void reservePatchArrays(
int numPatchArrays);
493 void allocateVaryingVertices(
495 void populateVaryingVertices();
501 struct FVarPatchChannel;
502 typedef std::vector<FVarPatchChannel> FVarPatchChannelVector;
504 FVarPatchChannel & getFVarPatchChannel(
int channel);
505 FVarPatchChannel
const & getFVarPatchChannel(
int channel)
const;
507 void allocateFVarPatchChannels(
int numChannels);
508 void allocateFVarPatchChannelValues(
512 void setFVarPatchChannelLinearInterpolation(
519 PatchParam getPatchFVarPatchParam(
int patch,
int channel)
const;
530 PatchArrayVector _patchArrays;
532 std::vector<Index> _patchVerts;
542 QuadOffsetsTable _quadOffsetsTable;
543 VertexValenceTable _vertexValenceTable;
553 std::vector<Index> _varyingVerts;
559 FVarPatchChannelVector _fvarChannels;
561 std::vector<StencilTable const *> _localPointFaceVaryingStencils;
567 std::vector<Index> _sharpnessIndices;
568 std::vector<float> _sharpnessValues;
574 if (_localPointStencils) {
575 _localPointStencils->UpdateValues(src, dst);
582 if (_localPointVaryingStencils) {
583 _localPointVaryingStencils->UpdateValues(src, dst);
590 if (channel >= 0 && channel < (
int)_localPointFaceVaryingStencils.size()) {
591 if (_localPointFaceVaryingStencils[channel]) {
592 _localPointFaceVaryingStencils[channel]->UpdateValues(src, dst);
601 using namespace OPENSUBDIV_VERSION;
void EvaluateBasisFaceVarying(PatchHandle const &handle, float u, float v, float wP[], float wDu[]=0, float wDv[]=0, float wDuu[]=0, float wDuv[]=0, float wDvv[]=0, int channel=0) const
Evaluate basis functions for a face-varying value and derivatives at a given (u,v) parametric locatio...
float * getSharpnessValues(Index arrayIndex)
ConstIndexArray GetPatchVaryingVertices(PatchHandle const &handle) const
Returns the varying vertex indices for a given patch.
int GetNumLocalPoints() const
Returns the number of local vertex points.
int GetNumLocalPointsVarying() const
Returns the number of local varying points.
PatchParam GetPatchParam(PatchHandle const &handle) const
Returns a PatchParam for the patch identified by handle.
Container for arrays of parametric patches.
std::vector< float > const & GetSharpnessValues() const
Returns sharpness values table.
Table of subdivision stencils.
StencilTable const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
void EvaluateBasis(PatchHandle const &handle, float u, float v, float wP[], float wDu[]=0, float wDv[]=0, float wDuu[]=0, float wDuv[]=0, float wDvv[]=0) const
Evaluate basis functions for position and derivatives at a given (u,v) parametric location of a patch...
VertexValenceTable const & GetVertexValenceTable() const
Returns the 'VertexValences' table (vertex neighborhoods table)
void ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel=0) const
Updates local point face-varying values.
PatchDescriptor GetFVarPatchDescriptor(int channel=0) const
Returns the patch descriptor for channel.
ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
ConstIndexArray GetFVarValues(int channel=0) const
Returns an array of value indices for the patches in channel.
int GetNumControlVerticesTotal() const
Returns the total number of control vertex indices in the table.
std::vector< unsigned int > QuadOffsetsTable
ConstIndexArray GetPatchArrayVaryingVertices(int array) const
Returns the varying vertex indices for the patches in array.
int GetMaxValence() const
Returns max vertex valence.
PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const
Returns the PatchDescriptor for the patch identified by handle.
PatchDescriptor GetVaryingPatchDescriptor() const
Returns the varying patch descriptor.
int GetNumControlVertices(int array) const
Returns the number of control vertices in array.
int GetNumPatchArrays() const
Returns the number of patch arrays in the table.
int GetNumFVarChannels() const
Returns the number of face-varying channels.
ConstIndexArray GetVaryingVertices() const
Returns an array of varying vertex indices for the patches.
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel=0) const
Deprecated.
PatchParam GetPatchFVarPatchParam(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray
Accessors for the gregory patch evaluation buffers. These methods will be deprecated.
QuadOffsetsTable const & GetQuadOffsetsTable() const
Returns the quad-offsets table.
void print() const
debug helper
Factory for constructing a PatchTable from a TopologyRefiner.
int GetNumPtexFaces() const
Returns the total number of ptex faces in the mesh.
void ComputeLocalPointValues(T const *src, T *dst) const
Updates local point vertex values.
An quadtree-based map connecting coarse faces to their sub-patches.
std::vector< PatchArray > PatchArrayVector
ConstIndexArray GetPatchVertices(PatchHandle const &handle) const
Returns the control vertex indices for the patch identified by handle.
Handle that can be used as unique patch identifier within PatchTable.
ConstIndexArray GetPatchArrayVertices(int array) const
Returns the control vertex indices for the patches in array.
void ComputeLocalPointValuesVarying(T const *src, T *dst) const
Updates local point varying values.
PatchParamArray getPatchParams(int arrayIndex)
void EvaluateBasisVarying(PatchHandle const &handle, float u, float v, float wP[], float wDu[]=0, float wDv[]=0, float wDuu[]=0, float wDuv[]=0, float wDvv[]=0) const
Evaluate basis functions for a varying value and derivatives at a given (u,v) parametric location of ...
ConstPatchParamArray const GetPatchParams(int array) const
Returns the PatchParams for the patches in array.
ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const
Returns the 'QuadOffsets' for the Gregory patch identified by handle.
Index * getSharpnessIndices(Index arrayIndex)
std::vector< Index > const & GetSharpnessIndexTable() const
Returns a sharpness index table for each patch (if exists)
int GetNumLocalPointsFaceVarying(int channel=0) const
Returns the number of local face-varying points for channel.
float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const
Returns the crease sharpness for the patch identified by handle if it is a single-crease patch...
PatchVertsTable const & GetPatchControlVerticesTable() const
Get the table of patch control vertices.
bool IsFeatureAdaptive() const
True if the patches are of feature adaptive types.
PatchParamTable const & GetPatchParamTable() const
Returns the PatchParamTable (PatchParams order matches patch array sorting)
Index getPatchIndex(int array, int patch) const
std::vector< PatchParam > PatchParamTable
PatchDescriptor GetPatchArrayDescriptor(int array) const
Returns the PatchDescriptor for the patches in array.
std::vector< Index > PatchVertsTable
ConstIndexArray GetPatchArrayFVarValues(int array, int channel=0) const
Returns the value indices for the patches in array in channel.
ConstPatchParamArray GetFVarPatchParams(int channel=0) const
Returns an array of face-varying patch param for channel.
int GetNumPatchesTotal() const
Returns the total number of patches stored in the table.
std::vector< Index > VertexValenceTable
StencilTable const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel=0) const
Returns the face-varying for a given patch in array in channel.
int GetNumPatches(int array) const
Returns the number of patches in array.
StencilTable const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
Describes the type of a patch.