OpenSubdiv
Loading...
Searching...
No Matches
stencilTable.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_STENCILTABLE_H
9#define OPENSUBDIV3_FAR_STENCILTABLE_H
10
11#include "../version.h"
12
13#include "../far/types.h"
14
15#include <cassert>
16#include <cstring>
17#include <vector>
18#include <iostream>
19
20namespace OpenSubdiv {
21namespace OPENSUBDIV_VERSION {
22
23namespace Far {
24
25// Forward declarations for friends:
26class PatchTableBuilder;
27
28template <typename REAL> class StencilTableFactoryReal;
29template <typename REAL> class LimitStencilTableFactoryReal;
30
35template <typename REAL>
36class StencilReal {
37public:
38
41
50 StencilReal(int * size, Index * indices, REAL * weights)
51 : _size(size), _indices(indices), _weights(weights) { }
52
54 StencilReal(StencilReal const & other) {
55 _size = other._size;
56 _indices = other._indices;
57 _weights = other._weights;
58 }
59
61 int GetSize() const {
62 return *_size;
63 }
64
66 int * GetSizePtr() const {
67 return _size;
68 }
69
71 Index const * GetVertexIndices() const {
72 return _indices;
73 }
74
76 REAL const * GetWeights() const {
77 return _weights;
78 }
79
81 void Next() {
82 int stride = *_size;
83 ++_size;
84 _indices += stride;
85 _weights += stride;
86 }
87
88protected:
89 friend class StencilTableFactoryReal<REAL>;
90 friend class LimitStencilTableFactoryReal<REAL>;
91
92 int * _size;
94 REAL * _weights;
95};
96
99class Stencil : public StencilReal<float> {
100protected:
102
103public:
105 Stencil(BaseStencil const & other) : BaseStencil(other) { }
106 Stencil(int * size, Index * indices, float * weights)
107 : BaseStencil(size, indices, weights) { }
108};
109
110
123template <typename REAL>
124class StencilTableReal {
125protected:
126 StencilTableReal(int numControlVerts,
127 std::vector<int> const& offsets,
128 std::vector<int> const& sizes,
129 std::vector<int> const& sources,
130 std::vector<REAL> const& weights,
131 bool includeCoarseVerts,
132 size_t firstOffset);
133
134public:
135
136 virtual ~StencilTableReal() {};
137
139 int GetNumStencils() const {
140 return (int)_sizes.size();
141 }
142
145 return _numControlVertices;
146 }
147
150
152 std::vector<int> const & GetSizes() const {
153 return _sizes;
154 }
155
157 std::vector<Index> const & GetOffsets() const {
158 return _offsets;
159 }
160
162 std::vector<Index> const & GetControlIndices() const {
163 return _indices;
164 }
165
167 std::vector<REAL> const & GetWeights() const {
168 return _weights;
169 }
170
173
187 template <class T, class U>
188 void UpdateValues(T const &srcValues, U &dstValues, Index start=-1, Index end=-1) const {
189 this->update(srcValues, dstValues, _weights, start, end);
190 }
191
192 template <class T1, class T2, class U>
193 void UpdateValues(T1 const &srcBase, int numBase, T2 const &srcRef,
194 U &dstValues, Index start=-1, Index end=-1) const {
195 this->update(srcBase, numBase, srcRef, dstValues, _weights, start, end);
196 }
197
198 // Pointer interface for backward compatibility
199 template <class T, class U>
200 void UpdateValues(T const *src, U *dst, Index start=-1, Index end=-1) const {
201 this->update(src, dst, _weights, start, end);
202 }
203 template <class T1, class T2, class U>
204 void UpdateValues(T1 const *srcBase, int numBase, T2 const *srcRef,
205 U *dst, Index start=-1, Index end=-1) const {
206 this->update(srcBase, numBase, srcRef, dst, _weights, start, end);
207 }
208
210 void Clear();
211
212protected:
213
214 // Update values by applying cached stencil weights to new control values
215 template <class T, class U>
216 void update( T const &srcValues, U &dstValues,
217 std::vector<REAL> const & valueWeights, Index start, Index end) const;
218 template <class T1, class T2, class U>
219 void update( T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues,
220 std::vector<REAL> const & valueWeights, Index start, Index end) const;
221
222 // Populate the offsets table from the stencil sizes in _sizes (factory helper)
224
225 // Resize the table arrays (factory helper)
226 void resize(int nstencils, int nelems);
227
228 // Reserves the table arrays (factory helper)
229 void reserve(int nstencils, int nelems);
230
231 // Reallocates the table arrays to remove excess capacity (factory helper)
233
234 // Performs any final operations on internal tables (factory helper)
235 void finalize();
236
237protected:
239 StencilTableReal(int numControlVerts)
240 : _numControlVertices(numControlVerts)
241 { }
242
243 friend class StencilTableFactoryReal<REAL>;
245
246 int _numControlVertices; // number of control vertices
247
248 std::vector<int> _sizes; // number of coefficients for each stencil
249 std::vector<Index> _offsets, // offset to the start of each stencil
250 _indices; // indices of contributing coarse vertices
251 std::vector<REAL> _weights; // stencil weight coefficients
252};
253
256class StencilTable : public StencilTableReal<float> {
257protected:
259
260public:
261 Stencil GetStencil(Index index) const {
262 return Stencil(BaseTable::GetStencil(index));
263 }
264 Stencil operator[] (Index index) const {
265 return Stencil(BaseTable::GetStencil(index));
266 }
267
268protected:
270 StencilTable(int numControlVerts) : BaseTable(numControlVerts) { }
271 StencilTable(int numControlVerts,
272 std::vector<int> const& offsets,
273 std::vector<int> const& sizes,
274 std::vector<int> const& sources,
275 std::vector<float> const& weights,
276 bool includeCoarseVerts,
277 size_t firstOffset)
278 : BaseTable(numControlVerts, offsets,
279 sizes, sources, weights, includeCoarseVerts, firstOffset) { }
280};
281
282
285template <typename REAL>
286class LimitStencilReal : public StencilReal<REAL> {
287public:
288
308 Index * indices,
309 REAL * weights,
310 REAL * duWeights=0,
311 REAL * dvWeights=0,
312 REAL * duuWeights=0,
313 REAL * duvWeights=0,
314 REAL * dvvWeights=0)
315 : StencilReal<REAL>(size, indices, weights),
316 _duWeights(duWeights),
317 _dvWeights(dvWeights),
318 _duuWeights(duuWeights),
319 _duvWeights(duvWeights),
320 _dvvWeights(dvvWeights) {
321 }
322
324 REAL const * GetDuWeights() const {
325 return _duWeights;
326 }
327
329 REAL const * GetDvWeights() const {
330 return _dvWeights;
331 }
332
334 REAL const * GetDuuWeights() const {
335 return _duuWeights;
336 }
337
339 REAL const * GetDuvWeights() const {
340 return _duvWeights;
341 }
342
344 REAL const * GetDvvWeights() const {
345 return _dvvWeights;
346 }
347
349 void Next() {
350 int stride = *this->_size;
351 ++this->_size;
352 this->_indices += stride;
353 this->_weights += stride;
354 if (_duWeights) _duWeights += stride;
355 if (_dvWeights) _dvWeights += stride;
356 if (_duuWeights) _duuWeights += stride;
357 if (_duvWeights) _duvWeights += stride;
358 if (_dvvWeights) _dvvWeights += stride;
359 }
360
361private:
362
363 friend class StencilTableFactoryReal<REAL>;
364 friend class LimitStencilTableFactoryReal<REAL>;
365
366 REAL * _duWeights, // pointer to stencil u derivative limit weights
367 * _dvWeights, // pointer to stencil v derivative limit weights
368 * _duuWeights, // pointer to stencil uu derivative limit weights
369 * _duvWeights, // pointer to stencil uv derivative limit weights
370 * _dvvWeights; // pointer to stencil vv derivative limit weights
371};
372
375class LimitStencil : public LimitStencilReal<float> {
376protected:
378
379public:
380 LimitStencil(BaseStencil const & other) : BaseStencil(other) { }
381 LimitStencil(int* size, Index * indices, float * weights,
382 float * duWeights=0, float * dvWeights=0,
383 float * duuWeights=0, float * duvWeights=0, float * dvvWeights=0)
384 : BaseStencil(size, indices, weights,
385 duWeights, dvWeights, duuWeights, duvWeights, dvvWeights) { }
386};
387
388
391template <typename REAL>
392class LimitStencilTableReal : public StencilTableReal<REAL> {
393protected:
395 int numControlVerts,
396 std::vector<int> const& offsets,
397 std::vector<int> const& sizes,
398 std::vector<int> const& sources,
399 std::vector<REAL> const& weights,
400 std::vector<REAL> const& duWeights,
401 std::vector<REAL> const& dvWeights,
402 std::vector<REAL> const& duuWeights,
403 std::vector<REAL> const& duvWeights,
404 std::vector<REAL> const& dvvWeights,
405 bool includeCoarseVerts,
406 size_t firstOffset);
407
408public:
409
412
415
417 std::vector<REAL> const & GetDuWeights() const {
418 return _duWeights;
419 }
420
422 std::vector<REAL> const & GetDvWeights() const {
423 return _dvWeights;
424 }
425
427 std::vector<REAL> const & GetDuuWeights() const {
428 return _duuWeights;
429 }
430
432 std::vector<REAL> const & GetDuvWeights() const {
433 return _duvWeights;
434 }
435
437 std::vector<REAL> const & GetDvvWeights() const {
438 return _dvvWeights;
439 }
440
458 template <class T, class U>
459 void UpdateDerivs(T const & srcValues, U & uderivs, U & vderivs,
460 int start=-1, int end=-1) const {
461
462 this->update(srcValues, uderivs, _duWeights, start, end);
463 this->update(srcValues, vderivs, _dvWeights, start, end);
464 }
465
466 template <class T1, class T2, class U>
467 void UpdateDerivs(T1 const & srcBase, int numBase, T2 const & srcRef,
468 U & uderivs, U & vderivs, int start=-1, int end=-1) const {
469
470 this->update(srcBase, numBase, srcRef, uderivs, _duWeights, start, end);
471 this->update(srcBase, numBase, srcRef, vderivs, _dvWeights, start, end);
472 }
473
474 // Pointer interface for backward compatibility
475 template <class T, class U>
476 void UpdateDerivs(T const *src, U *uderivs, U *vderivs,
477 int start=-1, int end=-1) const {
478
479 this->update(src, uderivs, _duWeights, start, end);
480 this->update(src, vderivs, _dvWeights, start, end);
481 }
482 template <class T1, class T2, class U>
483 void UpdateDerivs(T1 const *srcBase, int numBase, T2 const *srcRef,
484 U *uderivs, U *vderivs, int start=-1, int end=-1) const {
485
486 this->update(srcBase, numBase, srcRef, uderivs, _duWeights, start, end);
487 this->update(srcBase, numBase, srcRef, vderivs, _dvWeights, start, end);
488 }
489
510 template <class T, class U>
511 void Update2ndDerivs(T const & srcValues,
512 U & uuderivs, U & uvderivs, U & vvderivs,
513 int start=-1, int end=-1) const {
514
515 this->update(srcValues, uuderivs, _duuWeights, start, end);
516 this->update(srcValues, uvderivs, _duvWeights, start, end);
517 this->update(srcValues, vvderivs, _dvvWeights, start, end);
518 }
519
520 template <class T1, class T2, class U>
521 void Update2ndDerivs(T1 const & srcBase, int numBase, T2 const & srcRef,
522 U & uuderivs, U & uvderivs, U & vvderivs, int start=-1, int end=-1) const {
523
524 this->update(srcBase, numBase, srcRef, uuderivs, _duuWeights, start, end);
525 this->update(srcBase, numBase, srcRef, uvderivs, _duvWeights, start, end);
526 this->update(srcBase, numBase, srcRef, vvderivs, _dvvWeights, start, end);
527 }
528
529 // Pointer interface for backward compatibility
530 template <class T, class U>
531 void Update2ndDerivs(T const *src, T *uuderivs, U *uvderivs, U *vvderivs,
532 int start=-1, int end=-1) const {
533
534 this->update(src, uuderivs, _duuWeights, start, end);
535 this->update(src, uvderivs, _duvWeights, start, end);
536 this->update(src, vvderivs, _dvvWeights, start, end);
537 }
538 template <class T1, class T2, class U>
539 void Update2ndDerivs(T1 const *srcBase, int numBase, T2 const *srcRef,
540 U *uuderivs, U *uvderivs, U *vvderivs, int start=-1, int end=-1) const {
541
542 this->update(srcBase, numBase, srcRef, uuderivs, _duuWeights, start, end);
543 this->update(srcBase, numBase, srcRef, uvderivs, _duvWeights, start, end);
544 this->update(srcBase, numBase, srcRef, vvderivs, _dvvWeights, start, end);
545 }
546
548 void Clear();
549
550private:
551 friend class LimitStencilTableFactoryReal<REAL>;
552
553 // Resize the table arrays (factory helper)
554 void resize(int nstencils, int nelems);
555
556private:
557 std::vector<REAL> _duWeights, // u derivative limit stencil weights
558 _dvWeights, // v derivative limit stencil weights
559 _duuWeights, // uu derivative limit stencil weights
560 _duvWeights, // uv derivative limit stencil weights
561 _dvvWeights; // vv derivative limit stencil weights
562};
563
567protected:
569
570public:
576 }
577
578protected:
579 LimitStencilTable(int numControlVerts,
580 std::vector<int> const& offsets,
581 std::vector<int> const& sizes,
582 std::vector<int> const& sources,
583 std::vector<float> const& weights,
584 std::vector<float> const& duWeights,
585 std::vector<float> const& dvWeights,
586 std::vector<float> const& duuWeights,
587 std::vector<float> const& duvWeights,
588 std::vector<float> const& dvvWeights,
589 bool includeCoarseVerts,
590 size_t firstOffset)
591 : BaseTable(numControlVerts,
592 offsets, sizes, sources, weights,
593 duWeights, dvWeights, duuWeights, duvWeights, dvvWeights,
594 includeCoarseVerts, firstOffset) { }
595};
596
597
598// Update values by applying cached stencil weights to new control values
599template <typename REAL>
600template <class T1, class T2, class U> void
601StencilTableReal<REAL>::update(T1 const &srcBase, int numBase,
602 T2 const &srcRef, U &dstValues,
603 std::vector<REAL> const &valueWeights, Index start, Index end) const {
604
605 int const * sizes = &_sizes.at(0);
606 Index const * indices = &_indices.at(0);
607 REAL const * weights = &valueWeights.at(0);
608
609 if (start > 0) {
610 assert(start < (Index)_offsets.size());
611 sizes += start;
612 indices += _offsets[start];
613 weights += _offsets[start];
614 } else {
615 start = 0;
616 }
617
618 int nstencils = ((end < start) ? GetNumStencils() : end) - start;
619
620 for (int i = 0; i < nstencils; ++i, ++sizes) {
621 dstValues[start + i].Clear();
622 for (int j = 0; j < *sizes; ++j, ++indices, ++weights) {
623 if (*indices < numBase) {
624 dstValues[start + i].AddWithWeight(srcBase[*indices], *weights);
625 } else {
626 dstValues[start + i].AddWithWeight(srcRef[*indices - numBase], *weights);
627 }
628 }
629 }
630}
631template <typename REAL>
632template <class T, class U> void
633StencilTableReal<REAL>::update(T const &srcValues, U &dstValues,
634 std::vector<REAL> const &valueWeights, Index start, Index end) const {
635
636 int const * sizes = &_sizes.at(0);
637 Index const * indices = &_indices.at(0);
638 REAL const * weights = &valueWeights.at(0);
639
640 if (start > 0) {
641 assert(start < (Index)_offsets.size());
642 sizes += start;
643 indices += _offsets[start];
644 weights += _offsets[start];
645 } else {
646 start = 0;
647 }
648
649 int nstencils = ((end < start) ? GetNumStencils() : end) - start;
650
651 for (int i = 0; i < nstencils; ++i, ++sizes) {
652 dstValues[start + i].Clear();
653 for (int j = 0; j < *sizes; ++j, ++indices, ++weights) {
654 dstValues[start + i].AddWithWeight(srcValues[*indices], *weights);
655 }
656 }
657}
658
659template <typename REAL>
660inline void
662 Index offset=0;
663 int noffsets = (int)_sizes.size();
664 _offsets.resize(noffsets);
665 for (int i=0; i<(int)_sizes.size(); ++i ) {
666 _offsets[i]=offset;
667 offset+=_sizes[i];
668 }
669}
670
671template <typename REAL>
672inline void
673StencilTableReal<REAL>::resize(int nstencils, int nelems) {
674 _sizes.resize(nstencils);
675 _indices.resize(nelems);
676 _weights.resize(nelems);
677}
678
679template <typename REAL>
680inline void
681StencilTableReal<REAL>::reserve(int nstencils, int nelems) {
682 _sizes.reserve(nstencils);
683 _indices.reserve(nelems);
684 _weights.reserve(nelems);
685}
686
687template <typename REAL>
688inline void
690 std::vector<int>(_sizes).swap(_sizes);
691 std::vector<Index>(_indices).swap(_indices);
692 std::vector<REAL>(_weights).swap(_weights);
693}
694
695template <typename REAL>
696inline void
698 shrinkToFit();
699 generateOffsets();
700}
701
702// Returns a Stencil at index i in the table
703template <typename REAL>
706 assert((! _offsets.empty()) && i<(int)_offsets.size());
707
708 Index ofs = _offsets[i];
709
710 return StencilReal<REAL>(const_cast<int*>(&_sizes[i]),
711 const_cast<Index*>(&_indices[ofs]),
712 const_cast<REAL*>(&_weights[ofs]));
713}
714
715template <typename REAL>
718 return GetStencil(index);
719}
720
721template <typename REAL>
722inline void
723LimitStencilTableReal<REAL>::resize(int nstencils, int nelems) {
724 StencilTableReal<REAL>::resize(nstencils, nelems);
725 _duWeights.resize(nelems);
726 _dvWeights.resize(nelems);
727}
728
729// Returns a LimitStencil at index i in the table
730template <typename REAL>
731inline LimitStencilReal<REAL>
733 assert((! this->GetOffsets().empty()) && i<(int)this->GetOffsets().size());
734
735 Index ofs = this->GetOffsets()[i];
736
737 if (!_duWeights.empty() && !_dvWeights.empty() &&
738 !_duuWeights.empty() && !_duvWeights.empty() && !_dvvWeights.empty()) {
740 const_cast<int *>(&this->GetSizes()[i]),
741 const_cast<Index *>(&this->GetControlIndices()[ofs]),
742 const_cast<REAL *>(&this->GetWeights()[ofs]),
743 const_cast<REAL *>(&GetDuWeights()[ofs]),
744 const_cast<REAL *>(&GetDvWeights()[ofs]),
745 const_cast<REAL *>(&GetDuuWeights()[ofs]),
746 const_cast<REAL *>(&GetDuvWeights()[ofs]),
747 const_cast<REAL *>(&GetDvvWeights()[ofs]) );
748 } else if (!_duWeights.empty() && !_dvWeights.empty()) {
750 const_cast<int *>(&this->GetSizes()[i]),
751 const_cast<Index *>(&this->GetControlIndices()[ofs]),
752 const_cast<REAL *>(&this->GetWeights()[ofs]),
753 const_cast<REAL *>(&GetDuWeights()[ofs]),
754 const_cast<REAL *>(&GetDvWeights()[ofs]) );
755 } else {
757 const_cast<int *>(&this->GetSizes()[i]),
758 const_cast<Index *>(&this->GetControlIndices()[ofs]),
759 const_cast<REAL *>(&this->GetWeights()[ofs]) );
760 }
761}
762
763template <typename REAL>
766 return GetLimitStencil(index);
767}
768
769} // end namespace Far
770
771} // end namespace OPENSUBDIV_VERSION
772using namespace OPENSUBDIV_VERSION;
773
774} // end namespace OpenSubdiv
775
776#endif // OPENSUBDIV3_FAR_STENCILTABLE_H
StencilReal(int *size, Index *indices, REAL *weights)
Constructor.
void Next()
Advance to the next stencil in the table.
StencilReal(StencilReal const &other)
Copy constructor.
Index const * GetVertexIndices() const
Returns the control vertices' indices.
int GetSize() const
Returns the size of the stencil.
int * GetSizePtr() const
Returns the size of the stencil as a pointer.
REAL const * GetWeights() const
Returns the interpolation weights.
Vertex stencil class wrapping the template for compatibility.
Stencil(int *size, Index *indices, float *weights)
int GetNumControlVertices() const
Returns the number of control vertices indexed in the table.
void update(T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues, std::vector< REAL > const &valueWeights, Index start, Index end) const
void UpdateValues(T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues, Index start=-1, Index end=-1) const
std::vector< Index > const & GetControlIndices() const
Returns the indices of the control vertices.
StencilReal< REAL > operator[](Index index) const
Returns the stencil at index i in the table.
void update(T const &srcValues, U &dstValues, std::vector< REAL > const &valueWeights, Index start, Index end) const
std::vector< int > const & GetSizes() const
Returns the number of control vertices of each stencil in the table.
int GetNumStencils() const
Returns the number of stencils in the table.
std::vector< Index > const & GetOffsets() const
Returns the offset to a given stencil (factory may leave empty)
StencilReal< REAL > GetStencil(Index i) const
Returns a Stencil at index i in the table.
void Clear()
Clears the stencils from the table.
std::vector< REAL > const & GetWeights() const
Returns the stencil interpolation weights.
void UpdateValues(T1 const *srcBase, int numBase, T2 const *srcRef, U *dst, Index start=-1, Index end=-1) const
StencilTableReal(int numControlVerts, std::vector< int > const &offsets, std::vector< int > const &sizes, std::vector< int > const &sources, std::vector< REAL > const &weights, bool includeCoarseVerts, size_t firstOffset)
void UpdateValues(T const *src, U *dst, Index start=-1, Index end=-1) const
void UpdateValues(T const &srcValues, U &dstValues, Index start=-1, Index end=-1) const
Updates point values based on the control values.
Stencil table class wrapping the template for compatibility.
StencilTable(int numControlVerts, std::vector< int > const &offsets, std::vector< int > const &sizes, std::vector< int > const &sources, std::vector< float > const &weights, bool includeCoarseVerts, size_t firstOffset)
REAL const * GetDuvWeights() const
Returns the uv derivative weights.
REAL const * GetDvWeights() const
Returns the v derivative weights.
void Next()
Advance to the next stencil in the table.
REAL const * GetDvvWeights() const
Returns the vv derivative weights.
LimitStencilReal(int *size, Index *indices, REAL *weights, REAL *duWeights=0, REAL *dvWeights=0, REAL *duuWeights=0, REAL *duvWeights=0, REAL *dvvWeights=0)
Constructor.
REAL const * GetDuWeights() const
Returns the u derivative weights.
REAL const * GetDuuWeights() const
Returns the uu derivative weights.
Limit point stencil class wrapping the template for compatibility.
LimitStencil(int *size, Index *indices, float *weights, float *duWeights=0, float *dvWeights=0, float *duuWeights=0, float *duvWeights=0, float *dvvWeights=0)
std::vector< REAL > const & GetDuuWeights() const
Returns the 'uu' derivative stencil interpolation weights.
LimitStencilReal< REAL > operator[](Index index) const
Returns the limit stencil at index i in the table.
std::vector< REAL > const & GetDvvWeights() const
Returns the 'vv' derivative stencil interpolation weights.
void UpdateDerivs(T const *src, U *uderivs, U *vderivs, int start=-1, int end=-1) const
void Update2ndDerivs(T const *src, T *uuderivs, U *uvderivs, U *vvderivs, int start=-1, int end=-1) const
std::vector< REAL > const & GetDvWeights() const
Returns the 'v' derivative stencil interpolation weights.
void Update2ndDerivs(T1 const *srcBase, int numBase, T2 const *srcRef, U *uuderivs, U *uvderivs, U *vvderivs, int start=-1, int end=-1) const
void UpdateDerivs(T const &srcValues, U &uderivs, U &vderivs, int start=-1, int end=-1) const
Updates derivative values based on the control values.
LimitStencilReal< REAL > GetLimitStencil(Index i) const
Returns a LimitStencil at index i in the table.
LimitStencilTableReal(int numControlVerts, std::vector< int > const &offsets, std::vector< int > const &sizes, std::vector< int > const &sources, std::vector< REAL > const &weights, std::vector< REAL > const &duWeights, std::vector< REAL > const &dvWeights, std::vector< REAL > const &duuWeights, std::vector< REAL > const &duvWeights, std::vector< REAL > const &dvvWeights, bool includeCoarseVerts, size_t firstOffset)
void Update2ndDerivs(T const &srcValues, U &uuderivs, U &uvderivs, U &vvderivs, int start=-1, int end=-1) const
Updates 2nd derivative values based on the control values.
std::vector< REAL > const & GetDuWeights() const
Returns the 'u' derivative stencil interpolation weights.
void Clear()
Clears the stencils from the table.
void Update2ndDerivs(T1 const &srcBase, int numBase, T2 const &srcRef, U &uuderivs, U &uvderivs, U &vvderivs, int start=-1, int end=-1) const
std::vector< REAL > const & GetDuvWeights() const
Returns the 'uv' derivative stencil interpolation weights.
void UpdateDerivs(T1 const &srcBase, int numBase, T2 const &srcRef, U &uderivs, U &vderivs, int start=-1, int end=-1) const
void UpdateDerivs(T1 const *srcBase, int numBase, T2 const *srcRef, U *uderivs, U *vderivs, int start=-1, int end=-1) const
Limit stencil table class wrapping the template for compatibility.
LimitStencilTable(int numControlVerts, std::vector< int > const &offsets, std::vector< int > const &sizes, std::vector< int > const &sources, std::vector< float > const &weights, std::vector< float > const &duWeights, std::vector< float > const &dvWeights, std::vector< float > const &duuWeights, std::vector< float > const &duvWeights, std::vector< float > const &dvvWeights, bool includeCoarseVerts, size_t firstOffset)