OpenSubdiv
Loading...
Searching...
No Matches
patchTable.h
Go to the documentation of this file.
1//
2// Copyright 2013 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24
25#ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H
26#define OPENSUBDIV3_FAR_PATCH_TABLE_H
27
28#include "../version.h"
29
30#include "../far/patchDescriptor.h"
31#include "../far/patchParam.h"
32#include "../far/stencilTable.h"
33
34#include "../sdc/options.h"
35
36#include <vector>
37
38namespace OpenSubdiv {
39namespace OPENSUBDIV_VERSION {
40
41namespace Far {
42
56
57public:
58
61 // XXXX manuelk members will eventually be made private
62 public:
63
64 friend class PatchTable;
65 friend class PatchMap;
66
67 Index arrayIndex, // Array index of the patch
68 patchIndex, // Absolute Index of the patch
69 vertIndex; // Relative offset to the first CV of the patch in array
70 };
71
72public:
73
75 PatchTable(PatchTable const & src);
76
79
81 bool IsFeatureAdaptive() const;
82
85 return (int)_patchVerts.size();
86 }
87
89 int GetNumPatchesTotal() const;
90
92 int GetMaxValence() const { return _maxValence; }
93
95 int GetNumPtexFaces() const { return _numPtexFaces; }
96
97
99
105
108
111
113 PatchParam GetPatchParam(PatchHandle const & handle) const;
114
116 ConstIndexArray GetPatchVertices(int array, int patch) const;
117
119 PatchParam GetPatchParam(int array, int patch) const;
121
122
124
130
132 int GetNumPatchArrays() const;
133
135 int GetNumPatches(int array) const;
136
138 int GetNumControlVertices(int array) const;
139
142
145
147 ConstPatchParamArray const GetPatchParams(int array) const;
149
150
152
159
161 int GetNumLocalPoints() const;
162
165
167 template <typename REAL>
169
172 template <typename REAL> bool LocalPointStencilPrecisionMatchesType() const;
173
186 template <class T> void
187 ComputeLocalPointValues(T const *src, T *dst) const;
188
189
192
195
197 template <typename REAL>
199
202 template <typename REAL> bool LocalPointVaryingStencilPrecisionMatchesType() const;
203
216 template <class T> void
217 ComputeLocalPointValuesVarying(T const *src, T *dst) const;
218
219
221 int GetNumLocalPointsFaceVarying(int channel = 0) const;
222
224 StencilTable const *GetLocalPointFaceVaryingStencilTable(int channel = 0) const;
225
227 template <typename REAL>
229
232 template <typename REAL> bool LocalPointFaceVaryingStencilPrecisionMatchesType() const;
233
248 template <class T> void
249 ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel = 0) const;
251
252
254
255
260
263
264 typedef std::vector<Index> VertexValenceTable;
265
268 return _vertexValenceTable;
269 }
271
272
274
280
284
287 float GetSingleCreasePatchSharpnessValue(int array, int patch) const;
289
290
292
298
301
304
306 ConstIndexArray GetPatchVaryingVertices(int array, int patch) const;
307
310
314
315
317
323
326
329
332
335
337 ConstIndexArray GetPatchFVarValues(PatchHandle const & handle, int channel = 0) const;
338
340 ConstIndexArray GetPatchFVarValues(int array, int patch, int channel = 0) const;
341
343 ConstIndexArray GetPatchArrayFVarValues(int array, int channel = 0) const;
344
346 ConstIndexArray GetFVarValues(int channel = 0) const;
347
349 int GetFVarValueStride(int channel = 0) const;
350
352 PatchParam GetPatchFVarPatchParam(PatchHandle const & handle, int channel = 0) const;
353
355 PatchParam GetPatchFVarPatchParam(int array, int patch, int channel = 0) const;
356
358 ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel = 0) const;
359
362
366
367
369
374
375 typedef std::vector<Index> PatchVertsTable;
376
378 PatchVertsTable const & GetPatchControlVerticesTable() const { return _patchVerts; }
379
381 PatchParamTable const & GetPatchParamTable() const { return _paramTable; }
382
384 std::vector<Index> const &GetSharpnessIndexTable() const { return _sharpnessIndices; }
385
387 std::vector<float> const &GetSharpnessValues() const { return _sharpnessValues; }
388
389 typedef std::vector<unsigned int> QuadOffsetsTable;
390
393 return _quadOffsetsTable;
394 }
396
398 void print() const;
399
400public:
401
403
405
428 template <typename REAL>
429 void EvaluateBasis(PatchHandle const & handle, REAL u, REAL v,
430 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
431 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
432
435 void EvaluateBasis(PatchHandle const & handle, float u, float v,
436 float wP[], float wDu[] = 0, float wDv[] = 0,
437 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
438
441 void EvaluateBasis(PatchHandle const & handle, double u, double v,
442 double wP[], double wDu[] = 0, double wDv[] = 0,
443 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
444
467 template <typename REAL>
468 void EvaluateBasisVarying(PatchHandle const & handle, REAL u, REAL v,
469 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
470 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
471
474 void EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
475 float wP[], float wDu[] = 0, float wDv[] = 0,
476 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
477
480 void EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
481 double wP[], double wDu[] = 0, double wDv[] = 0,
482 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
483
508 template <typename REAL>
509 void EvaluateBasisFaceVarying(PatchHandle const & handle, REAL u, REAL v,
510 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
511 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0,
512 int channel = 0) const;
513
516 void EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
517 float wP[], float wDu[] = 0, float wDv[] = 0,
518 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0,
519 int channel = 0) const;
520
523 void EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
524 double wP[], double wDu[] = 0, double wDv[] = 0,
525 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0,
526 int channel = 0) const;
528
529protected:
530
531 friend class PatchTableBuilder;
532
533 // Factory constructor
534 PatchTable(int maxvalence);
535
536 Index getPatchIndex(int array, int patch) const;
537
539
541 float * getSharpnessValues(Index arrayIndex);
542
543private:
544
545 //
546 // Patch arrays
547 //
548 struct PatchArray {
549 PatchArray(PatchDescriptor d, int np, Index v, Index p, Index qo) :
550 desc(d), numPatches(np), vertIndex(v),
551 patchIndex(p), quadOffsetIndex (qo) { }
552
553 void print() const;
554
555 PatchDescriptor desc; // type of patches in the array
556
557 int numPatches; // number of patches in the array
558
559 Index vertIndex, // index to the first control vertex
560 patchIndex, // absolute index of the first patch in the array
561 quadOffsetIndex; // index of the first quad offset entry
562 };
563
564 typedef std::vector<PatchArray> PatchArrayVector;
565
566 PatchArray & getPatchArray(Index arrayIndex);
567 PatchArray const & getPatchArray(Index arrayIndex) const;
568
569 void reservePatchArrays(int numPatchArrays);
570 void pushPatchArray(PatchDescriptor desc, int npatches,
571 Index * vidx, Index * pidx, Index * qoidx=0);
572
573 IndexArray getPatchArrayVertices(int arrayIndex);
574
575 Index findPatchArray(PatchDescriptor desc);
576
577
578 //
579 // Varying patch arrays
580 //
581 IndexArray getPatchArrayVaryingVertices(int arrayIndex);
582
583 void allocateVaryingVertices(
584 PatchDescriptor desc, int numPatches);
585 void populateVaryingVertices();
586
587 //
588 // Face-varying patch channels
589 //
590
591 //
592 // FVarPatchChannel
593 //
594 // Stores a record for each patch in the primitive :
595 //
596 // - Each patch in the PatchTable has a corresponding patch in each
597 // face-varying patch channel. Patch vertex indices are sorted in the same
598 // patch-type order as PatchTable::PTables. Face-varying data for a patch
599 // can therefore be quickly accessed by using the patch primitive ID as
600 // index into patchValueOffsets to locate the face-varying control vertex
601 // indices.
602 //
603 // - Face-varying channels can have a different interpolation modes
604 //
605 // - Unlike "vertex" patches, there are no transition masks required
606 // for face-varying patches.
607 //
608 // - Face-varying patches still require boundary edge masks.
609 //
610 // - currently most patches with sharp boundaries but smooth interiors have
611 // to be isolated to level 10 : we need a special type of bicubic patch
612 // similar to single-crease to resolve this condition without requiring
613 // isolation if possible
614 //
615 struct FVarPatchChannel {
617
618 PatchDescriptor regDesc;
619 PatchDescriptor irregDesc;
620
621 int stride;
622
623 std::vector<Index> patchValues;
624 std::vector<PatchParam> patchParam;
625 };
626 typedef std::vector<FVarPatchChannel> FVarPatchChannelVector;
627
628 FVarPatchChannel & getFVarPatchChannel(int channel);
629 FVarPatchChannel const & getFVarPatchChannel(int channel) const;
630
631 void allocateFVarPatchChannels(int numChannels);
632 void allocateFVarPatchChannelValues(
633 PatchDescriptor regDesc, PatchDescriptor irregDesc,
634 int numPatches, int channel);
635
636 // deprecated
637 void setFVarPatchChannelLinearInterpolation(
638 Sdc::Options::FVarLinearInterpolation interpolation, int channel);
639
640 IndexArray getFVarValues(int channel);
641 ConstIndexArray getPatchFVarValues(int patch, int channel) const;
642
643 PatchParamArray getFVarPatchParams(int channel);
644 PatchParam getPatchFVarPatchParam(int patch, int channel) const;
645
646private:
647 //
648 // Simple private class to hold stencil table pointers of varying precision,
649 // where the discriminant of the precision is external.
650 //
651 // NOTE that this is a simple pointer container and NOT a smart pointer that
652 // manages the ownership of the object referred to by it.
653 //
654 class StencilTablePtr {
655 private:
656 typedef StencilTableReal<float> float_type;
657 typedef StencilTableReal<double> double_type;
658
659 union {
660 float_type * _fPtr;
661 double_type * _dPtr;
662 };
663
664 public:
665 StencilTablePtr() { _fPtr = 0; }
666 StencilTablePtr(float_type * ptr) { _fPtr = ptr; }
667 StencilTablePtr(double_type * ptr) { _dPtr = ptr; }
668
669 operator bool() const { return _fPtr != 0; }
670
671 void Set() { _fPtr = 0; }
672 void Set(float_type * ptr) { _fPtr = ptr; }
673 void Set(double_type * ptr) { _dPtr = ptr; }
674
675 template <typename REAL> StencilTableReal<REAL> * Get() const;
676 };
677
678private:
679
680 //
681 // Topology
682 //
683
684 int _maxValence, // highest vertex valence found in the mesh
685 _numPtexFaces; // total number of ptex faces
686
687 PatchArrayVector _patchArrays; // Vector of descriptors for arrays of patches
688
689 std::vector<Index> _patchVerts; // Indices of the control vertices of the patches
690
691 PatchParamTable _paramTable; // PatchParam bitfields (one per patch)
692
693 //
694 // Extraordinary vertex closed-form evaluation / endcap basis conversion
695 //
696 // XXXtakahito: these data will probably be replaced with mask coefficient or something
697 // SchemeWorker populates.
698 //
699 QuadOffsetsTable _quadOffsetsTable; // Quad offsets (for Gregory patches)
700 VertexValenceTable _vertexValenceTable; // Vertex valence table (for Gregory patches)
701
702 StencilTablePtr _localPointStencils; // local point conversion stencils
703 StencilTablePtr _localPointVaryingStencils; // local point varying stencils
704
705 //
706 // Varying data
707 //
708 PatchDescriptor _varyingDesc;
709
710 std::vector<Index> _varyingVerts;
711
712 //
713 // Face-varying data
714 //
715 FVarPatchChannelVector _fvarChannels;
716
717 std::vector<StencilTablePtr> _localPointFaceVaryingStencils;
718
719 //
720 // 'single-crease' patch sharpness tables
721 //
722 std::vector<Index> _sharpnessIndices; // Indices of single-crease sharpness (one per patch)
723 std::vector<float> _sharpnessValues; // Sharpness values.
724
725 //
726 // Construction history -- relevant to at least one public query:
727 //
728 unsigned int _isUniformLinear : 1;
729
730 //
731 // Precision -- only applies to local-point stencil tables
732 //
733 unsigned int _vertexPrecisionIsDouble : 1;
734 unsigned int _varyingPrecisionIsDouble : 1;
735 unsigned int _faceVaryingPrecisionIsDouble : 1;
736};
737
738
739//
740// Template specializations for float/double -- to be defined before used:
741//
742template <> inline StencilTableReal<float> *
743PatchTable::StencilTablePtr::Get<float>() const { return _fPtr; }
744
745template <> inline StencilTableReal<double> *
746PatchTable::StencilTablePtr::Get<double>() const { return _dPtr; }
747
748template <> inline bool
749PatchTable::LocalPointStencilPrecisionMatchesType<float>() const {
750 return !_vertexPrecisionIsDouble;
751}
752template <> inline bool
753PatchTable::LocalPointVaryingStencilPrecisionMatchesType<float>() const {
754 return !_varyingPrecisionIsDouble;
755}
756template <> inline bool
757PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<float>() const {
758 return !_faceVaryingPrecisionIsDouble;
759}
760
761template <> inline bool
762PatchTable::LocalPointStencilPrecisionMatchesType<double>() const {
763 return _vertexPrecisionIsDouble;
764}
765template <> inline bool
766PatchTable::LocalPointVaryingStencilPrecisionMatchesType<double>() const {
767 return _varyingPrecisionIsDouble;
768}
769template <> inline bool
770PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<double>() const {
771 return _faceVaryingPrecisionIsDouble;
772}
773
774//
775// StencilTable access -- backward compatible and generic:
776//
777inline StencilTable const *
779 assert(LocalPointStencilPrecisionMatchesType<float>());
780 return static_cast<StencilTable const *>(_localPointStencils.Get<float>());
781}
782inline StencilTable const *
784 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
785 return static_cast<StencilTable const *>(
786 _localPointVaryingStencils.Get<float>());
787}
788inline StencilTable const *
790 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
791 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
792 return static_cast<StencilTable const *>(
793 _localPointFaceVaryingStencils[channel].Get<float>());
794 }
795 return NULL;
796}
797
798template <typename REAL>
799inline StencilTableReal<REAL> const *
801 assert(LocalPointStencilPrecisionMatchesType<REAL>());
802 return _localPointStencils.Get<REAL>();
803}
804template <typename REAL>
805inline StencilTableReal<REAL> const *
807 assert(LocalPointVaryingStencilPrecisionMatchesType<REAL>());
808 return _localPointVaryingStencils.Get<REAL>();
809}
810template <typename REAL>
811inline StencilTableReal<REAL> const *
813 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<REAL>());
814 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
815 return _localPointFaceVaryingStencils[channel].Get<REAL>();
816 }
817 return NULL;
818}
819
820
821//
822// Computation of local point values:
823//
824template <class T>
825inline void
826PatchTable::ComputeLocalPointValues(T const *src, T *dst) const {
827 assert(LocalPointStencilPrecisionMatchesType<float>());
828 if (_localPointStencils) {
829 _localPointStencils.Get<float>()->UpdateValues(src, dst);
830 }
831}
832
833template <class T>
834inline void
836 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
837 if (_localPointVaryingStencils) {
838 _localPointVaryingStencils.Get<float>()->UpdateValues(src, dst);
839 }
840}
841
842template <class T>
843inline void
844PatchTable::ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel) const {
845 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
846 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
847 if (_localPointFaceVaryingStencils[channel]) {
848 _localPointFaceVaryingStencils[channel].Get<float>()->UpdateValues(src, dst);
849 }
850 }
851}
852
853
854//
855// Basis evaluation overloads
856//
857inline void
858PatchTable::EvaluateBasis(PatchHandle const & handle, float u, float v,
859 float wP[], float wDu[], float wDv[],
860 float wDuu[], float wDuv[], float wDvv[]) const {
861
862 EvaluateBasis<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
863}
864inline void
865PatchTable::EvaluateBasis(PatchHandle const & handle, double u, double v,
866 double wP[], double wDu[], double wDv[],
867 double wDuu[], double wDuv[], double wDvv[]) const {
868
869 EvaluateBasis<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
870}
871
872inline void
873PatchTable::EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
874 float wP[], float wDu[], float wDv[],
875 float wDuu[], float wDuv[], float wDvv[]) const {
876
877 EvaluateBasisVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
878}
879inline void
880PatchTable::EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
881 double wP[], double wDu[], double wDv[],
882 double wDuu[], double wDuv[], double wDvv[]) const {
883
884 EvaluateBasisVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
885}
886
887inline void
888PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
889 float wP[], float wDu[], float wDv[],
890 float wDuu[], float wDuv[], float wDvv[], int channel) const {
891
892 EvaluateBasisFaceVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
893}
894inline void
895PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
896 double wP[], double wDu[], double wDv[],
897 double wDuu[], double wDuv[], double wDvv[], int channel) const {
898
899 EvaluateBasisFaceVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
900}
901
902} // end namespace Far
903
904} // end namespace OPENSUBDIV_VERSION
905using namespace OPENSUBDIV_VERSION;
906
907} // end namespace OpenSubdiv
908
909#endif /* OPENSUBDIV3_FAR_PATCH_TABLE */
Vtr::ConstIndexArray ConstIndexArray
Definition: types.h:47
std::vector< PatchParam > PatchParamTable
Definition: patchParam.h:243
Vtr::IndexArray IndexArray
Definition: types.h:44
Vtr::Array< PatchParam > PatchParamArray
Definition: patchParam.h:245
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
An quadtree-based map connecting coarse faces to their sub-patches.
Definition: patchMap.h:49
Container for arrays of parametric patches.
Definition: patchTable.h:55
ConstIndexArray GetPatchArrayVaryingVertices(int array) const
Returns the varying vertex indices for the patches in array.
PatchVertsTable const & GetPatchControlVerticesTable() const
Get the table of patch control vertices.
Definition: patchTable.h:378
void ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel=0) const
Updates local point face-varying values.
Definition: patchTable.h:844
ConstIndexArray GetVaryingVertices() const
Returns an array of varying vertex indices for the patches.
void ComputeLocalPointValuesVarying(T const *src, T *dst) const
Updates local point varying values.
Definition: patchTable.h:835
ConstIndexArray GetPatchVaryingVertices(PatchHandle const &handle) const
Returns the varying vertex indices for a given patch.
bool IsFeatureAdaptive() const
True if the patches are of feature adaptive types.
int GetMaxValence() const
Returns max vertex valence.
Definition: patchTable.h:92
StencilTableReal< REAL > const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
StencilTable const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
Definition: patchTable.h:778
PatchParamArray getPatchParams(int arrayIndex)
ConstIndexArray GetPatchArrayFVarValues(int array, int channel=0) const
Returns the value indices for the patches in array in channel.
std::vector< float > const & GetSharpnessValues() const
Returns sharpness values table.
Definition: patchTable.h:387
PatchParam GetPatchFVarPatchParam(int array, int patch, int channel=0) const
Returns the face-varying params for a given patch channel.
ConstIndexArray GetPatchVaryingVertices(int array, int patch) const
Returns the varying vertex indices for a given patch.
PatchTable(PatchTable const &src)
Copy constructor.
int GetNumPatchArrays() const
Returns the number of patch arrays in the table.
ConstIndexArray GetPatchVertices(PatchHandle const &handle) const
Returns the control vertex indices for the patch identified by handle.
bool LocalPointFaceVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point face-varying values matches the gi...
PatchParamTable const & GetPatchParamTable() const
Returns the PatchParamTable (PatchParams order matches patch array sorting)
Definition: patchTable.h:381
VertexValenceTable const & GetVertexValenceTable() const
Returns the 'VertexValences' table (vertex neighborhoods table)
Definition: patchTable.h:267
StencilTable const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
Definition: patchTable.h:789
int GetNumControlVertices(int array) const
Returns the number of control vertices in array.
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...
ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const
Returns the 'QuadOffsets' for the Gregory patch identified by handle.
PatchDescriptor GetFVarPatchDescriptorIrregular(int channel=0) const
Returns the irregular patch descriptor for channel.
float GetSingleCreasePatchSharpnessValue(int array, int patch) const
Returns the crease sharpness for the patch in array if it is a single-crease patch,...
void ComputeLocalPointValues(T const *src, T *dst) const
Updates local point vertex values.
Definition: patchTable.h:826
float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const
Returns the crease sharpness for the patch identified by handle if it is a single-crease patch,...
PatchParam GetPatchParam(int array, int patch) const
Returns the PatchParam for patch in array.
ConstIndexArray GetPatchFVarValues(int array, int patch, int channel=0) const
Returns the value indices for a given patch in channel.
PatchDescriptor GetFVarPatchDescriptorRegular(int channel=0) const
Returns the regular patch descriptor for channel.
PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const
Returns the PatchDescriptor for the patch identified by handle.
QuadOffsetsTable const & GetQuadOffsetsTable() const
Returns the quad-offsets table.
Definition: patchTable.h:392
int GetNumPatches(int array) const
Returns the number of patches in array.
PatchDescriptor GetVaryingPatchDescriptor() const
Returns the varying patch descriptor.
ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
ConstPatchParamArray const GetPatchParams(int array) const
Returns the PatchParams for the patches in array.
int GetNumControlVerticesTotal() const
Returns the total number of control vertex indices in the table.
Definition: patchTable.h:84
int GetNumFVarChannels() const
Returns the number of face-varying channels.
ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel=0) const
Returns the face-varying for a given patch in array in channel.
Index getPatchIndex(int array, int patch) const
int GetNumLocalPoints() const
Returns the number of local vertex points.
bool LocalPointVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point varying values matches the given f...
ConstIndexArray GetPatchArrayVertices(int array) const
Returns the control vertex indices for the patches in array.
int GetNumPtexFaces() const
Returns the total number of ptex faces in the mesh.
Definition: patchTable.h:95
ConstIndexArray GetFVarValues(int channel=0) const
Returns an array of value indices for the patches in channel.
Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray
Accessors for the gregory patch evaluation buffers. These methods will be deprecated.
Definition: patchTable.h:259
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...
StencilTableReal< REAL > const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
int GetNumPatchesTotal() const
Returns the total number of patches stored in the table.
PatchParam GetPatchParam(PatchHandle const &handle) const
Returns a PatchParam for the patch identified by handle.
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel=0) const
Deprecated.
std::vector< Index > const & GetSharpnessIndexTable() const
Returns a sharpness index table for each patch (if exists)
Definition: patchTable.h:384
PatchDescriptor GetPatchArrayDescriptor(int array) const
Returns the PatchDescriptor for the patches in array.
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 ...
StencilTable const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
Definition: patchTable.h:783
std::vector< unsigned int > QuadOffsetsTable
Definition: patchTable.h:389
ConstIndexArray GetPatchVertices(int array, int patch) const
Returns the control vertex indices for patch in array.
PatchParam GetPatchFVarPatchParam(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
int GetFVarValueStride(int channel=0) const
Returns the stride between patches in the value index array of channel.
ConstPatchParamArray GetFVarPatchParams(int channel=0) const
Returns an array of face-varying patch param for channel.
PatchDescriptor GetFVarPatchDescriptor(int channel=0) const
Returns the default/irregular patch descriptor for channel.
int GetNumLocalPointsVarying() const
Returns the number of local varying points.
bool LocalPointStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point vertex values matches the given fl...
StencilTableReal< REAL > const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
int GetNumLocalPointsFaceVarying(int channel=0) const
Returns the number of local face-varying points for channel.
Handle that can be used as unique patch identifier within PatchTable.
Definition: patchTable.h:60
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273