Loading...
Searching...
No Matches
patchTable.h
Go to the documentation of this file.
//
// Copyright 2013 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H
#define OPENSUBDIV3_FAR_PATCH_TABLE_H
#include "../version.h"
#include "../far/patchDescriptor.h"
#include "../far/patchParam.h"
#include "../far/stencilTable.h"
#include "../sdc/options.h"
#include <vector>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Far {
class PatchTable {
public:
class PatchHandle {
// XXXX manuelk members will eventually be made private
public:
friend class PatchTable;
friend class PatchMap;
Index arrayIndex, // Array index of the patch
patchIndex, // Absolute Index of the patch
vertIndex; // Relative offset to the first CV of the patch in array
};
public:
PatchTable(PatchTable const & src);
~PatchTable();
bool IsFeatureAdaptive() const;
int GetNumControlVerticesTotal() const {
return (int)_patchVerts.size();
}
int GetNumPatchesTotal() const;
int GetMaxValence() const { return _maxValence; }
int GetNumPtexFaces() const { return _numPtexFaces; }
PatchDescriptor GetPatchDescriptor(PatchHandle const & handle) const;
ConstIndexArray GetPatchVertices(PatchHandle const & handle) const;
PatchParam GetPatchParam(PatchHandle const & handle) const;
ConstIndexArray GetPatchVertices(int array, int patch) const;
PatchParam GetPatchParam(int array, int patch) const;
int GetNumPatchArrays() const;
int GetNumPatches(int array) const;
int GetNumControlVertices(int array) const;
PatchDescriptor GetPatchArrayDescriptor(int array) const;
ConstIndexArray GetPatchArrayVertices(int array) const;
ConstPatchParamArray const GetPatchParams(int array) const;
int GetNumLocalPoints() const;
StencilTable const *GetLocalPointStencilTable() const;
template <typename REAL>
StencilTableReal<REAL> const *GetLocalPointStencilTable() const;
template <typename REAL> bool LocalPointStencilPrecisionMatchesType() const;
template <class T> void
ComputeLocalPointValues(T const *src, T *dst) const;
int GetNumLocalPointsVarying() const;
StencilTable const *GetLocalPointVaryingStencilTable() const;
template <typename REAL>
StencilTableReal<REAL> const *GetLocalPointVaryingStencilTable() const;
template <typename REAL> bool LocalPointVaryingStencilPrecisionMatchesType() const;
template <class T> void
ComputeLocalPointValuesVarying(T const *src, T *dst) const;
int GetNumLocalPointsFaceVarying(int channel = 0) const;
StencilTable const *GetLocalPointFaceVaryingStencilTable(int channel = 0) const;
template <typename REAL>
StencilTableReal<REAL> const * GetLocalPointFaceVaryingStencilTable(int channel = 0) const;
template <typename REAL> bool LocalPointFaceVaryingStencilPrecisionMatchesType() const;
template <class T> void
ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel = 0) const;
typedef Vtr::ConstArray<unsigned int> ConstQuadOffsetsArray;
ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const & handle) const;
typedef std::vector<Index> VertexValenceTable;
VertexValenceTable const & GetVertexValenceTable() const {
return _vertexValenceTable;
}
float GetSingleCreasePatchSharpnessValue(PatchHandle const & handle) const;
float GetSingleCreasePatchSharpnessValue(int array, int patch) const;
PatchDescriptor GetVaryingPatchDescriptor() const;
ConstIndexArray GetPatchVaryingVertices(PatchHandle const & handle) const;
ConstIndexArray GetPatchVaryingVertices(int array, int patch) const;
ConstIndexArray GetPatchArrayVaryingVertices(int array) const;
ConstIndexArray GetVaryingVertices() const;
int GetNumFVarChannels() const;
PatchDescriptor GetFVarPatchDescriptorRegular(int channel = 0) const;
PatchDescriptor GetFVarPatchDescriptorIrregular(int channel = 0) const;
PatchDescriptor GetFVarPatchDescriptor(int channel = 0) const;
ConstIndexArray GetPatchFVarValues(PatchHandle const & handle, int channel = 0) const;
ConstIndexArray GetPatchFVarValues(int array, int patch, int channel = 0) const;
ConstIndexArray GetPatchArrayFVarValues(int array, int channel = 0) const;
ConstIndexArray GetFVarValues(int channel = 0) const;
int GetFVarValueStride(int channel = 0) const;
PatchParam GetPatchFVarPatchParam(PatchHandle const & handle, int channel = 0) const;
PatchParam GetPatchFVarPatchParam(int array, int patch, int channel = 0) const;
ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel = 0) const;
ConstPatchParamArray GetFVarPatchParams(int channel = 0) const;
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel = 0) const;
typedef std::vector<Index> PatchVertsTable;
PatchVertsTable const & GetPatchControlVerticesTable() const { return _patchVerts; }
PatchParamTable const & GetPatchParamTable() const { return _paramTable; }
std::vector<Index> const &GetSharpnessIndexTable() const { return _sharpnessIndices; }
std::vector<float> const &GetSharpnessValues() const { return _sharpnessValues; }
typedef std::vector<unsigned int> QuadOffsetsTable;
QuadOffsetsTable const & GetQuadOffsetsTable() const {
return _quadOffsetsTable;
}
void print() const;
public:
template <typename REAL>
void EvaluateBasis(PatchHandle const & handle, REAL u, REAL v,
REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
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;
void EvaluateBasis(PatchHandle const & handle, double u, double v,
double wP[], double wDu[] = 0, double wDv[] = 0,
double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
template <typename REAL>
void EvaluateBasisVarying(PatchHandle const & handle, REAL u, REAL v,
REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
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;
void EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
double wP[], double wDu[] = 0, double wDv[] = 0,
double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
template <typename REAL>
void EvaluateBasisFaceVarying(PatchHandle const & handle, REAL u, REAL v,
REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0,
int channel = 0) const;
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;
void EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
double wP[], double wDu[] = 0, double wDv[] = 0,
double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0,
int channel = 0) const;
protected:
friend class PatchTableBuilder;
// Factory constructor
PatchTable(int maxvalence);
Index getPatchIndex(int array, int patch) const;
PatchParamArray getPatchParams(int arrayIndex);
Index * getSharpnessIndices(Index arrayIndex);
float * getSharpnessValues(Index arrayIndex);
private:
//
// Patch arrays
//
struct PatchArray;
typedef std::vector<PatchArray> PatchArrayVector;
PatchArray & getPatchArray(Index arrayIndex);
PatchArray const & getPatchArray(Index arrayIndex) const;
void reservePatchArrays(int numPatchArrays);
void pushPatchArray(PatchDescriptor desc, int npatches,
Index * vidx, Index * pidx, Index * qoidx=0);
IndexArray getPatchArrayVertices(int arrayIndex);
Index findPatchArray(PatchDescriptor desc);
//
// Varying patch arrays
//
IndexArray getPatchArrayVaryingVertices(int arrayIndex);
void allocateVaryingVertices(
PatchDescriptor desc, int numPatches);
void populateVaryingVertices();
//
// Face-varying patch channels
//
struct FVarPatchChannel;
typedef std::vector<FVarPatchChannel> FVarPatchChannelVector;
FVarPatchChannel & getFVarPatchChannel(int channel);
FVarPatchChannel const & getFVarPatchChannel(int channel) const;
void allocateFVarPatchChannels(int numChannels);
void allocateFVarPatchChannelValues(
PatchDescriptor regDesc, PatchDescriptor irregDesc,
int numPatches, int channel);
// deprecated
void setFVarPatchChannelLinearInterpolation(
Sdc::Options::FVarLinearInterpolation interpolation, int channel);
IndexArray getFVarValues(int channel);
ConstIndexArray getPatchFVarValues(int patch, int channel) const;
PatchParamArray getFVarPatchParams(int channel);
PatchParam getPatchFVarPatchParam(int patch, int channel) const;
private:
//
// Simple private class to hold stencil table pointers of varying precision,
// where the discriminant of the precision is external.
//
// NOTE that this is a simple pointer container and NOT a smart pointer that
// manages the ownership of the object referred to by it.
//
class StencilTablePtr {
private:
typedef StencilTableReal<float> float_type;
typedef StencilTableReal<double> double_type;
union {
float_type * _fPtr;
double_type * _dPtr;
};
public:
StencilTablePtr() { _fPtr = 0; }
StencilTablePtr(float_type * ptr) { _fPtr = ptr; }
StencilTablePtr(double_type * ptr) { _dPtr = ptr; }
operator bool() const { return _fPtr != 0; }
void Set() { _fPtr = 0; }
void Set(float_type * ptr) { _fPtr = ptr; }
void Set(double_type * ptr) { _dPtr = ptr; }
template <typename REAL> StencilTableReal<REAL> * Get() const;
};
private:
//
// Topology
//
int _maxValence, // highest vertex valence found in the mesh
_numPtexFaces; // total number of ptex faces
PatchArrayVector _patchArrays; // Vector of descriptors for arrays of patches
std::vector<Index> _patchVerts; // Indices of the control vertices of the patches
PatchParamTable _paramTable; // PatchParam bitfields (one per patch)
//
// Extraordinary vertex closed-form evaluation / endcap basis conversion
//
// XXXtakahito: these data will probably be replaced with mask coefficient or something
// SchemeWorker populates.
//
QuadOffsetsTable _quadOffsetsTable; // Quad offsets (for Gregory patches)
VertexValenceTable _vertexValenceTable; // Vertex valence table (for Gregory patches)
StencilTablePtr _localPointStencils; // local point conversion stencils
StencilTablePtr _localPointVaryingStencils; // local point varying stencils
//
// Varying data
//
PatchDescriptor _varyingDesc;
std::vector<Index> _varyingVerts;
//
// Face-varying data
//
FVarPatchChannelVector _fvarChannels;
std::vector<StencilTablePtr> _localPointFaceVaryingStencils;
//
// 'single-crease' patch sharpness tables
//
std::vector<Index> _sharpnessIndices; // Indices of single-crease sharpness (one per patch)
std::vector<float> _sharpnessValues; // Sharpness values.
//
// Construction history -- relevant to at least one public query:
//
unsigned int _isUniformLinear : 1;
//
// Precision -- only applies to local-point stencil tables
//
unsigned int _vertexPrecisionIsDouble : 1;
unsigned int _varyingPrecisionIsDouble : 1;
unsigned int _faceVaryingPrecisionIsDouble : 1;
};
//
// Template specializations for float/double -- to be defined before used:
//
template <> inline StencilTableReal<float> *
PatchTable::StencilTablePtr::Get<float>() const { return _fPtr; }
template <> inline StencilTableReal<double> *
PatchTable::StencilTablePtr::Get<double>() const { return _dPtr; }
template <> inline bool
PatchTable::LocalPointStencilPrecisionMatchesType<float>() const {
return !_vertexPrecisionIsDouble;
}
template <> inline bool
PatchTable::LocalPointVaryingStencilPrecisionMatchesType<float>() const {
return !_varyingPrecisionIsDouble;
}
template <> inline bool
PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<float>() const {
return !_faceVaryingPrecisionIsDouble;
}
template <> inline bool
PatchTable::LocalPointStencilPrecisionMatchesType<double>() const {
return _vertexPrecisionIsDouble;
}
template <> inline bool
PatchTable::LocalPointVaryingStencilPrecisionMatchesType<double>() const {
return _varyingPrecisionIsDouble;
}
template <> inline bool
PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<double>() const {
return _faceVaryingPrecisionIsDouble;
}
//
// StencilTable access -- backward compatible and generic:
//
inline StencilTable const *
PatchTable::GetLocalPointStencilTable() const {
assert(LocalPointStencilPrecisionMatchesType<float>());
return static_cast<StencilTable const *>(_localPointStencils.Get<float>());
}
inline StencilTable const *
PatchTable::GetLocalPointVaryingStencilTable() const {
assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
return static_cast<StencilTable const *>(
_localPointVaryingStencils.Get<float>());
}
inline StencilTable const *
PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const {
assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
return static_cast<StencilTable const *>(
_localPointFaceVaryingStencils[channel].Get<float>());
}
return NULL;
}
template <typename REAL>
inline StencilTableReal<REAL> const *
PatchTable::GetLocalPointStencilTable() const {
assert(LocalPointStencilPrecisionMatchesType<REAL>());
return _localPointStencils.Get<REAL>();
}
template <typename REAL>
inline StencilTableReal<REAL> const *
PatchTable::GetLocalPointVaryingStencilTable() const {
assert(LocalPointVaryingStencilPrecisionMatchesType<REAL>());
return _localPointVaryingStencils.Get<REAL>();
}
template <typename REAL>
inline StencilTableReal<REAL> const *
PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const {
assert(LocalPointFaceVaryingStencilPrecisionMatchesType<REAL>());
if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
return _localPointFaceVaryingStencils[channel].Get<REAL>();
}
return NULL;
}
//
// Computation of local point values:
//
template <class T>
inline void
PatchTable::ComputeLocalPointValues(T const *src, T *dst) const {
assert(LocalPointStencilPrecisionMatchesType<float>());
if (_localPointStencils) {
_localPointStencils.Get<float>()->UpdateValues(src, dst);
}
}
template <class T>
inline void
PatchTable::ComputeLocalPointValuesVarying(T const *src, T *dst) const {
assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
if (_localPointVaryingStencils) {
_localPointVaryingStencils.Get<float>()->UpdateValues(src, dst);
}
}
template <class T>
inline void
PatchTable::ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel) const {
assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
if (_localPointFaceVaryingStencils[channel]) {
_localPointFaceVaryingStencils[channel].Get<float>()->UpdateValues(src, dst);
}
}
}
//
// Basis evaluation overloads
//
inline void
PatchTable::EvaluateBasis(PatchHandle const & handle, float u, float v,
float wP[], float wDu[], float wDv[],
float wDuu[], float wDuv[], float wDvv[]) const {
EvaluateBasis<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
}
inline void
PatchTable::EvaluateBasis(PatchHandle const & handle, double u, double v,
double wP[], double wDu[], double wDv[],
double wDuu[], double wDuv[], double wDvv[]) const {
EvaluateBasis<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
}
inline void
PatchTable::EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
float wP[], float wDu[], float wDv[],
float wDuu[], float wDuv[], float wDvv[]) const {
EvaluateBasisVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
}
inline void
PatchTable::EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
double wP[], double wDu[], double wDv[],
double wDuu[], double wDuv[], double wDvv[]) const {
EvaluateBasisVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
}
inline void
PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
float wP[], float wDu[], float wDv[],
float wDuu[], float wDuv[], float wDvv[], int channel) const {
EvaluateBasisFaceVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
}
inline void
PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
double wP[], double wDu[], double wDv[],
double wDuu[], double wDuv[], double wDvv[], int channel) const {
EvaluateBasisFaceVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
}
} // end namespace Far
} // end namespace OPENSUBDIV_VERSION
using namespace OPENSUBDIV_VERSION;
} // end namespace OpenSubdiv
#endif /* OPENSUBDIV3_FAR_PATCH_TABLE */
options.h
stencilTable.h
patchParam.h
patchDescriptor.h
OpenSubdiv
Definition error.h:30
OpenSubdiv::OPENSUBDIV_VERSION
Definition error.h:31
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition error.h:33
OpenSubdiv::OPENSUBDIV_VERSION::Far::ConstPatchParamArray
Vtr::ConstArray< PatchParam > ConstPatchParamArray
Definition patchParam.h:246
OpenSubdiv::OPENSUBDIV_VERSION::Far::ConstIndexArray
Vtr::ConstIndexArray ConstIndexArray
Definition types.h:47
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParamTable
std::vector< PatchParam > PatchParamTable
Definition patchParam.h:243
OpenSubdiv::OPENSUBDIV_VERSION::Far::IndexArray
Vtr::IndexArray IndexArray
Definition types.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Far::Index
Vtr::Index Index
Definition types.h:41
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParamArray
Vtr::Array< PatchParam > PatchParamArray
Definition patchParam.h:245
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor
Describes the type of a patch.
Definition patchDescriptor.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParam
Patch parameterization.
Definition patchParam.h:152
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayVaryingVertices
ConstIndexArray GetPatchArrayVaryingVertices(int array) const
Returns the varying vertex indices for the patches in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getSharpnessValues
float * getSharpnessValues(Index arrayIndex)
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchControlVerticesTable
PatchVertsTable const & GetPatchControlVerticesTable() const
Get the table of patch control vertices.
Definition patchTable.h:378
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ComputeLocalPointValuesFaceVarying
void ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel=0) const
Updates local point face-varying values.
Definition patchTable.h:796
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVaryingVertices
ConstIndexArray GetVaryingVertices() const
Returns an array of varying vertex indices for the patches.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ComputeLocalPointValuesVarying
void ComputeLocalPointValuesVarying(T const *src, T *dst) const
Updates local point varying values.
Definition patchTable.h:787
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVaryingVertices
ConstIndexArray GetPatchVaryingVertices(PatchHandle const &handle) const
Returns the varying vertex indices for a given patch.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::IsFeatureAdaptive
bool IsFeatureAdaptive() const
True if the patches are of feature adaptive types.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetMaxValence
int GetMaxValence() const
Returns max vertex valence.
Definition patchTable.h:92
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointStencilTable
StencilTableReal< REAL > const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointStencilTable
StencilTable const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
Definition patchTable.h:730
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getPatchParams
PatchParamArray getPatchParams(int arrayIndex)
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayFVarValues
ConstIndexArray GetPatchArrayFVarValues(int array, int channel=0) const
Returns the value indices for the patches in array in channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSharpnessValues
std::vector< float > const & GetSharpnessValues() const
Returns sharpness values table.
Definition patchTable.h:387
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::VertexValenceTable
std::vector< Index > VertexValenceTable
Definition patchTable.h:264
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarPatchParam
PatchParam GetPatchFVarPatchParam(int array, int patch, int channel=0) const
Returns the face-varying params for a given patch channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVaryingVertices
ConstIndexArray GetPatchVaryingVertices(int array, int patch) const
Returns the varying vertex indices for a given patch.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTable
PatchTable(PatchTable const &src)
Copy constructor.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatchArrays
int GetNumPatchArrays() const
Returns the number of patch arrays in the table.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVertices
ConstIndexArray GetPatchVertices(PatchHandle const &handle) const
Returns the control vertex indices for the patch identified by handle.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTable
PatchTable(int maxvalence)
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType
bool LocalPointFaceVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point face-varying values matches the gi...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParamTable
PatchParamTable const & GetPatchParamTable() const
Returns the PatchParamTable (PatchParams order matches patch array sorting)
Definition patchTable.h:381
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVertexValenceTable
VertexValenceTable const & GetVertexValenceTable() const
Returns the 'VertexValences' table (vertex neighborhoods table)
Definition patchTable.h:267
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointFaceVaryingStencilTable
StencilTable const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
Definition patchTable.h:741
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumControlVertices
int GetNumControlVertices(int array) const
Returns the number of control vertices in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::~PatchTable
~PatchTable()
Destructor.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasisFaceVarying
void EvaluateBasisFaceVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0, int channel=0) const
Evaluate basis functions for a face-varying value and derivatives at a given (u,v) parametric locatio...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchQuadOffsets
ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const
Returns the 'QuadOffsets' for the Gregory patch identified by handle.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchDescriptorIrregular
PatchDescriptor GetFVarPatchDescriptorIrregular(int channel=0) const
Returns the irregular patch descriptor for channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSingleCreasePatchSharpnessValue
float GetSingleCreasePatchSharpnessValue(int array, int patch) const
Returns the crease sharpness for the patch in array if it is a single-crease patch,...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getSharpnessIndices
Index * getSharpnessIndices(Index arrayIndex)
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ComputeLocalPointValues
void ComputeLocalPointValues(T const *src, T *dst) const
Updates local point vertex values.
Definition patchTable.h:778
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSingleCreasePatchSharpnessValue
float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const
Returns the crease sharpness for the patch identified by handle if it is a single-crease patch,...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParam
PatchParam GetPatchParam(int array, int patch) const
Returns the PatchParam for patch in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarValues
ConstIndexArray GetPatchFVarValues(int array, int patch, int channel=0) const
Returns the value indices for a given patch in channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchDescriptorRegular
PatchDescriptor GetFVarPatchDescriptorRegular(int channel=0) const
Returns the regular patch descriptor for channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchDescriptor
PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const
Returns the PatchDescriptor for the patch identified by handle.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchVertsTable
std::vector< Index > PatchVertsTable
Definition patchTable.h:375
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetQuadOffsetsTable
QuadOffsetsTable const & GetQuadOffsetsTable() const
Returns the quad-offsets table.
Definition patchTable.h:392
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatches
int GetNumPatches(int array) const
Returns the number of patches in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVaryingPatchDescriptor
PatchDescriptor GetVaryingPatchDescriptor() const
Returns the varying patch descriptor.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarValues
ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParams
ConstPatchParamArray const GetPatchParams(int array) const
Returns the PatchParams for the patches in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumControlVerticesTotal
int GetNumControlVerticesTotal() const
Returns the total number of control vertex indices in the table.
Definition patchTable.h:84
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumFVarChannels
int GetNumFVarChannels() const
Returns the number of face-varying channels.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayFVarPatchParams
ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel=0) const
Returns the face-varying for a given patch in array in channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getPatchIndex
Index getPatchIndex(int array, int patch) const
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPoints
int GetNumLocalPoints() const
Returns the number of local vertex points.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::LocalPointVaryingStencilPrecisionMatchesType
bool LocalPointVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point varying values matches the given f...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayVertices
ConstIndexArray GetPatchArrayVertices(int array) const
Returns the control vertex indices for the patches in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPtexFaces
int GetNumPtexFaces() const
Returns the total number of ptex faces in the mesh.
Definition patchTable.h:95
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarValues
ConstIndexArray GetFVarValues(int channel=0) const
Returns an array of value indices for the patches in channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ConstQuadOffsetsArray
Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray
Accessors for the gregory patch evaluation buffers. These methods will be deprecated.
Definition patchTable.h:259
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasis
void EvaluateBasis(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const
Evaluate basis functions for position and derivatives at a given (u,v) parametric location of a patch...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointFaceVaryingStencilTable
StencilTableReal< REAL > const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatchesTotal
int GetNumPatchesTotal() const
Returns the total number of patches stored in the table.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParam
PatchParam GetPatchParam(PatchHandle const &handle) const
Returns a PatchParam for the patch identified by handle.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::print
void print() const
debug helper
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarChannelLinearInterpolation
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel=0) const
Deprecated.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSharpnessIndexTable
std::vector< Index > const & GetSharpnessIndexTable() const
Returns a sharpness index table for each patch (if exists)
Definition patchTable.h:384
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayDescriptor
PatchDescriptor GetPatchArrayDescriptor(int array) const
Returns the PatchDescriptor for the patches in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTableBuilder
friend class PatchTableBuilder
Definition patchTable.h:531
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasisVarying
void EvaluateBasisVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const
Evaluate basis functions for a varying value and derivatives at a given (u,v) parametric location of ...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointVaryingStencilTable
StencilTable const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
Definition patchTable.h:735
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::QuadOffsetsTable
std::vector< unsigned int > QuadOffsetsTable
Definition patchTable.h:389
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVertices
ConstIndexArray GetPatchVertices(int array, int patch) const
Returns the control vertex indices for patch in array.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarPatchParam
PatchParam GetPatchFVarPatchParam(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarValueStride
int GetFVarValueStride(int channel=0) const
Returns the stride between patches in the value index array of channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchParams
ConstPatchParamArray GetFVarPatchParams(int channel=0) const
Returns an array of face-varying patch param for channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchDescriptor
PatchDescriptor GetFVarPatchDescriptor(int channel=0) const
Returns the default/irregular patch descriptor for channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPointsVarying
int GetNumLocalPointsVarying() const
Returns the number of local varying points.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::LocalPointStencilPrecisionMatchesType
bool LocalPointStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point vertex values matches the given fl...
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointVaryingStencilTable
StencilTableReal< REAL > const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPointsFaceVarying
int GetNumLocalPointsFaceVarying(int channel=0) const
Returns the number of local face-varying points for channel.
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle
Handle that can be used as unique patch identifier within PatchTable.
Definition patchTable.h:60
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::patchIndex
Index patchIndex
Definition patchTable.h:68
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::arrayIndex
Index arrayIndex
Definition patchTable.h:67
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::vertIndex
Index vertIndex
Definition patchTable.h:69
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::PatchTable
friend class PatchTable
Definition patchTable.h:64
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::PatchMap
friend class PatchMap
Definition patchTable.h:65
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableReal
Table of subdivision stencils.
Definition stencilTable.h:141
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable
Stencil table class wrapping the template for compatibility.
Definition stencilTable.h:273
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation
FVarLinearInterpolation
Definition options.h:60
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray
Definition array.h:53