GA_AIFInterp *i = d.getAIFInterp();
i->startSum(d, sum);
i->addSum(d, sum,
a, 1-
t);
i->finishSum(d, sum);
}
GA_AIFInterp *i = d.getAIFInterp();
i->startSum(d, sum);
i->addSquare(d, sum,
a, 1);
i->addSquare(d, sum,
b, 1);
i->finishSquare(d, sum, 1/sum.getTotalWeight());
}
GA_AIFInterp *i = d.getAIFInterp();
i->startSum(d, sum);
i->addSquare(d, sum,
a, 1);
i->addSquare(d, sum,
b, 1);
i->finishSum(d, sum, 1.0);
}
{
public:
GA_AIFInterp() {}
virtual ~GA_AIFInterp();
Return whether
this interpolator is
a conditional interpolation or
whether
values are actually interpolated.
virtual bool isConditionalInterpolation() const { return false; }
Note: Weighted sums can only be performed on
a single element, and thus
don't have a generic GA_AttributeOperand method.
@param d The destination attribute
@param di The index in the destination attribute used to store results
@param sum Weighted sum to keep track of partial sums
virtual bool startSum(GA_Attribute &d, GA_Offset di,
const GA_WeightedSum &sum) const = 0;
Add an element into the weighted sum
@param d Destination attribute
@param di Destination offset
@param sum Storage for state of weighted sum
@param a Attribute to add into the sum
@param ai Index of the attribute to add into the sum
virtual bool addSum(GA_Attribute &d, GA_Offset di,
const GA_WeightedSum &sum,
const GA_Attribute &a, GA_Offset ai) const = 0;
Add the square of an element to the weighted sum
@param d Destination attribute
@param di Destination offset
@param sum Storage for state of weighted sum
@param a Attribute to add into the sum
@param ai Index of the attribute to add into the sum
virtual bool addSquare(GA_Attribute &d, GA_Offset di,
const GA_WeightedSum &sum,
const GA_Attribute &a, GA_Offset ai) const = 0;
Finish a weighted sum. The scale_factor can be used to normalize
weighting. For example: @code
endSum(d, di, sum, 1./sum.getTotalWeight());