1 #ifndef DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H
2 #define DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H
5 * Copyright (c) 2021 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/internal/common/message.h>
26 #include <dali/internal/event/common/event-thread-services.h>
27 #include <dali/internal/event/common/property-input-impl.h>
28 #include <dali/internal/update/common/double-buffered.h>
29 #include <dali/internal/update/common/property-base.h>
30 #include <dali/internal/update/common/scene-graph-buffers.h>
31 #include <dali/public-api/common/dali-common.h>
32 #include <dali/public-api/object/property-input.h>
33 #include <dali/public-api/object/property-types.h>
34 #include <dali/public-api/object/property.h>
43 * Dirty flags record whether an animatable property has changed.
44 * In the frame following a change, the property is reset to a base value.
46 * If the property was "Baked", then the base value matches the (double-buffered) value from the previous frame.
47 * Therefore when reset, the property is flagged as "clean".
49 * However if the property was only "Set" (and not "Baked"), then typically the base value and previous value will not match.
50 * In this case the reset operation is equivalent to a "Bake", and the value is considered "dirty" for an additional frame.
52 static const uint32_t CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame
53 static const uint32_t BAKED_FLAG = 0x01; ///< Indicates that the value was Baked during the previous frame
54 static const uint32_t SET_FLAG = 0x02; ///< Indicates that the value was Set during the previous frame
57 class AnimatableProperty;
60 * Base class to reduce code size from the templates.
62 class AnimatablePropertyBase : public PropertyBase
66 * Constructor, initialize the dirty flag
68 AnimatablePropertyBase()
70 mDirtyFlags(BAKED_FLAG)
77 ~AnimatablePropertyBase() override = default;
79 protected: // for derived classes
81 * Flag that the property has been Set during the current frame.
85 mDirtyFlags = SET_FLAG;
89 * Flag that the property has been Baked during the current frame.
93 mDirtyFlags = BAKED_FLAG;
96 public: // From PropertyBase
98 * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
100 bool IsClean() const override
102 return (CLEAN_FLAG == mDirtyFlags);
106 * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
108 bool InputInitialized() const override
110 return true; // Animatable properties are always valid
113 protected: // so that ResetToBaseValue can set it directly
114 uint32_t mDirtyFlags; ///< Flag whether value changed during previous 2 frames
118 * An boolean animatable property of a scene-graph object.
121 class AnimatableProperty<bool> : public AnimatablePropertyBase
125 * Create an animatable property.
126 * @param [in] initialValue The initial value of the property.
128 AnimatableProperty(bool initialValue)
129 : mValue(initialValue),
130 mBaseValue(initialValue)
135 * Virtual destructor.
137 ~AnimatableProperty() override = default;
140 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
142 Dali::Property::Type GetType() const override
144 return Dali::PropertyTypes::Get<bool>();
148 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
150 void ResetToBaseValue(BufferIndex updateBufferIndex) override
152 if(CLEAN_FLAG != mDirtyFlags)
154 mValue[updateBufferIndex] = mBaseValue;
156 mDirtyFlags = (mDirtyFlags >> 1);
161 * @copydoc Dali::Internal::PropertyInputImpl::GetBoolean()
163 const bool& GetBoolean(BufferIndex bufferIndex) const override
165 return mValue[bufferIndex];
169 * Set the property value. This will only persist for the current frame; the property
170 * will be reset with the base value, at the beginning of the next frame.
171 * @param[in] bufferIndex The buffer to write.
172 * @param[in] value The new property value.
174 void Set(BufferIndex bufferIndex, bool value)
176 // check if the value actually changed to avoid dirtying nodes unnecessarily
177 if(mValue[bufferIndex] != value)
179 mValue[bufferIndex] = value;
186 * Change the property value by a relative amount.
187 * @param[in] bufferIndex The buffer to write.
188 * @param[in] delta The property will change by this amount.
190 void SetRelative(BufferIndex bufferIndex, bool delta)
192 // check if the value actually changed to avoid dirtying nodes unnecessarily
193 // false + false does not change value, true + false does not either
194 if(delta && !mValue[bufferIndex])
196 mValue[bufferIndex] = delta;
203 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
205 bool& Get(BufferIndex bufferIndex)
207 return mValue[bufferIndex];
211 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
213 const bool& Get(BufferIndex bufferIndex) const
215 return mValue[bufferIndex];
219 * Retrieve the property value.
220 * @param[in] bufferIndex The buffer to read.
221 * @return The property value.
223 bool& operator[](BufferIndex bufferIndex)
225 return mValue[bufferIndex];
229 * Retrieve the property value.
230 * @param[in] bufferIndex The buffer to read.
231 * @return The property value.
233 const bool& operator[](BufferIndex bufferIndex) const
235 return mValue[bufferIndex];
239 * Set both the property value & base value.
240 * @param[in] bufferIndex The buffer to write for the property value.
241 * @param[in] value The new property value.
243 void Bake(BufferIndex bufferIndex, bool value)
245 // bake has to check the base value as current buffer value can be correct by constraint or something else
246 if(mBaseValue != value)
249 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
250 // has never been atomically safe.
251 mValue[bufferIndex] = value;
252 mValue[1 - bufferIndex] = value;
259 * Change the property value & base value by a relative amount.
260 * @param[in] bufferIndex The buffer to write for the local property value.
261 * @param[in] delta The property will change by this amount.
263 void BakeRelative(BufferIndex bufferIndex, bool delta)
265 mValue[bufferIndex] = mValue[bufferIndex] || delta;
266 mBaseValue = mValue[bufferIndex];
273 AnimatableProperty(const AnimatableProperty& property);
276 AnimatableProperty& operator=(const AnimatableProperty& rhs);
279 DoubleBuffered<bool> mValue; ///< The double-buffered property value
280 bool mBaseValue; ///< Reset to this base value at the beginning of each frame
284 * An integer animatable property of a scene-graph object.
287 class AnimatableProperty<int> : public AnimatablePropertyBase
291 * Create an animatable property.
292 * @param [in] initialValue The initial value of the property.
294 AnimatableProperty(int initialValue)
295 : mValue(initialValue),
296 mBaseValue(initialValue)
301 * Virtual destructor.
303 ~AnimatableProperty() override = default;
306 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
308 Dali::Property::Type GetType() const override
310 return Dali::PropertyTypes::Get<int>();
314 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
316 void ResetToBaseValue(BufferIndex updateBufferIndex) override
318 if(CLEAN_FLAG != mDirtyFlags)
320 mValue[updateBufferIndex] = mBaseValue;
322 mDirtyFlags = (mDirtyFlags >> 1);
327 * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
329 const int& GetInteger(BufferIndex bufferIndex) const override
331 return mValue[bufferIndex];
335 * Set the property value. This will only persist for the current frame; the property
336 * will be reset with the base value, at the beginning of the next frame.
337 * @param[in] bufferIndex The buffer to write.
338 * @param[in] value The new property value.
340 void Set(BufferIndex bufferIndex, int value)
342 mValue[bufferIndex] = value;
348 * Change the property value by a relative amount.
349 * @param[in] bufferIndex The buffer to write.
350 * @param[in] delta The property will change by this amount.
352 void SetRelative(BufferIndex bufferIndex, int delta)
354 mValue[bufferIndex] = mValue[bufferIndex] + delta;
360 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
362 int& Get(BufferIndex bufferIndex)
364 return mValue[bufferIndex];
368 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
370 const int& Get(BufferIndex bufferIndex) const
372 return mValue[bufferIndex];
376 * Retrieve the property value.
377 * @param[in] bufferIndex The buffer to read.
378 * @return The property value.
380 int& operator[](BufferIndex bufferIndex)
382 return mValue[bufferIndex];
386 * Retrieve the property value.
387 * @param[in] bufferIndex The buffer to read.
388 * @return The property value.
390 const int& operator[](BufferIndex bufferIndex) const
392 return mValue[bufferIndex];
396 * Set both the property value & base value.
397 * @param[in] bufferIndex The buffer to write for the property value.
398 * @param[in] value The new property value.
400 void Bake(BufferIndex bufferIndex, int value)
402 mValue[bufferIndex] = value;
403 mValue[1 - bufferIndex] = value;
404 mBaseValue = mValue[bufferIndex];
410 * Change the property value & base value by a relative amount.
411 * @param[in] bufferIndex The buffer to write for the local property value.
412 * @param[in] delta The property will change by this amount.
414 void BakeRelative(BufferIndex bufferIndex, int delta)
416 mValue[bufferIndex] = mValue[bufferIndex] + delta;
417 mBaseValue = mValue[bufferIndex];
423 * Sets both double-buffered values & the base value.
424 * This should only be used when the owning object has not been connected to the scene-graph.
425 * @param[in] value The new property value.
427 void SetInitial(const int& value)
430 mValue[1] = mValue[0];
431 mBaseValue = mValue[0];
435 * Change both double-buffered values & the base value by a relative amount.
436 * This should only be used when the owning object has not been connected to the scene-graph.
437 * @param[in] delta The property will change by this amount.
439 void SetInitialRelative(const int& delta)
441 mValue[0] = mValue[0] + delta;
442 mValue[1] = mValue[0];
443 mBaseValue = mValue[0];
448 AnimatableProperty(const AnimatableProperty& property);
451 AnimatableProperty& operator=(const AnimatableProperty& rhs);
454 DoubleBuffered<int> mValue; ///< The double-buffered property value
455 int mBaseValue; ///< Reset to this base value at the beginning of each frame
459 * An float animatable property of a scene-graph object.
462 class AnimatableProperty<float> : public AnimatablePropertyBase
466 * Create an animatable property.
467 * @param [in] initialValue The initial value of the property.
469 AnimatableProperty(float initialValue)
470 : mValue(initialValue),
471 mBaseValue(initialValue)
476 * Virtual destructor.
478 ~AnimatableProperty() override = default;
481 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
483 Dali::Property::Type GetType() const override
485 return Dali::PropertyTypes::Get<float>();
489 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
491 void ResetToBaseValue(BufferIndex updateBufferIndex) override
493 if(CLEAN_FLAG != mDirtyFlags)
495 mValue[updateBufferIndex] = mBaseValue;
497 mDirtyFlags = (mDirtyFlags >> 1);
502 * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
504 const float& GetFloat(BufferIndex bufferIndex) const override
506 return mValue[bufferIndex];
510 * Set the property value. This will only persist for the current frame; the property
511 * will be reset with the base value, at the beginning of the next frame.
512 * @param[in] bufferIndex The buffer to write.
513 * @param[in] value The new property value.
515 void Set(BufferIndex bufferIndex, float value)
517 mValue[bufferIndex] = value;
523 * Change the property value by a relative amount.
524 * @param[in] bufferIndex The buffer to write.
525 * @param[in] delta The property will change by this amount.
527 void SetRelative(BufferIndex bufferIndex, float delta)
529 mValue[bufferIndex] = mValue[bufferIndex] + delta;
535 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
537 float& Get(BufferIndex bufferIndex)
539 return mValue[bufferIndex];
543 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
545 const float& Get(BufferIndex bufferIndex) const
547 return mValue[bufferIndex];
551 * Retrieve the property value.
552 * @param[in] bufferIndex The buffer to read.
553 * @return The property value.
555 float& operator[](BufferIndex bufferIndex)
557 return mValue[bufferIndex];
561 * Retrieve the property value.
562 * @param[in] bufferIndex The buffer to read.
563 * @return The property value.
565 const float& operator[](BufferIndex bufferIndex) const
567 return mValue[bufferIndex];
571 * Set both the property value & base value.
572 * @param[in] bufferIndex The buffer to write for the property value.
573 * @param[in] value The new property value.
575 void Bake(BufferIndex bufferIndex, float value)
577 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
578 // has never been atomically safe.
579 mValue[bufferIndex] = value;
580 mValue[1 - bufferIndex] = value;
581 mBaseValue = mValue[bufferIndex];
587 * Change the property value & base value by a relative amount.
588 * @param[in] bufferIndex The buffer to write for the local property value.
589 * @param[in] delta The property will change by this amount.
591 void BakeRelative(BufferIndex bufferIndex, float delta)
593 mValue[bufferIndex] = mValue[bufferIndex] + delta;
594 mBaseValue = mValue[bufferIndex];
600 * Sets both double-buffered values & the base value.
601 * This should only be used when the owning object has not been connected to the scene-graph.
602 * @param[in] value The new property value.
604 void SetInitial(const float& value)
607 mValue[1] = mValue[0];
608 mBaseValue = mValue[0];
612 * Change both double-buffered values & the base value by a relative amount.
613 * This should only be used when the owning object has not been connected to the scene-graph.
614 * @param[in] delta The property will change by this amount.
616 void SetInitialRelative(const float& delta)
618 mValue[0] = mValue[0] + delta;
619 mValue[1] = mValue[0];
620 mBaseValue = mValue[0];
625 AnimatableProperty(const AnimatableProperty& property);
628 AnimatableProperty& operator=(const AnimatableProperty& rhs);
631 DoubleBuffered<float> mValue; ///< The double-buffered property value
632 float mBaseValue; ///< Reset to this base value at the beginning of each frame
636 * An Vector2 animatable property of a scene-graph object.
639 class AnimatableProperty<Vector2> : public AnimatablePropertyBase
643 * Create an animatable property.
644 * @param [in] initialValue The initial value of the property.
646 AnimatableProperty(const Vector2& initialValue)
647 : mValue(initialValue),
648 mBaseValue(initialValue)
653 * Virtual destructor.
655 ~AnimatableProperty() override = default;
658 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
660 Dali::Property::Type GetType() const override
662 return Dali::PropertyTypes::Get<Vector2>();
666 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
668 void ResetToBaseValue(BufferIndex updateBufferIndex) override
670 if(CLEAN_FLAG != mDirtyFlags)
672 mValue[updateBufferIndex] = mBaseValue;
674 mDirtyFlags = (mDirtyFlags >> 1);
679 * @copydoc Dali::PropertyInput::GetVector2()
681 const Vector2& GetVector2(BufferIndex bufferIndex) const override
683 return mValue[bufferIndex];
687 * Set the property value. This will only persist for the current frame; the property
688 * will be reset with the base value, at the beginning of the next frame.
689 * @param[in] bufferIndex The buffer to write.
690 * @param[in] value The new property value.
692 void Set(BufferIndex bufferIndex, const Vector2& value)
694 mValue[bufferIndex] = value;
700 * Set the property value. This will only persist for the current frame; the property
701 * will be reset with the base value, at the beginning of the next frame.
702 * @param[in] bufferIndex The buffer to write.
703 * @param[in] value The new X value.
705 void SetX(BufferIndex bufferIndex, float value)
707 mValue[bufferIndex].x = value;
713 * Set the property value. This will only persist for the current frame; the property
714 * will be reset with the base value, at the beginning of the next frame.
715 * @param[in] bufferIndex The buffer to write.
716 * @param[in] value The new Y value.
718 void SetY(BufferIndex bufferIndex, float value)
720 mValue[bufferIndex].y = value;
726 * Change the property value by a relative amount.
727 * @param[in] bufferIndex The buffer to write.
728 * @param[in] delta The property will change by this amount.
730 void SetRelative(BufferIndex bufferIndex, const Vector2& delta)
732 mValue[bufferIndex] += delta;
738 * Change the X value by a relative amount.
739 * @param[in] bufferIndex The buffer to write.
740 * @param[in] delta The X value will change by this amount.
742 void SetXRelative(BufferIndex bufferIndex, float delta)
744 mValue[bufferIndex].x += delta;
750 * Change the Y value by a relative amount.
751 * @param[in] bufferIndex The buffer to write.
752 * @param[in] delta The Y value will change by this amount.
754 void SetYRelative(BufferIndex bufferIndex, float delta)
756 mValue[bufferIndex].y += delta;
762 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
764 Vector2& Get(BufferIndex bufferIndex)
766 return mValue[bufferIndex];
770 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
772 const Vector2& Get(BufferIndex bufferIndex) const
774 return mValue[bufferIndex];
778 * Retrieve the property value.
779 * @param[in] bufferIndex The buffer to read.
780 * @return The property value.
782 Vector2& operator[](BufferIndex bufferIndex)
784 return mValue[bufferIndex];
788 * Retrieve the property value.
789 * @param[in] bufferIndex The buffer to read.
790 * @return The property value.
792 const Vector2& operator[](BufferIndex bufferIndex) const
794 return mValue[bufferIndex];
798 * Set both the property value & base value.
799 * @param[in] bufferIndex The buffer to write for the property value.
800 * @param[in] value The new property value.
802 void Bake(BufferIndex bufferIndex, const Vector2& value)
804 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
805 // has never been atomically safe.
806 mValue[bufferIndex] = value;
807 mValue[1 - bufferIndex] = value;
814 * Set both the X value & base X value.
815 * @param[in] bufferIndex The buffer to write for the property value.
816 * @param[in] value The new property value.
818 void BakeX(BufferIndex bufferIndex, float value)
820 mValue[bufferIndex].x = value;
821 mValue[1 - bufferIndex].x = value;
822 mBaseValue.x = value;
828 * Set both the Y value & base Y value.
829 * @param[in] bufferIndex The buffer to write for the property value.
830 * @param[in] value The new property value.
832 void BakeY(BufferIndex bufferIndex, float value)
834 mValue[bufferIndex].y = value;
835 mValue[1 - bufferIndex].y = value;
836 mBaseValue.y = value;
842 * Change the property value & base value by a relative amount.
843 * @param[in] bufferIndex The buffer to write for the local property value.
844 * @param[in] delta The property will change by this amount.
846 void BakeRelative(BufferIndex bufferIndex, const Vector2& delta)
848 mValue[bufferIndex] += delta;
849 mBaseValue = mValue[bufferIndex];
855 * Change the X value & base X value by a relative amount.
856 * @param[in] bufferIndex The buffer to write for the local property value.
857 * @param[in] delta The X value will change by this amount.
859 void BakeXRelative(BufferIndex bufferIndex, float delta)
861 mValue[bufferIndex].x += delta;
862 mBaseValue.x = mValue[bufferIndex].x;
868 * Change the Y value & base Y value by a relative amount.
869 * @param[in] bufferIndex The buffer to write for the local property value.
870 * @param[in] delta The Y value will change by this amount.
872 void BakeYRelative(BufferIndex bufferIndex, float delta)
874 mValue[bufferIndex].y += delta;
875 mBaseValue.y = mValue[bufferIndex].y;
882 AnimatableProperty(const AnimatableProperty& property);
885 AnimatableProperty& operator=(const AnimatableProperty& rhs);
888 DoubleBuffered<Vector2> mValue; ///< The double-buffered property value
889 Vector2 mBaseValue; ///< Reset to this base value at the beginning of each frame
893 * A Vector3 animatable property of a scene-graph object.
896 class AnimatableProperty<Vector3> : public AnimatablePropertyBase
900 * Create an animatable property.
909 * Create an animatable property.
910 * @param [in] initialValue The initial value of the property.
912 AnimatableProperty(const Vector3& initialValue)
913 : mValue(initialValue),
914 mBaseValue(initialValue)
919 * Virtual destructor.
921 ~AnimatableProperty() override = default;
924 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
926 Dali::Property::Type GetType() const override
928 return Dali::PropertyTypes::Get<Vector3>();
932 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
934 void ResetToBaseValue(BufferIndex updateBufferIndex) override
936 if(CLEAN_FLAG != mDirtyFlags)
938 mValue[updateBufferIndex] = mBaseValue;
940 mDirtyFlags = (mDirtyFlags >> 1);
945 * @copydoc Dali::PropertyInput::GetVector3()
947 const Vector3& GetVector3(BufferIndex bufferIndex) const override
949 return mValue[bufferIndex];
953 * Set the property value. This will only persist for the current frame; the property
954 * will be reset with the base value, at the beginning of the next frame.
955 * @param[in] bufferIndex The buffer to write.
956 * @param[in] value The new property value.
958 void Set(BufferIndex bufferIndex, const Vector3& value)
960 mValue[bufferIndex] = value;
966 * Set the property value. This will only persist for the current frame; the property
967 * will be reset with the base value, at the beginning of the next frame.
968 * @param[in] bufferIndex The buffer to write.
969 * @param[in] value The new X value.
971 void SetX(BufferIndex bufferIndex, float value)
973 mValue[bufferIndex].x = value;
979 * Set the property value. This will only persist for the current frame; the property
980 * will be reset with the base value, at the beginning of the next frame.
981 * @param[in] bufferIndex The buffer to write.
982 * @param[in] value The new Y value.
984 void SetY(BufferIndex bufferIndex, float value)
986 mValue[bufferIndex].y = value;
992 * Set the property value. This will only persist for the current frame; the property
993 * will be reset with the base value, at the beginning of the next frame.
994 * @param[in] bufferIndex The buffer to write.
995 * @param[in] value The new Z value.
997 void SetZ(BufferIndex bufferIndex, float value)
999 mValue[bufferIndex].z = value;
1005 * Change the property value by a relative amount.
1006 * @param[in] bufferIndex The buffer to write.
1007 * @param[in] delta The property will change by this amount.
1009 void SetRelative(BufferIndex bufferIndex, const Vector3& delta)
1011 mValue[bufferIndex] += delta;
1017 * Change the X value by a relative amount.
1018 * @param[in] bufferIndex The buffer to write.
1019 * @param[in] delta The X value will change by this amount.
1021 void SetXRelative(BufferIndex bufferIndex, float delta)
1023 mValue[bufferIndex].x += delta;
1029 * Change the Y value by a relative amount.
1030 * @param[in] bufferIndex The buffer to write.
1031 * @param[in] delta The Y value will change by this amount.
1033 void SetYRelative(BufferIndex bufferIndex, float delta)
1035 mValue[bufferIndex].y += delta;
1041 * Change the Z value by a relative amount.
1042 * @param[in] bufferIndex The buffer to write.
1043 * @param[in] delta The Z value will change by this amount.
1045 void SetZRelative(BufferIndex bufferIndex, float delta)
1047 mValue[bufferIndex].z += delta;
1053 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1055 Vector3& Get(BufferIndex bufferIndex)
1057 return mValue[bufferIndex];
1061 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1063 const Vector3& Get(BufferIndex bufferIndex) const
1065 return mValue[bufferIndex];
1069 * Retrieve the property value.
1070 * @param[in] bufferIndex The buffer to read.
1071 * @return The property value.
1073 Vector3& operator[](BufferIndex bufferIndex)
1075 return mValue[bufferIndex];
1079 * Retrieve the property value.
1080 * @param[in] bufferIndex The buffer to read.
1081 * @return The property value.
1083 const Vector3& operator[](BufferIndex bufferIndex) const
1085 return mValue[bufferIndex];
1089 * Set both the property value & base value.
1090 * @param[in] bufferIndex The buffer to write for the property value.
1091 * @param[in] value The new property value.
1093 void Bake(BufferIndex bufferIndex, const Vector3& value)
1095 mValue[bufferIndex] = value;
1096 mValue[1 - bufferIndex] = value;
1103 * Set both the X value & base X value.
1104 * @param[in] bufferIndex The buffer to write for the property value.
1105 * @param[in] value The new property value.
1107 void BakeX(BufferIndex bufferIndex, float value)
1109 mValue[bufferIndex].x = value;
1110 mValue[1 - bufferIndex].x = value;
1111 mBaseValue.x = value;
1117 * Set both the Y value & base Y value.
1118 * @param[in] bufferIndex The buffer to write for the property value.
1119 * @param[in] value The new property value.
1121 void BakeY(BufferIndex bufferIndex, float value)
1123 mValue[bufferIndex].y = value;
1124 mValue[1 - bufferIndex].y = value;
1125 mBaseValue.y = value;
1131 * Set both the Z value & base Z value.
1132 * @param[in] bufferIndex The buffer to write for the property value.
1133 * @param[in] value The new property value.
1135 void BakeZ(BufferIndex bufferIndex, float value)
1137 mValue[bufferIndex].z = value;
1138 mValue[1 - bufferIndex].z = value;
1139 mBaseValue.z = value;
1145 * Change the property value & base value by a relative amount.
1146 * @param[in] bufferIndex The buffer to write for the local property value.
1147 * @param[in] delta The property will change by this amount.
1149 void BakeRelative(BufferIndex bufferIndex, const Vector3& delta)
1151 mValue[bufferIndex] += delta;
1152 mBaseValue = mValue[bufferIndex];
1158 * Change the property value & base value by a relative amount.
1159 * @param[in] bufferIndex The buffer to write for the local property value.
1160 * @param[in] delta The property will change by this amount.
1162 void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& delta)
1164 mValue[bufferIndex] *= delta;
1165 mBaseValue = mValue[bufferIndex];
1171 * Change the X value & base X value by a relative amount.
1172 * @param[in] bufferIndex The buffer to write for the local property value.
1173 * @param[in] delta The X value will change by this amount.
1175 void BakeXRelative(BufferIndex bufferIndex, float delta)
1177 mValue[bufferIndex].x += delta;
1178 mBaseValue.x = mValue[bufferIndex].x;
1184 * Change the Y value & base Y value by a relative amount.
1185 * @param[in] bufferIndex The buffer to write for the local property value.
1186 * @param[in] delta The Y value will change by this amount.
1188 void BakeYRelative(BufferIndex bufferIndex, float delta)
1190 mValue[bufferIndex].y += delta;
1191 mBaseValue.y = mValue[bufferIndex].y;
1197 * Change the Z value & base Z value by a relative amount.
1198 * @param[in] bufferIndex The buffer to write for the local property value.
1199 * @param[in] delta The Z value will change by this amount.
1201 void BakeZRelative(BufferIndex bufferIndex, float delta)
1203 mValue[bufferIndex].z += delta;
1204 mBaseValue.z = mValue[bufferIndex].z;
1211 AnimatableProperty(const AnimatableProperty& property);
1214 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1217 DoubleBuffered<Vector3> mValue; ///< The double-buffered property value
1218 Vector3 mBaseValue; ///< Reset to this base value at the beginning of each frame
1222 * A Vector4 animatable property of a scene-graph object.
1225 class AnimatableProperty<Vector4> : public AnimatablePropertyBase
1229 * Create an animatable property.
1230 * @param [in] initialValue The initial value of the property.
1232 AnimatableProperty(const Vector4& initialValue)
1233 : mValue(initialValue),
1234 mBaseValue(initialValue)
1239 * Virtual destructor.
1241 ~AnimatableProperty() override = default;
1244 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1246 Dali::Property::Type GetType() const override
1248 return Dali::PropertyTypes::Get<Vector4>();
1252 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1254 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1256 if(CLEAN_FLAG != mDirtyFlags)
1258 mValue[updateBufferIndex] = mBaseValue;
1260 mDirtyFlags = (mDirtyFlags >> 1);
1265 * @copydoc Dali::PropertyInput::GetVector4()
1267 const Vector4& GetVector4(BufferIndex bufferIndex) const override
1269 return mValue[bufferIndex];
1273 * Set the property value. This will only persist for the current frame; the property
1274 * will be reset with the base value, at the beginning of the next frame.
1275 * @param[in] bufferIndex The buffer to write.
1276 * @param[in] value The new property value.
1278 void Set(BufferIndex bufferIndex, const Vector4& value)
1280 mValue[bufferIndex] = value;
1286 * Set the X value. This will only persist for the current frame; the property
1287 * will be reset with the base value, at the beginning of the next frame.
1288 * @param[in] bufferIndex The buffer to write.
1289 * @param[in] value The new X value.
1291 void SetX(BufferIndex bufferIndex, float value)
1293 mValue[bufferIndex].x = value;
1299 * Set the Y value. This will only persist for the current frame; the property
1300 * will be reset with the base value, at the beginning of the next frame.
1301 * @param[in] bufferIndex The buffer to write.
1302 * @param[in] value The new Y value.
1304 void SetY(BufferIndex bufferIndex, float value)
1306 mValue[bufferIndex].y = value;
1312 * Set the Z value. This will only persist for the current frame; the property
1313 * will be reset with the base value, at the beginning of the next frame.
1314 * @param[in] bufferIndex The buffer to write.
1315 * @param[in] value The new Z value.
1317 void SetZ(BufferIndex bufferIndex, float value)
1319 mValue[bufferIndex].z = value;
1325 * Set the W value. This will only persist for the current frame; the property
1326 * will be reset with the base value, at the beginning of the next frame.
1327 * @param[in] bufferIndex The buffer to write.
1328 * @param[in] value The new W value.
1330 void SetW(BufferIndex bufferIndex, float value)
1332 mValue[bufferIndex].w = value;
1338 * Change the property value by a relative amount.
1339 * @param[in] bufferIndex The buffer to write.
1340 * @param[in] delta The property will change by this amount.
1342 void SetRelative(BufferIndex bufferIndex, const Vector4& delta)
1344 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1350 * Change the X value by a relative amount.
1351 * @param[in] bufferIndex The buffer to write.
1352 * @param[in] delta The X value will change by this amount.
1354 void SetXRelative(BufferIndex bufferIndex, float delta)
1356 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1362 * Change the Y value by a relative amount.
1363 * @param[in] bufferIndex The buffer to write.
1364 * @param[in] delta The Y value will change by this amount.
1366 void SetYRelative(BufferIndex bufferIndex, float delta)
1368 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1374 * Change the Z value by a relative amount.
1375 * @param[in] bufferIndex The buffer to write.
1376 * @param[in] delta The Z value will change by this amount.
1378 void SetZRelative(BufferIndex bufferIndex, float delta)
1380 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1386 * Change the W value by a relative amount.
1387 * @param[in] bufferIndex The buffer to write.
1388 * @param[in] delta The W value will change by this amount.
1390 void SetWRelative(BufferIndex bufferIndex, float delta)
1392 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1398 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1400 Vector4& Get(BufferIndex bufferIndex)
1402 return mValue[bufferIndex];
1406 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1408 const Vector4& Get(BufferIndex bufferIndex) const
1410 return mValue[bufferIndex];
1414 * Retrieve the property value.
1415 * @param[in] bufferIndex The buffer to read.
1416 * @return The property value.
1418 Vector4& operator[](BufferIndex bufferIndex)
1420 return mValue[bufferIndex];
1424 * Retrieve the property value.
1425 * @param[in] bufferIndex The buffer to read.
1426 * @return The property value.
1428 const Vector4& operator[](BufferIndex bufferIndex) const
1430 return mValue[bufferIndex];
1434 * Set both the property value & base value.
1435 * @param[in] bufferIndex The buffer to write for the property value.
1436 * @param[in] value The new property value.
1438 void Bake(BufferIndex bufferIndex, const Vector4& value)
1440 mValue[bufferIndex] = value;
1441 mValue[1 - bufferIndex] = value;
1442 mBaseValue = mValue[bufferIndex];
1448 * Set both the X value & base X value.
1449 * @param[in] bufferIndex The buffer to write for the property value.
1450 * @param[in] value The new property value.
1452 void BakeX(BufferIndex bufferIndex, float value)
1454 mValue[bufferIndex].x = value;
1455 mValue[1 - bufferIndex].x = value;
1456 mBaseValue.x = mValue[bufferIndex].x;
1462 * Set both the Y value & base Y value.
1463 * @param[in] bufferIndex The buffer to write for the property value.
1464 * @param[in] value The new property value.
1466 void BakeY(BufferIndex bufferIndex, float value)
1468 mValue[bufferIndex].y = value;
1469 mValue[1 - bufferIndex].y = value;
1470 mBaseValue.y = mValue[bufferIndex].y;
1476 * Set both the Z value & base Z value.
1477 * @param[in] bufferIndex The buffer to write for the property value.
1478 * @param[in] value The new property value.
1480 void BakeZ(BufferIndex bufferIndex, float value)
1482 mValue[bufferIndex].z = value;
1483 mValue[1 - bufferIndex].z = value;
1484 mBaseValue.z = mValue[bufferIndex].z;
1490 * Set both the W value & base W value.
1491 * @param[in] bufferIndex The buffer to write for the property value.
1492 * @param[in] value The new property value.
1494 void BakeW(BufferIndex bufferIndex, float value)
1496 mValue[bufferIndex].w = value;
1497 mValue[1 - bufferIndex].w = value;
1498 mBaseValue.w = mValue[bufferIndex].w;
1504 * Change the property value & base value by a relative amount.
1505 * @param[in] bufferIndex The buffer to write for the local property value.
1506 * @param[in] delta The property will change by this amount.
1508 void BakeRelative(BufferIndex bufferIndex, const Vector4& delta)
1510 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1511 mBaseValue = mValue[bufferIndex];
1517 * Change the X value & base X value by a relative amount.
1518 * @param[in] bufferIndex The buffer to write for the local property value.
1519 * @param[in] delta The X value will change by this amount.
1521 void BakeXRelative(BufferIndex bufferIndex, float delta)
1523 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1524 mBaseValue.x = mValue[bufferIndex].x;
1530 * Change the Y value & base Y value by a relative amount.
1531 * @param[in] bufferIndex The buffer to write for the local property value.
1532 * @param[in] delta The Y value will change by this amount.
1534 void BakeYRelative(BufferIndex bufferIndex, float delta)
1536 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1537 mBaseValue.y = mValue[bufferIndex].y;
1543 * Change the Z value & base Z value by a relative amount.
1544 * @param[in] bufferIndex The buffer to write for the local property value.
1545 * @param[in] delta The Z value will change by this amount.
1547 void BakeZRelative(BufferIndex bufferIndex, float delta)
1549 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1550 mBaseValue.z = mValue[bufferIndex].z;
1556 * Change the W value & base W value by a relative amount.
1557 * @param[in] bufferIndex The buffer to write for the local property value.
1558 * @param[in] delta The W value will change by this amount.
1560 void BakeWRelative(BufferIndex bufferIndex, float delta)
1562 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1563 mBaseValue.w = mValue[bufferIndex].w;
1569 * Sets both double-buffered W values & the base W value.
1570 * This should only be used when the owning object has not been connected to the scene-graph.
1571 * @param[in] value The new W value.
1573 void SetWInitial(float value)
1575 mValue[0].w = value;
1576 mValue[1].w = mValue[0].w;
1577 mBaseValue.w = mValue[0].w;
1582 AnimatableProperty(const AnimatableProperty& property);
1585 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1588 DoubleBuffered<Vector4> mValue; ///< The double-buffered property value
1589 Vector4 mBaseValue; ///< Reset to this base value at the beginning of each frame
1592 * An Quaternion animatable property of a scene-graph object.
1595 class AnimatableProperty<Quaternion> : public AnimatablePropertyBase
1599 * Create an animatable property.
1601 AnimatableProperty()
1608 * Create an animatable property.
1609 * @param [in] initialValue The initial value of the property.
1611 AnimatableProperty(const Quaternion& initialValue)
1612 : mValue(initialValue),
1613 mBaseValue(initialValue)
1618 * Virtual destructor.
1620 ~AnimatableProperty() override = default;
1623 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1625 Dali::Property::Type GetType() const override
1627 return Dali::PropertyTypes::Get<Quaternion>();
1631 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1633 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1635 if(CLEAN_FLAG != mDirtyFlags)
1637 mValue[updateBufferIndex] = mBaseValue;
1639 mDirtyFlags = (mDirtyFlags >> 1);
1644 * @copydoc Dali::PropertyInput::GetQuaternion()
1646 const Quaternion& GetQuaternion(BufferIndex bufferIndex) const override
1648 return mValue[bufferIndex];
1652 * Set the property value. This will only persist for the current frame; the property
1653 * will be reset with the base value, at the beginning of the next frame.
1654 * @param[in] bufferIndex The buffer to write.
1655 * @param[in] value The new property value.
1657 void Set(BufferIndex bufferIndex, const Quaternion& value)
1659 mValue[bufferIndex] = value;
1665 * Change the property value by a relative amount.
1666 * @param[in] bufferIndex The buffer to write.
1667 * @param[in] delta The property will change by this amount.
1669 void SetRelative(BufferIndex bufferIndex, const Quaternion& delta)
1671 mValue[bufferIndex] *= delta;
1677 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1679 Quaternion& Get(BufferIndex bufferIndex)
1681 return mValue[bufferIndex];
1685 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1687 const Quaternion& Get(BufferIndex bufferIndex) const
1689 return mValue[bufferIndex];
1693 * Retrieve the property value.
1694 * @param[in] bufferIndex The buffer to read.
1695 * @return The property value.
1697 Quaternion& operator[](BufferIndex bufferIndex)
1699 return mValue[bufferIndex];
1703 * Retrieve the property value.
1704 * @param[in] bufferIndex The buffer to read.
1705 * @return The property value.
1707 const Quaternion& operator[](BufferIndex bufferIndex) const
1709 return mValue[bufferIndex];
1713 * Set both the property value & base value.
1714 * @param[in] bufferIndex The buffer to write for the property value.
1715 * @param[in] value The new property value.
1717 void Bake(BufferIndex bufferIndex, const Quaternion& value)
1719 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1720 // has never been atomically safe.
1721 mValue[bufferIndex] = value;
1722 mValue[1 - bufferIndex] = value;
1729 * Change the property value & base value by a relative amount.
1730 * @param[in] bufferIndex The buffer to write for the local property value.
1731 * @param[in] delta The property will change by this amount.
1733 void BakeRelative(BufferIndex bufferIndex, const Quaternion& delta)
1735 mValue[bufferIndex] *= delta;
1736 mBaseValue = mValue[bufferIndex];
1743 AnimatableProperty(const AnimatableProperty& property);
1746 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1749 DoubleBuffered<Quaternion> mValue; ///< The double-buffered property value
1750 Quaternion mBaseValue; ///< Reset to this base value at the beginning of each frame
1754 * A Matrix animatable property of a scene-graph object.
1757 class AnimatableProperty<Matrix> : public AnimatablePropertyBase
1761 * Create an animatable property.
1762 * @param [in] initialValue The initial value of the property.
1764 AnimatableProperty(const Matrix& initialValue)
1765 : mValue(initialValue),
1766 mBaseValue(initialValue)
1771 * Virtual destructor.
1773 ~AnimatableProperty() override = default;
1776 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1778 Dali::Property::Type GetType() const override
1780 return Dali::PropertyTypes::Get<Matrix>();
1784 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1786 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1788 if(CLEAN_FLAG != mDirtyFlags)
1790 mValue[updateBufferIndex] = mBaseValue;
1792 mDirtyFlags = (mDirtyFlags >> 1);
1797 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix()
1799 const Matrix& GetMatrix(BufferIndex bufferIndex) const override
1801 return mValue[bufferIndex];
1805 * Set the property value. This will only persist for the current frame; the property
1806 * will be reset with the base value, at the beginning of the next frame.
1807 * @param[in] bufferIndex The buffer to write.
1808 * @param[in] value The new property value.
1810 void Set(BufferIndex bufferIndex, const Matrix& value)
1812 mValue[bufferIndex] = value;
1817 * Change the property value by a relative amount.
1818 * @param[in] bufferIndex The buffer to write.
1819 * @param[in] delta The property will change by this amount.
1821 void SetRelative(BufferIndex bufferIndex, const Matrix& delta)
1824 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1825 mValue[bufferIndex] = temp;
1831 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1833 Matrix& Get(BufferIndex bufferIndex)
1835 return mValue[bufferIndex];
1839 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1841 const Matrix& Get(BufferIndex bufferIndex) const
1843 return mValue[bufferIndex];
1847 * Retrieve the property value.
1848 * @param[in] bufferIndex The buffer to read.
1849 * @return The property value.
1851 Matrix& operator[](BufferIndex bufferIndex)
1853 return mValue[bufferIndex];
1857 * Retrieve the property value.
1858 * @param[in] bufferIndex The buffer to read.
1859 * @return The property value.
1861 const Matrix& operator[](BufferIndex bufferIndex) const
1863 return mValue[bufferIndex];
1867 * Set both the property value & base value.
1868 * @param[in] bufferIndex The buffer to write for the property value.
1869 * @param[in] value The new property value.
1871 void Bake(BufferIndex bufferIndex, const Matrix& value)
1873 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1874 // has never been atomically safe.
1875 mValue[bufferIndex] = value;
1876 mValue[1 - bufferIndex] = value;
1877 mBaseValue = mValue[bufferIndex];
1883 * Change the property value & base value by a relative amount.
1884 * @param[in] bufferIndex The buffer to write for the local property value.
1885 * @param[in] delta The property will change by this amount.
1887 void BakeRelative(BufferIndex bufferIndex, const Matrix& delta)
1890 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1891 mValue[bufferIndex] = temp;
1899 AnimatableProperty(const AnimatableProperty& property);
1902 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1905 DoubleBuffered<Matrix> mValue; ///< The double-buffered property value
1906 Matrix mBaseValue; ///< Reset to this base value at the beginning of each frame
1910 * A Matrix3 animatable property of a scene-graph object.
1913 class AnimatableProperty<Matrix3> : public AnimatablePropertyBase
1917 * Create an animatable property.
1918 * @param [in] initialValue The initial value of the property.
1920 AnimatableProperty(const Matrix3& initialValue)
1921 : mValue(initialValue),
1922 mBaseValue(initialValue)
1927 * Virtual destructor.
1929 ~AnimatableProperty() override = default;
1932 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1934 Dali::Property::Type GetType() const override
1936 return Dali::PropertyTypes::Get<Matrix3>();
1940 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1942 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1944 if(CLEAN_FLAG != mDirtyFlags)
1946 mValue[updateBufferIndex] = mBaseValue;
1948 mDirtyFlags = (mDirtyFlags >> 1);
1953 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix3()
1955 const Matrix3& GetMatrix3(BufferIndex bufferIndex) const override
1957 return mValue[bufferIndex];
1961 * Set the property value. This will only persist for the current frame; the property
1962 * will be reset with the base value, at the beginning of the next frame.
1963 * @param[in] bufferIndex The buffer to write.
1964 * @param[in] value The new property value.
1966 void Set(BufferIndex bufferIndex, const Matrix3& value)
1968 mValue[bufferIndex] = value;
1973 * Change the property value by a relative amount.
1974 * @param[in] bufferIndex The buffer to write.
1975 * @param[in] delta The property will change by this amount.
1977 void SetRelative(BufferIndex bufferIndex, const Matrix3& delta)
1980 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
1981 mValue[bufferIndex] = temp;
1986 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1988 Matrix3& Get(BufferIndex bufferIndex)
1990 return mValue[bufferIndex];
1994 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1996 const Matrix3& Get(BufferIndex bufferIndex) const
1998 return mValue[bufferIndex];
2002 * Retrieve the property value.
2003 * @param[in] bufferIndex The buffer to read.
2004 * @return The property value.
2006 Matrix3& operator[](BufferIndex bufferIndex)
2008 return mValue[bufferIndex];
2012 * Retrieve the property value.
2013 * @param[in] bufferIndex The buffer to read.
2014 * @return The property value.
2016 const Matrix3& operator[](BufferIndex bufferIndex) const
2018 return mValue[bufferIndex];
2022 * Set both the property value & base value.
2023 * @param[in] bufferIndex The buffer to write for the property value.
2024 * @param[in] value The new property value.
2026 void Bake(BufferIndex bufferIndex, const Matrix3& value)
2028 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
2029 // has never been atomically safe.
2030 mValue[bufferIndex] = value;
2031 mValue[1 - bufferIndex] = value;
2032 mBaseValue = mValue[bufferIndex];
2038 * Change the property value & base value by a relative amount.
2039 * @param[in] bufferIndex The buffer to write for the local property value.
2040 * @param[in] delta The property will change by this amount.
2042 void BakeRelative(BufferIndex bufferIndex, const Matrix3& delta)
2045 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
2046 mValue[bufferIndex] = temp;
2054 AnimatableProperty(const AnimatableProperty& property);
2057 AnimatableProperty& operator=(const AnimatableProperty& rhs);
2060 DoubleBuffered<Matrix3> mValue; ///< The double-buffered property value
2061 Matrix3 mBaseValue; ///< Reset to this base value at the beginning of each frame
2064 } // namespace SceneGraph
2066 // Messages for AnimatableProperty<T>
2069 void BakeMessage(EventThreadServices& eventThreadServices,
2070 const SceneGraph::AnimatableProperty<T>& property,
2071 typename ParameterType<T>::PassingType newValue)
2073 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, T>;
2075 // Reserve some memory inside the message queue
2076 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2078 // Construct message in the message queue memory; note that delete should not be called on the return value
2079 new(slot) LocalType(&property,
2080 &SceneGraph::AnimatableProperty<T>::Bake,
2085 void BakeRelativeMessage(EventThreadServices& eventThreadServices,
2086 const SceneGraph::AnimatableProperty<T>& property,
2089 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, const T&>;
2091 // Reserve some memory inside the message queue
2092 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2094 // Construct message in the message queue memory; note that delete should not be called on the return value
2095 new(slot) LocalType(&property,
2096 &SceneGraph::AnimatableProperty<T>::BakeRelative,
2101 void SetXComponentMessage(EventThreadServices& eventThreadServices,
2102 const SceneGraph::AnimatableProperty<T>& property,
2103 typename ParameterType<float>::PassingType newValue)
2105 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2107 // Reserve some memory inside the message queue
2108 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2110 // Construct message in the message queue memory; note that delete should not be called on the return value
2111 new(slot) LocalType(&property,
2112 &SceneGraph::AnimatableProperty<T>::BakeX,
2117 void SetYComponentMessage(EventThreadServices& eventThreadServices,
2118 const SceneGraph::AnimatableProperty<T>& property,
2119 typename ParameterType<float>::PassingType newValue)
2121 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2123 // Reserve some memory inside the message queue
2124 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2126 // Construct message in the message queue memory; note that delete should not be called on the return value
2127 new(slot) LocalType(&property,
2128 &SceneGraph::AnimatableProperty<T>::BakeY,
2133 void SetZComponentMessage(EventThreadServices& eventThreadServices,
2134 const SceneGraph::AnimatableProperty<T>& property,
2135 typename ParameterType<float>::PassingType newValue)
2137 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2139 // Reserve some memory inside the message queue
2140 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2142 // Construct message in the message queue memory; note that delete should not be called on the return value
2143 new(slot) LocalType(&property,
2144 &SceneGraph::AnimatableProperty<T>::BakeZ,
2149 void SetWComponentMessage(EventThreadServices& eventThreadServices,
2150 const SceneGraph::AnimatableProperty<T>& property,
2151 typename ParameterType<float>::PassingType newValue)
2153 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2155 // Reserve some memory inside the message queue
2156 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2158 // Construct message in the message queue memory; note that delete should not be called on the return value
2159 new(slot) LocalType(&property,
2160 &SceneGraph::AnimatableProperty<T>::BakeW,
2164 } // namespace Internal
2168 #endif // DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H