activitiesfactory.cxx (70f497fb) | activitiesfactory.cxx (e630ada4) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 152 unchanged lines hidden (view full) --- 161 maFrom( rFrom ), 162 maTo( rTo ), 163 maBy( rBy ), 164 mpFormula( rParms.mpFormula ), 165 maStartValue(), 166 maEndValue(), 167 mpAnim( rAnim ), 168 maInterpolator( rInterpolator ), | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 152 unchanged lines hidden (view full) --- 161 maFrom( rFrom ), 162 maTo( rTo ), 163 maBy( rBy ), 164 mpFormula( rParms.mpFormula ), 165 maStartValue(), 166 maEndValue(), 167 mpAnim( rAnim ), 168 maInterpolator( rInterpolator ), |
169 mbDynamicStartValue( false ), | |
170 mbCumulative( bCumulative ) 171 { 172 ENSURE_OR_THROW( mpAnim, "Invalid animation object" ); 173 174 ENSURE_OR_THROW( 175 rTo || rBy, 176 "From and one of To or By, or To or By alone must be valid" ); 177 } --- 40 unchanged lines hidden (view full) --- 218 else 219 { 220 // By or To animation. According to SMIL spec, 221 // the To value takes precedence over the By 222 // value, if both are specified 223 if( maTo ) 224 { 225 // To animation | 169 mbCumulative( bCumulative ) 170 { 171 ENSURE_OR_THROW( mpAnim, "Invalid animation object" ); 172 173 ENSURE_OR_THROW( 174 rTo || rBy, 175 "From and one of To or By, or To or By alone must be valid" ); 176 } --- 40 unchanged lines hidden (view full) --- 217 else 218 { 219 // By or To animation. According to SMIL spec, 220 // the To value takes precedence over the By 221 // value, if both are specified 222 if( maTo ) 223 { 224 // To animation |
226 227 // According to the SMIL spec 228 // (http://www.w3.org/TR/smil20/animation.html#animationNS-ToAnimation), 229 // the to animation interpolates between 230 // the _running_ underlying value and the to value (as the end value) 231 mbDynamicStartValue = true; | 225 maStartValue = aAnimationStartValue; |
232 maEndValue = *maTo; 233 } 234 else if( maBy ) 235 { 236 // By animation 237 maStartValue = aAnimationStartValue; 238 maEndValue = maStartValue + *maBy; 239 } --- 11 unchanged lines hidden (view full) --- 251 void perform( double nModifiedTime, sal_uInt32 nRepeatCount ) const 252 { 253 if (this->isDisposed() || !mpAnim) 254 return; 255 (*mpAnim)( 256 getPresentationValue( 257 accumulate( maEndValue, 258 mbCumulative * nRepeatCount, // means: mbCumulative ? nRepeatCount : 0, | 226 maEndValue = *maTo; 227 } 228 else if( maBy ) 229 { 230 // By animation 231 maStartValue = aAnimationStartValue; 232 maEndValue = maStartValue + *maBy; 233 } --- 11 unchanged lines hidden (view full) --- 245 void perform( double nModifiedTime, sal_uInt32 nRepeatCount ) const 246 { 247 if (this->isDisposed() || !mpAnim) 248 return; 249 (*mpAnim)( 250 getPresentationValue( 251 accumulate( maEndValue, 252 mbCumulative * nRepeatCount, // means: mbCumulative ? nRepeatCount : 0, |
259 maInterpolator( (mbDynamicStartValue 260 ? mpAnim->getUnderlyingValue() 261 : maStartValue), | 253 maInterpolator( maStartValue, |
262 maEndValue, 263 nModifiedTime ) ) ) ); 264 } 265 266 using BaseType::perform; 267 268 /// perform override for DiscreteActivityBase base 269 void perform( sal_uInt32 nFrame, sal_uInt32 nRepeatCount ) const 270 { 271 if (this->isDisposed() || !mpAnim) 272 return; 273 (*mpAnim)( 274 getPresentationValue( 275 accumulate( maEndValue, mbCumulative ? nRepeatCount : 0, 276 lerp( maInterpolator, | 254 maEndValue, 255 nModifiedTime ) ) ) ); 256 } 257 258 using BaseType::perform; 259 260 /// perform override for DiscreteActivityBase base 261 void perform( sal_uInt32 nFrame, sal_uInt32 nRepeatCount ) const 262 { 263 if (this->isDisposed() || !mpAnim) 264 return; 265 (*mpAnim)( 266 getPresentationValue( 267 accumulate( maEndValue, mbCumulative ? nRepeatCount : 0, 268 lerp( maInterpolator, |
277 (mbDynamicStartValue 278 ? mpAnim->getUnderlyingValue() 279 : maStartValue), | 269 maStartValue, |
280 maEndValue, 281 nFrame, 282 BaseType::getNumberOfKeyTimes() ) ) ) ); 283 } 284 285 using BaseType::isAutoReverse; 286 287 virtual void performEnd() --- 22 unchanged lines hidden (view full) --- 310 311 ExpressionNodeSharedPtr mpFormula; 312 313 ValueType maStartValue; 314 ValueType maEndValue; 315 316 ::boost::shared_ptr< AnimationType > mpAnim; 317 Interpolator< ValueType > maInterpolator; | 270 maEndValue, 271 nFrame, 272 BaseType::getNumberOfKeyTimes() ) ) ) ); 273 } 274 275 using BaseType::isAutoReverse; 276 277 virtual void performEnd() --- 22 unchanged lines hidden (view full) --- 300 301 ExpressionNodeSharedPtr mpFormula; 302 303 ValueType maStartValue; 304 ValueType maEndValue; 305 306 ::boost::shared_ptr< AnimationType > mpAnim; 307 Interpolator< ValueType > maInterpolator; |
318 bool mbDynamicStartValue; | |
319 bool mbCumulative; 320}; 321 322 323/** Generate Activity corresponding to given FromToBy values 324 325 @tpl BaseType 326 BaseType to use for deriving the Activity from --- 657 unchanged lines hidden --- | 308 bool mbCumulative; 309}; 310 311 312/** Generate Activity corresponding to given FromToBy values 313 314 @tpl BaseType 315 BaseType to use for deriving the Activity from --- 657 unchanged lines hidden --- |