1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H__
5 * Copyright (c) 2014 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 unsigned int CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame
56 static const unsigned int BAKED_FLAG = 0x01; ///< Indicates that the value was Baked during the previous frame
57 static const unsigned int 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 unsigned int 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(size_t bufferIndex)
219 return mValue[bufferIndex];
223 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
225 const bool& Get(size_t 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[](size_t 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[](size_t 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 mValue[bufferIndex] = value;
268 * Change the property value & base value by a relative amount.
269 * @param[in] bufferIndex The buffer to write for the local property value.
270 * @param[in] delta The property will change by this amount.
272 void BakeRelative(BufferIndex bufferIndex, bool delta)
274 mValue[bufferIndex] += delta;
275 mBaseValue = mValue[bufferIndex];
283 AnimatableProperty(const AnimatableProperty& property);
286 AnimatableProperty& operator=(const AnimatableProperty& rhs);
290 DoubleBuffered<bool> mValue; ///< The double-buffered property value
291 bool mBaseValue; ///< Reset to this base value at the beginning of each frame
297 * An integer animatable property of a scene-graph object.
300 class AnimatableProperty<int> : public AnimatablePropertyBase
305 * Create an animatable property.
306 * @param [in] initialValue The initial value of the property.
308 AnimatableProperty( int initialValue )
309 : mValue( initialValue ),
310 mBaseValue( initialValue )
315 * Virtual destructor.
317 virtual ~AnimatableProperty()
322 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
324 virtual Dali::Property::Type GetType() const
326 return Dali::PropertyTypes::Get<int>();
330 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
332 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
334 if (CLEAN_FLAG != mDirtyFlags)
336 mValue[updateBufferIndex] = mBaseValue;
338 mDirtyFlags = ( mDirtyFlags >> 1 );
343 * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
345 virtual const int& GetInteger( BufferIndex bufferIndex ) const
347 return mValue[ bufferIndex ];
351 * Set the property value. This will only persist for the current frame; the property
352 * will be reset with the base value, at the beginning of the next frame.
353 * @param[in] bufferIndex The buffer to write.
354 * @param[in] value The new property value.
356 void Set(BufferIndex bufferIndex, int value)
358 mValue[bufferIndex] = value;
364 * Change the property value by a relative amount.
365 * @param[in] bufferIndex The buffer to write.
366 * @param[in] delta The property will change by this amount.
368 void SetRelative(BufferIndex bufferIndex, int delta)
370 mValue[bufferIndex] = mValue[bufferIndex] + delta;
376 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
378 int& Get(size_t bufferIndex)
380 return mValue[bufferIndex];
384 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
386 const int& Get(size_t bufferIndex) const
388 return mValue[bufferIndex];
392 * Retrieve the property value.
393 * @param[in] bufferIndex The buffer to read.
394 * @return The property value.
396 int& operator[](size_t bufferIndex)
398 return mValue[bufferIndex];
402 * Retrieve the property value.
403 * @param[in] bufferIndex The buffer to read.
404 * @return The property value.
406 const int& operator[](size_t bufferIndex) const
408 return mValue[bufferIndex];
412 * Set both the property value & base value.
413 * @param[in] bufferIndex The buffer to write for the property value.
414 * @param[in] value The new property value.
416 void Bake(BufferIndex bufferIndex, int value)
418 mValue[bufferIndex] = value;
419 mBaseValue = mValue[bufferIndex];
425 * Change the property value & base value by a relative amount.
426 * @param[in] bufferIndex The buffer to write for the local property value.
427 * @param[in] delta The property will change by this amount.
429 void BakeRelative(BufferIndex bufferIndex, int delta)
431 mValue[bufferIndex] = mValue[bufferIndex] + delta;
432 mBaseValue = mValue[bufferIndex];
438 * Sets both double-buffered values & the base value.
439 * This should only be used when the owning object has not been connected to the scene-graph.
440 * @param[in] value The new property value.
442 void SetInitial(const int& value)
445 mValue[1] = mValue[0];
446 mBaseValue = mValue[0];
450 * Change both double-buffered values & the base value by a relative amount.
451 * This should only be used when the owning object has not been connected to the scene-graph.
452 * @param[in] delta The property will change by this amount.
454 void SetInitialRelative(const int& delta)
456 mValue[0] = mValue[0] + delta;
457 mValue[1] = mValue[0];
458 mBaseValue = mValue[0];
464 AnimatableProperty(const AnimatableProperty& property);
467 AnimatableProperty& operator=(const AnimatableProperty& rhs);
471 DoubleBuffered<int> mValue; ///< The double-buffered property value
472 int mBaseValue; ///< Reset to this base value at the beginning of each frame
477 * An unsigned integer animatable property of a scene-graph object.
480 class AnimatableProperty<unsigned int> : public AnimatablePropertyBase
485 * Create an animatable property.
486 * @param [in] initialValue The initial value of the property.
488 AnimatableProperty( unsigned int initialValue )
489 : mValue( initialValue ),
490 mBaseValue( initialValue )
495 * Virtual destructor.
497 virtual ~AnimatableProperty()
502 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
504 virtual Dali::Property::Type GetType() const
506 return Dali::PropertyTypes::Get<unsigned int>();
510 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
512 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
514 if (CLEAN_FLAG != mDirtyFlags)
516 mValue[updateBufferIndex] = mBaseValue;
518 mDirtyFlags = ( mDirtyFlags >> 1 );
523 * @copydoc Dali::Internal::PropertyInputImpl::GetUnsignedInteger()
525 virtual const unsigned int& GetUnsignedInteger( BufferIndex bufferIndex ) const
527 return mValue[ bufferIndex ];
531 * Set the property value. This will only persist for the current frame; the property
532 * will be reset with the base value, at the beginning of the next frame.
533 * @param[in] bufferIndex The buffer to write.
534 * @param[in] value The new property value.
536 void Set(BufferIndex bufferIndex, unsigned int value)
538 mValue[bufferIndex] = value;
544 * Change the property value by a relative amount.
545 * @param[in] bufferIndex The buffer to write.
546 * @param[in] delta The property will change by this amount.
548 void SetRelative(BufferIndex bufferIndex, unsigned int delta)
550 mValue[bufferIndex] = mValue[bufferIndex] + delta;
556 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
558 unsigned int& Get(size_t bufferIndex)
560 return mValue[bufferIndex];
564 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
566 const unsigned int& Get(size_t bufferIndex) const
568 return mValue[bufferIndex];
572 * Retrieve the property value.
573 * @param[in] bufferIndex The buffer to read.
574 * @return The property value.
576 unsigned int& operator[](size_t bufferIndex)
578 return mValue[bufferIndex];
582 * Retrieve the property value.
583 * @param[in] bufferIndex The buffer to read.
584 * @return The property value.
586 const unsigned int& operator[](size_t bufferIndex) const
588 return mValue[bufferIndex];
592 * Set both the property value & base value.
593 * @param[in] bufferIndex The buffer to write for the property value.
594 * @param[in] value The new property value.
596 void Bake(BufferIndex bufferIndex, unsigned int value)
598 mValue[bufferIndex] = value;
599 mBaseValue = mValue[bufferIndex];
605 * Change the property value & base value by a relative amount.
606 * @param[in] bufferIndex The buffer to write for the local property value.
607 * @param[in] delta The property will change by this amount.
609 void BakeRelative(BufferIndex bufferIndex, unsigned int delta)
611 mValue[bufferIndex] = mValue[bufferIndex] + delta;
612 mBaseValue = mValue[bufferIndex];
618 * Sets both double-buffered values & the base value.
619 * This should only be used when the owning object has not been connected to the scene-graph.
620 * @param[in] value The new property value.
622 void SetInitial(const unsigned int& value)
625 mValue[1] = mValue[0];
626 mBaseValue = mValue[0];
630 * Change both double-buffered values & the base value by a relative amount.
631 * This should only be used when the owning object has not been connected to the scene-graph.
632 * @param[in] delta The property will change by this amount.
634 void SetInitialRelative(const unsigned int& delta)
636 mValue[0] = mValue[0] + delta;
637 mValue[1] = mValue[0];
638 mBaseValue = mValue[0];
644 AnimatableProperty(const AnimatableProperty& property);
647 AnimatableProperty& operator=(const AnimatableProperty& rhs);
650 DoubleBuffered<unsigned int> mValue; ///< The double-buffered property value
651 unsigned int mBaseValue; ///< Reset to this base value at the beginning of each frame
656 * An float animatable property of a scene-graph object.
659 class AnimatableProperty<float> : public AnimatablePropertyBase
664 * Create an animatable property.
665 * @param [in] initialValue The initial value of the property.
667 AnimatableProperty( float initialValue )
668 : mValue( initialValue ),
669 mBaseValue( initialValue )
674 * Virtual destructor.
676 virtual ~AnimatableProperty()
681 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
683 virtual Dali::Property::Type GetType() const
685 return Dali::PropertyTypes::Get<float>();
689 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
691 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
693 if (CLEAN_FLAG != mDirtyFlags)
695 mValue[updateBufferIndex] = mBaseValue;
697 mDirtyFlags = ( mDirtyFlags >> 1 );
702 * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
704 virtual const float& GetFloat( BufferIndex bufferIndex ) const
706 return mValue[ bufferIndex ];
710 * Set the property value. This will only persist for the current frame; the property
711 * will be reset with the base value, at the beginning of the next frame.
712 * @param[in] bufferIndex The buffer to write.
713 * @param[in] value The new property value.
715 void Set(BufferIndex bufferIndex, float value)
717 mValue[bufferIndex] = value;
723 * Change the property value by a relative amount.
724 * @param[in] bufferIndex The buffer to write.
725 * @param[in] delta The property will change by this amount.
727 void SetRelative(BufferIndex bufferIndex, float delta)
729 mValue[bufferIndex] = mValue[bufferIndex] + delta;
735 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
737 float& Get(size_t bufferIndex)
739 return mValue[bufferIndex];
743 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
745 const float& Get(size_t bufferIndex) const
747 return mValue[bufferIndex];
751 * Retrieve the property value.
752 * @param[in] bufferIndex The buffer to read.
753 * @return The property value.
755 float& operator[](size_t bufferIndex)
757 return mValue[bufferIndex];
761 * Retrieve the property value.
762 * @param[in] bufferIndex The buffer to read.
763 * @return The property value.
765 const float& operator[](size_t bufferIndex) const
767 return mValue[bufferIndex];
771 * Set both the property value & base value.
772 * @param[in] bufferIndex The buffer to write for the property value.
773 * @param[in] value The new property value.
775 void Bake(BufferIndex bufferIndex, float value)
777 mValue[bufferIndex] = value;
778 mBaseValue = mValue[bufferIndex];
784 * Change the property value & base value by a relative amount.
785 * @param[in] bufferIndex The buffer to write for the local property value.
786 * @param[in] delta The property will change by this amount.
788 void BakeRelative(BufferIndex bufferIndex, float delta)
790 mValue[bufferIndex] = mValue[bufferIndex] + delta;
791 mBaseValue = mValue[bufferIndex];
797 * Sets both double-buffered values & the base value.
798 * This should only be used when the owning object has not been connected to the scene-graph.
799 * @param[in] value The new property value.
801 void SetInitial(const float& value)
804 mValue[1] = mValue[0];
805 mBaseValue = mValue[0];
809 * Change both double-buffered values & the base value by a relative amount.
810 * This should only be used when the owning object has not been connected to the scene-graph.
811 * @param[in] delta The property will change by this amount.
813 void SetInitialRelative(const float& delta)
815 mValue[0] = mValue[0] + delta;
816 mValue[1] = mValue[0];
817 mBaseValue = mValue[0];
823 AnimatableProperty(const AnimatableProperty& property);
826 AnimatableProperty& operator=(const AnimatableProperty& rhs);
830 DoubleBuffered<float> mValue; ///< The double-buffered property value
831 float mBaseValue; ///< Reset to this base value at the beginning of each frame
835 * An Vector2 animatable property of a scene-graph object.
838 class AnimatableProperty<Vector2> : public AnimatablePropertyBase
843 * Create an animatable property.
844 * @param [in] initialValue The initial value of the property.
846 AnimatableProperty( const Vector2& initialValue )
847 : mValue( initialValue ),
848 mBaseValue( initialValue )
853 * Virtual destructor.
855 virtual ~AnimatableProperty()
860 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
862 virtual Dali::Property::Type GetType() const
864 return Dali::PropertyTypes::Get<Vector2>();
868 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
870 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
872 if (CLEAN_FLAG != mDirtyFlags)
874 mValue[updateBufferIndex] = mBaseValue;
876 mDirtyFlags = ( mDirtyFlags >> 1 );
881 * @copydoc Dali::PropertyInput::GetVector2()
883 virtual const Vector2& GetVector2( BufferIndex bufferIndex ) const
885 return mValue[ bufferIndex ];
889 * Set the property value. This will only persist for the current frame; the property
890 * will be reset with the base value, at the beginning of the next frame.
891 * @param[in] bufferIndex The buffer to write.
892 * @param[in] value The new property value.
894 void Set(BufferIndex bufferIndex, const Vector2& value)
896 mValue[bufferIndex] = value;
902 * Change the property value by a relative amount.
903 * @param[in] bufferIndex The buffer to write.
904 * @param[in] delta The property will change by this amount.
906 void SetRelative(BufferIndex bufferIndex, const Vector2& delta)
908 mValue[bufferIndex] += delta;
914 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
916 Vector2& Get(size_t bufferIndex)
918 return mValue[bufferIndex];
922 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
924 const Vector2& Get(size_t bufferIndex) const
926 return mValue[bufferIndex];
930 * Retrieve the property value.
931 * @param[in] bufferIndex The buffer to read.
932 * @return The property value.
934 Vector2& operator[](size_t bufferIndex)
936 return mValue[bufferIndex];
940 * Retrieve the property value.
941 * @param[in] bufferIndex The buffer to read.
942 * @return The property value.
944 const Vector2& operator[](size_t bufferIndex) const
946 return mValue[bufferIndex];
950 * Set both the property value & base value.
951 * @param[in] bufferIndex The buffer to write for the property value.
952 * @param[in] value The new property value.
954 void Bake(BufferIndex bufferIndex, const Vector2& value)
956 mValue[bufferIndex] = value;
963 * Change the property value & base value by a relative amount.
964 * @param[in] bufferIndex The buffer to write for the local property value.
965 * @param[in] delta The property will change by this amount.
967 void BakeRelative(BufferIndex bufferIndex, const Vector2& delta)
969 mValue[bufferIndex] += delta;
970 mBaseValue = mValue[bufferIndex];
978 AnimatableProperty(const AnimatableProperty& property);
981 AnimatableProperty& operator=(const AnimatableProperty& rhs);
985 DoubleBuffered<Vector2> mValue; ///< The double-buffered property value
986 Vector2 mBaseValue; ///< Reset to this base value at the beginning of each frame
991 * A Vector3 animatable property of a scene-graph object.
994 class AnimatableProperty<Vector3> : public AnimatablePropertyBase
999 * Create an animatable property.
1001 AnimatableProperty()
1008 * Create an animatable property.
1009 * @param [in] initialValue The initial value of the property.
1011 AnimatableProperty( const Vector3& initialValue )
1012 : mValue( initialValue ),
1013 mBaseValue( initialValue )
1018 * Virtual destructor.
1020 virtual ~AnimatableProperty()
1025 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1027 virtual Dali::Property::Type GetType() const
1029 return Dali::PropertyTypes::Get<Vector3>();
1033 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1035 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1037 if (CLEAN_FLAG != mDirtyFlags)
1039 mValue[updateBufferIndex] = mBaseValue;
1041 mDirtyFlags = ( mDirtyFlags >> 1 );
1046 * @copydoc Dali::PropertyInput::GetVector3()
1048 virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
1050 return mValue[ bufferIndex ];
1054 * Set the property value. This will only persist for the current frame; the property
1055 * will be reset with the base value, at the beginning of the next frame.
1056 * @param[in] bufferIndex The buffer to write.
1057 * @param[in] value The new property value.
1059 void Set(BufferIndex bufferIndex, const Vector3& value)
1061 mValue[bufferIndex] = value;
1067 * Set the property value. This will only persist for the current frame; the property
1068 * will be reset with the base value, at the beginning of the next frame.
1069 * @param[in] bufferIndex The buffer to write.
1070 * @param[in] value The new X value.
1072 void SetX(BufferIndex bufferIndex, float value)
1074 mValue[bufferIndex].x = value;
1080 * Set the property value. This will only persist for the current frame; the property
1081 * will be reset with the base value, at the beginning of the next frame.
1082 * @param[in] bufferIndex The buffer to write.
1083 * @param[in] value The new Y value.
1085 void SetY(BufferIndex bufferIndex, float value)
1087 mValue[bufferIndex].y = value;
1093 * Set the property value. This will only persist for the current frame; the property
1094 * will be reset with the base value, at the beginning of the next frame.
1095 * @param[in] bufferIndex The buffer to write.
1096 * @param[in] value The new Z value.
1098 void SetZ(BufferIndex bufferIndex, float value)
1100 mValue[bufferIndex].z = value;
1106 * Change the property value by a relative amount.
1107 * @param[in] bufferIndex The buffer to write.
1108 * @param[in] delta The property will change by this amount.
1110 void SetRelative(BufferIndex bufferIndex, const Vector3& delta)
1112 mValue[bufferIndex] += delta;
1118 * Change the X value by a relative amount.
1119 * @param[in] bufferIndex The buffer to write.
1120 * @param[in] delta The X value will change by this amount.
1122 void SetXRelative(BufferIndex bufferIndex, float delta)
1124 mValue[bufferIndex].x += delta;
1130 * Change the Y value by a relative amount.
1131 * @param[in] bufferIndex The buffer to write.
1132 * @param[in] delta The Y value will change by this amount.
1134 void SetYRelative(BufferIndex bufferIndex, float delta)
1136 mValue[bufferIndex].y += delta;
1142 * Change the Z value by a relative amount.
1143 * @param[in] bufferIndex The buffer to write.
1144 * @param[in] delta The Z value will change by this amount.
1146 void SetZRelative(BufferIndex bufferIndex, float delta)
1148 mValue[bufferIndex].z += delta;
1154 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1156 Vector3& Get(size_t bufferIndex)
1158 return mValue[bufferIndex];
1162 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1164 const Vector3& Get(size_t bufferIndex) const
1166 return mValue[bufferIndex];
1170 * Retrieve the property value.
1171 * @param[in] bufferIndex The buffer to read.
1172 * @return The property value.
1174 Vector3& operator[](size_t bufferIndex)
1176 return mValue[bufferIndex];
1180 * Retrieve the property value.
1181 * @param[in] bufferIndex The buffer to read.
1182 * @return The property value.
1184 const Vector3& operator[](size_t bufferIndex) const
1186 return mValue[bufferIndex];
1190 * Set both the property value & base value.
1191 * @param[in] bufferIndex The buffer to write for the property value.
1192 * @param[in] value The new property value.
1194 void Bake(BufferIndex bufferIndex, const Vector3& value)
1196 mValue[bufferIndex] = value;
1203 * Set both the X value & base X value.
1204 * @param[in] bufferIndex The buffer to write for the property value.
1205 * @param[in] value The new property value.
1207 void BakeX(BufferIndex bufferIndex, float value)
1209 mValue[bufferIndex].x = value;
1210 mBaseValue.x = value;
1216 * Set both the Y value & base Y value.
1217 * @param[in] bufferIndex The buffer to write for the property value.
1218 * @param[in] value The new property value.
1220 void BakeY(BufferIndex bufferIndex, float value)
1222 mValue[bufferIndex].y = value;
1223 mBaseValue.y = value;
1229 * Set both the Z value & base Z value.
1230 * @param[in] bufferIndex The buffer to write for the property value.
1231 * @param[in] value The new property value.
1233 void BakeZ(BufferIndex bufferIndex, float value)
1235 mValue[bufferIndex].z = value;
1236 mBaseValue.z = value;
1242 * Change the property value & base value by a relative amount.
1243 * @param[in] bufferIndex The buffer to write for the local property value.
1244 * @param[in] delta The property will change by this amount.
1246 void BakeRelative(BufferIndex bufferIndex, const Vector3& delta)
1248 mValue[bufferIndex] += delta;
1249 mBaseValue = mValue[bufferIndex];
1255 * Change the property value & base value by a relative amount.
1256 * @param[in] bufferIndex The buffer to write for the local property value.
1257 * @param[in] delta The property will change by this amount.
1259 void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& delta)
1261 mValue[bufferIndex] *= delta;
1262 mBaseValue = mValue[bufferIndex];
1268 * Change the X value & base X value by a relative amount.
1269 * @param[in] bufferIndex The buffer to write for the local property value.
1270 * @param[in] delta The X value will change by this amount.
1272 void BakeXRelative(BufferIndex bufferIndex, float delta)
1274 mValue[bufferIndex].x += delta;
1275 mBaseValue.x = mValue[bufferIndex].x;
1281 * Change the Y value & base Y value by a relative amount.
1282 * @param[in] bufferIndex The buffer to write for the local property value.
1283 * @param[in] delta The Y value will change by this amount.
1285 void BakeYRelative(BufferIndex bufferIndex, float delta)
1287 mValue[bufferIndex].y += delta;
1288 mBaseValue.y = mValue[bufferIndex].y;
1294 * Change the Z value & base Z value by a relative amount.
1295 * @param[in] bufferIndex The buffer to write for the local property value.
1296 * @param[in] delta The Z value will change by this amount.
1298 void BakeZRelative(BufferIndex bufferIndex, float delta)
1300 mValue[bufferIndex].z += delta;
1301 mBaseValue.z = mValue[bufferIndex].z;
1309 AnimatableProperty(const AnimatableProperty& property);
1312 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1316 DoubleBuffered<Vector3> mValue; ///< The double-buffered property value
1317 Vector3 mBaseValue; ///< Reset to this base value at the beginning of each frame
1322 * A Vector4 animatable property of a scene-graph object.
1325 class AnimatableProperty<Vector4> : public AnimatablePropertyBase
1330 * Create an animatable property.
1331 * @param [in] initialValue The initial value of the property.
1333 AnimatableProperty( const Vector4& initialValue )
1334 : mValue( initialValue ),
1335 mBaseValue( initialValue )
1340 * Virtual destructor.
1342 virtual ~AnimatableProperty()
1347 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1349 virtual Dali::Property::Type GetType() const
1351 return Dali::PropertyTypes::Get<Vector4>();
1355 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1357 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1359 if (CLEAN_FLAG != mDirtyFlags)
1361 mValue[updateBufferIndex] = mBaseValue;
1363 mDirtyFlags = ( mDirtyFlags >> 1 );
1368 * @copydoc Dali::PropertyInput::GetVector4()
1370 virtual const Vector4& GetVector4( BufferIndex bufferIndex ) const
1372 return mValue[ bufferIndex ];
1376 * Set the property value. This will only persist for the current frame; the property
1377 * will be reset with the base value, at the beginning of the next frame.
1378 * @param[in] bufferIndex The buffer to write.
1379 * @param[in] value The new property value.
1381 void Set(BufferIndex bufferIndex, const Vector4& value)
1383 mValue[bufferIndex] = value;
1389 * Set the X value. This will only persist for the current frame; the property
1390 * will be reset with the base value, at the beginning of the next frame.
1391 * @param[in] bufferIndex The buffer to write.
1392 * @param[in] value The new X value.
1394 void SetX(BufferIndex bufferIndex, float value)
1396 mValue[bufferIndex].x = value;
1402 * Set the Y value. This will only persist for the current frame; the property
1403 * will be reset with the base value, at the beginning of the next frame.
1404 * @param[in] bufferIndex The buffer to write.
1405 * @param[in] value The new Y value.
1407 void SetY(BufferIndex bufferIndex, float value)
1409 mValue[bufferIndex].y = value;
1415 * Set the Z value. This will only persist for the current frame; the property
1416 * will be reset with the base value, at the beginning of the next frame.
1417 * @param[in] bufferIndex The buffer to write.
1418 * @param[in] value The new Z value.
1420 void SetZ(BufferIndex bufferIndex, float value)
1422 mValue[bufferIndex].z = value;
1428 * Set the W value. This will only persist for the current frame; the property
1429 * will be reset with the base value, at the beginning of the next frame.
1430 * @param[in] bufferIndex The buffer to write.
1431 * @param[in] value The new W value.
1433 void SetW(BufferIndex bufferIndex, float value)
1435 mValue[bufferIndex].w = value;
1441 * Change the property value by a relative amount.
1442 * @param[in] bufferIndex The buffer to write.
1443 * @param[in] delta The property will change by this amount.
1445 void SetRelative(BufferIndex bufferIndex, const Vector4& delta)
1447 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1453 * Change the X value by a relative amount.
1454 * @param[in] bufferIndex The buffer to write.
1455 * @param[in] delta The X value will change by this amount.
1457 void SetXRelative(BufferIndex bufferIndex, float delta)
1459 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1465 * Change the Y value by a relative amount.
1466 * @param[in] bufferIndex The buffer to write.
1467 * @param[in] delta The Y value will change by this amount.
1469 void SetYRelative(BufferIndex bufferIndex, float delta)
1471 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1477 * Change the Z value by a relative amount.
1478 * @param[in] bufferIndex The buffer to write.
1479 * @param[in] delta The Z value will change by this amount.
1481 void SetZRelative(BufferIndex bufferIndex, float delta)
1483 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1489 * Change the W value by a relative amount.
1490 * @param[in] bufferIndex The buffer to write.
1491 * @param[in] delta The W value will change by this amount.
1493 void SetWRelative(BufferIndex bufferIndex, float delta)
1495 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1501 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1503 Vector4& Get(size_t bufferIndex)
1505 return mValue[bufferIndex];
1509 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1511 const Vector4& Get(size_t bufferIndex) const
1513 return mValue[bufferIndex];
1517 * Retrieve the property value.
1518 * @param[in] bufferIndex The buffer to read.
1519 * @return The property value.
1521 Vector4& operator[](size_t bufferIndex)
1523 return mValue[bufferIndex];
1527 * Retrieve the property value.
1528 * @param[in] bufferIndex The buffer to read.
1529 * @return The property value.
1531 const Vector4& operator[](size_t bufferIndex) const
1533 return mValue[bufferIndex];
1537 * Set both the property value & base value.
1538 * @param[in] bufferIndex The buffer to write for the property value.
1539 * @param[in] value The new property value.
1541 void Bake(BufferIndex bufferIndex, const Vector4& value)
1543 mValue[bufferIndex] = value;
1544 mBaseValue = mValue[bufferIndex];
1550 * Set both the X value & base X value.
1551 * @param[in] bufferIndex The buffer to write for the property value.
1552 * @param[in] value The new property value.
1554 void BakeX(BufferIndex bufferIndex, float value)
1556 mValue[bufferIndex].x = value;
1557 mBaseValue.x = mValue[bufferIndex].x;
1563 * Set both the Y value & base Y value.
1564 * @param[in] bufferIndex The buffer to write for the property value.
1565 * @param[in] value The new property value.
1567 void BakeY(BufferIndex bufferIndex, float value)
1569 mValue[bufferIndex].y = value;
1570 mBaseValue.y = mValue[bufferIndex].y;
1576 * Set both the Z value & base Z value.
1577 * @param[in] bufferIndex The buffer to write for the property value.
1578 * @param[in] value The new property value.
1580 void BakeZ(BufferIndex bufferIndex, float value)
1582 mValue[bufferIndex].z = value;
1583 mBaseValue.z = mValue[bufferIndex].z;
1589 * Set both the W value & base W value.
1590 * @param[in] bufferIndex The buffer to write for the property value.
1591 * @param[in] value The new property value.
1593 void BakeW(BufferIndex bufferIndex, float value)
1595 mValue[bufferIndex].w = value;
1596 mBaseValue.w = mValue[bufferIndex].w;
1602 * Change the property value & base value by a relative amount.
1603 * @param[in] bufferIndex The buffer to write for the local property value.
1604 * @param[in] delta The property will change by this amount.
1606 void BakeRelative(BufferIndex bufferIndex, const Vector4& delta)
1608 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1609 mBaseValue = mValue[bufferIndex];
1615 * Change the X value & base X value by a relative amount.
1616 * @param[in] bufferIndex The buffer to write for the local property value.
1617 * @param[in] delta The X value will change by this amount.
1619 void BakeXRelative(BufferIndex bufferIndex, float delta)
1621 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1622 mBaseValue.x = mValue[bufferIndex].x;
1628 * Change the Y value & base Y value by a relative amount.
1629 * @param[in] bufferIndex The buffer to write for the local property value.
1630 * @param[in] delta The Y value will change by this amount.
1632 void BakeYRelative(BufferIndex bufferIndex, float delta)
1634 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1635 mBaseValue.y = mValue[bufferIndex].y;
1641 * Change the Z value & base Z value by a relative amount.
1642 * @param[in] bufferIndex The buffer to write for the local property value.
1643 * @param[in] delta The Z value will change by this amount.
1645 void BakeZRelative(BufferIndex bufferIndex, float delta)
1647 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1648 mBaseValue.z = mValue[bufferIndex].z;
1654 * Change the W value & base W value by a relative amount.
1655 * @param[in] bufferIndex The buffer to write for the local property value.
1656 * @param[in] delta The W value will change by this amount.
1658 void BakeWRelative(BufferIndex bufferIndex, float delta)
1660 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1661 mBaseValue.w = mValue[bufferIndex].w;
1667 * Sets both double-buffered W values & the base W value.
1668 * This should only be used when the owning object has not been connected to the scene-graph.
1669 * @param[in] value The new W value.
1671 void SetWInitial(float value)
1673 mValue[0].w = value;
1674 mValue[1].w = mValue[0].w;
1675 mBaseValue.w = mValue[0].w;
1681 AnimatableProperty(const AnimatableProperty& property);
1684 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1688 DoubleBuffered<Vector4> mValue; ///< The double-buffered property value
1689 Vector4 mBaseValue; ///< Reset to this base value at the beginning of each frame
1693 * An Quaternion animatable property of a scene-graph object.
1696 class AnimatableProperty<Quaternion> : public AnimatablePropertyBase
1701 * Create an animatable property.
1703 AnimatableProperty()
1710 * Create an animatable property.
1711 * @param [in] initialValue The initial value of the property.
1713 AnimatableProperty( const Quaternion& initialValue )
1714 : mValue( initialValue ),
1715 mBaseValue( initialValue )
1720 * Virtual destructor.
1722 virtual ~AnimatableProperty()
1727 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1729 virtual Dali::Property::Type GetType() const
1731 return Dali::PropertyTypes::Get<Quaternion>();
1735 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1737 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1739 if (CLEAN_FLAG != mDirtyFlags)
1741 mValue[updateBufferIndex] = mBaseValue;
1743 mDirtyFlags = ( mDirtyFlags >> 1 );
1748 * @copydoc Dali::PropertyInput::GetQuaternion()
1750 virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const
1752 return mValue[ bufferIndex ];
1756 * Set the property value. This will only persist for the current frame; the property
1757 * will be reset with the base value, at the beginning of the next frame.
1758 * @param[in] bufferIndex The buffer to write.
1759 * @param[in] value The new property value.
1761 void Set(BufferIndex bufferIndex, const Quaternion& value)
1763 mValue[bufferIndex] = value;
1769 * Change the property value by a relative amount.
1770 * @param[in] bufferIndex The buffer to write.
1771 * @param[in] delta The property will change by this amount.
1773 void SetRelative(BufferIndex bufferIndex, const Quaternion& delta)
1775 mValue[bufferIndex] *= delta;
1781 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1783 Quaternion& Get(size_t bufferIndex)
1785 return mValue[bufferIndex];
1789 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1791 const Quaternion& Get(size_t bufferIndex) const
1793 return mValue[bufferIndex];
1797 * Retrieve the property value.
1798 * @param[in] bufferIndex The buffer to read.
1799 * @return The property value.
1801 Quaternion& operator[](size_t bufferIndex)
1803 return mValue[bufferIndex];
1807 * Retrieve the property value.
1808 * @param[in] bufferIndex The buffer to read.
1809 * @return The property value.
1811 const Quaternion& operator[](size_t bufferIndex) const
1813 return mValue[bufferIndex];
1817 * Set both the property value & base value.
1818 * @param[in] bufferIndex The buffer to write for the property value.
1819 * @param[in] value The new property value.
1821 void Bake(BufferIndex bufferIndex, const Quaternion& value)
1823 mValue[bufferIndex] = value;
1830 * Change the property value & base value by a relative amount.
1831 * @param[in] bufferIndex The buffer to write for the local property value.
1832 * @param[in] delta The property will change by this amount.
1834 void BakeRelative(BufferIndex bufferIndex, const Quaternion& delta)
1836 mValue[bufferIndex] *= delta;
1837 mBaseValue = mValue[bufferIndex];
1845 AnimatableProperty(const AnimatableProperty& property);
1848 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1852 DoubleBuffered<Quaternion> mValue; ///< The double-buffered property value
1853 Quaternion mBaseValue; ///< Reset to this base value at the beginning of each frame
1858 * A Matrix animatable property of a scene-graph object.
1861 class AnimatableProperty<Matrix> : public AnimatablePropertyBase
1866 * Create an animatable property.
1867 * @param [in] initialValue The initial value of the property.
1869 AnimatableProperty( const Matrix& initialValue )
1870 : mValue( initialValue ),
1871 mBaseValue( initialValue )
1876 * Virtual destructor.
1878 virtual ~AnimatableProperty()
1883 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1885 virtual Dali::Property::Type GetType() const
1887 return Dali::PropertyTypes::Get<Matrix>();
1891 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1893 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1895 if (CLEAN_FLAG != mDirtyFlags)
1897 mValue[updateBufferIndex] = mBaseValue;
1899 mDirtyFlags = ( mDirtyFlags >> 1 );
1904 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix()
1906 virtual const Matrix& GetMatrix( BufferIndex bufferIndex ) const
1908 return mValue[ bufferIndex ];
1912 * Set the property value. This will only persist for the current frame; the property
1913 * will be reset with the base value, at the beginning of the next frame.
1914 * @param[in] bufferIndex The buffer to write.
1915 * @param[in] value The new property value.
1917 void Set(BufferIndex bufferIndex, const Matrix& value)
1919 mValue[bufferIndex] = value;
1925 * Change the property value by a relative amount.
1926 * @param[in] bufferIndex The buffer to write.
1927 * @param[in] delta The property will change by this amount.
1929 void SetRelative(BufferIndex bufferIndex, const Matrix& delta)
1932 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1933 mValue[bufferIndex] = temp;
1939 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1941 Matrix& Get(size_t bufferIndex)
1943 return mValue[bufferIndex];
1947 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1949 const Matrix& Get(size_t bufferIndex) const
1951 return mValue[bufferIndex];
1955 * Retrieve the property value.
1956 * @param[in] bufferIndex The buffer to read.
1957 * @return The property value.
1959 Matrix& operator[](size_t bufferIndex)
1961 return mValue[bufferIndex];
1965 * Retrieve the property value.
1966 * @param[in] bufferIndex The buffer to read.
1967 * @return The property value.
1969 const Matrix& operator[](size_t bufferIndex) const
1971 return mValue[bufferIndex];
1975 * Set both the property value & base value.
1976 * @param[in] bufferIndex The buffer to write for the property value.
1977 * @param[in] value The new property value.
1979 void Bake(BufferIndex bufferIndex, const Matrix& value)
1981 mValue[bufferIndex] = value;
1982 mBaseValue = mValue[bufferIndex];
1988 * Change the property value & base value by a relative amount.
1989 * @param[in] bufferIndex The buffer to write for the local property value.
1990 * @param[in] delta The property will change by this amount.
1992 void BakeRelative(BufferIndex bufferIndex, const Matrix& delta)
1995 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1996 mValue[bufferIndex] = temp;
2005 AnimatableProperty(const AnimatableProperty& property);
2008 AnimatableProperty& operator=(const AnimatableProperty& rhs);
2012 DoubleBuffered<Matrix> mValue; ///< The double-buffered property value
2013 Matrix mBaseValue; ///< Reset to this base value at the beginning of each frame
2018 * A Matrix3 animatable property of a scene-graph object.
2021 class AnimatableProperty<Matrix3> : public AnimatablePropertyBase
2026 * Create an animatable property.
2027 * @param [in] initialValue The initial value of the property.
2029 AnimatableProperty( const Matrix3& initialValue )
2030 : mValue( initialValue ),
2031 mBaseValue( initialValue )
2036 * Virtual destructor.
2038 virtual ~AnimatableProperty()
2043 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
2045 virtual Dali::Property::Type GetType() const
2047 return Dali::PropertyTypes::Get<Matrix3>();
2051 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
2053 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
2055 if (CLEAN_FLAG != mDirtyFlags)
2057 mValue[updateBufferIndex] = mBaseValue;
2059 mDirtyFlags = ( mDirtyFlags >> 1 );
2064 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix3()
2066 virtual const Matrix3& GetMatrix3( BufferIndex bufferIndex ) const
2068 return mValue[ bufferIndex ];
2072 * Set the property value. This will only persist for the current frame; the property
2073 * will be reset with the base value, at the beginning of the next frame.
2074 * @param[in] bufferIndex The buffer to write.
2075 * @param[in] value The new property value.
2077 void Set(BufferIndex bufferIndex, const Matrix3& value)
2079 mValue[bufferIndex] = value;
2084 * Change the property value by a relative amount.
2085 * @param[in] bufferIndex The buffer to write.
2086 * @param[in] delta The property will change by this amount.
2088 void SetRelative(BufferIndex bufferIndex, const Matrix3& delta)
2091 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
2092 mValue[bufferIndex] = temp;
2097 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
2099 Matrix3& Get(size_t bufferIndex)
2101 return mValue[bufferIndex];
2105 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
2107 const Matrix3& Get(size_t bufferIndex) const
2109 return mValue[bufferIndex];
2113 * Retrieve the property value.
2114 * @param[in] bufferIndex The buffer to read.
2115 * @return The property value.
2117 Matrix3& operator[](size_t bufferIndex)
2119 return mValue[bufferIndex];
2123 * Retrieve the property value.
2124 * @param[in] bufferIndex The buffer to read.
2125 * @return The property value.
2127 const Matrix3& operator[](size_t bufferIndex) const
2129 return mValue[bufferIndex];
2133 * Set both the property value & base value.
2134 * @param[in] bufferIndex The buffer to write for the property value.
2135 * @param[in] value The new property value.
2137 void Bake(BufferIndex bufferIndex, const Matrix3& value)
2139 mValue[bufferIndex] = value;
2140 mBaseValue = mValue[bufferIndex];
2146 * Change the property value & base value by a relative amount.
2147 * @param[in] bufferIndex The buffer to write for the local property value.
2148 * @param[in] delta The property will change by this amount.
2150 void BakeRelative(BufferIndex bufferIndex, const Matrix3& delta)
2153 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
2154 mValue[bufferIndex] = temp;
2163 AnimatableProperty(const AnimatableProperty& property);
2166 AnimatableProperty& operator=(const AnimatableProperty& rhs);
2170 DoubleBuffered<Matrix3> mValue; ///< The double-buffered property value
2171 Matrix3 mBaseValue; ///< Reset to this base value at the beginning of each frame
2175 } // namespace SceneGraph
2177 // Messages for AnimatableProperty<T>
2180 void BakeMessage( EventThreadServices& eventThreadServices,
2181 const SceneGraph::AnimatableProperty<T>& property,
2182 typename ParameterType< T >::PassingType newValue )
2184 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, T > LocalType;
2186 // Reserve some memory inside the message queue
2187 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2189 // Construct message in the message queue memory; note that delete should not be called on the return value
2190 new (slot) LocalType( &property,
2191 &SceneGraph::AnimatableProperty<T>::Bake,
2196 void BakeRelativeMessage( EventThreadServices& eventThreadServices,
2197 const SceneGraph::AnimatableProperty<T>& property,
2200 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, const T& > LocalType;
2202 // Reserve some memory inside the message queue
2203 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2205 // Construct message in the message queue memory; note that delete should not be called on the return value
2206 new (slot) LocalType( &property,
2207 &SceneGraph::AnimatableProperty<T>::BakeRelative,
2212 void SetXComponentMessage( EventThreadServices& eventThreadServices,
2213 const SceneGraph::AnimatableProperty<T>& property,
2214 typename ParameterType< float >::PassingType newValue )
2216 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2218 // Reserve some memory inside the message queue
2219 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2221 // Construct message in the message queue memory; note that delete should not be called on the return value
2222 new (slot) LocalType( &property,
2223 &SceneGraph::AnimatableProperty<T>::BakeX,
2228 void SetYComponentMessage( EventThreadServices& eventThreadServices,
2229 const SceneGraph::AnimatableProperty<T>& property,
2230 typename ParameterType< float >::PassingType newValue )
2232 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2234 // Reserve some memory inside the message queue
2235 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2237 // Construct message in the message queue memory; note that delete should not be called on the return value
2238 new (slot) LocalType( &property,
2239 &SceneGraph::AnimatableProperty<T>::BakeY,
2244 void SetZComponentMessage( EventThreadServices& eventThreadServices,
2245 const SceneGraph::AnimatableProperty<T>& property,
2246 typename ParameterType< float >::PassingType newValue )
2248 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2250 // Reserve some memory inside the message queue
2251 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2253 // Construct message in the message queue memory; note that delete should not be called on the return value
2254 new (slot) LocalType( &property,
2255 &SceneGraph::AnimatableProperty<T>::BakeZ,
2260 void SetWComponentMessage( EventThreadServices& eventThreadServices,
2261 const SceneGraph::AnimatableProperty<T>& property,
2262 typename ParameterType< float >::PassingType newValue )
2264 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2266 // Reserve some memory inside the message queue
2267 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2269 // Construct message in the message queue memory; note that delete should not be called on the return value
2270 new (slot) LocalType( &property,
2271 &SceneGraph::AnimatableProperty<T>::BakeW,
2275 } // namespace Internal
2279 #endif // __DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H__