1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/object/property.h>
27 #include <dali/public-api/object/property-input.h>
28 #include <dali/public-api/object/property-types.h>
29 #include <dali/internal/common/message.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/event/common/property-input-impl.h>
32 #include <dali/internal/update/common/double-buffered.h>
33 #include <dali/internal/update/common/property-base.h>
34 #include <dali/internal/update/common/scene-graph-buffers.h>
46 * Dirty flags record whether an animatable property has changed.
47 * In the frame following a change, the property is reset to a base value.
49 * If the property was "Baked", then the base value matches the (double-buffered) value from the previous frame.
50 * Therefore when reset, the property is flagged as "clean".
52 * However if the property was only "Set" (and not "Baked"), then typically the base value and previous value will not match.
53 * In this case the reset operation is equivalent to a "Bake", and the value is considered "dirty" for an additional frame.
55 static const unsigned int CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame
56 static const unsigned int BAKED_FLAG = 0x01; ///< Indicates that the value was Baked during the previous frame
57 static const unsigned int SET_FLAG = 0x02; ///< Indicates that the value was Set during the previous frame
60 class AnimatableProperty;
63 * Base class to reduce code size from the templates.
65 class AnimatablePropertyBase : public PropertyBase
70 * Constructor, initialize the dirty flag
72 AnimatablePropertyBase()
74 mDirtyFlags( BAKED_FLAG )
80 virtual ~AnimatablePropertyBase()
83 protected: // for derived classes
86 * Flag that the property has been Set during the current frame.
90 mDirtyFlags = SET_FLAG;
94 * Flag that the property has been Baked during the current frame.
98 mDirtyFlags = BAKED_FLAG;
101 public: // From PropertyBase
104 * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
106 virtual bool IsClean() const
108 return ( CLEAN_FLAG == mDirtyFlags );
112 * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
114 virtual bool InputInitialized() const
116 return true; // Animatable properties are always valid
119 protected: // so that ResetToBaseValue can set it directly
121 unsigned int mDirtyFlags; ///< Flag whether value changed during previous 2 frames
127 * An boolean animatable property of a scene-graph object.
130 class AnimatableProperty<bool> : public AnimatablePropertyBase
135 * Create an animatable property.
136 * @param [in] initialValue The initial value of the property.
138 AnimatableProperty( bool initialValue )
139 : mValue( initialValue ),
140 mBaseValue( initialValue )
145 * Virtual destructor.
147 virtual ~AnimatableProperty()
152 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
154 virtual Dali::Property::Type GetType() const
156 return Dali::PropertyTypes::Get<bool>();
160 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
162 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
164 if (CLEAN_FLAG != mDirtyFlags)
166 mValue[updateBufferIndex] = mBaseValue;
168 mDirtyFlags = ( mDirtyFlags >> 1 );
173 * @copydoc Dali::Internal::PropertyInputImpl::GetBoolean()
175 virtual const bool& GetBoolean( BufferIndex bufferIndex ) const
177 return mValue[ bufferIndex ];
181 * Set the property value. This will only persist for the current frame; the property
182 * will be reset with the base value, at the beginning of the next frame.
183 * @param[in] bufferIndex The buffer to write.
184 * @param[in] value The new property value.
186 void Set(BufferIndex bufferIndex, bool value)
188 // check if the value actually changed to avoid dirtying nodes unnecessarily
189 if( mValue[bufferIndex] != value )
191 mValue[bufferIndex] = value;
198 * Change the property value by a relative amount.
199 * @param[in] bufferIndex The buffer to write.
200 * @param[in] delta The property will change by this amount.
202 void SetRelative(BufferIndex bufferIndex, bool delta)
204 // check if the value actually changed to avoid dirtying nodes unnecessarily
205 // false + false does not change value, true + false does not either
206 if( delta && !mValue[bufferIndex] )
208 mValue[bufferIndex] += delta;
215 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
217 bool& Get(size_t bufferIndex)
219 return mValue[bufferIndex];
223 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
225 const bool& Get(size_t bufferIndex) const
227 return mValue[bufferIndex];
231 * Retrieve the property value.
232 * @param[in] bufferIndex The buffer to read.
233 * @return The property value.
235 bool& operator[](size_t bufferIndex)
237 return mValue[bufferIndex];
241 * Retrieve the property value.
242 * @param[in] bufferIndex The buffer to read.
243 * @return The property value.
245 const bool& operator[](size_t bufferIndex) const
247 return mValue[bufferIndex];
251 * Set both the property value & base value.
252 * @param[in] bufferIndex The buffer to write for the property value.
253 * @param[in] value The new property value.
255 void Bake(BufferIndex bufferIndex, bool value)
257 // bake has to check the base value as current buffer value can be correct by constraint or something else
258 if( mBaseValue != value )
261 mValue[bufferIndex] = value;
268 * Change the property value & base value by a relative amount.
269 * @param[in] bufferIndex The buffer to write for the local property value.
270 * @param[in] delta The property will change by this amount.
272 void BakeRelative(BufferIndex bufferIndex, bool delta)
274 mValue[bufferIndex] += delta;
275 mBaseValue = mValue[bufferIndex];
283 AnimatableProperty(const AnimatableProperty& property);
286 AnimatableProperty& operator=(const AnimatableProperty& rhs);
290 DoubleBuffered<bool> mValue; ///< The double-buffered property value
291 bool mBaseValue; ///< Reset to this base value at the beginning of each frame
296 * An float animatable property of a scene-graph object.
299 class AnimatableProperty<float> : public AnimatablePropertyBase
304 * Create an animatable property.
305 * @param [in] initialValue The initial value of the property.
307 AnimatableProperty( float initialValue )
308 : mValue( initialValue ),
309 mBaseValue( initialValue )
314 * Virtual destructor.
316 virtual ~AnimatableProperty()
321 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
323 virtual Dali::Property::Type GetType() const
325 return Dali::PropertyTypes::Get<float>();
329 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
331 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
333 if (CLEAN_FLAG != mDirtyFlags)
335 mValue[updateBufferIndex] = mBaseValue;
337 mDirtyFlags = ( mDirtyFlags >> 1 );
342 * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
344 virtual const float& GetFloat( BufferIndex bufferIndex ) const
346 return mValue[ bufferIndex ];
350 * Set the property value. This will only persist for the current frame; the property
351 * will be reset with the base value, at the beginning of the next frame.
352 * @param[in] bufferIndex The buffer to write.
353 * @param[in] value The new property value.
355 void Set(BufferIndex bufferIndex, float value)
357 mValue[bufferIndex] = value;
363 * Change the property value by a relative amount.
364 * @param[in] bufferIndex The buffer to write.
365 * @param[in] delta The property will change by this amount.
367 void SetRelative(BufferIndex bufferIndex, float delta)
369 mValue[bufferIndex] = mValue[bufferIndex] + delta;
375 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
377 float& Get(size_t bufferIndex)
379 return mValue[bufferIndex];
383 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
385 const float& Get(size_t bufferIndex) const
387 return mValue[bufferIndex];
391 * Retrieve the property value.
392 * @param[in] bufferIndex The buffer to read.
393 * @return The property value.
395 float& operator[](size_t bufferIndex)
397 return mValue[bufferIndex];
401 * Retrieve the property value.
402 * @param[in] bufferIndex The buffer to read.
403 * @return The property value.
405 const float& operator[](size_t bufferIndex) const
407 return mValue[bufferIndex];
411 * Set both the property value & base value.
412 * @param[in] bufferIndex The buffer to write for the property value.
413 * @param[in] value The new property value.
415 void Bake(BufferIndex bufferIndex, float value)
417 mValue[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, float 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 float& 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 float& 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<float> mValue; ///< The double-buffered property value
471 float mBaseValue; ///< Reset to this base value at the beginning of each frame
476 * An integer animatable property of a scene-graph object.
479 class AnimatableProperty<int> : public AnimatablePropertyBase
484 * Create an animatable property.
485 * @param [in] initialValue The initial value of the property.
487 AnimatableProperty( int initialValue )
488 : mValue( initialValue ),
489 mBaseValue( initialValue )
494 * Virtual destructor.
496 virtual ~AnimatableProperty()
501 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
503 virtual Dali::Property::Type GetType() const
505 return Dali::PropertyTypes::Get<int>();
509 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
511 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
513 if (CLEAN_FLAG != mDirtyFlags)
515 mValue[updateBufferIndex] = mBaseValue;
517 mDirtyFlags = ( mDirtyFlags >> 1 );
522 * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
524 virtual const int& GetInteger( BufferIndex bufferIndex ) const
526 return mValue[ bufferIndex ];
530 * Set the property value. This will only persist for the current frame; the property
531 * will be reset with the base value, at the beginning of the next frame.
532 * @param[in] bufferIndex The buffer to write.
533 * @param[in] value The new property value.
535 void Set(BufferIndex bufferIndex, int value)
537 mValue[bufferIndex] = value;
543 * Change the property value by a relative amount.
544 * @param[in] bufferIndex The buffer to write.
545 * @param[in] delta The property will change by this amount.
547 void SetRelative(BufferIndex bufferIndex, int delta)
549 mValue[bufferIndex] = mValue[bufferIndex] + delta;
555 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
557 int& Get(size_t bufferIndex)
559 return mValue[bufferIndex];
563 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
565 const int& Get(size_t bufferIndex) const
567 return mValue[bufferIndex];
571 * Retrieve the property value.
572 * @param[in] bufferIndex The buffer to read.
573 * @return The property value.
575 int& operator[](size_t bufferIndex)
577 return mValue[bufferIndex];
581 * Retrieve the property value.
582 * @param[in] bufferIndex The buffer to read.
583 * @return The property value.
585 const int& operator[](size_t bufferIndex) const
587 return mValue[bufferIndex];
591 * Set both the property value & base value.
592 * @param[in] bufferIndex The buffer to write for the property value.
593 * @param[in] value The new property value.
595 void Bake(BufferIndex bufferIndex, int value)
597 mValue[bufferIndex] = value;
598 mBaseValue = mValue[bufferIndex];
604 * Change the property value & base value by a relative amount.
605 * @param[in] bufferIndex The buffer to write for the local property value.
606 * @param[in] delta The property will change by this amount.
608 void BakeRelative(BufferIndex bufferIndex, int delta)
610 mValue[bufferIndex] = mValue[bufferIndex] + delta;
611 mBaseValue = mValue[bufferIndex];
617 * Sets both double-buffered values & the base value.
618 * This should only be used when the owning object has not been connected to the scene-graph.
619 * @param[in] value The new property value.
621 void SetInitial(const int& value)
624 mValue[1] = mValue[0];
625 mBaseValue = mValue[0];
629 * Change both double-buffered values & the base value by a relative amount.
630 * This should only be used when the owning object has not been connected to the scene-graph.
631 * @param[in] delta The property will change by this amount.
633 void SetInitialRelative(const int& delta)
635 mValue[0] = mValue[0] + delta;
636 mValue[1] = mValue[0];
637 mBaseValue = mValue[0];
643 AnimatableProperty(const AnimatableProperty& property);
646 AnimatableProperty& operator=(const AnimatableProperty& rhs);
650 DoubleBuffered<int> mValue; ///< The double-buffered property value
651 int 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 virtual ~AnimatableProperty()
681 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
683 virtual Dali::Property::Type GetType() const
685 return Dali::PropertyTypes::Get<Vector2>();
689 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
691 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
693 if (CLEAN_FLAG != mDirtyFlags)
695 mValue[updateBufferIndex] = mBaseValue;
697 mDirtyFlags = ( mDirtyFlags >> 1 );
702 * @copydoc Dali::PropertyInput::GetVector2()
704 virtual const Vector2& GetVector2( BufferIndex bufferIndex ) const
706 return mValue[ bufferIndex ];
710 * Set the property value. This will only persist for the current frame; the property
711 * will be reset with the base value, at the beginning of the next frame.
712 * @param[in] bufferIndex The buffer to write.
713 * @param[in] value The new property value.
715 void Set(BufferIndex bufferIndex, const Vector2& value)
717 mValue[bufferIndex] = value;
723 * Change the property value by a relative amount.
724 * @param[in] bufferIndex The buffer to write.
725 * @param[in] delta The property will change by this amount.
727 void SetRelative(BufferIndex bufferIndex, const Vector2& delta)
729 mValue[bufferIndex] += delta;
735 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
737 Vector2& Get(size_t bufferIndex)
739 return mValue[bufferIndex];
743 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
745 const Vector2& Get(size_t bufferIndex) const
747 return mValue[bufferIndex];
751 * Retrieve the property value.
752 * @param[in] bufferIndex The buffer to read.
753 * @return The property value.
755 Vector2& operator[](size_t bufferIndex)
757 return mValue[bufferIndex];
761 * Retrieve the property value.
762 * @param[in] bufferIndex The buffer to read.
763 * @return The property value.
765 const Vector2& operator[](size_t bufferIndex) const
767 return mValue[bufferIndex];
771 * Set both the property value & base value.
772 * @param[in] bufferIndex The buffer to write for the property value.
773 * @param[in] value The new property value.
775 void Bake(BufferIndex bufferIndex, const Vector2& value)
777 mValue[bufferIndex] = value;
784 * Change the property value & base value by a relative amount.
785 * @param[in] bufferIndex The buffer to write for the local property value.
786 * @param[in] delta The property will change by this amount.
788 void BakeRelative(BufferIndex bufferIndex, const Vector2& delta)
790 mValue[bufferIndex] += delta;
791 mBaseValue = mValue[bufferIndex];
799 AnimatableProperty(const AnimatableProperty& property);
802 AnimatableProperty& operator=(const AnimatableProperty& rhs);
806 DoubleBuffered<Vector2> mValue; ///< The double-buffered property value
807 Vector2 mBaseValue; ///< Reset to this base value at the beginning of each frame
812 * A Vector3 animatable property of a scene-graph object.
815 class AnimatableProperty<Vector3> : public AnimatablePropertyBase
820 * Create an animatable property.
829 * Create an animatable property.
830 * @param [in] initialValue The initial value of the property.
832 AnimatableProperty( const Vector3& initialValue )
833 : mValue( initialValue ),
834 mBaseValue( initialValue )
839 * Virtual destructor.
841 virtual ~AnimatableProperty()
846 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
848 virtual Dali::Property::Type GetType() const
850 return Dali::PropertyTypes::Get<Vector3>();
854 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
856 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
858 if (CLEAN_FLAG != mDirtyFlags)
860 mValue[updateBufferIndex] = mBaseValue;
862 mDirtyFlags = ( mDirtyFlags >> 1 );
867 * @copydoc Dali::PropertyInput::GetVector3()
869 virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
871 return mValue[ bufferIndex ];
875 * Set the property value. This will only persist for the current frame; the property
876 * will be reset with the base value, at the beginning of the next frame.
877 * @param[in] bufferIndex The buffer to write.
878 * @param[in] value The new property value.
880 void Set(BufferIndex bufferIndex, const Vector3& value)
882 mValue[bufferIndex] = value;
888 * Set the property value. This will only persist for the current frame; the property
889 * will be reset with the base value, at the beginning of the next frame.
890 * @param[in] bufferIndex The buffer to write.
891 * @param[in] value The new X value.
893 void SetX(BufferIndex bufferIndex, float value)
895 mValue[bufferIndex].x = value;
901 * Set the property value. This will only persist for the current frame; the property
902 * will be reset with the base value, at the beginning of the next frame.
903 * @param[in] bufferIndex The buffer to write.
904 * @param[in] value The new Y value.
906 void SetY(BufferIndex bufferIndex, float value)
908 mValue[bufferIndex].y = value;
914 * Set the property value. This will only persist for the current frame; the property
915 * will be reset with the base value, at the beginning of the next frame.
916 * @param[in] bufferIndex The buffer to write.
917 * @param[in] value The new Z value.
919 void SetZ(BufferIndex bufferIndex, float value)
921 mValue[bufferIndex].z = value;
927 * Change the property value by a relative amount.
928 * @param[in] bufferIndex The buffer to write.
929 * @param[in] delta The property will change by this amount.
931 void SetRelative(BufferIndex bufferIndex, const Vector3& delta)
933 mValue[bufferIndex] += delta;
939 * Change the X value by a relative amount.
940 * @param[in] bufferIndex The buffer to write.
941 * @param[in] delta The X value will change by this amount.
943 void SetXRelative(BufferIndex bufferIndex, float delta)
945 mValue[bufferIndex].x += delta;
951 * Change the Y value by a relative amount.
952 * @param[in] bufferIndex The buffer to write.
953 * @param[in] delta The Y value will change by this amount.
955 void SetYRelative(BufferIndex bufferIndex, float delta)
957 mValue[bufferIndex].y += delta;
963 * Change the Z value by a relative amount.
964 * @param[in] bufferIndex The buffer to write.
965 * @param[in] delta The Z value will change by this amount.
967 void SetZRelative(BufferIndex bufferIndex, float delta)
969 mValue[bufferIndex].z += delta;
975 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
977 Vector3& Get(size_t bufferIndex)
979 return mValue[bufferIndex];
983 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
985 const Vector3& Get(size_t bufferIndex) const
987 return mValue[bufferIndex];
991 * Retrieve the property value.
992 * @param[in] bufferIndex The buffer to read.
993 * @return The property value.
995 Vector3& operator[](size_t bufferIndex)
997 return mValue[bufferIndex];
1001 * Retrieve the property value.
1002 * @param[in] bufferIndex The buffer to read.
1003 * @return The property value.
1005 const Vector3& operator[](size_t bufferIndex) const
1007 return mValue[bufferIndex];
1011 * Set both the property value & base value.
1012 * @param[in] bufferIndex The buffer to write for the property value.
1013 * @param[in] value The new property value.
1015 void Bake(BufferIndex bufferIndex, const Vector3& value)
1017 mValue[bufferIndex] = value;
1024 * Set both the X value & base X value.
1025 * @param[in] bufferIndex The buffer to write for the property value.
1026 * @param[in] value The new property value.
1028 void BakeX(BufferIndex bufferIndex, float value)
1030 mValue[bufferIndex].x = value;
1031 mBaseValue.x = value;
1037 * Set both the Y value & base Y value.
1038 * @param[in] bufferIndex The buffer to write for the property value.
1039 * @param[in] value The new property value.
1041 void BakeY(BufferIndex bufferIndex, float value)
1043 mValue[bufferIndex].y = value;
1044 mBaseValue.y = value;
1050 * Set both the Z value & base Z value.
1051 * @param[in] bufferIndex The buffer to write for the property value.
1052 * @param[in] value The new property value.
1054 void BakeZ(BufferIndex bufferIndex, float value)
1056 mValue[bufferIndex].z = value;
1057 mBaseValue.z = value;
1063 * Change the property value & base value by a relative amount.
1064 * @param[in] bufferIndex The buffer to write for the local property value.
1065 * @param[in] delta The property will change by this amount.
1067 void BakeRelative(BufferIndex bufferIndex, const Vector3& delta)
1069 mValue[bufferIndex] += delta;
1070 mBaseValue = mValue[bufferIndex];
1076 * Change the property value & base value by a relative amount.
1077 * @param[in] bufferIndex The buffer to write for the local property value.
1078 * @param[in] delta The property will change by this amount.
1080 void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& delta)
1082 mValue[bufferIndex] *= delta;
1083 mBaseValue = mValue[bufferIndex];
1089 * Change the X value & base X value by a relative amount.
1090 * @param[in] bufferIndex The buffer to write for the local property value.
1091 * @param[in] delta The X value will change by this amount.
1093 void BakeXRelative(BufferIndex bufferIndex, float delta)
1095 mValue[bufferIndex].x += delta;
1096 mBaseValue.x = mValue[bufferIndex].x;
1102 * Change the Y value & base Y value by a relative amount.
1103 * @param[in] bufferIndex The buffer to write for the local property value.
1104 * @param[in] delta The Y value will change by this amount.
1106 void BakeYRelative(BufferIndex bufferIndex, float delta)
1108 mValue[bufferIndex].y += delta;
1109 mBaseValue.y = mValue[bufferIndex].y;
1115 * Change the Z value & base Z value by a relative amount.
1116 * @param[in] bufferIndex The buffer to write for the local property value.
1117 * @param[in] delta The Z value will change by this amount.
1119 void BakeZRelative(BufferIndex bufferIndex, float delta)
1121 mValue[bufferIndex].z += delta;
1122 mBaseValue.z = mValue[bufferIndex].z;
1130 AnimatableProperty(const AnimatableProperty& property);
1133 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1137 DoubleBuffered<Vector3> mValue; ///< The double-buffered property value
1138 Vector3 mBaseValue; ///< Reset to this base value at the beginning of each frame
1143 * A Vector4 animatable property of a scene-graph object.
1146 class AnimatableProperty<Vector4> : public AnimatablePropertyBase
1151 * Create an animatable property.
1152 * @param [in] initialValue The initial value of the property.
1154 AnimatableProperty( const Vector4& initialValue )
1155 : mValue( initialValue ),
1156 mBaseValue( initialValue )
1161 * Virtual destructor.
1163 virtual ~AnimatableProperty()
1168 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1170 virtual Dali::Property::Type GetType() const
1172 return Dali::PropertyTypes::Get<Vector4>();
1176 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1178 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1180 if (CLEAN_FLAG != mDirtyFlags)
1182 mValue[updateBufferIndex] = mBaseValue;
1184 mDirtyFlags = ( mDirtyFlags >> 1 );
1189 * @copydoc Dali::PropertyInput::GetVector4()
1191 virtual const Vector4& GetVector4( BufferIndex bufferIndex ) const
1193 return mValue[ bufferIndex ];
1197 * Set the property value. This will only persist for the current frame; the property
1198 * will be reset with the base value, at the beginning of the next frame.
1199 * @param[in] bufferIndex The buffer to write.
1200 * @param[in] value The new property value.
1202 void Set(BufferIndex bufferIndex, const Vector4& value)
1204 mValue[bufferIndex] = value;
1210 * Set the X value. This will only persist for the current frame; the property
1211 * will be reset with the base value, at the beginning of the next frame.
1212 * @param[in] bufferIndex The buffer to write.
1213 * @param[in] value The new X value.
1215 void SetX(BufferIndex bufferIndex, float value)
1217 mValue[bufferIndex].x = value;
1223 * Set the Y value. This will only persist for the current frame; the property
1224 * will be reset with the base value, at the beginning of the next frame.
1225 * @param[in] bufferIndex The buffer to write.
1226 * @param[in] value The new Y value.
1228 void SetY(BufferIndex bufferIndex, float value)
1230 mValue[bufferIndex].y = value;
1236 * Set the Z value. This will only persist for the current frame; the property
1237 * will be reset with the base value, at the beginning of the next frame.
1238 * @param[in] bufferIndex The buffer to write.
1239 * @param[in] value The new Z value.
1241 void SetZ(BufferIndex bufferIndex, float value)
1243 mValue[bufferIndex].z = value;
1249 * Set the W value. This will only persist for the current frame; the property
1250 * will be reset with the base value, at the beginning of the next frame.
1251 * @param[in] bufferIndex The buffer to write.
1252 * @param[in] value The new W value.
1254 void SetW(BufferIndex bufferIndex, float value)
1256 mValue[bufferIndex].w = value;
1262 * Change the property value by a relative amount.
1263 * @param[in] bufferIndex The buffer to write.
1264 * @param[in] delta The property will change by this amount.
1266 void SetRelative(BufferIndex bufferIndex, const Vector4& delta)
1268 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1274 * Change the X value by a relative amount.
1275 * @param[in] bufferIndex The buffer to write.
1276 * @param[in] delta The X value will change by this amount.
1278 void SetXRelative(BufferIndex bufferIndex, float delta)
1280 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1286 * Change the Y value by a relative amount.
1287 * @param[in] bufferIndex The buffer to write.
1288 * @param[in] delta The Y value will change by this amount.
1290 void SetYRelative(BufferIndex bufferIndex, float delta)
1292 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1298 * Change the Z value by a relative amount.
1299 * @param[in] bufferIndex The buffer to write.
1300 * @param[in] delta The Z value will change by this amount.
1302 void SetZRelative(BufferIndex bufferIndex, float delta)
1304 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1310 * Change the W value by a relative amount.
1311 * @param[in] bufferIndex The buffer to write.
1312 * @param[in] delta The W value will change by this amount.
1314 void SetWRelative(BufferIndex bufferIndex, float delta)
1316 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1322 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1324 Vector4& Get(size_t bufferIndex)
1326 return mValue[bufferIndex];
1330 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1332 const Vector4& Get(size_t bufferIndex) const
1334 return mValue[bufferIndex];
1338 * Retrieve the property value.
1339 * @param[in] bufferIndex The buffer to read.
1340 * @return The property value.
1342 Vector4& operator[](size_t bufferIndex)
1344 return mValue[bufferIndex];
1348 * Retrieve the property value.
1349 * @param[in] bufferIndex The buffer to read.
1350 * @return The property value.
1352 const Vector4& operator[](size_t bufferIndex) const
1354 return mValue[bufferIndex];
1358 * Set both the property value & base value.
1359 * @param[in] bufferIndex The buffer to write for the property value.
1360 * @param[in] value The new property value.
1362 void Bake(BufferIndex bufferIndex, const Vector4& value)
1364 mValue[bufferIndex] = value;
1365 mBaseValue = mValue[bufferIndex];
1371 * Set both the X value & base X value.
1372 * @param[in] bufferIndex The buffer to write for the property value.
1373 * @param[in] value The new property value.
1375 void BakeX(BufferIndex bufferIndex, float value)
1377 mValue[bufferIndex].x = value;
1378 mBaseValue.x = mValue[bufferIndex].x;
1384 * Set both the Y value & base Y value.
1385 * @param[in] bufferIndex The buffer to write for the property value.
1386 * @param[in] value The new property value.
1388 void BakeY(BufferIndex bufferIndex, float value)
1390 mValue[bufferIndex].y = value;
1391 mBaseValue.y = mValue[bufferIndex].y;
1397 * Set both the Z value & base Z value.
1398 * @param[in] bufferIndex The buffer to write for the property value.
1399 * @param[in] value The new property value.
1401 void BakeZ(BufferIndex bufferIndex, float value)
1403 mValue[bufferIndex].z = value;
1404 mBaseValue.z = mValue[bufferIndex].z;
1410 * Set both the W value & base W value.
1411 * @param[in] bufferIndex The buffer to write for the property value.
1412 * @param[in] value The new property value.
1414 void BakeW(BufferIndex bufferIndex, float value)
1416 mValue[bufferIndex].w = value;
1417 mBaseValue.w = mValue[bufferIndex].w;
1423 * Change the property value & base value by a relative amount.
1424 * @param[in] bufferIndex The buffer to write for the local property value.
1425 * @param[in] delta The property will change by this amount.
1427 void BakeRelative(BufferIndex bufferIndex, const Vector4& delta)
1429 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1430 mBaseValue = mValue[bufferIndex];
1436 * Change the X value & base X value by a relative amount.
1437 * @param[in] bufferIndex The buffer to write for the local property value.
1438 * @param[in] delta The X value will change by this amount.
1440 void BakeXRelative(BufferIndex bufferIndex, float delta)
1442 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1443 mBaseValue.x = mValue[bufferIndex].x;
1449 * Change the Y value & base Y value by a relative amount.
1450 * @param[in] bufferIndex The buffer to write for the local property value.
1451 * @param[in] delta The Y value will change by this amount.
1453 void BakeYRelative(BufferIndex bufferIndex, float delta)
1455 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1456 mBaseValue.y = mValue[bufferIndex].y;
1462 * Change the Z value & base Z value by a relative amount.
1463 * @param[in] bufferIndex The buffer to write for the local property value.
1464 * @param[in] delta The Z value will change by this amount.
1466 void BakeZRelative(BufferIndex bufferIndex, float delta)
1468 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1469 mBaseValue.z = mValue[bufferIndex].z;
1475 * Change the W value & base W value by a relative amount.
1476 * @param[in] bufferIndex The buffer to write for the local property value.
1477 * @param[in] delta The W value will change by this amount.
1479 void BakeWRelative(BufferIndex bufferIndex, float delta)
1481 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1482 mBaseValue.w = mValue[bufferIndex].w;
1488 * Sets both double-buffered W values & the base W value.
1489 * This should only be used when the owning object has not been connected to the scene-graph.
1490 * @param[in] value The new W value.
1492 void SetWInitial(float value)
1494 mValue[0].w = value;
1495 mValue[1].w = mValue[0].w;
1496 mBaseValue.w = mValue[0].w;
1502 AnimatableProperty(const AnimatableProperty& property);
1505 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1509 DoubleBuffered<Vector4> mValue; ///< The double-buffered property value
1510 Vector4 mBaseValue; ///< Reset to this base value at the beginning of each frame
1514 * An Quaternion animatable property of a scene-graph object.
1517 class AnimatableProperty<Quaternion> : public AnimatablePropertyBase
1522 * Create an animatable property.
1524 AnimatableProperty()
1531 * Create an animatable property.
1532 * @param [in] initialValue The initial value of the property.
1534 AnimatableProperty( const Quaternion& initialValue )
1535 : mValue( initialValue ),
1536 mBaseValue( initialValue )
1541 * Virtual destructor.
1543 virtual ~AnimatableProperty()
1548 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1550 virtual Dali::Property::Type GetType() const
1552 return Dali::PropertyTypes::Get<Quaternion>();
1556 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1558 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1560 if (CLEAN_FLAG != mDirtyFlags)
1562 mValue[updateBufferIndex] = mBaseValue;
1564 mDirtyFlags = ( mDirtyFlags >> 1 );
1569 * @copydoc Dali::PropertyInput::GetQuaternion()
1571 virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const
1573 return mValue[ bufferIndex ];
1577 * Set the property value. This will only persist for the current frame; the property
1578 * will be reset with the base value, at the beginning of the next frame.
1579 * @param[in] bufferIndex The buffer to write.
1580 * @param[in] value The new property value.
1582 void Set(BufferIndex bufferIndex, const Quaternion& value)
1584 mValue[bufferIndex] = value;
1590 * Change the property value by a relative amount.
1591 * @param[in] bufferIndex The buffer to write.
1592 * @param[in] delta The property will change by this amount.
1594 void SetRelative(BufferIndex bufferIndex, const Quaternion& delta)
1596 mValue[bufferIndex] *= delta;
1602 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1604 Quaternion& Get(size_t bufferIndex)
1606 return mValue[bufferIndex];
1610 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1612 const Quaternion& Get(size_t bufferIndex) const
1614 return mValue[bufferIndex];
1618 * Retrieve the property value.
1619 * @param[in] bufferIndex The buffer to read.
1620 * @return The property value.
1622 Quaternion& operator[](size_t bufferIndex)
1624 return mValue[bufferIndex];
1628 * Retrieve the property value.
1629 * @param[in] bufferIndex The buffer to read.
1630 * @return The property value.
1632 const Quaternion& operator[](size_t bufferIndex) const
1634 return mValue[bufferIndex];
1638 * Set both the property value & base value.
1639 * @param[in] bufferIndex The buffer to write for the property value.
1640 * @param[in] value The new property value.
1642 void Bake(BufferIndex bufferIndex, const Quaternion& value)
1644 mValue[bufferIndex] = value;
1651 * Change the property value & base value by a relative amount.
1652 * @param[in] bufferIndex The buffer to write for the local property value.
1653 * @param[in] delta The property will change by this amount.
1655 void BakeRelative(BufferIndex bufferIndex, const Quaternion& delta)
1657 mValue[bufferIndex] *= delta;
1658 mBaseValue = mValue[bufferIndex];
1666 AnimatableProperty(const AnimatableProperty& property);
1669 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1673 DoubleBuffered<Quaternion> mValue; ///< The double-buffered property value
1674 Quaternion mBaseValue; ///< Reset to this base value at the beginning of each frame
1679 * A Matrix animatable property of a scene-graph object.
1682 class AnimatableProperty<Matrix> : public AnimatablePropertyBase
1687 * Create an animatable property.
1688 * @param [in] initialValue The initial value of the property.
1690 AnimatableProperty( const Matrix& initialValue )
1691 : mValue( initialValue ),
1692 mBaseValue( initialValue )
1697 * Virtual destructor.
1699 virtual ~AnimatableProperty()
1704 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1706 virtual Dali::Property::Type GetType() const
1708 return Dali::PropertyTypes::Get<Matrix>();
1712 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1714 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1716 if (CLEAN_FLAG != mDirtyFlags)
1718 mValue[updateBufferIndex] = mBaseValue;
1720 mDirtyFlags = ( mDirtyFlags >> 1 );
1725 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix()
1727 virtual const Matrix& GetMatrix( BufferIndex bufferIndex ) const
1729 return mValue[ bufferIndex ];
1733 * Set the property value. This will only persist for the current frame; the property
1734 * will be reset with the base value, at the beginning of the next frame.
1735 * @param[in] bufferIndex The buffer to write.
1736 * @param[in] value The new property value.
1738 void Set(BufferIndex bufferIndex, const Matrix& value)
1740 mValue[bufferIndex] = value;
1746 * Change the property value by a relative amount.
1747 * @param[in] bufferIndex The buffer to write.
1748 * @param[in] delta The property will change by this amount.
1750 void SetRelative(BufferIndex bufferIndex, const Matrix& delta)
1753 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1754 mValue[bufferIndex] = temp;
1760 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1762 Matrix& Get(size_t bufferIndex)
1764 return mValue[bufferIndex];
1768 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1770 const Matrix& Get(size_t bufferIndex) const
1772 return mValue[bufferIndex];
1776 * Retrieve the property value.
1777 * @param[in] bufferIndex The buffer to read.
1778 * @return The property value.
1780 Matrix& operator[](size_t bufferIndex)
1782 return mValue[bufferIndex];
1786 * Retrieve the property value.
1787 * @param[in] bufferIndex The buffer to read.
1788 * @return The property value.
1790 const Matrix& operator[](size_t bufferIndex) const
1792 return mValue[bufferIndex];
1796 * Set both the property value & base value.
1797 * @param[in] bufferIndex The buffer to write for the property value.
1798 * @param[in] value The new property value.
1800 void Bake(BufferIndex bufferIndex, const Matrix& value)
1802 mValue[bufferIndex] = value;
1803 mBaseValue = mValue[bufferIndex];
1809 * Change the property value & base value by a relative amount.
1810 * @param[in] bufferIndex The buffer to write for the local property value.
1811 * @param[in] delta The property will change by this amount.
1813 void BakeRelative(BufferIndex bufferIndex, const Matrix& delta)
1816 Matrix::Multiply(temp, mValue[bufferIndex], delta);
1817 mValue[bufferIndex] = temp;
1826 AnimatableProperty(const AnimatableProperty& property);
1829 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1833 DoubleBuffered<Matrix> mValue; ///< The double-buffered property value
1834 Matrix mBaseValue; ///< Reset to this base value at the beginning of each frame
1839 * A Matrix3 animatable property of a scene-graph object.
1842 class AnimatableProperty<Matrix3> : public AnimatablePropertyBase
1847 * Create an animatable property.
1848 * @param [in] initialValue The initial value of the property.
1850 AnimatableProperty( const Matrix3& initialValue )
1851 : mValue( initialValue ),
1852 mBaseValue( initialValue )
1857 * Virtual destructor.
1859 virtual ~AnimatableProperty()
1864 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1866 virtual Dali::Property::Type GetType() const
1868 return Dali::PropertyTypes::Get<Matrix3>();
1872 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1874 virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
1876 if (CLEAN_FLAG != mDirtyFlags)
1878 mValue[updateBufferIndex] = mBaseValue;
1880 mDirtyFlags = ( mDirtyFlags >> 1 );
1885 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix3()
1887 virtual const Matrix3& GetMatrix3( BufferIndex bufferIndex ) const
1889 return mValue[ bufferIndex ];
1893 * Set the property value. This will only persist for the current frame; the property
1894 * will be reset with the base value, at the beginning of the next frame.
1895 * @param[in] bufferIndex The buffer to write.
1896 * @param[in] value The new property value.
1898 void Set(BufferIndex bufferIndex, const Matrix3& value)
1900 mValue[bufferIndex] = value;
1905 * Change the property value by a relative amount.
1906 * @param[in] bufferIndex The buffer to write.
1907 * @param[in] delta The property will change by this amount.
1909 void SetRelative(BufferIndex bufferIndex, const Matrix3& delta)
1912 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
1913 mValue[bufferIndex] = temp;
1918 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1920 Matrix3& Get(size_t bufferIndex)
1922 return mValue[bufferIndex];
1926 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1928 const Matrix3& Get(size_t bufferIndex) const
1930 return mValue[bufferIndex];
1934 * Retrieve the property value.
1935 * @param[in] bufferIndex The buffer to read.
1936 * @return The property value.
1938 Matrix3& operator[](size_t bufferIndex)
1940 return mValue[bufferIndex];
1944 * Retrieve the property value.
1945 * @param[in] bufferIndex The buffer to read.
1946 * @return The property value.
1948 const Matrix3& operator[](size_t bufferIndex) const
1950 return mValue[bufferIndex];
1954 * Set both the property value & base value.
1955 * @param[in] bufferIndex The buffer to write for the property value.
1956 * @param[in] value The new property value.
1958 void Bake(BufferIndex bufferIndex, const Matrix3& value)
1960 mValue[bufferIndex] = value;
1961 mBaseValue = mValue[bufferIndex];
1967 * Change the property value & base value by a relative amount.
1968 * @param[in] bufferIndex The buffer to write for the local property value.
1969 * @param[in] delta The property will change by this amount.
1971 void BakeRelative(BufferIndex bufferIndex, const Matrix3& delta)
1974 Matrix3::Multiply(temp, mValue[bufferIndex], delta);
1975 mValue[bufferIndex] = temp;
1984 AnimatableProperty(const AnimatableProperty& property);
1987 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1991 DoubleBuffered<Matrix3> mValue; ///< The double-buffered property value
1992 Matrix3 mBaseValue; ///< Reset to this base value at the beginning of each frame
1996 } // namespace SceneGraph
1998 // Messages for AnimatableProperty<T>
2001 void BakeMessage( EventThreadServices& eventThreadServices,
2002 const SceneGraph::AnimatableProperty<T>& property,
2003 typename ParameterType< T >::PassingType newValue )
2005 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, T > LocalType;
2007 // Reserve some memory inside the message queue
2008 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2010 // Construct message in the message queue memory; note that delete should not be called on the return value
2011 new (slot) LocalType( &property,
2012 &SceneGraph::AnimatableProperty<T>::Bake,
2017 void BakeRelativeMessage( EventThreadServices& eventThreadServices,
2018 const SceneGraph::AnimatableProperty<T>& property,
2021 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, const T& > LocalType;
2023 // Reserve some memory inside the message queue
2024 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2026 // Construct message in the message queue memory; note that delete should not be called on the return value
2027 new (slot) LocalType( &property,
2028 &SceneGraph::AnimatableProperty<T>::BakeRelative,
2033 void SetXComponentMessage( EventThreadServices& eventThreadServices,
2034 const SceneGraph::AnimatableProperty<T>& property,
2035 typename ParameterType< float >::PassingType newValue )
2037 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2039 // Reserve some memory inside the message queue
2040 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2042 // Construct message in the message queue memory; note that delete should not be called on the return value
2043 new (slot) LocalType( &property,
2044 &SceneGraph::AnimatableProperty<T>::BakeX,
2049 void SetYComponentMessage( EventThreadServices& eventThreadServices,
2050 const SceneGraph::AnimatableProperty<T>& property,
2051 typename ParameterType< float >::PassingType newValue )
2053 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2055 // Reserve some memory inside the message queue
2056 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2058 // Construct message in the message queue memory; note that delete should not be called on the return value
2059 new (slot) LocalType( &property,
2060 &SceneGraph::AnimatableProperty<T>::BakeY,
2065 void SetZComponentMessage( EventThreadServices& eventThreadServices,
2066 const SceneGraph::AnimatableProperty<T>& property,
2067 typename ParameterType< float >::PassingType newValue )
2069 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2071 // Reserve some memory inside the message queue
2072 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2074 // Construct message in the message queue memory; note that delete should not be called on the return value
2075 new (slot) LocalType( &property,
2076 &SceneGraph::AnimatableProperty<T>::BakeZ,
2081 void SetWComponentMessage( EventThreadServices& eventThreadServices,
2082 const SceneGraph::AnimatableProperty<T>& property,
2083 typename ParameterType< float >::PassingType newValue )
2085 typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
2087 // Reserve some memory inside the message queue
2088 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
2090 // Construct message in the message queue memory; note that delete should not be called on the return value
2091 new (slot) LocalType( &property,
2092 &SceneGraph::AnimatableProperty<T>::BakeW,
2096 } // namespace Internal
2100 #endif // __DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H__