PatchTable Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
PatchTable Class Reference

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
Accessors for individual patches
PatchDescriptor | GetPatchDescriptor (PatchHandle const &handle) const
| Returns the PatchDescriptor for the patches in array 'array'. 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 the patch 'patch' in array 'array'. More...
PatchParam | GetPatchParam (int array, int patch) const
| Returns the PatchParam for the patch 'patch' in array 'array'. More...
Arrays of patches
Accessors for arrays of patches of the same type
int | GetNumPatchArrays () const
| Returns the number of patch arrays in the table. More...
int | GetNumPatches (int array) const
| Returns the number of patches in patch array 'array'. More...
int | GetNumControlVertices (int array) const
| Returns the number of control vertices in patch array 'array'. More...
PatchDescriptor | GetPatchArrayDescriptor (int array) const
| Returns the PatchDescriptor for the patches in array 'array'. More...
ConstIndexArray | GetPatchArrayVertices (int array) const
| Returns the control vertex indices for the patches in array 'array'. More...
ConstPatchParamArray const | GetPatchParams (int array) const
| Returns the PatchParams for the patches in array 'array'. More...
change of basis patches
Accessors for change of basis patch points
int | GetNumLocalPoints () const
| Returns the number of points of the change of basis patches. More...
template<class T >
void | ComputeLocalPointValues (T const *src, T *dst) const
| Updates local point values based on the refined values. More...
StencilTable const * | GetLocalPointStencilTable () const
| Returns the stencil table to get change of basis patch points. More...
StencilTable const * | GetLocalPointVaryingStencilTable () const
| Returns the varying stencil table for the change of basis patch points. More...
Single-crease patches
Accessors for single-crease patch edge sharpness
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 'patch' in array 'array' if it is a single-crease patch, or 0.0f. More...
Face-varying channels
Accessors for face-varying channels
int | GetNumFVarChannels () const
| Returns the number of face-varying channels. More...
Sdc::Options::FVarLinearInterpolation | GetFVarChannelLinearInterpolation (int channel=0) const
| Returns the interpolation mode for a given channel. More...
ConstIndexArray | GetPatchFVarValues (PatchHandle const &handle, int channel=0) const
| Returns the value indices for a given patch in a channel. More...
ConstIndexArray | GetPatchFVarValues (int array, int patch, int channel=0) const
| Returns the value indices for a given patch in a channel. More...
ConstIndexArray | GetFVarValues (int channel=0) const
| Returns an array of value indices for the patches in a channel. More...
Evaluation methods
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 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
Warning These direct accessors are left for convenience, but they are likely going to be deprecated in future releases
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...

## Detailed Description

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 56 of file patchTable.h.

## Member Typedef Documentation

typedef Vtr::ConstArray<unsigned int> ConstQuadOffsetsArray

Accessors for the gregory patch evaluation buffers. These methods will be deprecated.

Definition at line 194 of file patchTable.h.

typedef std::vector<Index> PatchVertsTable

Definition at line 261 of file patchTable.h.

typedef std::vector<unsigned int> QuadOffsetsTable

Definition at line 275 of file patchTable.h.

typedef std::vector<Index> VertexValenceTable

Definition at line 199 of file patchTable.h.

## Constructor & Destructor Documentation

PatchTable | ( | PatchTable const & | src | ) |

Copy constructor.

~PatchTable | ( |  | ) |

Destructor.

PatchTable | ( | int | maxvalence | ) |
| protected

## Member Function Documentation

void ComputeLocalPointValues | ( | T const * | src,
|  | T * | dst
| ) |  | const
| inline

Updates local point values based on the refined values.

Parameters

  src | Buffer with primvar data for the control vertices and refined vertices
  dst | Destination buffer for the computed local points

Definition at line 415 of file patchTable.h.

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 patch.

Parameters

  handle | A patch handle indentifying the sub-patch containing the (s,t) location
  s | Patch coordinate (in coarse face normalized space)
  t | Patch coordinate (in coarse face normalized space)
  wP | Weights (evaluated basis functions) for the position
  wDs | Weights (evaluated basis functions) for derivative wrt s
  wDt | Weights (evaluated basis functions) for derivative wrt t

Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation | ( | int | channel = `0` | ) | const

Returns the interpolation mode for a given channel.

ConstIndexArray GetFVarValues | ( | int | channel = `0` | ) | const

Returns an array of value indices for the patches in a channel.

