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 ~AnimatablePropertyBase() override = default;
82 protected: // for derived classes
85 * Flag that the property has been Set during the current frame.
89 mDirtyFlags = SET_FLAG;
93 * Flag that the property has been Baked during the current frame.
97 mDirtyFlags = BAKED_FLAG;
100 public: // From PropertyBase
103 * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
105 bool IsClean() const override
107 return ( CLEAN_FLAG == mDirtyFlags );
111 * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
113 bool InputInitialized() const override
115 return true; // Animatable properties are always valid
118 protected: // so that ResetToBaseValue can set it directly
120 uint32_t mDirtyFlags; ///< Flag whether value changed during previous 2 frames
126 * An boolean animatable property of a scene-graph object.
129 class AnimatableProperty<bool> : public AnimatablePropertyBase
134 * Create an animatable property.
135 * @param [in] initialValue The initial value of the property.
137 AnimatableProperty( bool initialValue )
138 : mValue( initialValue ),
139 mBaseValue( initialValue )
144 * Virtual destructor.
146 ~AnimatableProperty() override = default;
149 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
151 Dali::Property::Type GetType() const override
153 return Dali::PropertyTypes::Get<bool>();
157 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
159 void ResetToBaseValue(BufferIndex updateBufferIndex) override
161 if (CLEAN_FLAG != mDirtyFlags)
163 mValue[updateBufferIndex] = mBaseValue;
165 mDirtyFlags = ( mDirtyFlags >> 1 );
170 * @copydoc Dali::Internal::PropertyInputImpl::GetBoolean()
172 const bool& GetBoolean( BufferIndex bufferIndex ) const override
174 return mValue[ bufferIndex ];
178 * Set the property value. This will only persist for the current frame; the property
179 * will be reset with the base value, at the beginning of the next frame.
180 * @param[in] bufferIndex The buffer to write.
181 * @param[in] value The new property value.
183 void Set(BufferIndex bufferIndex, bool value)
185 // check if the value actually changed to avoid dirtying nodes unnecessarily
186 if( mValue[bufferIndex] != value )
188 mValue[bufferIndex] = value;
195 * Change the property value by a relative amount.
196 * @param[in] bufferIndex The buffer to write.
197 * @param[in] delta The property will change by this amount.
199 void SetRelative(BufferIndex bufferIndex, bool delta)
201 // check if the value actually changed to avoid dirtying nodes unnecessarily
202 // false + false does not change value, true + false does not either
203 if( delta && !mValue[bufferIndex] )
205 mValue[bufferIndex] = delta;
212 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
214 bool& Get( BufferIndex bufferIndex )
216 return mValue[bufferIndex];
220 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
222 const bool& Get( BufferIndex bufferIndex ) const
224 return mValue[bufferIndex];
228 * Retrieve the property value.
229 * @param[in] bufferIndex The buffer to read.
230 * @return The property value.
232 bool& operator[]( BufferIndex bufferIndex )
234 return mValue[bufferIndex];
238 * Retrieve the property value.
239 * @param[in] bufferIndex The buffer to read.
240 * @return The property value.
242 const bool& operator[]( BufferIndex bufferIndex ) const
244 return mValue[bufferIndex];
248 * Set both the property value & base value.
249 * @param[in] bufferIndex The buffer to write for the property value.
250 * @param[in] value The new property value.
252 void Bake(BufferIndex bufferIndex, bool value)
254 // bake has to check the base value as current buffer value can be correct by constraint or something else
255 if( mBaseValue != value )
258 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
259 // has never been atomically safe.
260 mValue[bufferIndex] = value;
261 mValue[1-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] = 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 ~AnimatableProperty() override = default;
320 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
322 Dali::Property::Type GetType() const override
324 return Dali::PropertyTypes::Get<int>();
328 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
330 void ResetToBaseValue(BufferIndex updateBufferIndex) override
332 if (CLEAN_FLAG != mDirtyFlags)
334 mValue[updateBufferIndex] = mBaseValue;
336 mDirtyFlags = ( mDirtyFlags >> 1 );
341 * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
343 const int& GetInteger( BufferIndex bufferIndex ) const override
345 return mValue[ bufferIndex ];
349 * Set the property value. This will only persist for the current frame; the property
350 * will be reset with the base value, at the beginning of the next frame.
351 * @param[in] bufferIndex The buffer to write.
352 * @param[in] value The new property value.
354 void Set(BufferIndex bufferIndex, int value)
356 mValue[bufferIndex] = value;
362 * Change the property value by a relative amount.
363 * @param[in] bufferIndex The buffer to write.
364 * @param[in] delta The property will change by this amount.
366 void SetRelative(BufferIndex bufferIndex, int delta)
368 mValue[bufferIndex] = mValue[bufferIndex] + delta;
374 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
376 int& Get( BufferIndex bufferIndex )
378 return mValue[bufferIndex];
382 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
384 const int& Get( BufferIndex bufferIndex ) const
386 return mValue[bufferIndex];
390 * Retrieve the property value.
391 * @param[in] bufferIndex The buffer to read.
392 * @return The property value.
394 int& operator[]( BufferIndex bufferIndex )
396 return mValue[bufferIndex];
400 * Retrieve the property value.
401 * @param[in] bufferIndex The buffer to read.
402 * @return The property value.
404 const int& operator[]( BufferIndex bufferIndex ) const
406 return mValue[bufferIndex];
410 * Set both the property value & base value.
411 * @param[in] bufferIndex The buffer to write for the property value.
412 * @param[in] value The new property value.
414 void Bake(BufferIndex bufferIndex, int value)
416 mValue[bufferIndex] = value;
417 mValue[1-bufferIndex] = value;
418 mBaseValue = mValue[bufferIndex];
424 * Change the property value & base value by a relative amount.
425 * @param[in] bufferIndex The buffer to write for the local property value.
426 * @param[in] delta The property will change by this amount.
428 void BakeRelative(BufferIndex bufferIndex, int delta)
430 mValue[bufferIndex] = mValue[bufferIndex] + delta;
431 mBaseValue = mValue[bufferIndex];
437 * Sets both double-buffered values & the base value.
438 * This should only be used when the owning object has not been connected to the scene-graph.
439 * @param[in] value The new property value.
441 void SetInitial(const int& value)
444 mValue[1] = mValue[0];
445 mBaseValue = mValue[0];
449 * Change both double-buffered values & the base value by a relative amount.
450 * This should only be used when the owning object has not been connected to the scene-graph.
451 * @param[in] delta The property will change by this amount.
453 void SetInitialRelative(const int& delta)
455 mValue[0] = mValue[0] + delta;
456 mValue[1] = mValue[0];
457 mBaseValue = mValue[0];
463 AnimatableProperty(const AnimatableProperty& property);
466 AnimatableProperty& operator=(const AnimatableProperty& rhs);
470 DoubleBuffered<int> mValue; ///< The double-buffered property value
471 int mBaseValue; ///< Reset to this base value at the beginning of each frame
476 * An float animatable property of a scene-graph object.
479 class AnimatableProperty<float> : public AnimatablePropertyBase
484 * Create an animatable property.
485 * @param [in] initialValue The initial value of the property.
487 AnimatableProperty( float initialValue )
488 : mValue( initialValue ),
489 mBaseValue( initialValue )
494 * Virtual destructor.
496 ~AnimatableProperty() override = default;
499 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
501 Dali::Property::Type GetType() const override
503 return Dali::PropertyTypes::Get<float>();
507 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
509 void ResetToBaseValue(BufferIndex updateBufferIndex) override
511 if (CLEAN_FLAG != mDirtyFlags)
513 mValue[updateBufferIndex] = mBaseValue;
515 mDirtyFlags = ( mDirtyFlags >> 1 );
520 * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
522 const float& GetFloat( BufferIndex bufferIndex ) const override
524 return mValue[ bufferIndex ];
528 * Set the property value. This will only persist for the current frame; the property
529 * will be reset with the base value, at the beginning of the next frame.
530 * @param[in] bufferIndex The buffer to write.
531 * @param[in] value The new property value.
533 void Set(BufferIndex bufferIndex, float value)
535 mValue[bufferIndex] = value;
541 * Change the property value by a relative amount.
542 * @param[in] bufferIndex The buffer to write.
543 * @param[in] delta The property will change by this amount.
545 void SetRelative(BufferIndex bufferIndex, float delta)
547 mValue[bufferIndex] = mValue[bufferIndex] + delta;
553 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
555 float& Get( BufferIndex bufferIndex )
557 return mValue[bufferIndex];
561 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
563 const float& Get( BufferIndex bufferIndex ) const
565 return mValue[bufferIndex];
569 * Retrieve the property value.
570 * @param[in] bufferIndex The buffer to read.
571 * @return The property value.
573 float& operator[]( BufferIndex bufferIndex )
575 return mValue[bufferIndex];
579 * Retrieve the property value.
580 * @param[in] bufferIndex The buffer to read.
581 * @return The property value.
583 const float& operator[]( BufferIndex bufferIndex ) const
585 return mValue[bufferIndex];
589 * Set both the property value & base value.
590 * @param[in] bufferIndex The buffer to write for the property value.
591 * @param[in] value The new property value.
593 void Bake(BufferIndex bufferIndex, float value)
595 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
596 // has never been atomically safe.
597 mValue[bufferIndex] = value;
598 mValue[1-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, float 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 float& 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 float& 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);
651 DoubleBuffered<float> mValue; ///< The double-buffered property value
652 float mBaseValue; ///< Reset to this base value at the beginning of each frame
656 * An Vector2 animatable property of a scene-graph object.
659 class AnimatableProperty<Vector2> : public AnimatablePropertyBase
664 * Create an animatable property.
665 * @param [in] initialValue The initial value of the property.
667 AnimatableProperty( const Vector2& initialValue )
668 : mValue( initialValue ),
669 mBaseValue( initialValue )
674 * Virtual destructor.
676 ~AnimatableProperty() override = default;
679 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
681 Dali::Property::Type GetType() const override
683 return Dali::PropertyTypes::Get<Vector2>();
687 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
689 void ResetToBaseValue(BufferIndex updateBufferIndex) override
691 if (CLEAN_FLAG != mDirtyFlags)
693 mValue[updateBufferIndex] = mBaseValue;
695 mDirtyFlags = ( mDirtyFlags >> 1 );
700 * @copydoc Dali::PropertyInput::GetVector2()
702 const Vector2& GetVector2( BufferIndex bufferIndex ) const override
704 return mValue[ bufferIndex ];
708 * Set the property value. This will only persist for the current frame; the property
709 * will be reset with the base value, at the beginning of the next frame.
710 * @param[in] bufferIndex The buffer to write.
711 * @param[in] value The new property value.
713 void Set(BufferIndex bufferIndex, const Vector2& value)
715 mValue[bufferIndex] = value;
721 * Set the property value. This will only persist for the current frame; the property
722 * will be reset with the base value, at the beginning of the next frame.
723 * @param[in] bufferIndex The buffer to write.
724 * @param[in] value The new X value.
726 void SetX(BufferIndex bufferIndex, float value)
728 mValue[bufferIndex].x = value;
734 * Set the property value. This will only persist for the current frame; the property
735 * will be reset with the base value, at the beginning of the next frame.
736 * @param[in] bufferIndex The buffer to write.
737 * @param[in] value The new Y value.
739 void SetY(BufferIndex bufferIndex, float value)
741 mValue[bufferIndex].y = value;
747 * Change the property value by a relative amount.
748 * @param[in] bufferIndex The buffer to write.
749 * @param[in] delta The property will change by this amount.
751 void SetRelative(BufferIndex bufferIndex, const Vector2& delta)
753 mValue[bufferIndex] += delta;
759 * Change the X value by a relative amount.
760 * @param[in] bufferIndex The buffer to write.
761 * @param[in] delta The X value will change by this amount.
763 void SetXRelative(BufferIndex bufferIndex, float delta)
765 mValue[bufferIndex].x += delta;
771 * Change the Y value by a relative amount.
772 * @param[in] bufferIndex The buffer to write.
773 * @param[in] delta The Y value will change by this amount.
775 void SetYRelative(BufferIndex bufferIndex, float delta)
777 mValue[bufferIndex].y += delta;
783 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
785 Vector2& Get( BufferIndex bufferIndex )
787 return mValue[bufferIndex];
791 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
793 const Vector2& Get( BufferIndex bufferIndex ) const
795 return mValue[bufferIndex];
799 * Retrieve the property value.
800 * @param[in] bufferIndex The buffer to read.
801 * @return The property value.
803 Vector2& operator[]( BufferIndex bufferIndex )
805 return mValue[bufferIndex];
809 * Retrieve the property value.
810 * @param[in] bufferIndex The buffer to read.
811 * @return The property value.
813 const Vector2& operator[]( BufferIndex bufferIndex ) const
815 return mValue[bufferIndex];
819 * Set both the property value & base value.
820 * @param[in] bufferIndex The buffer to write for the property value.
821 * @param[in] value The new property value.
823 void Bake(BufferIndex bufferIndex, const Vector2& value)
825 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
826 // has never been atomically safe.
827 mValue[bufferIndex] = value;
828 mValue[1-bufferIndex] = value;
835 * Set both the X value & base X value.
836 * @param[in] bufferIndex The buffer to write for the property value.
837 * @param[in] value The new property value.
839 void BakeX(BufferIndex bufferIndex, float value)
841 mValue[bufferIndex].x = value;
842 mValue[1-bufferIndex].x = value;
843 mBaseValue.x = value;
849 * Set both the Y value & base Y value.
850 * @param[in] bufferIndex The buffer to write for the property value.
851 * @param[in] value The new property value.
853 void BakeY(BufferIndex bufferIndex, float value)
855 mValue[bufferIndex].y = value;
856 mValue[1-bufferIndex].y = value;
857 mBaseValue.y = value;
863 * Change the property value & base value by a relative amount.
864 * @param[in] bufferIndex The buffer to write for the local property value.
865 * @param[in] delta The property will change by this amount.
867 void BakeRelative(BufferIndex bufferIndex, const Vector2& delta)
869 mValue[bufferIndex] += delta;
870 mBaseValue = mValue[bufferIndex];
876 * Change the X value & base X value by a relative amount.
877 * @param[in] bufferIndex The buffer to write for the local property value.
878 * @param[in] delta The X value will change by this amount.
880 void BakeXRelative(BufferIndex bufferIndex, float delta)
882 mValue[bufferIndex].x += delta;
883 mBaseValue.x = mValue[bufferIndex].x;
889 * Change the Y value & base Y value by a relative amount.
890 * @param[in] bufferIndex The buffer to write for the local property value.
891 * @param[in] delta The Y value will change by this amount.
893 void BakeYRelative(BufferIndex bufferIndex, float delta)
895 mValue[bufferIndex].y += delta;
896 mBaseValue.y = mValue[bufferIndex].y;
904 AnimatableProperty(const AnimatableProperty& property);
907 AnimatableProperty& operator=(const AnimatableProperty& rhs);
911 DoubleBuffered<Vector2> mValue; ///< The double-buffered property value
912 Vector2 mBaseValue; ///< Reset to this base value at the beginning of each frame
917 * A Vector3 animatable property of a scene-graph object.
920 class AnimatableProperty<Vector3> : public AnimatablePropertyBase
925 * Create an animatable property.
934 * Create an animatable property.
935 * @param [in] initialValue The initial value of the property.
937 AnimatableProperty( const Vector3& initialValue )
938 : mValue( initialValue ),
939 mBaseValue( initialValue )
944 * Virtual destructor.
946 ~AnimatableProperty() override = default;
949 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
951 Dali::Property::Type GetType() const override
953 return Dali::PropertyTypes::Get<Vector3>();
957 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
959 void ResetToBaseValue(BufferIndex updateBufferIndex) override
961 if (CLEAN_FLAG != mDirtyFlags)
963 mValue[updateBufferIndex] = mBaseValue;
965 mDirtyFlags = ( mDirtyFlags >> 1 );
970 * @copydoc Dali::PropertyInput::GetVector3()
972 const Vector3& GetVector3( BufferIndex bufferIndex ) const override
974 return mValue[ bufferIndex ];
978 * Set the property value. This will only persist for the current frame; the property
979 * will be reset with the base value, at the beginning of the next frame.
980 * @param[in] bufferIndex The buffer to write.
981 * @param[in] value The new property value.
983 void Set(BufferIndex bufferIndex, const Vector3& value)
985 mValue[bufferIndex] = value;
991 * Set the property value. This will only persist for the current frame; the property
992 * will be reset with the base value, at the beginning of the next frame.
993 * @param[in] bufferIndex The buffer to write.
994 * @param[in] value The new X value.
996 void SetX(BufferIndex bufferIndex, float value)
998 mValue[bufferIndex].x = value;
1004 * Set the property value. This will only persist for the current frame; the property
1005 * will be reset with the base value, at the beginning of the next frame.
1006 * @param[in] bufferIndex The buffer to write.
1007 * @param[in] value The new Y value.
1009 void SetY(BufferIndex bufferIndex, float value)
1011 mValue[bufferIndex].y = value;
1017 * Set the property value. This will only persist for the current frame; the property
1018 * will be reset with the base value, at the beginning of the next frame.
1019 * @param[in] bufferIndex The buffer to write.
1020 * @param[in] value The new Z value.
1022 void SetZ(BufferIndex bufferIndex, float value)
1024 mValue[bufferIndex].z = value;
1030 * Change the property value by a relative amount.
1031 * @param[in] bufferIndex The buffer to write.
1032 * @param[in] delta The property will change by this amount.
1034 void SetRelative(BufferIndex bufferIndex, const Vector3& delta)
1036 mValue[bufferIndex] += delta;
1042 * Change the X value by a relative amount.
1043 * @param[in] bufferIndex The buffer to write.
1044 * @param[in] delta The X value will change by this amount.
1046 void SetXRelative(BufferIndex bufferIndex, float delta)
1048 mValue[bufferIndex].x += delta;
1054 * Change the Y value by a relative amount.
1055 * @param[in] bufferIndex The buffer to write.
1056 * @param[in] delta The Y value will change by this amount.
1058 void SetYRelative(BufferIndex bufferIndex, float delta)
1060 mValue[bufferIndex].y += delta;
1066 * Change the Z value by a relative amount.
1067 * @param[in] bufferIndex The buffer to write.
1068 * @param[in] delta The Z value will change by this amount.
1070 void SetZRelative(BufferIndex bufferIndex, float delta)
1072 mValue[bufferIndex].z += delta;
1078 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1080 Vector3& Get( BufferIndex bufferIndex )
1082 return mValue[bufferIndex];
1086 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1088 const Vector3& Get( BufferIndex bufferIndex ) const
1090 return mValue[bufferIndex];
1094 * Retrieve the property value.
1095 * @param[in] bufferIndex The buffer to read.
1096 * @return The property value.
1098 Vector3& operator[]( BufferIndex bufferIndex )
1100 return mValue[bufferIndex];
1104 * Retrieve the property value.
1105 * @param[in] bufferIndex The buffer to read.
1106 * @return The property value.
1108 const Vector3& operator[]( BufferIndex bufferIndex ) const
1110 return mValue[bufferIndex];
1114 * Set both the property value & base value.
1115 * @param[in] bufferIndex The buffer to write for the property value.
1116 * @param[in] value The new property value.
1118 void Bake(BufferIndex bufferIndex, const Vector3& value)
1120 mValue[bufferIndex] = value;
1121 mValue[1-bufferIndex] = value;
1128 * Set both the X value & base X value.
1129 * @param[in] bufferIndex The buffer to write for the property value.
1130 * @param[in] value The new property value.
1132 void BakeX(BufferIndex bufferIndex, float value)
1134 mValue[bufferIndex].x = value;
1135 mValue[1-bufferIndex].x = value;
1136 mBaseValue.x = value;
1142 * Set both the Y value & base Y value.
1143 * @param[in] bufferIndex The buffer to write for the property value.
1144 * @param[in] value The new property value.
1146 void BakeY(BufferIndex bufferIndex, float value)
1148 mValue[bufferIndex].y = value;
1149 mValue[1-bufferIndex].y = value;
1150 mBaseValue.y = value;
1156 * Set both the Z value & base Z value.
1157 * @param[in] bufferIndex The buffer to write for the property value.
1158 * @param[in] value The new property value.
1160 void BakeZ(BufferIndex bufferIndex, float value)
1162 mValue[bufferIndex].z = value;
1163 mValue[1-bufferIndex].z = value;
1164 mBaseValue.z = value;
1170 * Change the property value & base value by a relative amount.
1171 * @param[in] bufferIndex The buffer to write for the local property value.
1172 * @param[in] delta The property will change by this amount.
1174 void BakeRelative(BufferIndex bufferIndex, const Vector3& delta)
1176 mValue[bufferIndex] += delta;
1177 mBaseValue = mValue[bufferIndex];
1183 * Change the property value & base value by a relative amount.
1184 * @param[in] bufferIndex The buffer to write for the local property value.
1185 * @param[in] delta The property will change by this amount.
1187 void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& delta)
1189 mValue[bufferIndex] *= delta;
1190 mBaseValue = mValue[bufferIndex];
1196 * Change the X value & base X value by a relative amount.
1197 * @param[in] bufferIndex The buffer to write for the local property value.
1198 * @param[in] delta The X value will change by this amount.
1200 void BakeXRelative(BufferIndex bufferIndex, float delta)
1202 mValue[bufferIndex].x += delta;
1203 mBaseValue.x = mValue[bufferIndex].x;
1209 * Change the Y value & base Y value by a relative amount.
1210 * @param[in] bufferIndex The buffer to write for the local property value.
1211 * @param[in] delta The Y value will change by this amount.
1213 void BakeYRelative(BufferIndex bufferIndex, float delta)
1215 mValue[bufferIndex].y += delta;
1216 mBaseValue.y = mValue[bufferIndex].y;
1222 * Change the Z value & base Z value by a relative amount.
1223 * @param[in] bufferIndex The buffer to write for the local property value.
1224 * @param[in] delta The Z value will change by this amount.
1226 void BakeZRelative(BufferIndex bufferIndex, float delta)
1228 mValue[bufferIndex].z += delta;
1229 mBaseValue.z = mValue[bufferIndex].z;
1237 AnimatableProperty(const AnimatableProperty& property);
1240 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1244 DoubleBuffered<Vector3> mValue; ///< The double-buffered property value
1245 Vector3 mBaseValue; ///< Reset to this base value at the beginning of each frame
1250 * A Vector4 animatable property of a scene-graph object.
1253 class AnimatableProperty<Vector4> : public AnimatablePropertyBase
1258 * Create an animatable property.
1259 * @param [in] initialValue The initial value of the property.
1261 AnimatableProperty( const Vector4& initialValue )
1262 : mValue( initialValue ),
1263 mBaseValue( initialValue )
1268 * Virtual destructor.
1270 ~AnimatableProperty() override = default;
1273 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1275 Dali::Property::Type GetType() const override
1277 return Dali::PropertyTypes::Get<Vector4>();
1281 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1283 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1285 if (CLEAN_FLAG != mDirtyFlags)
1287 mValue[updateBufferIndex] = mBaseValue;
1289 mDirtyFlags = ( mDirtyFlags >> 1 );
1294 * @copydoc Dali::PropertyInput::GetVector4()
1296 const Vector4& GetVector4( BufferIndex bufferIndex ) const override
1298 return mValue[ bufferIndex ];
1302 * Set the property value. This will only persist for the current frame; the property
1303 * will be reset with the base value, at the beginning of the next frame.
1304 * @param[in] bufferIndex The buffer to write.
1305 * @param[in] value The new property value.
1307 void Set(BufferIndex bufferIndex, const Vector4& value)
1309 mValue[bufferIndex] = value;
1315 * Set the X 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 X value.
1320 void SetX(BufferIndex bufferIndex, float value)
1322 mValue[bufferIndex].x = value;
1328 * Set the Y 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 Y value.
1333 void SetY(BufferIndex bufferIndex, float value)
1335 mValue[bufferIndex].y = value;
1341 * Set the Z 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 Z value.
1346 void SetZ(BufferIndex bufferIndex, float value)
1348 mValue[bufferIndex].z = value;
1354 * Set the W 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 W value.
1359 void SetW(BufferIndex bufferIndex, float value)
1361 mValue[bufferIndex].w = value;
1367 * Change the property value by a relative amount.
1368 * @param[in] bufferIndex The buffer to write.
1369 * @param[in] delta The property will change by this amount.
1371 void SetRelative(BufferIndex bufferIndex, const Vector4& delta)
1373 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1379 * Change the X value by a relative amount.
1380 * @param[in] bufferIndex The buffer to write.
1381 * @param[in] delta The X value will change by this amount.
1383 void SetXRelative(BufferIndex bufferIndex, float delta)
1385 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1391 * Change the Y value by a relative amount.
1392 * @param[in] bufferIndex The buffer to write.
1393 * @param[in] delta The Y value will change by this amount.
1395 void SetYRelative(BufferIndex bufferIndex, float delta)
1397 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1403 * Change the Z value by a relative amount.
1404 * @param[in] bufferIndex The buffer to write.
1405 * @param[in] delta The Z value will change by this amount.
1407 void SetZRelative(BufferIndex bufferIndex, float delta)
1409 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1415 * Change the W value by a relative amount.
1416 * @param[in] bufferIndex The buffer to write.
1417 * @param[in] delta The W value will change by this amount.
1419 void SetWRelative(BufferIndex bufferIndex, float delta)
1421 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1427 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1429 Vector4& Get( BufferIndex bufferIndex )
1431 return mValue[bufferIndex];
1435 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1437 const Vector4& Get( BufferIndex bufferIndex ) const
1439 return mValue[bufferIndex];
1443 * Retrieve the property value.
1444 * @param[in] bufferIndex The buffer to read.
1445 * @return The property value.
1447 Vector4& operator[]( BufferIndex bufferIndex )
1449 return mValue[bufferIndex];
1453 * Retrieve the property value.
1454 * @param[in] bufferIndex The buffer to read.
1455 * @return The property value.
1457 const Vector4& operator[]( BufferIndex bufferIndex ) const
1459 return mValue[bufferIndex];
1463 * Set both the property value & base value.
1464 * @param[in] bufferIndex The buffer to write for the property value.
1465 * @param[in] value The new property value.
1467 void Bake(BufferIndex bufferIndex, const Vector4& value)
1469 mValue[bufferIndex] = value;
1470 mValue[1-bufferIndex] = value;
1471 mBaseValue = mValue[bufferIndex];
1477 * Set both the X value & base X value.
1478 * @param[in] bufferIndex The buffer to write for the property value.
1479 * @param[in] value The new property value.
1481 void BakeX(BufferIndex bufferIndex, float value)
1483 mValue[bufferIndex].x = value;
1484 mValue[1-bufferIndex].x = value;
1485 mBaseValue.x = mValue[bufferIndex].x;
1491 * Set both the Y value & base Y value.
1492 * @param[in] bufferIndex The buffer to write for the property value.
1493 * @param[in] value The new property value.
1495 void BakeY(BufferIndex bufferIndex, float value)
1497 mValue[bufferIndex].y = value;
1498 mValue[1-bufferIndex].y = value;
1499 mBaseValue.y = mValue[bufferIndex].y;
1505 * Set both the Z value & base Z value.
1506 * @param[in] bufferIndex The buffer to write for the property value.
1507 * @param[in] value The new property value.
1509 void BakeZ(BufferIndex bufferIndex, float value)
1511 mValue[bufferIndex].z = value;
1512 mValue[1-bufferIndex].z = value;
1513 mBaseValue.z = mValue[bufferIndex].z;
1519 * Set both the W value & base W value.
1520 * @param[in] bufferIndex The buffer to write for the property value.
1521 * @param[in] value The new property value.
1523 void BakeW(BufferIndex bufferIndex, float value)
1525 mValue[bufferIndex].w = value;
1526 mValue[1-bufferIndex].w = value;
1527 mBaseValue.w = mValue[bufferIndex].w;
1533 * Change the property value & base value by a relative amount.
1534 * @param[in] bufferIndex The buffer to write for the local property value.
1535 * @param[in] delta The property will change by this amount.
1537 void BakeRelative(BufferIndex bufferIndex, const Vector4& delta)
1539 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1540 mBaseValue = mValue[bufferIndex];
1546 * Change the X value & base X value by a relative amount.
1547 * @param[in] bufferIndex The buffer to write for the local property value.
1548 * @param[in] delta The X value will change by this amount.
1550 void BakeXRelative(BufferIndex bufferIndex, float delta)
1552 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1553 mBaseValue.x = mValue[bufferIndex].x;
1559 * Change the Y value & base Y value by a relative amount.
1560 * @param[in] bufferIndex The buffer to write for the local property value.
1561 * @param[in] delta The Y value will change by this amount.
1563 void BakeYRelative(BufferIndex bufferIndex, float delta)
1565 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1566 mBaseValue.y = mValue[bufferIndex].y;
1572 * Change the Z value & base Z value by a relative amount.
1573 * @param[in] bufferIndex The buffer to write for the local property value.
1574 * @param[in] delta The Z value will change by this amount.
1576 void BakeZRelative(BufferIndex bufferIndex, float delta)
1578 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1579 mBaseValue.z = mValue[bufferIndex].z;
1585 * Change the W value & base W value by a relative amount.
1586 * @param[in] bufferIndex The buffer to write for the local property value.
1587 * @param[in] delta The W value will change by this amount.
1589 void BakeWRelative(BufferIndex bufferIndex, float delta)
1591 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1592 mBaseValue.w = mValue[bufferIndex].w;
1598 * Sets both double-buffered W values & the base W value.
1599 * This should only be used when the owning object has not been connected to the scene-graph.
1600 * @param[in] value The new W value.
1602 void SetWInitial(float value)
1604 mValue[0].w = value;
1605 mValue[1].w = mValue[0].w;
1606 mBaseValue.w = mValue[0].w;
1612 AnimatableProperty(const AnimatableProperty& property);
1615 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1619 DoubleBuffered<Vector4> mValue; ///< The double-buffered property value
1620 Vector4 mBaseValue; ///< Reset to this base value at the beginning of each frame
1624 * An Quaternion animatable property of a scene-graph object.
1627 class AnimatableProperty<Quaternion> : public AnimatablePropertyBase
1632 * Create an animatable property.
1634 AnimatableProperty()
1641 * Create an animatable property.
1642 * @param [in] initialValue The initial value of the property.
1644 AnimatableProperty( const Quaternion& initialValue )
1645 : mValue( initialValue ),
1646 mBaseValue( initialValue )
1651 * Virtual destructor.
1653 ~AnimatableProperty() override = default;
1656 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1658 Dali::Property::Type GetType() const override
1660 return Dali::PropertyTypes::Get<Quaternion>();
1664 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1666 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1668 if (CLEAN_FLAG != mDirtyFlags)
1670 mValue[updateBufferIndex] = mBaseValue;
1672 mDirtyFlags = ( mDirtyFlags >> 1 );
1677 * @copydoc Dali::PropertyInput::GetQuaternion()
1679 const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const override
1681 return mValue[ bufferIndex ];
1685 * Set the property value. This will only persist for the current frame; the property
1686 * will be reset with the base value, at the beginning of the next frame.
1687 * @param[in] bufferIndex The buffer to write.
1688 * @param[in] value The new property value.
1690 void Set(BufferIndex bufferIndex, const Quaternion& value)
1692 mValue[bufferIndex] = value;
1698 * Change the property value by a relative amount.
1699 * @param[in] bufferIndex The buffer to write.
1700 * @param[in] delta The property will change by this amount.
1702 void SetRelative(BufferIndex bufferIndex, const Quaternion& delta)
1704 mValue[bufferIndex] *= delta;
1710 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1712 Quaternion& Get( BufferIndex bufferIndex )
1714 return mValue[bufferIndex];
1718 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1720 const Quaternion& Get( BufferIndex bufferIndex ) const
1722 return mValue[bufferIndex];
1726 * Retrieve the property value.
1727 * @param[in] bufferIndex The buffer to read.
1728 * @return The property value.
1730 Quaternion& operator[]( BufferIndex bufferIndex )
1732 return mValue[bufferIndex];
1736 * Retrieve the property value.
1737 * @param[in] bufferIndex The buffer to read.
1738 * @return The property value.
1740 const Quaternion& operator[]( BufferIndex bufferIndex ) const
1742 return mValue[bufferIndex];
1746 * Set both the property value & base value.
1747 * @param[in] bufferIndex The buffer to write for the property value.
1748 * @param[in] value The new property value.
1750 void Bake(BufferIndex bufferIndex, const Quaternion& value)
1752 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1753 // has never been atomically safe.
1754 mValue[bufferIndex] = value;
1755 mValue[1-bufferIndex] = value;
1762 * Change the property value & base value by a relative amount.
1763 * @param[in] bufferIndex The buffer to write for the local property value.
1764 * @param[in] delta The property will change by this amount.
1766 void BakeRelative(BufferIndex bufferIndex, const Quaternion& delta)
1768 mValue[bufferIndex] *= delta;
1769 mBaseValue = mValue[bufferIndex];
1777 AnimatableProperty(const AnimatableProperty& property);
1780 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1784 DoubleBuffered<Quaternion> mValue; ///< The double-buffered property value
1785 Quaternion mBaseValue; ///< Reset to this base value at the beginning of each frame
1790 * A Matrix animatable property of a scene-graph object.
1793 class AnimatableProperty<Matrix> : public AnimatablePropertyBase
1798 * Create an animatable property.
1799 * @param [in] initialValue The initial value of the property.
1801 AnimatableProperty( const Matrix& initialValue )
1802 : mValue( initialValue ),
1803 mBaseValue( initialValue )
1808 * Virtual destructor.
1810 ~AnimatableProperty() override = default;
1813 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1815 Dali::Property::Type GetType() const override
1817 return Dali::PropertyTypes::Get<Matrix>();
1821 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1823 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1825 if (CLEAN_FLAG != mDirtyFlags)
1827 mValue[updateBufferIndex] = mBaseValue;
1829 mDirtyFlags = ( mDirtyFlags >> 1 );
1834 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix()
1836 const Matrix& GetMatrix( BufferIndex bufferIndex ) const override
1838 return mValue[ bufferIndex ];
1842 * Set the property value. This will only persist for the current frame; the property
1843 * will be reset with the base value, at the beginning of the next frame.
1844 * @param[in] bufferIndex The buffer to write.
1845 * @param[in] value The new property value.
1847 void Set(BufferIndex bufferIndex, const Matrix& value)
1849 mValue[bufferIndex] = value;
1855 * Change the property value by a relative amount.
1856 * @param[in] bufferIndex The buffer to write.
1857 * @param[in] delta The property will change by this amount.
1859 void SetRelative(BufferIndex bufferIndex, const Matrix& delta)
1862 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1863 mValue[bufferIndex] = temp;
1869 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1871 Matrix& Get( BufferIndex bufferIndex )
1873 return mValue[bufferIndex];
1877 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1879 const Matrix& Get( BufferIndex bufferIndex ) const
1881 return mValue[bufferIndex];
1885 * Retrieve the property value.
1886 * @param[in] bufferIndex The buffer to read.
1887 * @return The property value.
1889 Matrix& operator[]( BufferIndex bufferIndex )
1891 return mValue[bufferIndex];
1895 * Retrieve the property value.
1896 * @param[in] bufferIndex The buffer to read.
1897 * @return The property value.
1899 const Matrix& operator[]( BufferIndex bufferIndex ) const
1901 return mValue[bufferIndex];
1905 * Set both the property value & base value.
1906 * @param[in] bufferIndex The buffer to write for the property value.
1907 * @param[in] value The new property value.
1909 void Bake(BufferIndex bufferIndex, const Matrix& value)
1911 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1912 // has never been atomically safe.
1913 mValue[bufferIndex] = value;
1914 mValue[1-bufferIndex] = value;
1915 mBaseValue = mValue[bufferIndex];
1921 * Change the property value & base value by a relative amount.
1922 * @param[in] bufferIndex The buffer to write for the local property value.
1923 * @param[in] delta The property will change by this amount.
1925 void BakeRelative(BufferIndex bufferIndex, const Matrix& delta)
1928 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1929 mValue[bufferIndex] = temp;
1938 AnimatableProperty(const AnimatableProperty& property);
1941 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1945 DoubleBuffered<Matrix> mValue; ///< The double-buffered property value
1946 Matrix mBaseValue; ///< Reset to this base value at the beginning of each frame
1951 * A Matrix3 animatable property of a scene-graph object.
1954 class AnimatableProperty<Matrix3> : public AnimatablePropertyBase
1959 * Create an animatable property.
1960 * @param [in] initialValue The initial value of the property.
1962 AnimatableProperty( const Matrix3& initialValue )
1963 : mValue( initialValue ),
1964 mBaseValue( initialValue )
1969 * Virtual destructor.
1971 ~AnimatableProperty() override = default;
1974 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1976 Dali::Property::Type GetType() const override
1978 return Dali::PropertyTypes::Get<Matrix3>();
1982 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1984 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1986 if (CLEAN_FLAG != mDirtyFlags)
1988 mValue[updateBufferIndex] = mBaseValue;
1990 mDirtyFlags = ( mDirtyFlags >> 1 );
1995 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix3()
1997 const Matrix3& GetMatrix3( BufferIndex bufferIndex ) const override
1999 return mValue[ bufferIndex ];
2003 * Set the property value. This will only persist for the current frame; the property
2004 * will be reset with the base value, at the beginning of the next frame.
2005 * @param[in] bufferIndex The buffer to write.
2006 * @param[in] value The new property value.
2008 void Set(BufferIndex bufferIndex, const Matrix3& value)
2010 mValue[bufferIndex] = value;
2015 * Change the property value by a relative amount.
2016 * @param[in] bufferIndex The buffer to write.
2017 * @param[in] delta The property will change by this amount.
2019 void SetRelative(BufferIndex bufferIndex, const Matrix3& delta)
2022 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
2023 mValue[bufferIndex] = temp;
2028 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
2030 Matrix3& Get( BufferIndex bufferIndex )
2032 return mValue[bufferIndex];
2036 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
2038 const Matrix3& Get( BufferIndex bufferIndex ) const
2040 return mValue[bufferIndex];
2044 * Retrieve the property value.
2045 * @param[in] bufferIndex The buffer to read.
2046 * @return The property value.
2048 Matrix3& operator[]( BufferIndex bufferIndex )
2050 return mValue[bufferIndex];
2054 * Retrieve the property value.
2055 * @param[in] bufferIndex The buffer to read.
2056 * @return The property value.
2058 const Matrix3& operator[]( BufferIndex bufferIndex ) const
2060 return mValue[bufferIndex];
2064 * Set both the property value & base value.
2065 * @param[in] bufferIndex The buffer to write for the property value.
2066 * @param[in] value The new property value.
2068 void Bake(BufferIndex bufferIndex, const Matrix3& value)
2070 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
2071 // has never been atomically safe.
2072 mValue[bufferIndex] = value;
2073 mValue[1-bufferIndex] = value;
2074 mBaseValue = mValue[bufferIndex];
2080 * Change the property value & base value by a relative amount.
2081 * @param[in] bufferIndex The buffer to write for the local property value.
2082 * @param[in] delta The property will change by this amount.
2084 void BakeRelative(BufferIndex bufferIndex, const Matrix3& delta)
2087 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
2088 mValue[bufferIndex] = temp;
2097 AnimatableProperty(const AnimatableProperty& property);
2100 AnimatableProperty& operator=(const AnimatableProperty& rhs);
2104 DoubleBuffered<Matrix3> mValue; ///< The double-buffered property value
2105 Matrix3 mBaseValue; ///< Reset to this base value at the beginning of each frame
2109 } // namespace SceneGraph
2111 // Messages for AnimatableProperty<T>
2114 void BakeMessage( EventThreadServices& eventThreadServices,
2115 const SceneGraph::AnimatableProperty<T>& property,
2116 typename ParameterType< T >::PassingType newValue )
2118 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, T>;
2120 // Reserve some memory inside the message queue
2121 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2123 // Construct message in the message queue memory; note that delete should not be called on the return value
2124 new (slot) LocalType( &property,
2125 &SceneGraph::AnimatableProperty<T>::Bake,
2130 void BakeRelativeMessage( EventThreadServices& eventThreadServices,
2131 const SceneGraph::AnimatableProperty<T>& property,
2134 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, const T&>;
2136 // Reserve some memory inside the message queue
2137 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2139 // Construct message in the message queue memory; note that delete should not be called on the return value
2140 new (slot) LocalType( &property,
2141 &SceneGraph::AnimatableProperty<T>::BakeRelative,
2146 void SetXComponentMessage( EventThreadServices& eventThreadServices,
2147 const SceneGraph::AnimatableProperty<T>& property,
2148 typename ParameterType< float >::PassingType newValue )
2150 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2152 // Reserve some memory inside the message queue
2153 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2155 // Construct message in the message queue memory; note that delete should not be called on the return value
2156 new (slot) LocalType( &property,
2157 &SceneGraph::AnimatableProperty<T>::BakeX,
2162 void SetYComponentMessage( EventThreadServices& eventThreadServices,
2163 const SceneGraph::AnimatableProperty<T>& property,
2164 typename ParameterType< float >::PassingType newValue )
2166 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2168 // Reserve some memory inside the message queue
2169 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2171 // Construct message in the message queue memory; note that delete should not be called on the return value
2172 new (slot) LocalType( &property,
2173 &SceneGraph::AnimatableProperty<T>::BakeY,
2178 void SetZComponentMessage( EventThreadServices& eventThreadServices,
2179 const SceneGraph::AnimatableProperty<T>& property,
2180 typename ParameterType< float >::PassingType newValue )
2182 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2184 // Reserve some memory inside the message queue
2185 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2187 // Construct message in the message queue memory; note that delete should not be called on the return value
2188 new (slot) LocalType( &property,
2189 &SceneGraph::AnimatableProperty<T>::BakeZ,
2194 void SetWComponentMessage( EventThreadServices& eventThreadServices,
2195 const SceneGraph::AnimatableProperty<T>& property,
2196 typename ParameterType< float >::PassingType newValue )
2198 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2200 // Reserve some memory inside the message queue
2201 uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2203 // Construct message in the message queue memory; note that delete should not be called on the return value
2204 new (slot) LocalType( &property,
2205 &SceneGraph::AnimatableProperty<T>::BakeW,
2209 } // namespace Internal
2213 #endif // DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H