mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-03 13:41:06 +00:00
Merge pull request #756 from davidgyu/limitStencilFix
Added missing LimitStencil accessor methods
This commit is contained in:
commit
cf7135eb2a
@ -304,6 +304,12 @@ class LimitStencilTable : public StencilTable {
|
||||
|
||||
public:
|
||||
|
||||
/// \brief Returns a LimitStencil at index i in the table
|
||||
LimitStencil GetLimitStencil(Index i) const;
|
||||
|
||||
/// \brief Returns the limit stencil at index i in the table
|
||||
LimitStencil operator[] (Index index) const;
|
||||
|
||||
/// \brief Returns the 'u' derivative stencil interpolation weights
|
||||
std::vector<float> const & GetDuWeights() const {
|
||||
return _duWeights;
|
||||
@ -437,6 +443,25 @@ LimitStencilTable::resize(int nstencils, int nelems) {
|
||||
_dvWeights.resize(nelems);
|
||||
}
|
||||
|
||||
// Returns a LimitStencil at index i in the table
|
||||
inline LimitStencil
|
||||
LimitStencilTable::GetLimitStencil(Index i) const {
|
||||
assert((not GetOffsets().empty()) and i<(int)GetOffsets().size());
|
||||
|
||||
Index ofs = GetOffsets()[i];
|
||||
|
||||
return LimitStencil( const_cast<int *>(&GetSizes()[i]),
|
||||
const_cast<Index *>(&GetControlIndices()[ofs]),
|
||||
const_cast<float *>(&GetWeights()[ofs]),
|
||||
const_cast<float *>(&GetDuWeights()[ofs]),
|
||||
const_cast<float *>(&GetDvWeights()[ofs]) );
|
||||
}
|
||||
|
||||
inline LimitStencil
|
||||
LimitStencilTable::operator[] (Index index) const {
|
||||
return GetLimitStencil(index);
|
||||
}
|
||||
|
||||
|
||||
} // end namespace Far
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user