- AnimatorTransformProperty* animator = new AnimatorTransformProperty( const_cast<PropertyOwner*>( &propertyOwner ),
- const_cast<PropertyBase*>( &property ),
- animatorFunction );
-
- animator->SetAlphaFunction( alphaFunction );
- animator->SetIntervalDelay( timePeriod.delaySeconds );
- animator->SetDuration( timePeriod.durationSeconds );
-
- return animator;
- }
-
- /**
- * Virtual destructor.
- */
- virtual ~AnimatorTransformProperty()
- {
- if (mPropertyOwner && mConnectedToSceneGraph)
- {
- mPropertyOwner->RemoveObserver(*this);
- }
-
- delete mAnimatorFunction;
- }
-
- /**
- * Called when Animator is added to the scene-graph in update-thread.
- */
- virtual void ConnectToSceneGraph()
- {
- mConnectedToSceneGraph = true;
- mPropertyOwner->AddObserver(*this);
- }
-
- /**
- * Called when mPropertyOwner is connected to the scene graph.
- */
- virtual void PropertyOwnerConnected( PropertyOwner& owner )
- {
- mEnabled = true;
- }
-
- /**
- * Called when mPropertyOwner is disconnected from the scene graph.
- */
- virtual void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner )
- {
- // If we are active, then bake the value if required
- if ( mActive && mDisconnectAction != Dali::Animation::Discard )
- {
- // Bake to target-value if BakeFinal, otherwise bake current value
- Update( bufferIndex, ( mDisconnectAction == Dali::Animation::Bake ? mCurrentProgress : 1.0f ), true );
- }
-
- mActive = false;
- mEnabled = false;
+ return new AnimatorTransformProperty(const_cast<PropertyOwner*>(&propertyOwner),
+ const_cast<PropertyBase*>(&property),
+ std::move(animatorFunction),
+ alphaFunction,
+ timePeriod);