1 #ifndef DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_INDEX_H
2 #define DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_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.
24 #include <dali-scene3d/public-api/model-motion/motion-index/motion-index.h>
30 //Forward declarations.
33 class MotionPropertyIndex;
34 } // namespace Internal
37 * @addtogroup dali_scene3d_model_motion_motion_property_index
42 * @brief Basic MotionIndex to control Dali::Property.
43 * It can control more general case.
47 * MotionPropertyIndex color = MotionPropertyIndex::New("nodeName", Dali::Actor::Property::COLOR);
49 * // We can change the property later.
50 * MotionPropertyIndex custom = MotionPropertyIndex::New();
51 * orientation.SetModelNodeId("nodeName");
52 * orientation.SetPropertyId("some_custom_property");
54 * // Note that all cases of MotionTransformIndex can be controled by MotionPropertyIndex
55 * // Both position0 and position1 can control the node's Position.
56 * MotionTransformIndex position0 = MotionTransformIndex::New("nodeName", MotionTransformIndex::TransformType::POSITION);
57 * MotionPropertyIndex position1 = MotionPropertyIndex::New("nodeName", Dali::Actor::Property::POSITION);
63 class DALI_SCENE3D_API MotionPropertyIndex : public MotionIndex
65 public: // Creation & Destruction
67 * @brief Create an initialized MotionPropertyIndex.
70 * @return A handle to a newly allocated Dali resource
72 static MotionPropertyIndex New();
75 * @brief Create an initialized MotionPropertyIndex with values.
78 * @param[in] modelNodeId The id of model node what this motion index looks.
79 * @param[in] propertyId The id of property what this motion index looks.
80 * @return A handle to a newly allocated Dali resource
82 static MotionPropertyIndex New(Property::Key modelNodeId, Property::Key propertyId);
85 * @brief Creates an uninitialized MotionPropertyIndex.
87 * Only derived versions can be instantiated. Calling member
88 * functions with an uninitialized Dali::Object is not allowed.
92 MotionPropertyIndex();
97 * This is non-virtual since derived Handle types must not contain data or virtual methods.
101 ~MotionPropertyIndex();
104 * @brief Copy constructor.
107 * @param[in] motionPropertyIndex Handle to an object
109 MotionPropertyIndex(const MotionPropertyIndex& motionPropertyIndex);
112 * @brief Move constructor
115 * @param[in] rhs A reference to the moved handle
117 MotionPropertyIndex(MotionPropertyIndex&& rhs) noexcept;
120 * @brief Assignment operator.
123 * @param[in] motionPropertyIndex Handle to an object
124 * @return reference to this
126 MotionPropertyIndex& operator=(const MotionPropertyIndex& motionPropertyIndex);
129 * @brief Move assignment
132 * @param[in] rhs A reference to the moved handle
133 * @return A reference to this
135 MotionPropertyIndex& operator=(MotionPropertyIndex&& rhs) noexcept;
138 * @brief Downcasts an Object handle to MotionPropertyIndex.
140 * If handle points to a MotionPropertyIndex, the downcast produces valid handle.
141 * If not, the returned handle is left uninitialized.
144 * @param[in] handle Handle to an object
145 * @return Handle to a MotionPropertyIndex or an uninitialized handle
147 static MotionPropertyIndex DownCast(BaseHandle handle);
149 public: // Public Method
151 * @brief Set the id of property what this motion index looks.
154 * @param[in] propertyId The property id.
156 void SetPropertyId(Property::Key propertyId);
159 * @brief Get the id of property what this motion index looks.
162 * @return The blend shape id.
164 Property::Key GetPropertyId() const;
166 public: // Not intended for application developers
169 * @brief Creates a handle using the Scene3D::Internal implementation.
171 * @param[in] implementation The MotionPropertyIndex implementation
173 DALI_INTERNAL MotionPropertyIndex(Dali::Scene3D::Internal::MotionPropertyIndex* implementation);
181 } // namespace Scene3D
185 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_INDEX_H