StencilTable const* GetLocalPointStencilTable | ( |  | ) | const
| inline

Returns the stencil table to get change of basis patch points.

Definition at line 176 of file patchTable.h.

StencilTable const* GetLocalPointVaryingStencilTable | ( |  | ) | const
| inline

Returns the varying stencil table for the change of basis patch points.

Definition at line 182 of file patchTable.h.

int GetMaxValence | ( |  | ) | const
| inline

Returns max vertex valence.

Definition at line 93 of file patchTable.h.

int GetNumControlVertices | ( | int | array | ) | const

Returns the number of control vertices in patch array 'array'.

int GetNumControlVerticesTotal | ( |  | ) | const
| inline

Returns the total number of control vertex indices in the table.

Definition at line 85 of file patchTable.h.

int GetNumFVarChannels | ( |  | ) | const

Returns the number of face-varying channels.

int GetNumLocalPoints | ( |  | ) | const

Returns the number of points of the change of basis patches.

int GetNumPatchArrays | ( |  | ) | const

Returns the number of patch arrays in the table.

int GetNumPatches | ( | int | array | ) | const

Returns the number of patches in patch array 'array'.

int GetNumPatchesTotal | ( |  | ) | const

Returns the total number of patches stored in the table.

int GetNumPtexFaces | ( |  | ) | const
| inline

Returns the total number of ptex faces in the mesh.

Definition at line 96 of file patchTable.h.

PatchDescriptor GetPatchArrayDescriptor | ( | int | array | ) | const

Returns the PatchDescriptor for the patches in array 'array'.

ConstIndexArray GetPatchArrayVertices | ( | int | array | ) | const

Returns the control vertex indices for the patches in array 'array'.

PatchVertsTable const& GetPatchControlVerticesTable | ( |  | ) | const
| inline

Get the table of patch control vertices.

Definition at line 264 of file patchTable.h.

PatchDescriptor GetPatchDescriptor | ( | PatchHandle const & | handle | ) | const

Returns the PatchDescriptor for the patches in array 'array'.

ConstIndexArray GetPatchFVarValues | ( | PatchHandle const & | handle,
|  | int | channel = `0`
| ) |  | const

Returns the value indices for a given patch in a channel.

ConstIndexArray GetPatchFVarValues | ( | int | array,
|  | int | patch,
|  | int | channel = `0`
| ) |  | const

Returns the value indices for a given patch in a channel.

Index getPatchIndex | ( | int | array,
|  | int | patch
| ) |  | const
| 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 the patch 'patch' in array 'array'.

ConstPatchParamArray const GetPatchParams | ( | int | array | ) | const

Returns the PatchParams for the patches in array 'array'.

PatchParamArray getPatchParams | ( | int | arrayIndex | ) |
| protected

PatchParamTable const& GetPatchParamTable | ( |  | ) | const
| inline

Returns the PatchParamTable (PatchParams order matches patch array sorting)

Definition at line 267 of file patchTable.h.

ConstQuadOffsetsArray GetPatchQuadOffsets | ( | PatchHandle const & | handle | ) | const

Returns the 'QuadOffsets' for the Gregory patch identified by 'handle'.

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 the patch 'patch' in array 'array'.

QuadOffsetsTable const& GetQuadOffsetsTable | ( |  | ) | const
| inline

Returns the quad-offsets table.

Definition at line 278 of file patchTable.h.

std::vector<Index> const& GetSharpnessIndexTable | ( |  | ) | const
| inline

Returns a sharpness index table for each patch (if exists)

Definition at line 270 of file patchTable.h.

Index* getSharpnessIndices | ( | Index | arrayIndex | ) |
| protected

std::vector<float> const& GetSharpnessValues | ( |  | ) | const
| inline

Returns sharpness values table.

Definition at line 273 of file patchTable.h.

float* getSharpnessValues | ( | Index | arrayIndex | ) |
| 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 'patch' in array 'array' if it is a single-crease patch, or 0.0f.

VertexValenceTable const& GetVertexValenceTable | ( |  | ) | const
| inline

Returns the 'VertexValences' table (vertex neighborhoods table)

Definition at line 202 of file patchTable.h.

bool IsFeatureAdaptive | ( |  | ) | const

True if the patches are of feature adaptive types.

void print | ( |  | ) | const

debug helper

## Friends And Related Function Documentation

friend class PatchTableFactory
| friend

Definition at line 315 of file patchTable.h.

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

- opensubdiv/far/patchTable.h