OpenSubdiv: opensubdiv/far/patchTable.h Source File

| OpenSubdiv

Loading...
Searching...
No Matches
patchTable.h
Go to the documentation of this file.
1//
2// Copyright 2013 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://opensubdiv.org/license.
6//
7
8#ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H
9#define OPENSUBDIV3_FAR_PATCH_TABLE_H
10
11#include "../version.h"
12
13#include "../far/patchDescriptor.h"
14#include "../far/patchParam.h"
15#include "../far/stencilTable.h"
16
17#include "../sdc/options.h"
18
19#include <vector>
20
21namespace OpenSubdiv {
22namespace OPENSUBDIV_VERSION {
23
24namespace Far {
25
38 class PatchTable {
39
40public:
41
43 class PatchHandle {
44 // XXXX manuelk members will eventually be made private
45 public:
46
47 friend class PatchTable;
48 friend class PatchMap;
49
50 Index arrayIndex, // Array index of the patch
51 patchIndex, // Absolute Index of the patch
52 vertIndex; // Relative offset to the first CV of the patch in array
53 };
54
55public:
56
58 PatchTable(PatchTable const & src);
59
61 ~PatchTable();
62
64 bool IsFeatureAdaptive() const;
65
67 int GetNumControlVerticesTotal() const {
68 return (int)_patchVerts.size();
69 }
70
72 int GetNumPatchesTotal() const;
73
75 int GetMaxValence() const { return _maxValence; }
76
78 int GetNumPtexFaces() const { return _numPtexFaces; }
79
80
82
88
90 PatchDescriptor GetPatchDescriptor(PatchHandle const & handle) const;
91
93 ConstIndexArray GetPatchVertices(PatchHandle const & handle) const;
94
96 PatchParam GetPatchParam(PatchHandle const & handle) const;
97
99 ConstIndexArray GetPatchVertices(int array, int patch) const;
100
102 PatchParam GetPatchParam(int array, int patch) const;
104
105
107
113
115 int GetNumPatchArrays() const;
116
118 int GetNumPatches(int array) const;
119
121 int GetNumControlVertices(int array) const;
122
124 PatchDescriptor GetPatchArrayDescriptor(int array) const;
125
127 ConstIndexArray GetPatchArrayVertices(int array) const;
128
130 ConstPatchParamArray const GetPatchParams(int array) const;
132
133
135
142
144 int GetNumLocalPoints() const;
145
147 StencilTable const *GetLocalPointStencilTable() const;
148
150 template <typename REAL>
151 StencilTableReal<REAL> const *GetLocalPointStencilTable() const;
152
155 template <typename REAL> bool LocalPointStencilPrecisionMatchesType() const;
156
169 template <class T> void
170 ComputeLocalPointValues(T const *src, T *dst) const;
171
172
174 int GetNumLocalPointsVarying() const;
175
177 StencilTable const *GetLocalPointVaryingStencilTable() const;
178
180 template <typename REAL>
181 StencilTableReal<REAL> const *GetLocalPointVaryingStencilTable() const;
182
185 template <typename REAL> bool LocalPointVaryingStencilPrecisionMatchesType() const;
186
199 template <class T> void
200 ComputeLocalPointValuesVarying(T const *src, T *dst) const;
201
202
204 int GetNumLocalPointsFaceVarying(int channel = 0) const;
205
207 StencilTable const *GetLocalPointFaceVaryingStencilTable(int channel = 0) const;
208
210 template <typename REAL>
211 StencilTableReal<REAL> const * GetLocalPointFaceVaryingStencilTable(int channel = 0) const;
212
215 template <typename REAL> bool LocalPointFaceVaryingStencilPrecisionMatchesType() const;
216
231 template <class T> void
232 ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel = 0) const;
234
235
237
238
242 typedef Vtr::ConstArray<unsigned int> ConstQuadOffsetsArray;
243
245 ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const & handle) const;
246
247 typedef std::vector<Index> VertexValenceTable;
248
250 VertexValenceTable const & GetVertexValenceTable() const {
251 return _vertexValenceTable;
252 }
253
254
255
257
263
266 float GetSingleCreasePatchSharpnessValue(PatchHandle const & handle) const;
267
270 float GetSingleCreasePatchSharpnessValue(int array, int patch) const;
272
273
275
281
283 PatchDescriptor GetVaryingPatchDescriptor() const;
284
286 ConstIndexArray GetPatchVaryingVertices(PatchHandle const & handle) const;
287
289 ConstIndexArray GetPatchVaryingVertices(int array, int patch) const;
290
292 ConstIndexArray GetPatchArrayVaryingVertices(int array) const;
293
295 ConstIndexArray GetVaryingVertices() const;
297
298
300
306
308 int GetNumFVarChannels() const;
309
311 PatchDescriptor GetFVarPatchDescriptorRegular(int channel = 0) const;
312
314 PatchDescriptor GetFVarPatchDescriptorIrregular(int channel = 0) const;
315
317 PatchDescriptor GetFVarPatchDescriptor(int channel = 0) const;
318
320 ConstIndexArray GetPatchFVarValues(PatchHandle const & handle, int channel = 0) const;
321
323 ConstIndexArray GetPatchFVarValues(int array, int patch, int channel = 0) const;
324
326 ConstIndexArray GetPatchArrayFVarValues(int array, int channel = 0) const;
327
329 ConstIndexArray GetFVarValues(int channel = 0) const;
330
332 int GetFVarValueStride(int channel = 0) const;
333
335 PatchParam GetPatchFVarPatchParam(PatchHandle const & handle, int channel = 0) const;
336
338 PatchParam GetPatchFVarPatchParam(int array, int patch, int channel = 0) const;
339
341 ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel = 0) const;
342
344 ConstPatchParamArray GetFVarPatchParams(int channel = 0) const;
345
347 Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel = 0) const;
349
350
352
357
358 typedef std::vector<Index> PatchVertsTable;
359
361 PatchVertsTable const & GetPatchControlVerticesTable() const { return _patchVerts; }
362
364 PatchParamTable const & GetPatchParamTable() const { return _paramTable; }
365
367 std::vector<Index> const &GetSharpnessIndexTable() const { return _sharpnessIndices; }
368
370 std::vector<float> const &GetSharpnessValues() const { return _sharpnessValues; }
371
372 typedef std::vector<unsigned int> QuadOffsetsTable;
373
375 QuadOffsetsTable const & GetQuadOffsetsTable() const {
376 return _quadOffsetsTable;
377 }
378
379
381 void print() const;
382
383public:
384
386
388
411 template <typename REAL>
412 void EvaluateBasis(PatchHandle const & handle, REAL u, REAL v,
413 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
414 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
415
418 void EvaluateBasis(PatchHandle const & handle, float u, float v,
419 float wP[], float wDu[] = 0, float wDv[] = 0,
420 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
421
424 void EvaluateBasis(PatchHandle const & handle, double u, double v,
425 double wP[], double wDu[] = 0, double wDv[] = 0,
426 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
427
450 template <typename REAL>
451 void EvaluateBasisVarying(PatchHandle const & handle, REAL u, REAL v,
452 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
453 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
454
457 void EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
458 float wP[], float wDu[] = 0, float wDv[] = 0,
459 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
460
463 void EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
464 double wP[], double wDu[] = 0, double wDv[] = 0,
465 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
466
491 template <typename REAL>
492 void EvaluateBasisFaceVarying(PatchHandle const & handle, REAL u, REAL v,
493 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
494 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0,
495 int channel = 0) const;
496
499 void EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
500 float wP[], float wDu[] = 0, float wDv[] = 0,
501 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0,
502 int channel = 0) const;
503
506 void EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
507 double wP[], double wDu[] = 0, double wDv[] = 0,
508 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0,
509 int channel = 0) const;
511
512protected:
513
514 friend class PatchTableBuilder;
515
516 // Factory constructor
517 PatchTable(int maxvalence);
518
519 Index getPatchIndex(int array, int patch) const;
520
521 PatchParamArray getPatchParams(int arrayIndex);
522
523 Index * getSharpnessIndices(Index arrayIndex);
524 float * getSharpnessValues(Index arrayIndex);
525
526private:
527
528 //
529 // Patch arrays
530 //
531 struct PatchArray {
532 PatchArray(PatchDescriptor d, int np, Index v, Index p, Index qo) :
533 desc(d), numPatches(np), vertIndex(v),
534 patchIndex(p), quadOffsetIndex (qo) { }
535
536 void print() const;
537
538 PatchDescriptor desc; // type of patches in the array
539
540 int numPatches; // number of patches in the array
541
542 Index vertIndex, // index to the first control vertex
543 patchIndex, // absolute index of the first patch in the array
544 quadOffsetIndex; // index of the first quad offset entry
545 };
546
547 typedef std::vector<PatchArray> PatchArrayVector;
548
549 PatchArray & getPatchArray(Index arrayIndex);
550 PatchArray const & getPatchArray(Index arrayIndex) const;
551
552 void reservePatchArrays(int numPatchArrays);
553 void pushPatchArray(PatchDescriptor desc, int npatches,
554 Index * vidx, Index * pidx, Index * qoidx=0);
555
556 IndexArray getPatchArrayVertices(int arrayIndex);
557
558 Index findPatchArray(PatchDescriptor desc);
559
560
561 //
562 // Varying patch arrays
563 //
564 IndexArray getPatchArrayVaryingVertices(int arrayIndex);
565
566 void allocateVaryingVertices(
567 PatchDescriptor desc, int numPatches);
568 void populateVaryingVertices();
569
570 //
571 // Face-varying patch channels
572 //
573
574 //
575 // FVarPatchChannel
576 //
577 // Stores a record for each patch in the primitive :
578 //
579 // - Each patch in the PatchTable has a corresponding patch in each
580 // face-varying patch channel. Patch vertex indices are sorted in the same
581 // patch-type order as PatchTable::PTables. Face-varying data for a patch
582 // can therefore be quickly accessed by using the patch primitive ID as
583 // index into patchValueOffsets to locate the face-varying control vertex
584 // indices.
585 //
586 // - Face-varying channels can have a different interpolation modes
587 //
588 // - Unlike "vertex" patches, there are no transition masks required
589 // for face-varying patches.
590 //
591 // - Face-varying patches still require boundary edge masks.
592 //
593 // - currently most patches with sharp boundaries but smooth interiors have
594 // to be isolated to level 10 : we need a special type of bicubic patch
595 // similar to single-crease to resolve this condition without requiring
596 // isolation if possible
597 //
598 struct FVarPatchChannel {
599 Sdc::Options::FVarLinearInterpolation interpolation;
600
601 PatchDescriptor regDesc;
602 PatchDescriptor irregDesc;
603
604 int stride;
605
606 std::vector<Index> patchValues;
607 std::vector<PatchParam> patchParam;
608 };
609 typedef std::vector<FVarPatchChannel> FVarPatchChannelVector;
610
611 FVarPatchChannel & getFVarPatchChannel(int channel);
612 FVarPatchChannel const & getFVarPatchChannel(int channel) const;
613
614 void allocateFVarPatchChannels(int numChannels);
615 void allocateFVarPatchChannelValues(
616 PatchDescriptor regDesc, PatchDescriptor irregDesc,
617 int numPatches, int channel);
618
619 // deprecated
620 void setFVarPatchChannelLinearInterpolation(
621 Sdc::Options::FVarLinearInterpolation interpolation, int channel);
622
623 IndexArray getFVarValues(int channel);
624 ConstIndexArray getPatchFVarValues(int patch, int channel) const;
625
626 PatchParamArray getFVarPatchParams(int channel);
627 PatchParam getPatchFVarPatchParam(int patch, int channel) const;
628
629private:
630 //
631 // Simple private class to hold stencil table pointers of varying precision,
632 // where the discriminant of the precision is external.
633 //
634 // NOTE that this is a simple pointer container and NOT a smart pointer that
635 // manages the ownership of the object referred to by it.
636 //
637 class StencilTablePtr {
638 private:
639 typedef StencilTableReal<float> float_type;
640 typedef StencilTableReal<double> double_type;
641
642 union {
643 float_type * _fPtr;
644 double_type * _dPtr;
645 };
646
647 public:
648 StencilTablePtr() { _fPtr = 0; }
649 StencilTablePtr(float_type * ptr) { _fPtr = ptr; }
650 StencilTablePtr(double_type * ptr) { _dPtr = ptr; }
651
652 operator bool() const { return _fPtr != 0; }
653
654 void Set() { _fPtr = 0; }
655 void Set(float_type * ptr) { _fPtr = ptr; }
656 void Set(double_type * ptr) { _dPtr = ptr; }
657
658 template <typename REAL> StencilTableReal<REAL> * Get() const;
659 };
660
661private:
662
663 //
664 // Topology
665 //
666
667 int _maxValence, // highest vertex valence found in the mesh
668 _numPtexFaces; // total number of ptex faces
669
670 PatchArrayVector _patchArrays; // Vector of descriptors for arrays of patches
671
672 std::vector<Index> _patchVerts; // Indices of the control vertices of the patches
673
674 PatchParamTable _paramTable; // PatchParam bitfields (one per patch)
675
676 //
677 // Extraordinary vertex closed-form evaluation / endcap basis conversion
678 //
679 // XXXtakahito: these data will probably be replaced with mask coefficient or something
680 // SchemeWorker populates.
681 //
682 QuadOffsetsTable _quadOffsetsTable; // Quad offsets (for Gregory patches)
683 VertexValenceTable _vertexValenceTable; // Vertex valence table (for Gregory patches)
684
685 StencilTablePtr _localPointStencils; // local point conversion stencils
686 StencilTablePtr _localPointVaryingStencils; // local point varying stencils
687
688 //
689 // Varying data
690 //
691 PatchDescriptor _varyingDesc;
692
693 std::vector<Index> _varyingVerts;
694
695 //
696 // Face-varying data
697 //
698 FVarPatchChannelVector _fvarChannels;
699
700 std::vector<StencilTablePtr> _localPointFaceVaryingStencils;
701
702 //
703 // 'single-crease' patch sharpness tables
704 //
705 std::vector<Index> _sharpnessIndices; // Indices of single-crease sharpness (one per patch)
706 std::vector<float> _sharpnessValues; // Sharpness values.
707
708 //
709 // Construction history -- relevant to at least one public query:
710 //
711 unsigned int _isUniformLinear : 1;
712
713 //
714 // Precision -- only applies to local-point stencil tables
715 //
716 unsigned int _vertexPrecisionIsDouble : 1;
717 unsigned int _varyingPrecisionIsDouble : 1;
718 unsigned int _faceVaryingPrecisionIsDouble : 1;
719};
720
721
722//
723// Template specializations for float/double -- to be defined before used:
724//
725template <> inline StencilTableReal<float> *
726PatchTable::StencilTablePtr::Get<float>() const { return _fPtr; }
727
728template <> inline StencilTableReal<double> *
729PatchTable::StencilTablePtr::Get<double>() const { return _dPtr; }
730
731 template <> inline bool
732 PatchTable::LocalPointStencilPrecisionMatchesType<float>() const {
733 return !_vertexPrecisionIsDouble;
734}
735 template <> inline bool
736 PatchTable::LocalPointVaryingStencilPrecisionMatchesType<float>() const {
737 return !_varyingPrecisionIsDouble;
738}
739 template <> inline bool
740 PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<float>() const {
741 return !_faceVaryingPrecisionIsDouble;
742}
743
744 template <> inline bool
745 PatchTable::LocalPointStencilPrecisionMatchesType<double>() const {
746 return _vertexPrecisionIsDouble;
747}
748 template <> inline bool
749 PatchTable::LocalPointVaryingStencilPrecisionMatchesType<double>() const {
750 return _varyingPrecisionIsDouble;
751}
752 template <> inline bool
753 PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<double>() const {
754 return _faceVaryingPrecisionIsDouble;
755}
756
757//
758// StencilTable access -- backward compatible and generic:
759//
760inline StencilTable const *
761PatchTable::GetLocalPointStencilTable() const {
762 assert(LocalPointStencilPrecisionMatchesType<float>());
763 return reinterpret_cast<StencilTable const *>(_localPointStencils.Get<float>());
764}
765inline StencilTable const *
766PatchTable::GetLocalPointVaryingStencilTable() const {
767 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
768 return reinterpret_cast<StencilTable const *>(
769 _localPointVaryingStencils.Get<float>());
770}
771inline StencilTable const *
772PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const {
773 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
774 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
775 return reinterpret_cast<StencilTable const *>(
776 _localPointFaceVaryingStencils[channel].Get<float>());
777 }
778 return NULL;
779}
780
781template <typename REAL>
782inline StencilTableReal<REAL> const *
783 PatchTable::GetLocalPointStencilTable() const {
784 assert(LocalPointStencilPrecisionMatchesType<REAL>());
785 return _localPointStencils.Get<REAL>();
786}
787template <typename REAL>
788inline StencilTableReal<REAL> const *
789 PatchTable::GetLocalPointVaryingStencilTable() const {
790 assert(LocalPointVaryingStencilPrecisionMatchesType<REAL>());
791 return _localPointVaryingStencils.Get<REAL>();
792}
793template <typename REAL>
794inline StencilTableReal<REAL> const *
795 PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const {
796 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<REAL>());
797 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
798 return _localPointFaceVaryingStencils[channel].Get<REAL>();
799 }
800 return NULL;
801}
802
803
804//
805// Computation of local point values:
806//
807template <class T>
808inline void
809PatchTable::ComputeLocalPointValues(T const *src, T *dst) const {
810 assert(LocalPointStencilPrecisionMatchesType<float>());
811 if (_localPointStencils) {
812 _localPointStencils.Get<float>()->UpdateValues(src, dst);
813 }
814}
815
816template <class T>
817inline void
818PatchTable::ComputeLocalPointValuesVarying(T const *src, T *dst) const {
819 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
820 if (_localPointVaryingStencils) {
821 _localPointVaryingStencils.Get<float>()->UpdateValues(src, dst);
822 }
823}
824
825template <class T>
826inline void
827PatchTable::ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel) const {
828 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
829 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
830 if (_localPointFaceVaryingStencils[channel]) {
831 _localPointFaceVaryingStencils[channel].Get<float>()->UpdateValues(src, dst);
832 }
833 }
834}
835
836
837//
838// Basis evaluation overloads
839//
840inline void
841 PatchTable::EvaluateBasis(PatchHandle const & handle, float u, float v,
842 float wP[], float wDu[], float wDv[],
843 float wDuu[], float wDuv[], float wDvv[]) const {
844
845 EvaluateBasis<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
846}
847inline void
848 PatchTable::EvaluateBasis(PatchHandle const & handle, double u, double v,
849 double wP[], double wDu[], double wDv[],
850 double wDuu[], double wDuv[], double wDvv[]) const {
851
852 EvaluateBasis<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
853}
854
855inline void
856 PatchTable::EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
857 float wP[], float wDu[], float wDv[],
858 float wDuu[], float wDuv[], float wDvv[]) const {
859
860 EvaluateBasisVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
861}
862inline void
863 PatchTable::EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
864 double wP[], double wDu[], double wDv[],
865 double wDuu[], double wDuv[], double wDvv[]) const {
866
867 EvaluateBasisVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
868}
869
870inline void
871 PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
872 float wP[], float wDu[], float wDv[],
873 float wDuu[], float wDuv[], float wDvv[], int channel) const {
874
875 EvaluateBasisFaceVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
876}
877inline void
878 PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
879 double wP[], double wDu[], double wDv[],
880 double wDuu[], double wDuv[], double wDvv[], int channel) const {
881
882 EvaluateBasisFaceVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
883}
884
885} // end namespace Far
886
887} // end namespace OPENSUBDIV_VERSION
888using namespace OPENSUBDIV_VERSION;
889
890} // end namespace OpenSubdiv
891
892#endif /* OPENSUBDIV3_FAR_PATCH_TABLE */
options.h
patchParam.h
patchDescriptor.h
stencilTable.h
OpenSubdiv
Definition limits.h:15
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:16
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition refinerSurfaceFactory.h:19
OpenSubdiv::OPENSUBDIV_VERSION::Far::ConstPatchParamArray
Vtr::ConstArray< PatchParam > ConstPatchParamArray
Definition patchParam.h:229
OpenSubdiv::OPENSUBDIV_VERSION::Far::ConstIndexArray
Vtr::ConstIndexArray ConstIndexArray
Definition types.h:30
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParamTable
std::vector< PatchParam > PatchParamTable
Definition patchParam.h:226
OpenSubdiv::OPENSUBDIV_VERSION::Far::IndexArray
Vtr::IndexArray IndexArray
Definition types.h:27
OpenSubdiv::OPENSUBDIV_VERSION::Far::Index
Vtr::Index Index
Definition types.h:24
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParamArray
Vtr::Array< PatchParam > PatchParamArray
Definition patchParam.h:228
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor
Describes the type of a patch.
Definition patchDescriptor.h:27
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParam
Patch parameterization.
Definition patchParam.h:135
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:361
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:827
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:818
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:75
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:761
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:370
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::VertexValenceTable
std::vector< Index > VertexValenceTable
Definition patchTable.h:247
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:364
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVertexValenceTable
VertexValenceTable const & GetVertexValenceTable() const
Returns the 'VertexValences' table (vertex neighborhoods table).
Definition patchTable.h:250
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:772
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:809
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:358
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetQuadOffsetsTable
QuadOffsetsTable const & GetQuadOffsetsTable() const
Returns the quad-offsets table.
Definition patchTable.h:375
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:67
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:78
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:242
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:367
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:514
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:766
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::QuadOffsetsTable
std::vector< unsigned int > QuadOffsetsTable
Definition patchTable.h:372
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:43
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::patchIndex
Index patchIndex
Definition patchTable.h:51
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::arrayIndex
Index arrayIndex
Definition patchTable.h:50
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::vertIndex
Index vertIndex
Definition patchTable.h:52
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::PatchTable
friend class PatchTable
Definition patchTable.h:47
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::PatchMap
friend class PatchMap
Definition patchTable.h:48
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableReal
Table of subdivision stencils.
Definition stencilTable.h:124
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable
Stencil table class wrapping the template for compatibility.
Definition stencilTable.h:256
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation
FVarLinearInterpolation
Definition options.h:43
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray
Definition array.h:36