1 #ifndef DALI_SCENE3D_MODEL_MOTION_MOTION_INDEX_H
2 #define DALI_SCENE3D_MODEL_MOTION_MOTION_INDEX_H
5 * Copyright (c) 2023 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.
22 #include <dali/public-api/object/property-key.h>
23 #include <dali/public-api/object/property.h>
27 #include <dali-scene3d/public-api/model-components/model-node.h>
33 //Forward declarations.
37 } // namespace Internal
40 * @addtogroup dali_scene3d_model_motion_motion_index
45 * @brief Key of motion data to specify what ModelNode's property will be moved.
46 * MotionIndex itself is abstract classes. We need to create New from one of below classes.
47 * - BlendShapeIndex : To control blendshape.
48 * - MotionPropertyIndex : To control the property by Dali::Property.
49 * - MotionTransfromIndex : To control the transform property. Usually be used on CSharp binded API who cannot use Dali::Property directly.
50 * @todo Need to implement ModelNodeId as IndexKey. Currently, StringKey only works well.
54 class DALI_SCENE3D_API MotionIndex : public Dali::BaseHandle
56 public: // Creation & Destruction
58 * @brief Creates an uninitialized MotionIndex.
60 * Only derived versions can be instantiated. Calling member
61 * functions with an uninitialized Dali::Object is not allowed.
70 * This is non-virtual since derived Handle types must not contain data or virtual methods.
77 * @brief Copy constructor.
80 * @param[in] motionIndex Handle to an object
82 MotionIndex(const MotionIndex& motionIndex);
85 * @brief Move constructor
88 * @param[in] rhs A reference to the moved handle
90 MotionIndex(MotionIndex&& rhs) noexcept;
93 * @brief Assignment operator.
96 * @param[in] motionIndex Handle to an object
97 * @return reference to this
99 MotionIndex& operator=(const MotionIndex& motionIndex);
102 * @brief Move assignment
105 * @param[in] rhs A reference to the moved handle
106 * @return A reference to this
108 MotionIndex& operator=(MotionIndex&& rhs) noexcept;
111 * @brief Downcasts an Object handle to MotionIndex.
113 * If handle points to a MotionIndex, the downcast produces valid handle.
114 * If not, the returned handle is left uninitialized.
117 * @param[in] handle Handle to an object
118 * @return Handle to a MotionIndex or an uninitialized handle
120 static MotionIndex DownCast(BaseHandle handle);
122 public: // Public Method
124 * @brief Set the id of ModelNode what this motion index looks.
127 * @param[in] modelNodeId The model node id.
129 void SetModelNodeId(Property::Key modelNodeId);
132 * @brief Get the id of ModelNode what this motion index looks.
135 * @return The model node id.
137 Property::Key GetModelNodeId() const;
140 * @brief Get the property name of this MotionIndex from given ModelNode.
143 * @param[in] node The model node to get the property name.
144 * @return The name of current property.
146 std::string GetPropertyName(ModelNode node = ModelNode());
149 * @brief Get the property index of this MotionIndex from given ModelNode.
152 * @param[in] node The model node to get the property index.
153 * @return The index of current property.
155 Property::Index GetPropertyIndex(ModelNode node = ModelNode());
157 public: // Not intended for application developers
160 * @brief Creates a handle using the Scene3D::Internal implementation.
162 * @param[in] implementation The MotionIndex implementation
164 DALI_INTERNAL MotionIndex(Dali::Scene3D::Internal::MotionIndex* implementation);
172 } // namespace Scene3D
176 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_INDEX_H