OpenSubdiv
Loading...
Searching...
No Matches
stencilTable.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_STENCILTABLE_H
26#define OPENSUBDIV3_FAR_STENCILTABLE_H
27
28#include "../version.h"
29
30#include "../far/types.h"
31
32#include <cassert>
33#include <cstring>
34#include <vector>
35#include <iostream>
36
37namespace OpenSubdiv {
38namespace OPENSUBDIV_VERSION {
39
40namespace Far {
41
42// Forward declarations for friends:
43class PatchTableBuilder;
44
45template <typename REAL> class StencilTableFactoryReal;
46template <typename REAL> class LimitStencilTableFactoryReal;
47
52template <typename REAL>
54public:
55
58
67 StencilReal(int * size, Index * indices, REAL * weights)
68 : _size(size), _indices(indices), _weights(weights) { }
69
71 StencilReal(StencilReal const & other) {
72 _size = other._size;
73 _indices = other._indices;
74 _weights = other._weights;
75 }
76
78 int GetSize() const {
79 return *_size;
80 }
81
83 int * GetSizePtr() const {
84 return _size;
85 }
86
88 Index const * GetVertexIndices() const {
89 return _indices;
90 }
91
93 REAL const * GetWeights() const {
94 return _weights;
95 }
96
98 void Next() {
99 int stride = *_size;
100 ++_size;
101 _indices += stride;
102 _weights += stride;
103 }
104
105protected:
106 friend class StencilTableFactoryReal<REAL>;
107 friend class LimitStencilTableFactoryReal<REAL>;
108
109 int * _size;
111 REAL * _weights;
112};
113
116class Stencil : public StencilReal<float> {
117protected:
119
120public:
122 Stencil(BaseStencil const & other) : BaseStencil(other) { }
123 Stencil(int * size, Index * indices, float * weights)
124 : BaseStencil(size, indices, weights) { }
125};
126
127
140template <typename REAL>
142protected:
143 StencilTableReal(int numControlVerts,
144 std::vector<int> const& offsets,
145 std::vector<int> const& sizes,
146 std::vector<int> const& sources,
147 std::vector<REAL> const& weights,
148 bool includeCoarseVerts,
149 size_t firstOffset);
150
151public:
152
153 virtual ~StencilTableReal() {};
154
156 int GetNumStencils() const {
157 return (int)_sizes.size();
158 }
159
162 return _numControlVertices;
163 }
164
167
169 std::vector<int> const & GetSizes() const {
170 return _sizes;
171 }
172
174 std::vector<Index> const & GetOffsets() const {
175 return _offsets;
176 }
177
179 std::vector<Index> const & GetControlIndices() const {
180 return _indices;
181 }
182
184 std::vector<REAL> const & GetWeights() const {
185 return _weights;
186 }
187
190
204 template <class T, class U>
205 void UpdateValues(T const &srcValues, U &dstValues, Index start=-1, Index end=-1) const {
206 this->update(srcValues, dstValues, _weights, start, end);
207 }
208
209 template <class T1, class T2, class U>
210 void UpdateValues(T1 const &srcBase, int numBase, T2 const &srcRef,
211 U &dstValues, Index start=-1, Index end=-1) const {
212 this->update(srcBase, numBase, srcRef, dstValues, _weights, start, end);
213 }
214
215 // Pointer interface for backward compatibility
216 template <class T, class U>
217 void UpdateValues(T const *src, U *dst, Index start=-1, Index end=-1) const {
218 this->update(src, dst, _weights, start, end);
219 }
220 template <class T1, class T2, class U>
221 void UpdateValues(T1 const *srcBase, int numBase, T2 const *srcRef,
222 U *dst, Index start=-1, Index end=-1) const {
223 this->update(srcBase, numBase, srcRef, dst, _weights, start, end);
224 }
225
227 void Clear();
228
229protected:
230
231 // Update values by applying cached stencil weights to new control values
232 template <class T, class U>
233 void update( T const &srcValues, U &dstValues,
234 std::vector<REAL> const & valueWeights, Index start, Index end) const;
235 template <class T1, class T2, class U>
236 void update( T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues,
237 std::vector<REAL> const & valueWeights, Index start, Index end) const;
238
239 // Populate the offsets table from the stencil sizes in _sizes (factory helper)
241
242 // Resize the table arrays (factory helper)
243 void resize(int nstencils, int nelems);
244
245 // Reserves the table arrays (factory helper)
246 void reserve(int nstencils, int nelems);
247
248 // Reallocates the table arrays to remove excess capacity (factory helper)
250
251 // Performs any final operations on internal tables (factory helper)
252 void finalize();
253
254protected:
256 StencilTableReal(int numControlVerts)
257 : _numControlVertices(numControlVerts)
258 { }
259
260 friend class StencilTableFactoryReal<REAL>;
262
263 int _numControlVertices; // number of control vertices
264
265 std::vector<int> _sizes; // number of coefficients for each stencil
266 std::vector<Index> _offsets, // offset to the start of each stencil
267 _indices; // indices of contributing coarse vertices
268 std::vector<REAL> _weights; // stencil weight coefficients
269};
270
273class StencilTable : public StencilTableReal<float> {
274protected:
276
277public:
278 Stencil GetStencil(Index index) const {
279 return Stencil(BaseTable::GetStencil(index));
280 }
281 Stencil operator[] (Index index) const {
282 return Stencil(BaseTable::GetStencil(index));
283 }
284
285protected:
287 StencilTable(int numControlVerts) : BaseTable(numControlVerts) { }
288 StencilTable(int numControlVerts,
289 std::vector<int> const& offsets,
290 std::vector<int> const& sizes,
291 std::vector<int> const& sources,
292 std::vector<float> const& weights,
293 bool includeCoarseVerts,
294 size_t firstOffset)
295 : BaseTable(numControlVerts, offsets,
296 sizes, sources, weights, includeCoarseVerts, firstOffset) { }
297};
298
299
302template <typename REAL>
303class LimitStencilReal : public StencilReal<REAL> {
304public:
305
325 Index * indices,
326 REAL * weights,
327 REAL * duWeights=0,
328 REAL * dvWeights=0,
329 REAL * duuWeights=0,
330 REAL * duvWeights=0,
331 REAL * dvvWeights=0)
332 : StencilReal<REAL>(size, indices, weights),
333 _duWeights(duWeights),
334 _dvWeights(dvWeights),
335 _duuWeights(duuWeights),
336 _duvWeights(duvWeights),
337 _dvvWeights(dvvWeights) {
338 }
339
341 REAL const * GetDuWeights() const {
342 return _duWeights;
343 }
344
346 REAL const * GetDvWeights() const {
347 return _dvWeights;
348 }
349
351 REAL const * GetDuuWeights() const {
352 return _duuWeights;
353 }
354
356 REAL const * GetDuvWeights() const {
357 return _duvWeights;
358 }
359
361 REAL const * GetDvvWeights() const {
362 return _dvvWeights;
363 }
364
366 void Next() {
367 int stride = *this->_size;
368 ++this->_size;
369 this->_indices += stride;
370 this->_weights += stride;
371 if (_duWeights) _duWeights += stride;
372 if (_dvWeights) _dvWeights += stride;
373 if (_duuWeights) _duuWeights += stride;
374 if (_duvWeights) _duvWeights += stride;
375 if (_dvvWeights) _dvvWeights += stride;
376 }
377
378private:
379
380 friend class StencilTableFactoryReal<REAL>;
381 friend class LimitStencilTableFactoryReal<REAL>;
382
383 REAL * _duWeights, // pointer to stencil u derivative limit weights
384 * _dvWeights, // pointer to stencil v derivative limit weights
385 * _duuWeights, // pointer to stencil uu derivative limit weights
386 * _duvWeights, // pointer to stencil uv derivative limit weights
387 * _dvvWeights; // pointer to stencil vv derivative limit weights
388};
389
392class LimitStencil : public LimitStencilReal<float> {
393protected:
395
396public:
397 LimitStencil(BaseStencil const & other) : BaseStencil(other) { }
398 LimitStencil(int* size, Index * indices, float * weights,
399 float * duWeights=0, float * dvWeights=0,
400 float * duuWeights=0, float * duvWeights=0, float * dvvWeights=0)
401 : BaseStencil(size, indices, weights,
402 duWeights, dvWeights, duuWeights, duvWeights, dvvWeights) { }
403};
404
405
408template <typename REAL>
410protected:
412 int numControlVerts,
413 std::vector<int> const& offsets,
414 std::vector<int> const& sizes,
415 std::vector<int> const& sources,
416 std::vector<REAL> const& weights,
417 std::vector<REAL> const& duWeights,
418 std::vector<REAL> const& dvWeights,
419 std::vector<REAL> const& duuWeights,
420 std::vector<REAL> const& duvWeights,
421 std::vector<REAL> const& dvvWeights,
422 bool includeCoarseVerts,
423 size_t firstOffset);
424
425public:
426
429
432
434 std::vector<REAL> const & GetDuWeights() const {
435 return _duWeights;
436 }
437
439 std::vector<REAL> const & GetDvWeights() const {
440 return _dvWeights;
441 }
442
444 std::vector<REAL> const & GetDuuWeights() const {
445 return _duuWeights;
446 }
447
449 std::vector<REAL> const & GetDuvWeights() const {
450 return _duvWeights;
451 }
452
454 std::vector<REAL> const & GetDvvWeights() const {
455 return _dvvWeights;
456 }
457
475 template <class T, class U>
476 void UpdateDerivs(T const & srcValues, U & uderivs, U & vderivs,
477 int start=-1, int end=-1) const {
478
479 this->update(srcValues, uderivs, _duWeights, start, end);
480 this->update(srcValues, vderivs, _dvWeights, start, end);
481 }
482
483 template <class T1, class T2, class U>
484 void UpdateDerivs(T1 const & srcBase, int numBase, T2 const & srcRef,
485 U & uderivs, U & vderivs, int start=-1, int end=-1) const {
486
487 this->update(srcBase, numBase, srcRef, uderivs, _duWeights, start, end);
488 this->update(srcBase, numBase, srcRef, vderivs, _dvWeights, start, end);
489 }
490
491 // Pointer interface for backward compatibility
492 template <class T, class U>
493 void UpdateDerivs(T const *src, U *uderivs, U *vderivs,
494 int start=-1, int end=-1) const {
495
496 this->update(src, uderivs, _duWeights, start, end);
497 this->update(src, vderivs, _dvWeights, start, end);
498 }
499 template <class T1, class T2, class U>
500 void UpdateDerivs(T1 const *srcBase, int numBase, T2 const *srcRef,
501 U *uderivs, U *vderivs, int start=-1, int end=-1) const {
502
503 this->update(srcBase, numBase, srcRef, uderivs, _duWeights, start, end);
504 this->update(srcBase, numBase, srcRef, vderivs, _dvWeights, start, end);
505 }
506
527 template <class T, class U>
528 void Update2ndDerivs(T const & srcValues,
529 U & uuderivs, U & uvderivs, U & vvderivs,
530 int start=-1, int end=-1) const {
531
532 this->update(srcValues, uuderivs, _duuWeights, start, end);
533 this->update(srcValues, uvderivs, _duvWeights, start, end);
534 this->update(srcValues, vvderivs, _dvvWeights, start, end);
535 }
536
537 template <class T1, class T2, class U>
538 void Update2ndDerivs(T1 const & srcBase, int numBase, T2 const & srcRef,
539 U & uuderivs, U & uvderivs, U & vvderivs, int start=-1, int end=-1) const {
540
541 this->update(srcBase, numBase, srcRef, uuderivs, _duuWeights, start, end);
542 this->update(srcBase, numBase, srcRef, uvderivs, _duvWeights, start, end);
543 this->update(srcBase, numBase, srcRef, vvderivs, _dvvWeights, start, end);
544 }
545
546 // Pointer interface for backward compatibility
547 template <class T, class U>
548 void Update2ndDerivs(T const *src, T *uuderivs, U *uvderivs, U *vvderivs,
549 int start=-1, int end=-1) const {
550
551 this->update(src, uuderivs, _duuWeights, start, end);
552 this->update(src, uvderivs, _duvWeights, start, end);
553 this->update(src, vvderivs, _dvvWeights, start, end);
554 }
555 template <class T1, class T2, class U>
556 void Update2ndDerivs(T1 const *srcBase, int numBase, T2 const *srcRef,
557 U *uuderivs, U *uvderivs, U *vvderivs, int start=-1, int end=-1) const {
558
559 this->update(srcBase, numBase, srcRef, uuderivs, _duuWeights, start, end);
560 this->update(srcBase, numBase, srcRef, uvderivs, _duvWeights, start, end);
561 this->update(srcBase, numBase, srcRef, vvderivs, _dvvWeights, start, end);
562 }
563
565 void Clear();
566
567private:
568 friend class LimitStencilTableFactoryReal<REAL>;
569
570 // Resize the table arrays (factory helper)
571 void resize(int nstencils, int nelems);
572
573private:
574 std::vector<REAL> _duWeights, // u derivative limit stencil weights
575 _dvWeights, // v derivative limit stencil weights
576 _duuWeights, // uu derivative limit stencil weights
577 _duvWeights, // uv derivative limit stencil weights
578 _dvvWeights; // vv derivative limit stencil weights
579};
580
584protected:
586
587public:
590 }
593 }
594
595protected:
596 LimitStencilTable(int numControlVerts,
597 std::vector<int> const& offsets,
598 std::vector<int> const& sizes,
599 std::vector<int> const& sources,
600 std::vector<float> const& weights,
601 std::vector<float> const& duWeights,
602 std::vector<float> const& dvWeights,
603 std::vector<float> const& duuWeights,
604 std::vector<float> const& duvWeights,
605 std::vector<float> const& dvvWeights,
606 bool includeCoarseVerts,
607 size_t firstOffset)
608 : BaseTable(numControlVerts,
609 offsets, sizes, sources, weights,
610 duWeights, dvWeights, duuWeights, duvWeights, dvvWeights,
611 includeCoarseVerts, firstOffset) { }
612};
613
614
615// Update values by applying cached stencil weights to new control values
616template <typename REAL>
617template <class T1, class T2, class U> void
618StencilTableReal<REAL>::update(T1 const &srcBase, int numBase,
619 T2 const &srcRef, U &dstValues,
620 std::vector<REAL> const &valueWeights, Index start, Index end) const {
621
622 int const * sizes = &_sizes.at(0);
623 Index const * indices = &_indices.at(0);
624 REAL const * weights = &valueWeights.at(0);
625
626 if (start > 0) {
627 assert(start < (Index)_offsets.size());
628 sizes += start;
629 indices += _offsets[start];
630 weights += _offsets[start];
631 } else {
632 start = 0;
633 }
634
635 int nstencils = ((end < start) ? GetNumStencils() : end) - start;
636
637 for (int i = 0; i < nstencils; ++i, ++sizes) {
638 dstValues[start + i].Clear();
639 for (int j = 0; j < *sizes; ++j, ++indices, ++weights) {
640 if (*indices < numBase) {
641 dstValues[start + i].AddWithWeight(srcBase[*indices], *weights);
642 } else {
643 dstValues[start + i].AddWithWeight(srcRef[*indices - numBase], *weights);
644 }
645 }
646 }
647}
648template <typename REAL>
649template <class T, class U> void
650StencilTableReal<REAL>::update(T const &srcValues, U &dstValues,
651 std::vector<REAL> const &valueWeights, Index start, Index end) const {
652
653 int const * sizes = &_sizes.at(0);
654 Index const * indices = &_indices.at(0);
655 REAL const * weights = &valueWeights.at(0);
656
657 if (start > 0) {
658 assert(start < (Index)_offsets.size());
659 sizes += start;
660 indices += _offsets[start];
661 weights += _offsets[start];
662 } else {
663 start = 0;
664 }
665
666 int nstencils = ((end < start) ? GetNumStencils() : end) - start;
667
668 for (int i = 0; i < nstencils; ++i, ++sizes) {
669 dstValues[start + i].Clear();
670 for (int j = 0; j < *sizes; ++j, ++indices, ++weights) {
671 dstValues[start + i].AddWithWeight(srcValues[*indices], *weights);
672 }
673 }
674}
675
676template <typename REAL>
677inline void
679 Index offset=0;
680 int noffsets = (int)_sizes.size();
681 _offsets.resize(noffsets);
682 for (int i=0; i<(int)_sizes.size(); ++i ) {
683 _offsets[i]=offset;
684 offset+=_sizes[i];
685 }
686}
687
688template <typename REAL>
689inline void
690StencilTableReal<REAL>::resize(int nstencils, int nelems) {
691 _sizes.resize(nstencils);
692 _indices.resize(nelems);
693 _weights.resize(nelems);
694}
695
696template <typename REAL>
697inline void
698StencilTableReal<REAL>::reserve(int nstencils, int nelems) {
699 _sizes.reserve(nstencils);
700 _indices.reserve(nelems);
701 _weights.reserve(nelems);
702}
703
704template <typename REAL>
705inline void
707 std::vector<int>(_sizes).swap(_sizes);
708 std::vector<Index>(_indices).swap(_indices);
709 std::vector<REAL>(_weights).swap(_weights);
710}
711
712template <typename REAL>
713inline void
715 shrinkToFit();
716 generateOffsets();
717}
718
719// Returns a Stencil at index i in the table
720template <typename REAL>
723 assert((! _offsets.empty()) && i<(int)_offsets.size());
724
725 Index ofs = _offsets[i];
726
727 return StencilReal<REAL>(const_cast<int*>(&_sizes[i]),
728 const_cast<Index*>(&_indices[ofs]),
729 const_cast<REAL*>(&_weights[ofs]));
730}
731
732template <typename REAL>
735 return GetStencil(index);
736}
737
738template <typename REAL>
739inline void
740LimitStencilTableReal<REAL>::resize(int nstencils, int nelems) {
741 StencilTableReal<REAL>::resize(nstencils, nelems);
742 _duWeights.resize(nelems);
743 _dvWeights.resize(nelems);
744}
745
746// Returns a LimitStencil at index i in the table
747template <typename REAL>
748inline LimitStencilReal<REAL>
750 assert((! this->GetOffsets().empty()) && i<(int)this->GetOffsets().size());
751
752 Index ofs = this->GetOffsets()[i];
753
754 if (!_duWeights.empty() && !_dvWeights.empty() &&
755 !_duuWeights.empty() && !_duvWeights.empty() && !_dvvWeights.empty()) {
757 const_cast<int *>(&this->GetSizes()[i]),
758 const_cast<Index *>(&this->GetControlIndices()[ofs]),
759 const_cast<REAL *>(&this->GetWeights()[ofs]),
760 const_cast<REAL *>(&GetDuWeights()[ofs]),
761 const_cast<REAL *>(&GetDvWeights()[ofs]),
762 const_cast<REAL *>(&GetDuuWeights()[ofs]),
763 const_cast<REAL *>(&GetDuvWeights()[ofs]),
764 const_cast<REAL *>(&GetDvvWeights()[ofs]) );
765 } else if (!_duWeights.empty() && !_dvWeights.empty()) {
767 const_cast<int *>(&this->GetSizes()[i]),
768 const_cast<Index *>(&this->GetControlIndices()[ofs]),
769 const_cast<REAL *>(&this->GetWeights()[ofs]),
770 const_cast<REAL *>(&GetDuWeights()[ofs]),
771 const_cast<REAL *>(&GetDvWeights()[ofs]) );
772 } else {
774 const_cast<int *>(&this->GetSizes()[i]),
775 const_cast<Index *>(&this->GetControlIndices()[ofs]),
776 const_cast<REAL *>(&this->GetWeights()[ofs]) );
777 }
778}
779
780template <typename REAL>
783 return GetLimitStencil(index);
784}
785
786} // end namespace Far
787
788} // end namespace OPENSUBDIV_VERSION
789using namespace OPENSUBDIV_VERSION;
790
791} // end namespace OpenSubdiv
792
793#endif // OPENSUBDIV3_FAR_STENCILTABLE_H
StencilReal(int *size, Index *indices, REAL *weights)
Constructor.
Definition: stencilTable.h:67
void Next()
Advance to the next stencil in the table.
Definition: stencilTable.h:98
StencilReal(StencilReal const &other)
Copy constructor.
Definition: stencilTable.h:71
Index const * GetVertexIndices() const
Returns the control vertices' indices.
Definition: stencilTable.h:88
int GetSize() const
Returns the size of the stencil.
Definition: stencilTable.h:78
int * GetSizePtr() const
Returns the size of the stencil as a pointer.
Definition: stencilTable.h:83
REAL const * GetWeights() const
Returns the interpolation weights.
Definition: stencilTable.h:93
Vertex stencil class wrapping the template for compatibility.
Definition: stencilTable.h:116
Stencil(int *size, Index *indices, float *weights)
Definition: stencilTable.h:123
int GetNumControlVertices() const
Returns the number of control vertices indexed in the table.
Definition: stencilTable.h:161
void update(T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues, std::vector< REAL > const &valueWeights, Index start, Index end) const
Definition: stencilTable.h:618
void UpdateValues(T1 const &srcBase, int numBase, T2 const &srcRef, U &dstValues, Index start=-1, Index end=-1) const
Definition: stencilTable.h:210
std::vector< Index > const & GetControlIndices() const
Returns the indices of the control vertices.
Definition: stencilTable.h:179
StencilReal< REAL > operator[](Index index) const
Returns the stencil at index i in the table.
Definition: stencilTable.h:734
void update(T const &srcValues, U &dstValues, std::vector< REAL > const &valueWeights, Index start, Index end) const
Definition: stencilTable.h:650
std::vector< int > const & GetSizes() const
Returns the number of control vertices of each stencil in the table.
Definition: stencilTable.h:169
int GetNumStencils() const
Returns the number of stencils in the table.
Definition: stencilTable.h:156
std::vector< Index > const & GetOffsets() const
Returns the offset to a given stencil (factory may leave empty)
Definition: stencilTable.h:174
StencilReal< REAL > GetStencil(Index i) const
Returns a Stencil at index i in the table.
Definition: stencilTable.h:722
void Clear()
Clears the stencils from the table.
std::vector< REAL > const & GetWeights() const
Returns the stencil interpolation weights.
Definition: stencilTable.h:184
void UpdateValues(T1 const *srcBase, int numBase, T2 const *srcRef, U *dst, Index start=-1, Index end=-1) const
Definition: stencilTable.h:221
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
Definition: stencilTable.h:217
void UpdateValues(T const &srcValues, U &dstValues, Index start=-1, Index end=-1) const
Updates point values based on the control values.
Definition: stencilTable.h:205
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
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)
Definition: stencilTable.h:288
REAL const * GetDuvWeights() const
Returns the uv derivative weights.
Definition: stencilTable.h:356
REAL const * GetDvWeights() const
Returns the v derivative weights.
Definition: stencilTable.h:346
void Next()
Advance to the next stencil in the table.
Definition: stencilTable.h:366
REAL const * GetDvvWeights() const
Returns the vv derivative weights.
Definition: stencilTable.h:361
LimitStencilReal(int *size, Index *indices, REAL *weights, REAL *duWeights=0, REAL *dvWeights=0, REAL *duuWeights=0, REAL *duvWeights=0, REAL *dvvWeights=0)
Constructor.
Definition: stencilTable.h:324
REAL const * GetDuWeights() const
Returns the u derivative weights.
Definition: stencilTable.h:341
REAL const * GetDuuWeights() const
Returns the uu derivative weights.
Definition: stencilTable.h:351
Limit point stencil class wrapping the template for compatibility.
Definition: stencilTable.h:392
LimitStencil(int *size, Index *indices, float *weights, float *duWeights=0, float *dvWeights=0, float *duuWeights=0, float *duvWeights=0, float *dvvWeights=0)
Definition: stencilTable.h:398
std::vector< REAL > const & GetDuuWeights() const
Returns the 'uu' derivative stencil interpolation weights.
Definition: stencilTable.h:444
LimitStencilReal< REAL > operator[](Index index) const
Returns the limit stencil at index i in the table.
Definition: stencilTable.h:782
std::vector< REAL > const & GetDvvWeights() const
Returns the 'vv' derivative stencil interpolation weights.
Definition: stencilTable.h:454
void UpdateDerivs(T const *src, U *uderivs, U *vderivs, int start=-1, int end=-1) const
Definition: stencilTable.h:493
void Update2ndDerivs(T const *src, T *uuderivs, U *uvderivs, U *vvderivs, int start=-1, int end=-1) const
Definition: stencilTable.h:548
std::vector< REAL > const & GetDvWeights() const
Returns the 'v' derivative stencil interpolation weights.
Definition: stencilTable.h:439
void Update2ndDerivs(T1 const *srcBase, int numBase, T2 const *srcRef, U *uuderivs, U *uvderivs, U *vvderivs, int start=-1, int end=-1) const
Definition: stencilTable.h:556
void UpdateDerivs(T const &srcValues, U &uderivs, U &vderivs, int start=-1, int end=-1) const
Updates derivative values based on the control values.
Definition: stencilTable.h:476
LimitStencilReal< REAL > GetLimitStencil(Index i) const
Returns a LimitStencil at index i in the table.
Definition: stencilTable.h:749
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.
Definition: stencilTable.h:528
std::vector< REAL > const & GetDuWeights() const
Returns the 'u' derivative stencil interpolation weights.
Definition: stencilTable.h:434
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
Definition: stencilTable.h:538
std::vector< REAL > const & GetDuvWeights() const
Returns the 'uv' derivative stencil interpolation weights.
Definition: stencilTable.h:449
void UpdateDerivs(T1 const &srcBase, int numBase, T2 const &srcRef, U &uderivs, U &vderivs, int start=-1, int end=-1) const
Definition: stencilTable.h:484
void UpdateDerivs(T1 const *srcBase, int numBase, T2 const *srcRef, U *uderivs, U *vderivs, int start=-1, int end=-1) const
Definition: stencilTable.h:500
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
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)
Definition: stencilTable.h:596