[dali_2.3.25] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / internal / update / manager / transform-manager-property.h
1 #ifndef DALI_INTERNAL_UPDATE_TRANSFORM_MANAGER_PROPERTY_H
2 #define DALI_INTERNAL_UPDATE_TRANSFORM_MANAGER_PROPERTY_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 #include <dali/internal/update/common/animatable-property.h>
22 #include <dali/internal/update/manager/transform-manager.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 namespace SceneGraph
29 {
30 template<typename T>
31 struct TransformManagerPropertyHandler : public AnimatablePropertyBase
32 {
33   /**
34    * Constructor
35    */
36   TransformManagerPropertyHandler() = default;
37
38   /**
39    * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
40    */
41   Dali::Property::Type GetType() const override = 0;
42
43   /**
44    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
45    */
46   virtual T& Get(BufferIndex bufferIndex) = 0;
47
48   /**
49    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
50    */
51   virtual const T& Get(BufferIndex bufferIndex) const = 0;
52
53   /**
54    * @copydoc Dali::PropertyInput::GetVector3()
55    */
56   const Vector3& GetVector3(BufferIndex bufferIndex) const override
57   {
58     return Vector3::ZERO;
59   }
60
61   /**
62    * Retrieve a component of property
63    * @param[in] component The component of the property
64    */
65   virtual const float& GetFloatComponent(uint32_t component) const
66   {
67     DALI_ASSERT_DEBUG(0 && "Invalid call");
68
69     static const float value = 0.0f;
70     return value;
71   }
72
73   /**
74    * Set the property value. This will only persist for the current frame; the property
75    * will be reset with the base value, at the beginning of the next frame.
76    * @param[in] bufferIndex Not used
77    * @param[in] value The new property value.
78    */
79   virtual void Set(BufferIndex bufferIndex, const T& value) = 0;
80
81   /**
82    * Change a component of property
83    * @param[in] value The new value of the component
84    * @param[in] component The component of the property
85    */
86   virtual void SetFloatComponent(float value, uint32_t component)
87   {
88   }
89
90   /**
91    * @copydoc Dali::AnimatableProperty::Bake()
92    */
93   virtual void Bake(BufferIndex bufferIndex, const T& value) = 0;
94
95   /**
96    * Bake a component of a property
97    * @param[in] value The new value of the component
98    * @param[in] component The component of the property
99    */
100   virtual void BakeFloatComponent(float value, uint32_t component)
101   {
102   }
103
104   /**
105    * @copydoc Dali::AnimatableProperty::BakeX()
106    */
107   virtual void BakeX(BufferIndex bufferIndex, float value)
108   {
109   }
110
111   /**
112    * @copydoc Dali::AnimatableProperty::BakeY()
113    */
114   virtual void BakeY(BufferIndex bufferIndex, float value)
115   {
116   }
117
118   /**
119    * @copydoc Dali::AnimatableProperty::BakeZ()
120    */
121   virtual void BakeZ(BufferIndex bufferIndex, float value)
122   {
123   }
124
125   /**
126    * @copydoc Dali::AnimatableProperty::BakeRelative()
127    */
128   virtual void BakeRelative(BufferIndex bufferIndex, const T& value) = 0;
129
130   /**
131    * @copydoc Dali::AnimatableProperty::BakeRelativeMultiply()
132    */
133   virtual void BakeRelativeMultiply(BufferIndex bufferIndex, const T& value){};
134
135   /**
136    * @copydoc Dali::AnimatableProperty::ResetToBaseValue()
137    */
138   void ResetToBaseValue(BufferIndex updateBufferIndex) override
139   {
140   }
141
142   /**
143    * @copydoc Dali::AnimatableProperty::IsClean()
144    */
145   bool IsClean() const override
146   {
147     return false;
148   }
149
150   /**
151    * @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
152    */
153   bool IsTransformManagerProperty() const override
154   {
155     return true;
156   }
157 };
158
159 template<TransformManagerProperty PropertyT, size_t TxMgrDataOffset>
160 struct TransformManagerPropertyVector3 final : public TransformManagerPropertyHandler<Vector3>
161 {
162   enum
163   {
164     TRANSFORM_MANAGER_DATA_OFFSET = TxMgrDataOffset
165   };
166   TransformManagerData* GetTxManagerData()
167   {
168     return reinterpret_cast<TransformManagerData*>(
169       reinterpret_cast<uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
170   }
171   const TransformManagerData* GetTxManagerData() const
172   {
173     return reinterpret_cast<const TransformManagerData*>(
174       reinterpret_cast<const uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
175   }
176
177   TransformManagerPropertyVector3() = default;
178
179   Dali::Property::Type GetType() const override
180   {
181     return Dali::PropertyTypes::Get<Vector3>();
182   }
183
184   Vector3& Get(BufferIndex bufferIndex) override
185   {
186     return GetTxManagerData()->Manager()->GetVector3PropertyValue(GetTxManagerData()->Id(), PropertyT);
187   }
188
189   const Vector3& Get(BufferIndex bufferIndex) const override
190   {
191     return GetTxManagerData()->Manager()->GetVector3PropertyValue(GetTxManagerData()->Id(), PropertyT);
192   }
193
194   const Vector3& GetVector3(BufferIndex bufferIndex) const override
195   {
196     return Get(bufferIndex);
197   }
198
199   /**
200    * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
201    */
202   const void* GetValueAddress(BufferIndex bufferIndex) const override
203   {
204     return &GetVector3(bufferIndex);
205   }
206
207   /**
208    * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
209    */
210   size_t GetValueSize() const override
211   {
212     return sizeof(Vector3);
213   }
214
215   const float& GetFloatComponent(uint32_t component) const override
216   {
217     return GetTxManagerData()->Manager()->GetVector3PropertyComponentValue(GetTxManagerData()->Id(), PropertyT, component);
218   }
219
220   void Set(BufferIndex bufferIndex, const Vector3& value) override
221   {
222     GetTxManagerData()->Manager()->SetVector3PropertyValue(GetTxManagerData()->Id(), PropertyT, value);
223   }
224
225   void SetComponent(BufferIndex bufferIndex, float value, uint32_t component)
226   {
227     GetTxManagerData()->Manager()->SetVector3PropertyComponentValue(GetTxManagerData()->Id(), PropertyT, value, component);
228   }
229
230   void BakeComponent(BufferIndex bufferIndex, float value, uint32_t component)
231   {
232     GetTxManagerData()->Manager()->BakeVector3PropertyComponentValue(GetTxManagerData()->Id(), PropertyT, value, component);
233   }
234
235   void Bake(BufferIndex bufferIndex, const Vector3& value) override
236   {
237     GetTxManagerData()->Manager()->BakeVector3PropertyValue(GetTxManagerData()->Id(), PropertyT, value);
238   }
239
240   void BakeX(BufferIndex bufferIndex, float value) override
241   {
242     GetTxManagerData()->Manager()->BakeXVector3PropertyValue(GetTxManagerData()->Id(), PropertyT, value);
243   }
244
245   void BakeY(BufferIndex bufferIndex, float value) override
246   {
247     GetTxManagerData()->Manager()->BakeYVector3PropertyValue(GetTxManagerData()->Id(), PropertyT, value);
248   }
249
250   void BakeZ(BufferIndex bufferIndex, float value) override
251   {
252     GetTxManagerData()->Manager()->BakeZVector3PropertyValue(GetTxManagerData()->Id(), PropertyT, value);
253   }
254
255   void SetFloatComponent(float value, uint32_t component) override
256   {
257     GetTxManagerData()->Manager()->SetVector3PropertyComponentValue(GetTxManagerData()->Id(), PropertyT, value, component);
258   }
259
260   void BakeFloatComponent(float value, uint32_t component) override
261   {
262     GetTxManagerData()->Manager()->BakeVector3PropertyComponentValue(GetTxManagerData()->Id(), PropertyT, value, component);
263   }
264
265   void BakeRelative(BufferIndex bufferIndex, const Vector3& value) override
266   {
267     GetTxManagerData()->Manager()->BakeRelativeVector3PropertyValue(GetTxManagerData()->Id(), PropertyT, value);
268   }
269
270   void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& value) override
271   {
272     GetTxManagerData()->Manager()->BakeMultiplyVector3PropertyValue(GetTxManagerData()->Id(), PropertyT, value);
273   }
274 };
275
276 template<size_t TxMgrDataOffset>
277 class TransformManagerPropertyQuaternion final : public TransformManagerPropertyHandler<Quaternion>
278 {
279 public:
280   enum
281   {
282     TRANSFORM_MANAGER_DATA_OFFSET = TxMgrDataOffset
283   };
284   TransformManagerData* GetTxManagerData()
285   {
286     return reinterpret_cast<TransformManagerData*>(
287       reinterpret_cast<uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
288   }
289   const TransformManagerData* GetTxManagerData() const
290   {
291     return reinterpret_cast<const TransformManagerData*>(
292       reinterpret_cast<const uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
293   }
294
295   TransformManagerPropertyQuaternion() = default;
296
297   Dali::Property::Type GetType() const override
298   {
299     return Dali::PropertyTypes::Get<Quaternion>();
300   }
301
302   Quaternion& Get(BufferIndex bufferIndex) override
303   {
304     return GetTxManagerData()->Manager()->GetQuaternionPropertyValue(GetTxManagerData()->Id());
305   }
306
307   const Quaternion& Get(BufferIndex bufferIndex) const override
308   {
309     return GetTxManagerData()->Manager()->GetQuaternionPropertyValue(GetTxManagerData()->Id());
310   }
311
312   void Set(BufferIndex bufferIndex, const Quaternion& value) override
313   {
314     return GetTxManagerData()->Manager()->SetQuaternionPropertyValue(GetTxManagerData()->Id(), value);
315   }
316
317   void Bake(BufferIndex bufferIndex, const Quaternion& value) override
318   {
319     return GetTxManagerData()->Manager()->BakeQuaternionPropertyValue(GetTxManagerData()->Id(), value);
320   }
321
322   void BakeRelative(BufferIndex bufferIndex, const Quaternion& value) override
323   {
324     return GetTxManagerData()->Manager()->BakeRelativeQuaternionPropertyValue(GetTxManagerData()->Id(), value);
325   }
326
327   const Quaternion& GetQuaternion(BufferIndex bufferIndex) const override
328   {
329     return Get(bufferIndex);
330   }
331
332   /**
333    * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
334    */
335   const void* GetValueAddress(BufferIndex bufferIndex) const override
336   {
337     return &Get(bufferIndex);
338   }
339
340   /**
341    * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
342    */
343   size_t GetValueSize() const override
344   {
345     return sizeof(Vector4);
346   }
347 };
348
349 /**
350  * A Vector3 property used as input.
351  */
352 template<size_t TxMgrDataOffset>
353 class TransformManagerVector3Input : public PropertyInputImpl
354 {
355 public:
356   enum
357   {
358     TRANSFORM_MANAGER_DATA_OFFSET = TxMgrDataOffset
359   };
360   TransformManagerData* GetTxManagerData()
361   {
362     return reinterpret_cast<TransformManagerData*>(
363       reinterpret_cast<uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
364   }
365   const TransformManagerData* GetTxManagerData() const
366   {
367     return reinterpret_cast<const TransformManagerData*>(
368       reinterpret_cast<const uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
369   }
370
371   /**
372    * Create an TransformManagerVector3Input
373    */
374   TransformManagerVector3Input(TransformManagerProperty property, const Vector3& initialValue)
375   : mProperty(property),
376     mValue(initialValue)
377   {
378   }
379
380   /**
381    * Virtual destructor.
382    */
383   ~TransformManagerVector3Input() override = default;
384
385   /**
386    * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
387    */
388   Dali::Property::Type GetType() const override
389   {
390     return Dali::PropertyTypes::Get<Vector3>();
391   }
392
393   /**
394    * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
395    */
396   virtual bool IsClean() const
397   {
398     return false;
399   }
400
401   /**
402    * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
403    */
404   bool InputInitialized() const override
405   {
406     return true;
407   }
408
409   /**
410    * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
411    * @note A constraint can only receive the inherited property from the previous frame.
412    */
413   bool InputChanged() const override
414   {
415     return true;
416   }
417
418   /**
419    * Helper function to get the transform components out of the world matrix.
420    * It stores the value in the mValue member variable
421    */
422   void ComputeTransformComponent() const
423   {
424     auto transformManagerData = GetTxManagerData();
425     auto id                   = transformManagerData->Id();
426     if(id != INVALID_TRANSFORM_ID)
427     {
428       const Matrix& worldMatrix = transformManagerData->Manager()->GetWorldMatrix(id);
429       if(mProperty == TRANSFORM_PROPERTY_WORLD_POSITION)
430       {
431         mValue = worldMatrix.GetTranslation3();
432       }
433       else if(mProperty == TRANSFORM_PROPERTY_WORLD_SCALE)
434       {
435         mValue = worldMatrix.GetScale();
436       }
437     }
438   }
439
440   /**
441    * @copydoc Dali::PropertyInput::GetVector3()
442    */
443   const Vector3& GetVector3(BufferIndex bufferIndex) const override
444   {
445     ComputeTransformComponent();
446     return mValue;
447   }
448
449   /**
450    * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
451    */
452   const void* GetValueAddress(BufferIndex bufferIndex) const override
453   {
454     return &GetVector3(bufferIndex);
455   }
456
457   /**
458    * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
459    */
460   size_t GetValueSize() const override
461   {
462     return sizeof(Vector3);
463   }
464
465   /**
466    * @copydoc Dali::PropertyInput::GetConstraintInputVector3()
467    */
468   const Vector3& GetConstraintInputVector3(BufferIndex bufferIndex) const override
469   {
470     ComputeTransformComponent();
471     return mValue;
472   }
473
474   /**
475    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
476    */
477   Vector3& Get(BufferIndex bufferIndex)
478   {
479     ComputeTransformComponent();
480     return mValue;
481   }
482
483   /**
484    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
485    */
486   const Vector3& Get(BufferIndex bufferIndex) const
487   {
488     ComputeTransformComponent();
489     return mValue;
490   }
491
492   /**
493    * Retrieve the property value.
494    * @param[in] bufferIndex The buffer to read.
495    * @return The property value.
496    */
497   const Vector3& operator[](BufferIndex bufferIndex) const
498   {
499     ComputeTransformComponent();
500     return mValue;
501   }
502
503   /**
504    * @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
505    */
506   bool IsTransformManagerProperty() const override
507   {
508     return true;
509   }
510
511 private:
512   TransformManagerVector3Input(const TransformManagerVector3Input& property) = delete;
513   TransformManagerVector3Input& operator=(const TransformManagerVector3Input& rhs) = delete;
514
515 public:
516   TransformManagerProperty mProperty;
517   mutable Vector3          mValue;
518 };
519
520 /**
521  * A Quaternion property used as input.
522  */
523 template<size_t TxMgrDataOffset>
524 class TransformManagerQuaternionInput final : public PropertyInputImpl
525 {
526 public:
527   enum
528   {
529     TRANSFORM_MANAGER_DATA_OFFSET = TxMgrDataOffset
530   };
531   TransformManagerData* GetTxManagerData()
532   {
533     return reinterpret_cast<TransformManagerData*>(
534       reinterpret_cast<uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
535   }
536   const TransformManagerData* GetTxManagerData() const
537   {
538     return reinterpret_cast<const TransformManagerData*>(
539       reinterpret_cast<const uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
540   }
541
542   /**
543    * Constructor
544    */
545   TransformManagerQuaternionInput() = default;
546
547   /**
548    * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
549    */
550   Dali::Property::Type GetType() const override
551   {
552     return Dali::PropertyTypes::Get<Quaternion>();
553   }
554
555   /**
556    * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
557    */
558   virtual bool IsClean() const
559   {
560     return false;
561   }
562
563   /**
564    * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
565    */
566   bool InputInitialized() const override
567   {
568     return true;
569   }
570
571   /**
572    * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
573    * @note A constraint can only receive the inherited property from the previous frame.
574    */
575   bool InputChanged() const override
576   {
577     return true;
578   }
579
580   /**
581    * Helper function to get the orientation out of the world matrix.
582    * It stores the result in the mValue member variable
583    */
584   void ComputeTransformComponent() const
585   {
586     auto transformManagerData = GetTxManagerData();
587     auto id                   = transformManagerData->Id();
588     if(id != INVALID_TRANSFORM_ID)
589     {
590       const Matrix& worldMatrix = transformManagerData->Manager()->GetWorldMatrix(id);
591       Vector3       position, scale;
592       worldMatrix.GetTransformComponents(position, mValue, scale);
593     }
594   }
595
596   /**
597    * @copydoc Dali::PropertyInput::GetQuaternion()
598    */
599   const Quaternion& GetQuaternion(BufferIndex bufferIndex) const override
600   {
601     ComputeTransformComponent();
602     return mValue;
603   }
604
605   /**
606    * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
607    */
608   const void* GetValueAddress(BufferIndex bufferIndex) const override
609   {
610     return &GetQuaternion(bufferIndex);
611   }
612
613   /**
614    * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
615    */
616   size_t GetValueSize() const override
617   {
618     return sizeof(Vector4);
619   }
620
621   /**
622    * @copydoc Dali::PropertyInput::GetConstraintInputQuaternion()
623    */
624   const Quaternion& GetConstraintInputQuaternion(BufferIndex bufferIndex) const override
625   {
626     ComputeTransformComponent();
627     return mValue;
628   }
629
630   /**
631    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
632    */
633   Quaternion& Get(BufferIndex bufferIndex)
634   {
635     ComputeTransformComponent();
636     return mValue;
637   }
638
639   /**
640    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
641    */
642   const Quaternion& Get(BufferIndex bufferIndex) const
643   {
644     ComputeTransformComponent();
645     return mValue;
646   }
647
648   /**
649    * Retrieve the property value.
650    * @param[in] bufferIndex The buffer to read.
651    * @return The property value.
652    */
653   const Quaternion& operator[](BufferIndex bufferIndex) const
654   {
655     ComputeTransformComponent();
656     return mValue;
657   }
658
659   /**
660    * @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
661    */
662   bool IsTransformManagerProperty() const override
663   {
664     return true;
665   }
666
667 private:
668   TransformManagerQuaternionInput(const TransformManagerQuaternionInput& property) = delete;
669   TransformManagerQuaternionInput& operator=(const TransformManagerQuaternionInput& rhs) = delete;
670
671 public:
672   mutable Quaternion mValue;
673 };
674
675 /**
676  * A Matrix property used as input.
677  */
678 template<size_t TxMgrDataOffset>
679 class TransformManagerMatrixInput final : public PropertyInputImpl
680 {
681 public:
682   enum
683   {
684     TRANSFORM_MANAGER_DATA_OFFSET = TxMgrDataOffset
685   };
686   TransformManagerData* GetTxManagerData()
687   {
688     return reinterpret_cast<TransformManagerData*>(
689       reinterpret_cast<uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
690   }
691   const TransformManagerData* GetTxManagerData() const
692   {
693     return reinterpret_cast<const TransformManagerData*>(
694       reinterpret_cast<const uint8_t*>(this) - TRANSFORM_MANAGER_DATA_OFFSET);
695   }
696
697   /**
698    * Constructor
699    */
700   TransformManagerMatrixInput() = default;
701
702   /**
703    * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
704    */
705   Dali::Property::Type GetType() const override
706   {
707     return Dali::PropertyTypes::Get<Matrix>();
708   }
709
710   /**
711    * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
712    */
713   virtual bool IsClean() const
714   {
715     return false;
716   }
717
718   /**
719    * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
720    */
721   bool InputInitialized() const override
722   {
723     return true;
724   }
725
726   /**
727    * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
728    * @note A constraint can only receive the inherited property from the previous frame.
729    */
730   bool InputChanged() const override
731   {
732     return true;
733   }
734
735   /**
736    * @copydoc Dali::PropertyInput::GetMatrix()
737    */
738   const Matrix& GetMatrix(BufferIndex bufferIndex) const override
739   {
740     auto transformManagerData = GetTxManagerData();
741     auto id                   = transformManagerData->Id();
742     if(id != INVALID_TRANSFORM_ID)
743     {
744       return transformManagerData->Manager()->GetWorldMatrix(id);
745     }
746     return Matrix::IDENTITY;
747   }
748
749   /**
750    * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
751    */
752   const void* GetValueAddress(BufferIndex bufferIndex) const override
753   {
754     static const Matrix identityMatrix(Matrix::IDENTITY);
755     auto                transformManagerData = GetTxManagerData();
756     auto                id                   = transformManagerData->Id();
757     if(id != INVALID_TRANSFORM_ID)
758     {
759       return &(transformManagerData->Manager()->GetWorldMatrix(id));
760     }
761     return &identityMatrix;
762   }
763
764   /**
765    * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
766    */
767   size_t GetValueSize() const override
768   {
769     return sizeof(Matrix);
770   }
771
772   /**
773    * @copydoc Dali::PropertyInput::GetConstraintInputMatrix()
774    */
775   const Matrix& GetConstraintInputMatrix(BufferIndex bufferIndex) const override
776   {
777     auto transformManagerData = GetTxManagerData();
778     auto id                   = transformManagerData->Id();
779     if(id != INVALID_TRANSFORM_ID)
780     {
781       return transformManagerData->Manager()->GetWorldMatrix(id);
782     }
783     return Matrix::IDENTITY;
784   }
785
786   /**
787    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
788    */
789   Matrix& Get(BufferIndex bufferIndex)
790   {
791     auto transformManagerData = GetTxManagerData();
792     auto id                   = transformManagerData->Id();
793     DALI_ASSERT_ALWAYS(id != INVALID_TRANSFORM_ID);
794     return transformManagerData->Manager()->GetWorldMatrix(id);
795   }
796
797   /**
798    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
799    */
800   const Matrix& Get(BufferIndex bufferIndex) const
801   {
802     return GetMatrix(bufferIndex);
803   }
804
805   /**
806    * Retrieve the property value.
807    * @param[in] bufferIndex The buffer to read.
808    * @return The property value.
809    */
810   const Matrix& operator[](BufferIndex bufferIndex) const
811   {
812     return GetMatrix(bufferIndex);
813   }
814
815   /**
816    * @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
817    */
818   bool IsTransformManagerProperty() const override
819   {
820     return true;
821   }
822
823 private:
824   TransformManagerMatrixInput(const TransformManagerMatrixInput& property) = delete;
825   TransformManagerMatrixInput& operator=(const TransformManagerMatrixInput& rhs) = delete;
826 };
827
828 } // namespace SceneGraph
829 } // namespace Internal
830 } // namespace Dali
831
832 #endif // DALI_INTERNAL_UPDATE_TRANSFORM_MANAGER_PROPERTY_H