1 #ifndef DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H
2 #define DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/object/property.h>
27 #include <dali/public-api/object/property-input.h>
28 #include <dali/public-api/object/property-types.h>
29 #include <dali/internal/common/message.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/event/common/property-input-impl.h>
32 #include <dali/internal/update/common/double-buffered.h>
33 #include <dali/internal/update/common/property-base.h>
34 #include <dali/internal/update/common/scene-graph-buffers.h>
46 * Dirty flags record whether an animatable property has changed.
47 * In the frame following a change, the property is reset to a base value.
49 * If the property was "Baked", then the base value matches the (double-buffered) value from the previous frame.
50 * Therefore when reset, the property is flagged as "clean".
52 * However if the property was only "Set" (and not "Baked"), then typically the base value and previous value will not match.
53 * In this case the reset operation is equivalent to a "Bake", and the value is considered "dirty" for an additional frame.
55 static const uint32_t CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame
56 static const uint32_t BAKED_FLAG = 0x01; ///< Indicates that the value was Baked during the previous frame
57 static const uint32_t SET_FLAG = 0x02; ///< Indicates that the value was Set during the previous frame
60 class AnimatableProperty;
63 * Base class to reduce code size from the templates.
65 class AnimatablePropertyBase : public PropertyBase
70 * Constructor, initialize the dirty flag
72 AnimatablePropertyBase()
74 mDirtyFlags( BAKED_FLAG )
80 virtual ~AnimatablePropertyBase()
83 protected: // for derived classes
86 * Flag that the property has been Set during the current frame.
90 mDirtyFlags = SET_FLAG;
94 * Flag that the property has been Baked during the current frame.
98 mDirtyFlags = BAKED_FLAG;
101 public: // From PropertyBase
104 * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
106 virtual bool IsClean() const
108 return ( CLEAN_FLAG == mDirtyFlags );
112 * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
114 virtual bool InputInitialized() const
116 return true; // Animatable properties are always valid
119 protected: // so that ResetToBaseValue can set it directly
121 uint32_t mDirtyFlags; ///< Flag whether value changed during previous 2 frames
127 * An boolean animatable property of a scene-graph object.
130 class AnimatableProperty<bool> : public AnimatablePropertyBase
135 * Create an animatable property.
136 * @param [in] initialValue The initial value of the property.
138 AnimatableProperty( bool initialValue )
139 : mValue( initialValue ),
140 mBaseValue( initialValue )
145 * Virtual destructor.
147 virtual ~AnimatableProperty()
152 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
154 virtual Dali::Property::Type GetType() const
156 return Dali::PropertyTypes::Get<bool>();
160 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
162 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
164 if (CLEAN_FLAG != mDirtyFlags)
166 mValue[updateBufferIndex] = mBaseValue;
168 mDirtyFlags = ( mDirtyFlags >> 1 );
173 * @copydoc Dali::Internal::PropertyInputImpl::GetBoolean()
175 virtual const bool& GetBoolean( BufferIndex bufferIndex ) const
177 return mValue[ bufferIndex ];
181 * Set the property value. This will only persist for the current frame; the property
182 * will be reset with the base value, at the beginning of the next frame.
183 * @param[in] bufferIndex The buffer to write.
184 * @param[in] value The new property value.
186 void Set(BufferIndex bufferIndex, bool value)
188 // check if the value actually changed to avoid dirtying nodes unnecessarily
189 if( mValue[bufferIndex] != value )
191 mValue[bufferIndex] = value;
198 * Change the property value by a relative amount.
199 * @param[in] bufferIndex The buffer to write.
200 * @param[in] delta The property will change by this amount.
202 void SetRelative(BufferIndex bufferIndex, bool delta)
204 // check if the value actually changed to avoid dirtying nodes unnecessarily
205 // false + false does not change value, true + false does not either
206 if( delta && !mValue[bufferIndex] )
208 mValue[bufferIndex] += delta;
215 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
217 bool& Get( BufferIndex bufferIndex )
219 return mValue[bufferIndex];
223 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
225 const bool& Get( BufferIndex bufferIndex ) const
227 return mValue[bufferIndex];
231 * Retrieve the property value.
232 * @param[in] bufferIndex The buffer to read.
233 * @return The property value.
235 bool& operator[]( BufferIndex bufferIndex )
237 return mValue[bufferIndex];
241 * Retrieve the property value.
242 * @param[in] bufferIndex The buffer to read.
243 * @return The property value.
245 const bool& operator[]( BufferIndex bufferIndex ) const
247 return mValue[bufferIndex];
251 * Set both the property value & base value.
252 * @param[in] bufferIndex The buffer to write for the property value.
253 * @param[in] value The new property value.
255 void Bake(BufferIndex bufferIndex, bool value)
257 // bake has to check the base value as current buffer value can be correct by constraint or something else
258 if( mBaseValue != value )
261 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
262 // has never been atomically safe.
263 mValue[bufferIndex] = value;
264 mValue[1-bufferIndex] = value;
271 * Change the property value & base value by a relative amount.
272 * @param[in] bufferIndex The buffer to write for the local property value.
273 * @param[in] delta The property will change by this amount.
275 void BakeRelative(BufferIndex bufferIndex, bool delta)
277 mValue[bufferIndex] += delta;
278 mBaseValue = mValue[bufferIndex];
286 AnimatableProperty(const AnimatableProperty& property);
289 AnimatableProperty& operator=(const AnimatableProperty& rhs);
293 DoubleBuffered<bool> mValue; ///< The double-buffered property value
294 bool mBaseValue; ///< Reset to this base value at the beginning of each frame
300 * An integer animatable property of a scene-graph object.
303 class AnimatableProperty<int> : public AnimatablePropertyBase
308 * Create an animatable property.
309 * @param [in] initialValue The initial value of the property.
311 AnimatableProperty( int initialValue )
312 : mValue( initialValue ),
313 mBaseValue( initialValue )
318 * Virtual destructor.
320 virtual ~AnimatableProperty()
325 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
327 virtual Dali::Property::Type GetType() const
329 return Dali::PropertyTypes::Get<int>();
333 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
335 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
337 if (CLEAN_FLAG != mDirtyFlags)
339 mValue[updateBufferIndex] = mBaseValue;
341 mDirtyFlags = ( mDirtyFlags >> 1 );
346 * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
348 virtual const int& GetInteger( BufferIndex bufferIndex ) const
350 return mValue[ bufferIndex ];
354 * Set the property value. This will only persist for the current frame; the property
355 * will be reset with the base value, at the beginning of the next frame.
356 * @param[in] bufferIndex The buffer to write.
357 * @param[in] value The new property value.
359 void Set(BufferIndex bufferIndex, int value)
361 mValue[bufferIndex] = value;
367 * Change the property value by a relative amount.
368 * @param[in] bufferIndex The buffer to write.
369 * @param[in] delta The property will change by this amount.
371 void SetRelative(BufferIndex bufferIndex, int delta)
373 mValue[bufferIndex] = mValue[bufferIndex] + delta;
379 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
381 int& Get( BufferIndex bufferIndex )
383 return mValue[bufferIndex];
387 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
389 const int& Get( BufferIndex bufferIndex ) const
391 return mValue[bufferIndex];
395 * Retrieve the property value.
396 * @param[in] bufferIndex The buffer to read.
397 * @return The property value.
399 int& operator[]( BufferIndex bufferIndex )
401 return mValue[bufferIndex];
405 * Retrieve the property value.
406 * @param[in] bufferIndex The buffer to read.
407 * @return The property value.
409 const int& operator[]( BufferIndex bufferIndex ) const
411 return mValue[bufferIndex];
415 * Set both the property value & base value.
416 * @param[in] bufferIndex The buffer to write for the property value.
417 * @param[in] value The new property value.
419 void Bake(BufferIndex bufferIndex, int value)
421 mValue[bufferIndex] = value;
422 mValue[1-bufferIndex] = value;
423 mBaseValue = mValue[bufferIndex];
429 * Change the property value & base value by a relative amount.
430 * @param[in] bufferIndex The buffer to write for the local property value.
431 * @param[in] delta The property will change by this amount.
433 void BakeRelative(BufferIndex bufferIndex, int delta)
435 mValue[bufferIndex] = mValue[bufferIndex] + delta;
436 mBaseValue = mValue[bufferIndex];
442 * Sets both double-buffered values & the base value.
443 * This should only be used when the owning object has not been connected to the scene-graph.
444 * @param[in] value The new property value.
446 void SetInitial(const int& value)
449 mValue[1] = mValue[0];
450 mBaseValue = mValue[0];
454 * Change both double-buffered values & the base value by a relative amount.
455 * This should only be used when the owning object has not been connected to the scene-graph.
456 * @param[in] delta The property will change by this amount.
458 void SetInitialRelative(const int& delta)
460 mValue[0] = mValue[0] + delta;
461 mValue[1] = mValue[0];
462 mBaseValue = mValue[0];
468 AnimatableProperty(const AnimatableProperty& property);
471 AnimatableProperty& operator=(const AnimatableProperty& rhs);
475 DoubleBuffered<int> mValue; ///< The double-buffered property value
476 int mBaseValue; ///< Reset to this base value at the beginning of each frame
481 * An float animatable property of a scene-graph object.
484 class AnimatableProperty<float> : public AnimatablePropertyBase
489 * Create an animatable property.
490 * @param [in] initialValue The initial value of the property.
492 AnimatableProperty( float initialValue )
493 : mValue( initialValue ),
494 mBaseValue( initialValue )
499 * Virtual destructor.
501 virtual ~AnimatableProperty()
506 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
508 virtual Dali::Property::Type GetType() const
510 return Dali::PropertyTypes::Get<float>();
514 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
516 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
518 if (CLEAN_FLAG != mDirtyFlags)
520 mValue[updateBufferIndex] = mBaseValue;
522 mDirtyFlags = ( mDirtyFlags >> 1 );
527 * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
529 virtual const float& GetFloat( BufferIndex bufferIndex ) const
531 return mValue[ bufferIndex ];
535 * Set the property value. This will only persist for the current frame; the property
536 * will be reset with the base value, at the beginning of the next frame.
537 * @param[in] bufferIndex The buffer to write.
538 * @param[in] value The new property value.
540 void Set(BufferIndex bufferIndex, float value)
542 mValue[bufferIndex] = value;
548 * Change the property value by a relative amount.
549 * @param[in] bufferIndex The buffer to write.
550 * @param[in] delta The property will change by this amount.
552 void SetRelative(BufferIndex bufferIndex, float delta)
554 mValue[bufferIndex] = mValue[bufferIndex] + delta;
560 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
562 float& Get( BufferIndex bufferIndex )
564 return mValue[bufferIndex];
568 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
570 const float& Get( BufferIndex bufferIndex ) const
572 return mValue[bufferIndex];
576 * Retrieve the property value.
577 * @param[in] bufferIndex The buffer to read.
578 * @return The property value.
580 float& operator[]( BufferIndex bufferIndex )
582 return mValue[bufferIndex];
586 * Retrieve the property value.
587 * @param[in] bufferIndex The buffer to read.
588 * @return The property value.
590 const float& operator[]( BufferIndex bufferIndex ) const
592 return mValue[bufferIndex];
596 * Set both the property value & base value.
597 * @param[in] bufferIndex The buffer to write for the property value.
598 * @param[in] value The new property value.
600 void Bake(BufferIndex bufferIndex, float value)
602 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
603 // has never been atomically safe.
604 mValue[bufferIndex] = value;
605 mValue[1-bufferIndex] = value;
606 mBaseValue = mValue[bufferIndex];
612 * Change the property value & base value by a relative amount.
613 * @param[in] bufferIndex The buffer to write for the local property value.
614 * @param[in] delta The property will change by this amount.
616 void BakeRelative(BufferIndex bufferIndex, float delta)
618 mValue[bufferIndex] = mValue[bufferIndex] + delta;
619 mBaseValue = mValue[bufferIndex];
625 * Sets both double-buffered values & the base value.
626 * This should only be used when the owning object has not been connected to the scene-graph.
627 * @param[in] value The new property value.
629 void SetInitial(const float& value)
632 mValue[1] = mValue[0];
633 mBaseValue = mValue[0];
637 * Change both double-buffered values & the base value by a relative amount.
638 * This should only be used when the owning object has not been connected to the scene-graph.
639 * @param[in] delta The property will change by this amount.
641 void SetInitialRelative(const float& delta)
643 mValue[0] = mValue[0] + delta;
644 mValue[1] = mValue[0];
645 mBaseValue = mValue[0];
651 AnimatableProperty(const AnimatableProperty& property);
654 AnimatableProperty& operator=(const AnimatableProperty& rhs);
658 DoubleBuffered<float> mValue; ///< The double-buffered property value
659 float mBaseValue; ///< Reset to this base value at the beginning of each frame
663 * An Vector2 animatable property of a scene-graph object.
666 class AnimatableProperty<Vector2> : public AnimatablePropertyBase
671 * Create an animatable property.
672 * @param [in] initialValue The initial value of the property.
674 AnimatableProperty( const Vector2& initialValue )
675 : mValue( initialValue ),
676 mBaseValue( initialValue )
681 * Virtual destructor.
683 virtual ~AnimatableProperty()
688 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
690 virtual Dali::Property::Type GetType() const
692 return Dali::PropertyTypes::Get<Vector2>();
696 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
698 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
700 if (CLEAN_FLAG != mDirtyFlags)
702 mValue[updateBufferIndex] = mBaseValue;
704 mDirtyFlags = ( mDirtyFlags >> 1 );
709 * @copydoc Dali::PropertyInput::GetVector2()
711 virtual const Vector2& GetVector2( BufferIndex bufferIndex ) const
713 return mValue[ bufferIndex ];
717 * Set the property value. This will only persist for the current frame; the property
718 * will be reset with the base value, at the beginning of the next frame.
719 * @param[in] bufferIndex The buffer to write.
720 * @param[in] value The new property value.
722 void Set(BufferIndex bufferIndex, const Vector2& value)
724 mValue[bufferIndex] = value;
730 * Set the property value. This will only persist for the current frame; the property
731 * will be reset with the base value, at the beginning of the next frame.
732 * @param[in] bufferIndex The buffer to write.
733 * @param[in] value The new X value.
735 void SetX(BufferIndex bufferIndex, float value)
737 mValue[bufferIndex].x = value;
743 * Set the property value. This will only persist for the current frame; the property
744 * will be reset with the base value, at the beginning of the next frame.
745 * @param[in] bufferIndex The buffer to write.
746 * @param[in] value The new Y value.
748 void SetY(BufferIndex bufferIndex, float value)
750 mValue[bufferIndex].y = value;
756 * Change the property value by a relative amount.
757 * @param[in] bufferIndex The buffer to write.
758 * @param[in] delta The property will change by this amount.
760 void SetRelative(BufferIndex bufferIndex, const Vector2& delta)
762 mValue[bufferIndex] += delta;
768 * Change the X value by a relative amount.
769 * @param[in] bufferIndex The buffer to write.
770 * @param[in] delta The X value will change by this amount.
772 void SetXRelative(BufferIndex bufferIndex, float delta)
774 mValue[bufferIndex].x += delta;
780 * Change the Y value by a relative amount.
781 * @param[in] bufferIndex The buffer to write.
782 * @param[in] delta The Y value will change by this amount.
784 void SetYRelative(BufferIndex bufferIndex, float delta)
786 mValue[bufferIndex].y += delta;
792 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
794 Vector2& Get( BufferIndex bufferIndex )
796 return mValue[bufferIndex];
800 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
802 const Vector2& Get( BufferIndex bufferIndex ) const
804 return mValue[bufferIndex];
808 * Retrieve the property value.
809 * @param[in] bufferIndex The buffer to read.
810 * @return The property value.
812 Vector2& operator[]( BufferIndex bufferIndex )
814 return mValue[bufferIndex];
818 * Retrieve the property value.
819 * @param[in] bufferIndex The buffer to read.
820 * @return The property value.
822 const Vector2& operator[]( BufferIndex bufferIndex ) const
824 return mValue[bufferIndex];
828 * Set both the property value & base value.
829 * @param[in] bufferIndex The buffer to write for the property value.
830 * @param[in] value The new property value.
832 void Bake(BufferIndex bufferIndex, const Vector2& value)
834 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
835 // has never been atomically safe.
836 mValue[bufferIndex] = value;
837 mValue[1-bufferIndex] = value;
844 * Set both the X value & base X value.
845 * @param[in] bufferIndex The buffer to write for the property value.
846 * @param[in] value The new property value.
848 void BakeX(BufferIndex bufferIndex, float value)
850 mValue[bufferIndex].x = value;
851 mValue[1-bufferIndex].x = value;
852 mBaseValue.x = value;
858 * Set both the Y value & base Y value.
859 * @param[in] bufferIndex The buffer to write for the property value.
860 * @param[in] value The new property value.
862 void BakeY(BufferIndex bufferIndex, float value)
864 mValue[bufferIndex].y = value;
865 mValue[1-bufferIndex].y = value;
866 mBaseValue.y = value;
872 * Change the property value & base value by a relative amount.
873 * @param[in] bufferIndex The buffer to write for the local property value.
874 * @param[in] delta The property will change by this amount.
876 void BakeRelative(BufferIndex bufferIndex, const Vector2& delta)
878 mValue[bufferIndex] += delta;
879 mBaseValue = mValue[bufferIndex];
885 * Change the X value & base X value by a relative amount.
886 * @param[in] bufferIndex The buffer to write for the local property value.
887 * @param[in] delta The X value will change by this amount.
889 void BakeXRelative(BufferIndex bufferIndex, float delta)
891 mValue[bufferIndex].x += delta;
892 mBaseValue.x = mValue[bufferIndex].x;
898 * Change the Y value & base Y value by a relative amount.
899 * @param[in] bufferIndex The buffer to write for the local property value.
900 * @param[in] delta The Y value will change by this amount.
902 void BakeYRelative(BufferIndex bufferIndex, float delta)
904 mValue[bufferIndex].y += delta;
905 mBaseValue.y = mValue[bufferIndex].y;
913 AnimatableProperty(const AnimatableProperty& property);
916 AnimatableProperty& operator=(const AnimatableProperty& rhs);
920 DoubleBuffered<Vector2> mValue; ///< The double-buffered property value
921 Vector2 mBaseValue; ///< Reset to this base value at the beginning of each frame
926 * A Vector3 animatable property of a scene-graph object.
929 class AnimatableProperty<Vector3> : public AnimatablePropertyBase
934 * Create an animatable property.
943 * Create an animatable property.
944 * @param [in] initialValue The initial value of the property.
946 AnimatableProperty( const Vector3& initialValue )
947 : mValue( initialValue ),
948 mBaseValue( initialValue )
953 * Virtual destructor.
955 virtual ~AnimatableProperty()
960 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
962 virtual Dali::Property::Type GetType() const
964 return Dali::PropertyTypes::Get<Vector3>();
968 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
970 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
972 if (CLEAN_FLAG != mDirtyFlags)
974 mValue[updateBufferIndex] = mBaseValue;
976 mDirtyFlags = ( mDirtyFlags >> 1 );
981 * @copydoc Dali::PropertyInput::GetVector3()
983 virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
985 return mValue[ bufferIndex ];
989 * Set the property value. This will only persist for the current frame; the property
990 * will be reset with the base value, at the beginning of the next frame.
991 * @param[in] bufferIndex The buffer to write.
992 * @param[in] value The new property value.
994 void Set(BufferIndex bufferIndex, const Vector3& value)
996 mValue[bufferIndex] = value;
1002 * Set the property value. This will only persist for the current frame; the property
1003 * will be reset with the base value, at the beginning of the next frame.
1004 * @param[in] bufferIndex The buffer to write.
1005 * @param[in] value The new X value.
1007 void SetX(BufferIndex bufferIndex, float value)
1009 mValue[bufferIndex].x = value;
1015 * Set the property value. This will only persist for the current frame; the property
1016 * will be reset with the base value, at the beginning of the next frame.
1017 * @param[in] bufferIndex The buffer to write.
1018 * @param[in] value The new Y value.
1020 void SetY(BufferIndex bufferIndex, float value)
1022 mValue[bufferIndex].y = value;
1028 * Set the property value. This will only persist for the current frame; the property
1029 * will be reset with the base value, at the beginning of the next frame.
1030 * @param[in] bufferIndex The buffer to write.
1031 * @param[in] value The new Z value.
1033 void SetZ(BufferIndex bufferIndex, float value)
1035 mValue[bufferIndex].z = value;
1041 * Change the property value by a relative amount.
1042 * @param[in] bufferIndex The buffer to write.
1043 * @param[in] delta The property will change by this amount.
1045 void SetRelative(BufferIndex bufferIndex, const Vector3& delta)
1047 mValue[bufferIndex] += delta;
1053 * Change the X value by a relative amount.
1054 * @param[in] bufferIndex The buffer to write.
1055 * @param[in] delta The X value will change by this amount.
1057 void SetXRelative(BufferIndex bufferIndex, float delta)
1059 mValue[bufferIndex].x += delta;
1065 * Change the Y value by a relative amount.
1066 * @param[in] bufferIndex The buffer to write.
1067 * @param[in] delta The Y value will change by this amount.
1069 void SetYRelative(BufferIndex bufferIndex, float delta)
1071 mValue[bufferIndex].y += delta;
1077 * Change the Z value by a relative amount.
1078 * @param[in] bufferIndex The buffer to write.
1079 * @param[in] delta The Z value will change by this amount.
1081 void SetZRelative(BufferIndex bufferIndex, float delta)
1083 mValue[bufferIndex].z += delta;
1089 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1091 Vector3& Get( BufferIndex bufferIndex )
1093 return mValue[bufferIndex];
1097 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1099 const Vector3& Get( BufferIndex bufferIndex ) const
1101 return mValue[bufferIndex];
1105 * Retrieve the property value.
1106 * @param[in] bufferIndex The buffer to read.
1107 * @return The property value.
1109 Vector3& operator[]( BufferIndex bufferIndex )
1111 return mValue[bufferIndex];
1115 * Retrieve the property value.
1116 * @param[in] bufferIndex The buffer to read.
1117 * @return The property value.
1119 const Vector3& operator[]( BufferIndex bufferIndex ) const
1121 return mValue[bufferIndex];
1125 * Set both the property value & base value.
1126 * @param[in] bufferIndex The buffer to write for the property value.
1127 * @param[in] value The new property value.
1129 void Bake(BufferIndex bufferIndex, const Vector3& value)
1131 mValue[bufferIndex] = value;
1132 mValue[1-bufferIndex] = value;
1139 * Set both the X value & base X value.
1140 * @param[in] bufferIndex The buffer to write for the property value.
1141 * @param[in] value The new property value.
1143 void BakeX(BufferIndex bufferIndex, float value)
1145 mValue[bufferIndex].x = value;
1146 mValue[1-bufferIndex].x = value;
1147 mBaseValue.x = value;
1153 * Set both the Y value & base Y value.
1154 * @param[in] bufferIndex The buffer to write for the property value.
1155 * @param[in] value The new property value.
1157 void BakeY(BufferIndex bufferIndex, float value)
1159 mValue[bufferIndex].y = value;
1160 mValue[1-bufferIndex].y = value;
1161 mBaseValue.y = value;
1167 * Set both the Z value & base Z value.
1168 * @param[in] bufferIndex The buffer to write for the property value.
1169 * @param[in] value The new property value.
1171 void BakeZ(BufferIndex bufferIndex, float value)
1173 mValue[bufferIndex].z = value;
1174 mValue[1-bufferIndex].z = value;
1175 mBaseValue.z = value;
1181 * Change the property value & base value by a relative amount.
1182 * @param[in] bufferIndex The buffer to write for the local property value.
1183 * @param[in] delta The property will change by this amount.
1185 void BakeRelative(BufferIndex bufferIndex, const Vector3& delta)
1187 mValue[bufferIndex] += delta;
1188 mBaseValue = mValue[bufferIndex];
1194 * Change the property value & base value by a relative amount.
1195 * @param[in] bufferIndex The buffer to write for the local property value.
1196 * @param[in] delta The property will change by this amount.
1198 void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& delta)
1200 mValue[bufferIndex] *= delta;
1201 mBaseValue = mValue[bufferIndex];
1207 * Change the X value & base X value by a relative amount.
1208 * @param[in] bufferIndex The buffer to write for the local property value.
1209 * @param[in] delta The X value will change by this amount.
1211 void BakeXRelative(BufferIndex bufferIndex, float delta)
1213 mValue[bufferIndex].x += delta;
1214 mBaseValue.x = mValue[bufferIndex].x;
1220 * Change the Y value & base Y value by a relative amount.
1221 * @param[in] bufferIndex The buffer to write for the local property value.
1222 * @param[in] delta The Y value will change by this amount.
1224 void BakeYRelative(BufferIndex bufferIndex, float delta)
1226 mValue[bufferIndex].y += delta;
1227 mBaseValue.y = mValue[bufferIndex].y;
1233 * Change the Z value & base Z value by a relative amount.
1234 * @param[in] bufferIndex The buffer to write for the local property value.
1235 * @param[in] delta The Z value will change by this amount.
1237 void BakeZRelative(BufferIndex bufferIndex, float delta)
1239 mValue[bufferIndex].z += delta;
1240 mBaseValue.z = mValue[bufferIndex].z;
1248 AnimatableProperty(const AnimatableProperty& property);
1251 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1255 DoubleBuffered<Vector3> mValue; ///< The double-buffered property value
1256 Vector3 mBaseValue; ///< Reset to this base value at the beginning of each frame
1261 * A Vector4 animatable property of a scene-graph object.
1264 class AnimatableProperty<Vector4> : public AnimatablePropertyBase
1269 * Create an animatable property.
1270 * @param [in] initialValue The initial value of the property.
1272 AnimatableProperty( const Vector4& initialValue )
1273 : mValue( initialValue ),
1274 mBaseValue( initialValue )
1279 * Virtual destructor.
1281 virtual ~AnimatableProperty()
1286 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1288 virtual Dali::Property::Type GetType() const
1290 return Dali::PropertyTypes::Get<Vector4>();
1294 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1296 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1298 if (CLEAN_FLAG != mDirtyFlags)
1300 mValue[updateBufferIndex] = mBaseValue;
1302 mDirtyFlags = ( mDirtyFlags >> 1 );
1307 * @copydoc Dali::PropertyInput::GetVector4()
1309 virtual const Vector4& GetVector4( BufferIndex bufferIndex ) const
1311 return mValue[ bufferIndex ];
1315 * Set the property value. This will only persist for the current frame; the property
1316 * will be reset with the base value, at the beginning of the next frame.
1317 * @param[in] bufferIndex The buffer to write.
1318 * @param[in] value The new property value.
1320 void Set(BufferIndex bufferIndex, const Vector4& value)
1322 mValue[bufferIndex] = value;
1328 * Set the X value. This will only persist for the current frame; the property
1329 * will be reset with the base value, at the beginning of the next frame.
1330 * @param[in] bufferIndex The buffer to write.
1331 * @param[in] value The new X value.
1333 void SetX(BufferIndex bufferIndex, float value)
1335 mValue[bufferIndex].x = value;
1341 * Set the Y value. This will only persist for the current frame; the property
1342 * will be reset with the base value, at the beginning of the next frame.
1343 * @param[in] bufferIndex The buffer to write.
1344 * @param[in] value The new Y value.
1346 void SetY(BufferIndex bufferIndex, float value)
1348 mValue[bufferIndex].y = value;
1354 * Set the Z value. This will only persist for the current frame; the property
1355 * will be reset with the base value, at the beginning of the next frame.
1356 * @param[in] bufferIndex The buffer to write.
1357 * @param[in] value The new Z value.
1359 void SetZ(BufferIndex bufferIndex, float value)
1361 mValue[bufferIndex].z = value;
1367 * Set the W value. This will only persist for the current frame; the property
1368 * will be reset with the base value, at the beginning of the next frame.
1369 * @param[in] bufferIndex The buffer to write.
1370 * @param[in] value The new W value.
1372 void SetW(BufferIndex bufferIndex, float value)
1374 mValue[bufferIndex].w = value;
1380 * Change the property value by a relative amount.
1381 * @param[in] bufferIndex The buffer to write.
1382 * @param[in] delta The property will change by this amount.
1384 void SetRelative(BufferIndex bufferIndex, const Vector4& delta)
1386 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1392 * Change the X value by a relative amount.
1393 * @param[in] bufferIndex The buffer to write.
1394 * @param[in] delta The X value will change by this amount.
1396 void SetXRelative(BufferIndex bufferIndex, float delta)
1398 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1404 * Change the Y value by a relative amount.
1405 * @param[in] bufferIndex The buffer to write.
1406 * @param[in] delta The Y value will change by this amount.
1408 void SetYRelative(BufferIndex bufferIndex, float delta)
1410 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1416 * Change the Z value by a relative amount.
1417 * @param[in] bufferIndex The buffer to write.
1418 * @param[in] delta The Z value will change by this amount.
1420 void SetZRelative(BufferIndex bufferIndex, float delta)
1422 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1428 * Change the W value by a relative amount.
1429 * @param[in] bufferIndex The buffer to write.
1430 * @param[in] delta The W value will change by this amount.
1432 void SetWRelative(BufferIndex bufferIndex, float delta)
1434 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1440 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1442 Vector4& Get( BufferIndex bufferIndex )
1444 return mValue[bufferIndex];
1448 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1450 const Vector4& Get( BufferIndex bufferIndex ) const
1452 return mValue[bufferIndex];
1456 * Retrieve the property value.
1457 * @param[in] bufferIndex The buffer to read.
1458 * @return The property value.
1460 Vector4& operator[]( BufferIndex bufferIndex )
1462 return mValue[bufferIndex];
1466 * Retrieve the property value.
1467 * @param[in] bufferIndex The buffer to read.
1468 * @return The property value.
1470 const Vector4& operator[]( BufferIndex bufferIndex ) const
1472 return mValue[bufferIndex];
1476 * Set both the property value & base value.
1477 * @param[in] bufferIndex The buffer to write for the property value.
1478 * @param[in] value The new property value.
1480 void Bake(BufferIndex bufferIndex, const Vector4& value)
1482 mValue[bufferIndex] = value;
1483 mValue[1-bufferIndex] = value;
1484 mBaseValue = mValue[bufferIndex];
1490 * Set both the X value & base X value.
1491 * @param[in] bufferIndex The buffer to write for the property value.
1492 * @param[in] value The new property value.
1494 void BakeX(BufferIndex bufferIndex, float value)
1496 mValue[bufferIndex].x = value;
1497 mValue[1-bufferIndex].x = value;
1498 mBaseValue.x = mValue[bufferIndex].x;
1504 * Set both the Y value & base Y value.
1505 * @param[in] bufferIndex The buffer to write for the property value.
1506 * @param[in] value The new property value.
1508 void BakeY(BufferIndex bufferIndex, float value)
1510 mValue[bufferIndex].y = value;
1511 mValue[1-bufferIndex].y = value;
1512 mBaseValue.y = mValue[bufferIndex].y;
1518 * Set both the Z value & base Z value.
1519 * @param[in] bufferIndex The buffer to write for the property value.
1520 * @param[in] value The new property value.
1522 void BakeZ(BufferIndex bufferIndex, float value)
1524 mValue[bufferIndex].z = value;
1525 mValue[1-bufferIndex].z = value;
1526 mBaseValue.z = mValue[bufferIndex].z;
1532 * Set both the W value & base W value.
1533 * @param[in] bufferIndex The buffer to write for the property value.
1534 * @param[in] value The new property value.
1536 void BakeW(BufferIndex bufferIndex, float value)
1538 mValue[bufferIndex].w = value;
1539 mValue[1-bufferIndex].w = value;
1540 mBaseValue.w = mValue[bufferIndex].w;
1546 * Change the property value & base value by a relative amount.
1547 * @param[in] bufferIndex The buffer to write for the local property value.
1548 * @param[in] delta The property will change by this amount.
1550 void BakeRelative(BufferIndex bufferIndex, const Vector4& delta)
1552 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1553 mBaseValue = mValue[bufferIndex];
1559 * Change the X value & base X value by a relative amount.
1560 * @param[in] bufferIndex The buffer to write for the local property value.
1561 * @param[in] delta The X value will change by this amount.
1563 void BakeXRelative(BufferIndex bufferIndex, float delta)
1565 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1566 mBaseValue.x = mValue[bufferIndex].x;
1572 * Change the Y value & base Y value by a relative amount.
1573 * @param[in] bufferIndex The buffer to write for the local property value.
1574 * @param[in] delta The Y value will change by this amount.
1576 void BakeYRelative(BufferIndex bufferIndex, float delta)
1578 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1579 mBaseValue.y = mValue[bufferIndex].y;
1585 * Change the Z value & base Z value by a relative amount.
1586 * @param[in] bufferIndex The buffer to write for the local property value.
1587 * @param[in] delta The Z value will change by this amount.
1589 void BakeZRelative(BufferIndex bufferIndex, float delta)
1591 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1592 mBaseValue.z = mValue[bufferIndex].z;
1598 * Change the W value & base W value by a relative amount.
1599 * @param[in] bufferIndex The buffer to write for the local property value.
1600 * @param[in] delta The W value will change by this amount.
1602 void BakeWRelative(BufferIndex bufferIndex, float delta)
1604 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1605 mBaseValue.w = mValue[bufferIndex].w;
1611 * Sets both double-buffered W values & the base W value.
1612 * This should only be used when the owning object has not been connected to the scene-graph.
1613 * @param[in] value The new W value.
1615 void SetWInitial(float value)
1617 mValue[0].w = value;
1618 mValue[1].w = mValue[0].w;
1619 mBaseValue.w = mValue[0].w;
1625 AnimatableProperty(const AnimatableProperty& property);
1628 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1632 DoubleBuffered<Vector4> mValue; ///< The double-buffered property value
1633 Vector4 mBaseValue; ///< Reset to this base value at the beginning of each frame
1637 * An Quaternion animatable property of a scene-graph object.
1640 class AnimatableProperty<Quaternion> : public AnimatablePropertyBase
1645 * Create an animatable property.
1647 AnimatableProperty()
1654 * Create an animatable property.
1655 * @param [in] initialValue The initial value of the property.
1657 AnimatableProperty( const Quaternion& initialValue )
1658 : mValue( initialValue ),
1659 mBaseValue( initialValue )
1664 * Virtual destructor.
1666 virtual ~AnimatableProperty()
1671 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1673 virtual Dali::Property::Type GetType() const
1675 return Dali::PropertyTypes::Get<Quaternion>();
1679 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1681 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1683 if (CLEAN_FLAG != mDirtyFlags)
1685 mValue[updateBufferIndex] = mBaseValue;
1687 mDirtyFlags = ( mDirtyFlags >> 1 );
1692 * @copydoc Dali::PropertyInput::GetQuaternion()
1694 virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const
1696 return mValue[ bufferIndex ];
1700 * Set the property value. This will only persist for the current frame; the property
1701 * will be reset with the base value, at the beginning of the next frame.
1702 * @param[in] bufferIndex The buffer to write.
1703 * @param[in] value The new property value.
1705 void Set(BufferIndex bufferIndex, const Quaternion& value)
1707 mValue[bufferIndex] = value;
1713 * Change the property value by a relative amount.
1714 * @param[in] bufferIndex The buffer to write.
1715 * @param[in] delta The property will change by this amount.
1717 void SetRelative(BufferIndex bufferIndex, const Quaternion& delta)
1719 mValue[bufferIndex] *= delta;
1725 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1727 Quaternion& Get( BufferIndex bufferIndex )
1729 return mValue[bufferIndex];
1733 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1735 const Quaternion& Get( BufferIndex bufferIndex ) const
1737 return mValue[bufferIndex];
1741 * Retrieve the property value.
1742 * @param[in] bufferIndex The buffer to read.
1743 * @return The property value.
1745 Quaternion& operator[]( BufferIndex bufferIndex )
1747 return mValue[bufferIndex];
1751 * Retrieve the property value.
1752 * @param[in] bufferIndex The buffer to read.
1753 * @return The property value.
1755 const Quaternion& operator[]( BufferIndex bufferIndex ) const
1757 return mValue[bufferIndex];
1761 * Set both the property value & base value.
1762 * @param[in] bufferIndex The buffer to write for the property value.
1763 * @param[in] value The new property value.
1765 void Bake(BufferIndex bufferIndex, const Quaternion& value)
1767 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1768 // has never been atomically safe.
1769 mValue[bufferIndex] = value;
1770 mValue[1-bufferIndex] = value;
1777 * Change the property value & base value by a relative amount.
1778 * @param[in] bufferIndex The buffer to write for the local property value.
1779 * @param[in] delta The property will change by this amount.
1781 void BakeRelative(BufferIndex bufferIndex, const Quaternion& delta)
1783 mValue[bufferIndex] *= delta;
1784 mBaseValue = mValue[bufferIndex];
1792 AnimatableProperty(const AnimatableProperty& property);
1795 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1799 DoubleBuffered<Quaternion> mValue; ///< The double-buffered property value
1800 Quaternion mBaseValue; ///< Reset to this base value at the beginning of each frame
1805 * A Matrix animatable property of a scene-graph object.
1808 class AnimatableProperty<Matrix> : public AnimatablePropertyBase
1813 * Create an animatable property.
1814 * @param [in] initialValue The initial value of the property.
1816 AnimatableProperty( const Matrix& initialValue )
1817 : mValue( initialValue ),
1818 mBaseValue( initialValue )
1823 * Virtual destructor.
1825 virtual ~AnimatableProperty()
1830 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1832 virtual Dali::Property::Type GetType() const
1834 return Dali::PropertyTypes::Get<Matrix>();
1838 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1840 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1842 if (CLEAN_FLAG != mDirtyFlags)
1844 mValue[updateBufferIndex] = mBaseValue;
1846 mDirtyFlags = ( mDirtyFlags >> 1 );
1851 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix()
1853 virtual const Matrix& GetMatrix( BufferIndex bufferIndex ) const
1855 return mValue[ bufferIndex ];
1859 * Set the property value. This will only persist for the current frame; the property
1860 * will be reset with the base value, at the beginning of the next frame.
1861 * @param[in] bufferIndex The buffer to write.
1862 * @param[in] value The new property value.
1864 void Set(BufferIndex bufferIndex, const Matrix& value)
1866 mValue[bufferIndex] = value;
1872 * Change the property value by a relative amount.
1873 * @param[in] bufferIndex The buffer to write.
1874 * @param[in] delta The property will change by this amount.
1876 void SetRelative(BufferIndex bufferIndex, const Matrix& delta)
1879 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1880 mValue[bufferIndex] = temp;
1886 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1888 Matrix& Get( BufferIndex bufferIndex )
1890 return mValue[bufferIndex];
1894 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1896 const Matrix& Get( BufferIndex bufferIndex ) const
1898 return mValue[bufferIndex];
1902 * Retrieve the property value.
1903 * @param[in] bufferIndex The buffer to read.
1904 * @return The property value.
1906 Matrix& operator[]( BufferIndex bufferIndex )
1908 return mValue[bufferIndex];
1912 * Retrieve the property value.
1913 * @param[in] bufferIndex The buffer to read.
1914 * @return The property value.
1916 const Matrix& operator[]( BufferIndex bufferIndex ) const
1918 return mValue[bufferIndex];
1922 * Set both the property value & base value.
1923 * @param[in] bufferIndex The buffer to write for the property value.
1924 * @param[in] value The new property value.
1926 void Bake(BufferIndex bufferIndex, const Matrix& value)
1928 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1929 // has never been atomically safe.
1930 mValue[bufferIndex] = value;
1931 mValue[1-bufferIndex] = value;
1932 mBaseValue = mValue[bufferIndex];
1938 * Change the property value & base value by a relative amount.
1939 * @param[in] bufferIndex The buffer to write for the local property value.
1940 * @param[in] delta The property will change by this amount.
1942 void BakeRelative(BufferIndex bufferIndex, const Matrix& delta)
1945 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1946 mValue[bufferIndex] = temp;
1955 AnimatableProperty(const AnimatableProperty& property);
1958 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1962 DoubleBuffered<Matrix> mValue; ///< The double-buffered property value
1963 Matrix mBaseValue; ///< Reset to this base value at the beginning of each frame
1968 * A Matrix3 animatable property of a scene-graph object.
1971 class AnimatableProperty<Matrix3> : public AnimatablePropertyBase
1976 * Create an animatable property.
1977 * @param [in] initialValue The initial value of the property.
1979 AnimatableProperty( const Matrix3& initialValue )
1980 : mValue( initialValue ),
1981 mBaseValue( initialValue )
1986 * Virtual destructor.
1988 virtual ~AnimatableProperty()
1993 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1995 virtual Dali::Property::Type GetType() const
1997 return Dali::PropertyTypes::Get<Matrix3>();
2001 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
2003 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
2005 if (CLEAN_FLAG != mDirtyFlags)
2007 mValue[updateBufferIndex] = mBaseValue;
2009 mDirtyFlags = ( mDirtyFlags >> 1 );
2014 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix3()
2016 virtual const Matrix3& GetMatrix3( BufferIndex bufferIndex ) const
2018 return mValue[ bufferIndex ];
2022 * Set the property value. This will only persist for the current frame; the property
2023 * will be reset with the base value, at the beginning of the next frame.
2024 * @param[in] bufferIndex The buffer to write.
2025 * @param[in] value The new property value.
2027 void Set(BufferIndex bufferIndex, const Matrix3& value)
2029 mValue[bufferIndex] = value;
2034 * Change the property value by a relative amount.
2035 * @param[in] bufferIndex The buffer to write.
2036 * @param[in] delta The property will change by this amount.
2038 void SetRelative(BufferIndex bufferIndex, const Matrix3& delta)
2041 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
2042 mValue[bufferIndex] = temp;
2047 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
2049 Matrix3& Get( BufferIndex bufferIndex )
2051 return mValue[bufferIndex];
2055 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
2057 const Matrix3& Get( BufferIndex bufferIndex ) const
2059 return mValue[bufferIndex];
2063 * Retrieve the property value.
2064 * @param[in] bufferIndex The buffer to read.
2065 * @return The property value.
2067 Matrix3& operator[]( BufferIndex bufferIndex )
2069 return mValue[bufferIndex];
2073 * Retrieve the property value.
2074 * @param[in] bufferIndex The buffer to read.
2075 * @return The property value.
2077 const Matrix3& operator[]( BufferIndex bufferIndex ) const
2079 return mValue[bufferIndex];
2083 * Set both the property value & base value.
2084 * @param[in] bufferIndex The buffer to write for the property value.
2085 * @param[in] value The new property value.
2087 void Bake(BufferIndex bufferIndex, const Matrix3& value)
2089 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
2090 // has never been atomically safe.
2091 mValue[bufferIndex] = value;
2092 mValue[1-bufferIndex] = value;
2093 mBaseValue = mValue[bufferIndex];
2099 * Change the property value & base value by a relative amount.
2100 * @param[in] bufferIndex The buffer to write for the local property value.
2101 * @param[in] delta The property will change by this amount.
2103 void BakeRelative(BufferIndex bufferIndex, const Matrix3& delta)
2106 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
2107 mValue[bufferIndex] = temp;
2116 AnimatableProperty(const AnimatableProperty& property);
2119 AnimatableProperty& operator=(const AnimatableProperty& rhs);
2123 DoubleBuffered<Matrix3> mValue; ///< The double-buffered property value
2124 Matrix3 mBaseValue; ///< Reset to this base value at the beginning of each frame
2128 } // namespace SceneGraph
2130 // Messages for AnimatableProperty<T>
2133 void BakeMessage( EventThreadServices& eventThreadServices,
2134 const SceneGraph::AnimatableProperty<T>& property,
2135 typename ParameterType< T >::PassingType newValue )
2137 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, T > LocalType;
2139 // Reserve some memory inside the message queue
2140 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2142 // Construct message in the message queue memory; note that delete should not be called on the return value
2143 new (slot) LocalType( &property,
2144 &SceneGraph::AnimatableProperty<T>::Bake,
2149 void BakeRelativeMessage( EventThreadServices& eventThreadServices,
2150 const SceneGraph::AnimatableProperty<T>& property,
2153 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, const T& > LocalType;
2155 // Reserve some memory inside the message queue
2156 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2158 // Construct message in the message queue memory; note that delete should not be called on the return value
2159 new (slot) LocalType( &property,
2160 &SceneGraph::AnimatableProperty<T>::BakeRelative,
2165 void SetXComponentMessage( EventThreadServices& eventThreadServices,
2166 const SceneGraph::AnimatableProperty<T>& property,
2167 typename ParameterType< float >::PassingType newValue )
2169 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2171 // Reserve some memory inside the message queue
2172 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2174 // Construct message in the message queue memory; note that delete should not be called on the return value
2175 new (slot) LocalType( &property,
2176 &SceneGraph::AnimatableProperty<T>::BakeX,
2181 void SetYComponentMessage( EventThreadServices& eventThreadServices,
2182 const SceneGraph::AnimatableProperty<T>& property,
2183 typename ParameterType< float >::PassingType newValue )
2185 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2187 // Reserve some memory inside the message queue
2188 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2190 // Construct message in the message queue memory; note that delete should not be called on the return value
2191 new (slot) LocalType( &property,
2192 &SceneGraph::AnimatableProperty<T>::BakeY,
2197 void SetZComponentMessage( EventThreadServices& eventThreadServices,
2198 const SceneGraph::AnimatableProperty<T>& property,
2199 typename ParameterType< float >::PassingType newValue )
2201 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2203 // Reserve some memory inside the message queue
2204 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2206 // Construct message in the message queue memory; note that delete should not be called on the return value
2207 new (slot) LocalType( &property,
2208 &SceneGraph::AnimatableProperty<T>::BakeZ,
2213 void SetWComponentMessage( EventThreadServices& eventThreadServices,
2214 const SceneGraph::AnimatableProperty<T>& property,
2215 typename ParameterType< float >::PassingType newValue )
2217 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2219 // Reserve some memory inside the message queue
2220 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2222 // Construct message in the message queue memory; note that delete should not be called on the return value
2223 new (slot) LocalType( &property,
2224 &SceneGraph::AnimatableProperty<T>::BakeW,
2228 } // namespace Internal
2232 #endif // DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H