![]() |
Container for arrays of parametric patches. More...
#include <patchTable.h>
Classes | |
class | PatchHandle |
Handle that can be used as unique patch identifier within PatchTable. More... | |
Public Member Functions | |
PatchTable (PatchTable const &src) | |
Copy constructor. More... | |
~PatchTable () | |
Destructor. More... | |
bool | IsFeatureAdaptive () const |
True if the patches are of feature adaptive types. More... | |
int | GetNumControlVerticesTotal () const |
Returns the total number of control vertex indices in the table. More... | |
int | GetNumPatchesTotal () const |
Returns the total number of patches stored in the table. More... | |
int | GetMaxValence () const |
Returns max vertex valence. More... | |
int | GetNumPtexFaces () const |
Returns the total number of ptex faces in the mesh. More... | |
void | print () const |
debug helper More... | |
Individual patches | |
PatchDescriptor | GetPatchDescriptor (PatchHandle const &handle) const |
Returns the PatchDescriptor for the patch identified by handle . More... | |
ConstIndexArray | GetPatchVertices (PatchHandle const &handle) const |
Returns the control vertex indices for the patch identified by handle . More... | |
PatchParam | GetPatchParam (PatchHandle const &handle) const |
Returns a PatchParam for the patch identified by handle . More... | |
ConstIndexArray | GetPatchVertices (int array, int patch) const |
Returns the control vertex indices for patch in array . More... | |
PatchParam | GetPatchParam (int array, int patch) const |
Returns the PatchParam for patch in array . More... | |
Arrays of patches | |
int | GetNumPatchArrays () const |
Returns the number of patch arrays in the table. More... | |
int | GetNumPatches (int array) const |
Returns the number of patches in array . More... | |
int | GetNumControlVertices (int array) const |
Returns the number of control vertices in array . More... | |
PatchDescriptor | GetPatchArrayDescriptor (int array) const |
Returns the PatchDescriptor for the patches in array . More... | |
ConstIndexArray | GetPatchArrayVertices (int array) const |
Returns the control vertex indices for the patches in array . More... | |
ConstPatchParamArray const | GetPatchParams (int array) const |
Returns the PatchParams for the patches in array . More... | |
Change of basis patches | |
int | GetNumLocalPoints () const |
Returns the number of local vertex points. More... | |
template<class T > | |
void | ComputeLocalPointValues (T const *src, T *dst) const |
Updates local point vertex values. More... | |
StencilTable const * | GetLocalPointStencilTable () const |
Returns the stencil table to compute local point vertex values. More... | |
int | GetNumLocalPointsVarying () const |
Returns the number of local varying points. More... | |
template<class T > | |
void | ComputeLocalPointValuesVarying (T const *src, T *dst) const |
Updates local point varying values. More... | |
StencilTable const * | GetLocalPointVaryingStencilTable () const |
Returns the stencil table to compute local point varying values. More... | |
int | GetNumLocalPointsFaceVarying (int channel=0) const |
Returns the number of local face-varying points for channel . More... | |
template<class T > | |
void | ComputeLocalPointValuesFaceVarying (T const *src, T *dst, int channel=0) const |
Updates local point face-varying values. More... | |
StencilTable const * | GetLocalPointFaceVaryingStencilTable (int channel=0) const |
Returns the stencil table to compute local point face-varying values. More... | |
Single-crease patches | |
float | GetSingleCreasePatchSharpnessValue (PatchHandle const &handle) const |
Returns the crease sharpness for the patch identified by handle if it is a single-crease patch, or 0.0f. More... | |
float | GetSingleCreasePatchSharpnessValue (int array, int patch) const |
Returns the crease sharpness for the patch in array if it is a single-crease patch, or 0.0f. More... | |
Varying data | |
PatchDescriptor | GetVaryingPatchDescriptor () const |
Returns the varying patch descriptor. More... | |
ConstIndexArray | GetPatchVaryingVertices (PatchHandle const &handle) const |
Returns the varying vertex indices for a given patch. More... | |
ConstIndexArray | GetPatchVaryingVertices (int array, int patch) const |
Returns the varying vertex indices for a given patch. More... | |
ConstIndexArray | GetPatchArrayVaryingVertices (int array) const |
Returns the varying vertex indices for the patches in array . More... | |
ConstIndexArray | GetVaryingVertices () const |
Returns an array of varying vertex indices for the patches. More... | |
Face-varying channels | |
int | GetNumFVarChannels () const |
Returns the number of face-varying channels. More... | |
PatchDescriptor | GetFVarPatchDescriptor (int channel=0) const |
Returns the patch descriptor for channel . More... | |
ConstIndexArray | GetPatchFVarValues (PatchHandle const &handle, int channel=0) const |
Returns the value indices for a given patch in channel . More... | |
ConstIndexArray | GetPatchFVarValues (int array, int patch, int channel=0) const |
Returns the value indices for a given patch in channel . More... | |
ConstIndexArray | GetPatchArrayFVarValues (int array, int channel=0) const |
Returns the value indices for the patches in array in channel . More... | |
ConstIndexArray | GetFVarValues (int channel=0) const |
Returns an array of value indices for the patches in channel . More... | |
PatchParam | GetPatchFVarPatchParam (PatchHandle const &handle, int channel=0) const |
Returns the value indices for a given patch in channel . More... | |
PatchParam | GetPatchFVarPatchParam (int array, int patch, int channel=0) const |
Returns the face-varying params for a given patch channel . More... | |
ConstPatchParamArray | GetPatchArrayFVarPatchParams (int array, int channel=0) const |
Returns the face-varying for a given patch in array in channel . More... | |
ConstPatchParamArray | GetFVarPatchParams (int channel=0) const |
Returns an array of face-varying patch param for channel . More... | |
Sdc::Options::FVarLinearInterpolation | GetFVarChannelLinearInterpolation (int channel=0) const |
Deprecated. More... | |
Evaluation methods | |
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. More... | |
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 a patch. More... | |
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 location of a patch. More... | |
Protected Member Functions | |
PatchTable (int maxvalence) | |
Index | getPatchIndex (int array, int patch) const |
PatchParamArray | getPatchParams (int arrayIndex) |
Index * | getSharpnessIndices (Index arrayIndex) |
float * | getSharpnessValues (Index arrayIndex) |
Friends | |
class | PatchTableFactory |
Legacy gregory patch evaluation buffers | |
typedef Vtr::ConstArray< unsigned int > | ConstQuadOffsetsArray |
Accessors for the gregory patch evaluation buffers. These methods will be deprecated. More... | |
typedef std::vector< Index > | VertexValenceTable |
ConstQuadOffsetsArray | GetPatchQuadOffsets (PatchHandle const &handle) const |
Returns the 'QuadOffsets' for the Gregory patch identified by handle . More... | |
VertexValenceTable const & | GetVertexValenceTable () const |
Returns the 'VertexValences' table (vertex neighborhoods table) More... | |
Direct accessors | |
| |
typedef std::vector< Index > | PatchVertsTable |
typedef std::vector< unsigned int > | QuadOffsetsTable |
PatchVertsTable const & | GetPatchControlVerticesTable () const |
Get the table of patch control vertices. More... | |
PatchParamTable const & | GetPatchParamTable () const |
Returns the PatchParamTable (PatchParams order matches patch array sorting) More... | |
std::vector< Index > const & | GetSharpnessIndexTable () const |
Returns a sharpness index table for each patch (if exists) More... | |
std::vector< float > const & | GetSharpnessValues () const |
Returns sharpness values table. More... | |
QuadOffsetsTable const & | GetQuadOffsetsTable () const |
Returns the quad-offsets table. More... | |
Container for arrays of parametric patches.
PatchTable contain topology and parametric information about the patches generated by the Refinement process. Patches in the table are sorted into arrays based on their PatchDescriptor Type.
Note : PatchTable can be accessed either using a PatchHandle or a combination of array and patch indices.
XXXX manuelk we should add a PatchIterator that can dereference into a PatchHandle for fast linear traversal of the table
Definition at line 55 of file patchTable.h.
typedef Vtr::ConstArray<unsigned int> ConstQuadOffsetsArray |
Accessors for the gregory patch evaluation buffers. These methods will be deprecated.
Definition at line 233 of file patchTable.h.
typedef std::vector<Index> PatchVertsTable |
Definition at line 340 of file patchTable.h.
typedef std::vector<unsigned int> QuadOffsetsTable |
Definition at line 354 of file patchTable.h.
typedef std::vector<Index> VertexValenceTable |
Definition at line 238 of file patchTable.h.
PatchTable | ( | PatchTable const & | src | ) |
Copy constructor.
~PatchTable | ( | ) |
Destructor.
|
protected |
|
inline |
Updates local point vertex values.
src | Buffer with primvar data for the base and refined vertex values |
dst | Destination buffer for the computed local point vertex values |
Definition at line 573 of file patchTable.h.
|
inline |
Updates local point face-varying values.
src | Buffer with primvar data for the base and refined face-varying values |
dst | Destination buffer for the computed local point face-varying values |
channel | face-varying channel |
Definition at line 589 of file patchTable.h.
|
inline |
Updates local point varying values.
src | Buffer with primvar data for the base and refined varying values |
dst | Destination buffer for the computed local point varying values |
Definition at line 581 of file patchTable.h.
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.
handle | A patch handle indentifying the sub-patch containing the (u,v) location |
u | Patch coordinate (in base face normalized space) |
v | Patch coordinate (in base face normalized space) |
wP | Weights (evaluated basis functions) for the position |
wDu | Weights (evaluated basis functions) for derivative wrt u |
wDv | Weights (evaluated basis functions) for derivative wrt v |
wDuu | Weights (evaluated basis functions) for 2nd derivative wrt u |
wDuv | Weights (evaluated basis functions) for 2nd derivative wrt u and v |
wDvv | Weights (evaluated basis functions) for 2nd derivative wrt v |
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 location of a patch.
handle | A patch handle indentifying the sub-patch containing the (u,v) location |
u | Patch coordinate (in base face normalized space) |
v | Patch coordinate (in base face normalized space) |
wP | Weights (evaluated basis functions) for the position |
wDu | Weights (evaluated basis functions) for derivative wrt u |
wDv | Weights (evaluated basis functions) for derivative wrt v |
wDuu | Weights (evaluated basis functions) for 2nd derivative wrt u |
wDuv | Weights (evaluated basis functions) for 2nd derivative wrt u and v |
wDvv | Weights (evaluated basis functions) for 2nd derivative wrt v |
channel | face-varying channel |
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 a patch.
handle | A patch handle indentifying the sub-patch containing the (u,v) location |
u | Patch coordinate (in base face normalized space) |
v | Patch coordinate (in base face normalized space) |
wP | Weights (evaluated basis functions) for the position |
wDu | Weights (evaluated basis functions) for derivative wrt u |
wDv | Weights (evaluated basis functions) for derivative wrt v |
wDuu | Weights (evaluated basis functions) for 2nd derivative wrt u |
wDuv | Weights (evaluated basis functions) for 2nd derivative wrt u and v |
wDvv | Weights (evaluated basis functions) for 2nd derivative wrt v |
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation | ( | int | channel = 0 | ) | const |
Deprecated.
PatchDescriptor GetFVarPatchDescriptor | ( | int | channel = 0 | ) | const |
Returns the patch descriptor for channel
.
ConstPatchParamArray GetFVarPatchParams | ( | int | channel = 0 | ) | const |
Returns an array of face-varying patch param for channel
.
ConstIndexArray GetFVarValues | ( | int | channel = 0 | ) | const |
Returns an array of value indices for the patches in channel
.
|
inline |
Returns the stencil table to compute local point face-varying values.
Definition at line 218 of file patchTable.h.
|
inline |
Returns the stencil table to compute local point vertex values.
Definition at line 176 of file patchTable.h.
|
inline |
Returns the stencil table to compute local point varying values.
Definition at line 196 of file patchTable.h.
|
inline |
Returns max vertex valence.
Definition at line 92 of file patchTable.h.
int GetNumControlVertices | ( | int | array | ) | const |
Returns the number of control vertices in array
.
|
inline |
Returns the total number of control vertex indices in the table.
Definition at line 84 of file patchTable.h.
int GetNumFVarChannels | ( | ) | const |
Returns the number of face-varying channels.
int GetNumLocalPoints | ( | ) | const |
Returns the number of local vertex points.
int GetNumLocalPointsFaceVarying | ( | int | channel = 0 | ) | const |
Returns the number of local face-varying points for channel
.
int GetNumLocalPointsVarying | ( | ) | const |
Returns the number of local varying points.
int GetNumPatchArrays | ( | ) | const |
Returns the number of patch arrays in the table.
int GetNumPatches | ( | int | array | ) | const |
Returns the number of patches in array
.
int GetNumPatchesTotal | ( | ) | const |
Returns the total number of patches stored in the table.
|
inline |
Returns the total number of ptex faces in the mesh.
Definition at line 95 of file patchTable.h.
PatchDescriptor GetPatchArrayDescriptor | ( | int | array | ) | const |
Returns the PatchDescriptor for the patches in array
.
ConstPatchParamArray GetPatchArrayFVarPatchParams | ( | int | array, |
int | channel = 0 |
||
) | const |
Returns the face-varying for a given patch in array
in channel
.
ConstIndexArray GetPatchArrayFVarValues | ( | int | array, |
int | channel = 0 |
||
) | const |
Returns the value indices for the patches in array
in channel
.
ConstIndexArray GetPatchArrayVaryingVertices | ( | int | array | ) | const |
Returns the varying vertex indices for the patches in array
.
ConstIndexArray GetPatchArrayVertices | ( | int | array | ) | const |
Returns the control vertex indices for the patches in array
.
|
inline |
Get the table of patch control vertices.
Definition at line 343 of file patchTable.h.
PatchDescriptor GetPatchDescriptor | ( | PatchHandle const & | handle | ) | const |
Returns the PatchDescriptor for the patch identified by handle
.
PatchParam GetPatchFVarPatchParam | ( | PatchHandle const & | handle, |
int | channel = 0 |
||
) | const |
Returns the value indices for a given patch in channel
.
PatchParam GetPatchFVarPatchParam | ( | int | array, |
int | patch, | ||
int | channel = 0 |
||
) | const |
Returns the face-varying params for a given patch channel
.
ConstIndexArray GetPatchFVarValues | ( | PatchHandle const & | handle, |
int | channel = 0 |
||
) | const |
Returns the value indices for a given patch in channel
.
ConstIndexArray GetPatchFVarValues | ( | int | array, |
int | patch, | ||
int | channel = 0 |
||
) | const |
Returns the value indices for a given patch in channel
.
|
protected |
PatchParam GetPatchParam | ( | PatchHandle const & | handle | ) | const |
Returns a PatchParam for the patch identified by handle
.
PatchParam GetPatchParam | ( | int | array, |
int | patch | ||
) | const |
Returns the PatchParam for patch
in array
.
ConstPatchParamArray const GetPatchParams | ( | int | array | ) | const |
Returns the PatchParams for the patches in array
.
|
protected |
|
inline |
Returns the PatchParamTable (PatchParams order matches patch array sorting)
Definition at line 346 of file patchTable.h.
ConstQuadOffsetsArray GetPatchQuadOffsets | ( | PatchHandle const & | handle | ) | const |
Returns the 'QuadOffsets' for the Gregory patch identified by handle
.
ConstIndexArray GetPatchVaryingVertices | ( | PatchHandle const & | handle | ) | const |
Returns the varying vertex indices for a given patch.
ConstIndexArray GetPatchVaryingVertices | ( | int | array, |
int | patch | ||
) | const |
Returns the varying vertex indices for a given patch.
ConstIndexArray GetPatchVertices | ( | PatchHandle const & | handle | ) | const |
Returns the control vertex indices for the patch identified by handle
.
ConstIndexArray GetPatchVertices | ( | int | array, |
int | patch | ||
) | const |
Returns the control vertex indices for patch
in array
.
|
inline |
Returns the quad-offsets table.
Definition at line 357 of file patchTable.h.
|
inline |
Returns a sharpness index table for each patch (if exists)
Definition at line 349 of file patchTable.h.
|
inline |
Returns sharpness values table.
Definition at line 352 of file patchTable.h.
|
protected |
float GetSingleCreasePatchSharpnessValue | ( | PatchHandle const & | handle | ) | const |
Returns the crease sharpness for the patch identified by handle
if it is a single-crease patch, or 0.0f.
float GetSingleCreasePatchSharpnessValue | ( | int | array, |
int | patch | ||
) | const |
Returns the crease sharpness for the patch
in array
if it is a single-crease patch, or 0.0f.
PatchDescriptor GetVaryingPatchDescriptor | ( | ) | const |
Returns the varying patch descriptor.
ConstIndexArray GetVaryingVertices | ( | ) | const |
Returns an array of varying vertex indices for the patches.
|
inline |
Returns the 'VertexValences' table (vertex neighborhoods table)
Definition at line 241 of file patchTable.h.
bool IsFeatureAdaptive | ( | ) | const |
True if the patches are of feature adaptive types.
void print | ( | ) | const |
debug helper
|
friend |
Definition at line 455 of file patchTable.h.