[Tizen] Add MotionData class and generate Animation by this
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / model-motion / motion-index / motion-transform-index.h
1 #ifndef DALI_SCENE3D_MODEL_MOTION_MOTION_TRANSFORM_INDEX_H
2 #define DALI_SCENE3D_MODEL_MOTION_MOTION_TRANSFORM_INDEX_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 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali-scene3d/public-api/model-motion/motion-index/motion-index.h>
25
26 namespace Dali
27 {
28 namespace Scene3D
29 {
30 //Forward declarations.
31 namespace Internal
32 {
33 class MotionTransformIndex;
34 } // namespace Internal
35
36 /**
37  * @addtogroup dali_scene3d_model_motion_motion_transform_index
38  * @{
39  */
40
41 /**
42  * @brief Specialized MotionIndex to control transform.
43  *
44  * @SINCE_2_2.99
45  */
46 class DALI_SCENE3D_API MotionTransformIndex : public MotionIndex
47 {
48 public:
49   /**
50    * @brief The type of Transform
51    * @SINCE_2_2.99
52    */
53   enum class TransformType
54   {
55     INVALID = -1,
56
57     POSITION = 0, ///< The position of ModelNode. MotionValue should be Vector3.
58     POSITION_X,   ///< The x position of ModelNode. MotionValue should be float.
59     POSITION_Y,   ///< The y position of ModelNode. MotionValue should be float.
60     POSITION_Z,   ///< The z position of ModelNode. MotionValue should be float.
61
62     ORIENTATION, ///< The orientation of ModelNode. MotionValue should be Quaternion.
63
64     SCALE,   ///< The scale of ModelNode. MotionValue should be Vector3.
65     SCALE_X, ///< The x scale of ModelNode. MotionValue should be float.
66     SCALE_Y, ///< The y scale of ModelNode. MotionValue should be float.
67     SCALE_Z, ///< The z scale of ModelNode. MotionValue should be float.
68   };
69
70 public: // Creation & Destruction
71   /**
72    * @brief Create an initialized MotionTransformIndex.
73    *
74    * @SINCE_2_2.99
75    * @return A handle to a newly allocated Dali resource
76    */
77   static MotionTransformIndex New();
78
79   /**
80    * @brief Create an initialized MotionTransformIndex with values.
81    *
82    * @SINCE_2_2.99
83    * @param[in] modelNodeId The id of model node what this motion index looks.
84    * @param[in] type The type of transform what this motion index looks.
85    * @return A handle to a newly allocated Dali resource
86    */
87   static MotionTransformIndex New(Property::Key modelNodeId, TransformType type);
88
89   /**
90    * @brief Creates an uninitialized MotionTransformIndex.
91    *
92    * Only derived versions can be instantiated. Calling member
93    * functions with an uninitialized Dali::Object is not allowed.
94    *
95    * @SINCE_2_2.99
96    */
97   MotionTransformIndex();
98
99   /**
100    * @brief Destructor.
101    *
102    * This is non-virtual since derived Handle types must not contain data or virtual methods.
103    *
104    * @SINCE_2_2.99
105    */
106   ~MotionTransformIndex();
107
108   /**
109    * @brief Copy constructor.
110    *
111    * @SINCE_2_2.99
112    * @param[in] motionTransformIndex Handle to an object
113    */
114   MotionTransformIndex(const MotionTransformIndex& motionTransformIndex);
115
116   /**
117    * @brief Move constructor
118    *
119    * @SINCE_2_2.99
120    * @param[in] rhs A reference to the moved handle
121    */
122   MotionTransformIndex(MotionTransformIndex&& rhs) noexcept;
123
124   /**
125    * @brief Assignment operator.
126    *
127    * @SINCE_2_2.99
128    * @param[in] motionTransformIndex Handle to an object
129    * @return reference to this
130    */
131   MotionTransformIndex& operator=(const MotionTransformIndex& motionTransformIndex);
132
133   /**
134    * @brief Move assignment
135    *
136    * @SINCE_2_2.99
137    * @param[in] rhs A reference to the moved handle
138    * @return A reference to this
139    */
140   MotionTransformIndex& operator=(MotionTransformIndex&& rhs) noexcept;
141
142   /**
143    * @brief Downcasts an Object handle to MotionTransformIndex.
144    *
145    * If handle points to a MotionTransformIndex, the downcast produces valid handle.
146    * If not, the returned handle is left uninitialized.
147    *
148    * @SINCE_2_2.99
149    * @param[in] handle Handle to an object
150    * @return Handle to a MotionTransformIndex or an uninitialized handle
151    */
152   static MotionTransformIndex DownCast(BaseHandle handle);
153
154 public: // Public Method
155   /**
156    * @brief Set the type of transform what this motion index looks.
157    *
158    * @SINCE_2_2.99
159    * @param[in] type The type of transform.
160    */
161   void SetTransformType(TransformType type);
162
163   /**
164    * @brief Get the type of transform what this motion index looks.
165    *
166    * @SINCE_2_2.99
167    * @return The type of transform.
168    */
169   TransformType GetTransformType() const;
170
171 public: // Not intended for application developers
172   /// @cond internal
173   /**
174    * @brief Creates a handle using the Scene3D::Internal implementation.
175    *
176    * @param[in] implementation The MotionTransformIndex implementation
177    */
178   DALI_INTERNAL MotionTransformIndex(Dali::Scene3D::Internal::MotionTransformIndex* implementation);
179   /// @endcond
180 };
181
182 /**
183  * @}
184  */
185
186 } // namespace Scene3D
187
188 } // namespace Dali
189
190 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_TRANSFORM_INDEX_H