本文整理汇总了C++中SVGAnimationElement::applyAnimatedValueToElement方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGAnimationElement::applyAnimatedValueToElement方法的具体用法?C++ SVGAnimationElement::applyAnimatedValueToElement怎么用?C++ SVGAnimationElement::applyAnimatedValueToElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGAnimationElement
的用法示例。
在下文中一共展示了SVGAnimationElement::applyAnimatedValueToElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyAnimations
// FIXME: This funtion will eventually become part of the AnimationCompositor
void SVGTimer::applyAnimations(double elapsedSeconds, const SVGTimer::TargetAnimationMap& targetMap)
{
TargetAnimationMap::const_iterator targetIterator = targetMap.begin();
TargetAnimationMap::const_iterator tend = targetMap.end();
for (; targetIterator != tend; ++targetIterator) {
// FIXME: This is still not 100% correct. Correct would be:
// 1. Walk backwards through the priority list until a replace (!isAdditive()) is found
// -- This optimization is not possible without careful consideration for dependent values (such as cx and fx in SVGRadialGradient)
// 2. Set the initial value (or last replace) as the new animVal
// 3. Call each enabled animation in turn, to have it apply its changes
// 4. After building a new animVal, set it on the element.
// Currenly we use the actual animVal on the element as "temporary storage"
// and abstract the getting/setting of the attributes into the SVGAnimate* classes
unsigned count = targetIterator->second.size();
for (unsigned i = 0; i < count; ++i) {
SVGAnimationElement* animation = targetIterator->second[i];
if (!animation->isValidAnimation())
continue;
if (!animation->updateAnimationBaseValueFromElement())
continue;
if (!animation->updateAnimatedValueForElapsedSeconds(elapsedSeconds))
continue;
animation->applyAnimatedValueToElement();
}
}
// Make a second pass through the map to avoid multiple setChanged calls on the same element.
for (targetIterator = targetMap.begin(); targetIterator != tend; ++targetIterator) {
SVGElement* key = targetIterator->first;
if (key && key->isStyled())
static_cast<SVGStyledElement*>(key)->setChanged(true);
}
}