1 #ifndef DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_INDEX_IMPL_H
2 #define DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_INDEX_IMPL_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/common/dali-common.h>
23 #include <dali/public-api/common/intrusive-ptr.h>
24 #include <dali/public-api/object/base-object.h>
27 #include <dali-scene3d/internal/model-motion/motion-index/motion-index-impl.h>
28 #include <dali-scene3d/public-api/model-motion/motion-index/motion-property-index.h>
36 using MotionPropertyIndexPtr = IntrusivePtr<MotionPropertyIndex>;
39 * @brief Internal data for Scene3D::MotionPropertyIndex.
41 class MotionPropertyIndex : public MotionIndex
43 public: // Creation & Destruction
45 * @brief Create a new MotionPropertyIndex object.
46 * @return A smart-pointer to the newly allocated MotionPropertyIndex.
48 static MotionPropertyIndexPtr New();
52 * @brief Construct a new MotionPropertyIndex.
54 MotionPropertyIndex();
57 * @brief Second-phase constructor.
62 * @brief Virtual destructor.
64 virtual ~MotionPropertyIndex();
66 public: // Public Method
68 * @copydoc Dali::Scene3D::MotionPropertyIndex::SetPropertyId()
70 void SetPropertyId(Property::Key propertyId);
73 * @copydoc Dali::Scene3D::MotionPropertyIndex::GetPropertyId()
75 Property::Key GetPropertyId() const;
77 public: // MotionIndex Override Method
79 * @copydoc Dali::Scene3D::Internal::MotionIndex::GetPropertyName()
81 std::string GetPropertyName(Scene3D::ModelNode node = Scene3D::ModelNode()) override;
84 * @copydoc Dali::Scene3D::Internal::MotionIndex::GetPropertyIndex()
86 Property::Index GetPropertyIndex(Scene3D::ModelNode node = Scene3D::ModelNode()) override;
89 Property::Key mPropertyId{Property::INVALID_KEY}; ///< The id of blend shape
92 } // namespace Internal
94 // Helpers for public-api forwarding methods
96 inline Internal::MotionPropertyIndex& GetImplementation(Dali::Scene3D::MotionPropertyIndex& motionPropertyIndex)
98 DALI_ASSERT_ALWAYS(motionPropertyIndex && "MotionPropertyIndex handle is empty");
100 BaseObject& handle = motionPropertyIndex.GetBaseObject();
102 return static_cast<Internal::MotionPropertyIndex&>(handle);
105 inline const Internal::MotionPropertyIndex& GetImplementation(const Dali::Scene3D::MotionPropertyIndex& motionPropertyIndex)
107 DALI_ASSERT_ALWAYS(motionPropertyIndex && "MotionPropertyIndex handle is empty");
109 const BaseObject& handle = motionPropertyIndex.GetBaseObject();
111 return static_cast<const Internal::MotionPropertyIndex&>(handle);
114 } // namespace Scene3D
118 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_INDEX_IMPL_H