901f37d20197466f5f2c82addf6d0a96f5ee9fff
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / model-motion / motion-index / blend-shape-index.h
1 #ifndef DALI_SCENE3D_MODEL_MOTION_BLEND_SHAPE_INDEX_H
2 #define DALI_SCENE3D_MODEL_MOTION_BLEND_SHAPE_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 BlendShapeIndex;
34 } // namespace Internal
35
36 /**
37  * @addtogroup dali_scene3d_model_motion_blend_shape_index
38  * @{
39  */
40
41 /**
42  * @brief Specialized MotionIndex to control blendshape.
43  * Specially, if ModelNodeId is Property::INVALID_KEY and BlendShapeId is StringKey,
44  * It will control all ModelNode that has the inputed BlendShape name.
45  *
46  * @SINCE_2_2.99
47  */
48 class DALI_SCENE3D_API BlendShapeIndex : public MotionIndex
49 {
50 public: // Creation & Destruction
51   /**
52    * @brief Create an initialized BlendShapeIndex.
53    *
54    * @SINCE_2_2.99
55    * @return A handle to a newly allocated Dali resource
56    */
57   static BlendShapeIndex New();
58
59   /**
60    * @brief Create an initialized BlendShapeIndex with values.
61    *
62    * @SINCE_2_2.99
63    * @param[in] blendShapeId The id of blendshape what this motion index looks.
64    * @return A handle to a newly allocated Dali resource
65    */
66   static BlendShapeIndex New(Property::Key blendShapeId);
67
68   /**
69    * @brief Create an initialized BlendShapeIndex with values.
70    *
71    * @SINCE_2_2.99
72    * @param[in] modelNodeId The id of model node what this motion index looks.
73    * @param[in] blendShapeId The id of blendshape what this motion index looks.
74    * @return A handle to a newly allocated Dali resource
75    */
76   static BlendShapeIndex New(Property::Key modelNodeId, Property::Key blendShapeId);
77
78   /**
79    * @brief Creates an uninitialized BlendShapeIndex.
80    *
81    * Only derived versions can be instantiated. Calling member
82    * functions with an uninitialized Dali::Object is not allowed.
83    *
84    * @SINCE_2_2.99
85    */
86   BlendShapeIndex();
87
88   /**
89    * @brief Destructor.
90    *
91    * This is non-virtual since derived Handle types must not contain data or virtual methods.
92    *
93    * @SINCE_2_2.99
94    */
95   ~BlendShapeIndex();
96
97   /**
98    * @brief Copy constructor.
99    *
100    * @SINCE_2_2.99
101    * @param[in] blendShapeIndex Handle to an object
102    */
103   BlendShapeIndex(const BlendShapeIndex& blendShapeIndex);
104
105   /**
106    * @brief Move constructor
107    *
108    * @SINCE_2_2.99
109    * @param[in] rhs A reference to the moved handle
110    */
111   BlendShapeIndex(BlendShapeIndex&& rhs) noexcept;
112
113   /**
114    * @brief Assignment operator.
115    *
116    * @SINCE_2_2.99
117    * @param[in] blendShapeIndex Handle to an object
118    * @return reference to this
119    */
120   BlendShapeIndex& operator=(const BlendShapeIndex& blendShapeIndex);
121
122   /**
123    * @brief Move assignment
124    *
125    * @SINCE_2_2.99
126    * @param[in] rhs A reference to the moved handle
127    * @return A reference to this
128    */
129   BlendShapeIndex& operator=(BlendShapeIndex&& rhs) noexcept;
130
131   /**
132    * @brief Downcasts an Object handle to BlendShapeIndex.
133    *
134    * If handle points to a BlendShapeIndex, the downcast produces valid handle.
135    * If not, the returned handle is left uninitialized.
136    *
137    * @SINCE_2_2.99
138    * @param[in] handle Handle to an object
139    * @return Handle to a BlendShapeIndex or an uninitialized handle
140    */
141   static BlendShapeIndex DownCast(BaseHandle handle);
142
143 public: // Public Method
144   /**
145    * @brief Set the id of BlendShape what this motion index looks.
146    *
147    * @SINCE_2_2.99
148    * @param[in] blendShapeId The blend shape id.
149    */
150   void SetBlendShapeId(Property::Key blendShapeId);
151
152   /**
153    * @brief Get the id of BlendShape what this motion index looks.
154    *
155    * @SINCE_2_2.99
156    * @return The blend shape id.
157    */
158   Property::Key GetBlendShapeId() const;
159
160 public: // Not intended for application developers
161   /// @cond internal
162   /**
163    * @brief Creates a handle using the Scene3D::Internal implementation.
164    *
165    * @param[in] implementation The BlendShapeIndex implementation
166    */
167   DALI_INTERNAL BlendShapeIndex(Dali::Scene3D::Internal::BlendShapeIndex* implementation);
168   /// @endcond
169 };
170
171 /**
172  * @}
173  */
174
175 } // namespace Scene3D
176
177 } // namespace Dali
178
179 #endif // DALI_SCENE3D_MODEL_MOTION_BLEND_SHAPE_INDEX_H