1 #ifndef DALI_SCENE3D_MODEL_MOTION_BLEND_SHAPE_INDEX_IMPL_H
2 #define DALI_SCENE3D_MODEL_MOTION_BLEND_SHAPE_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/blend-shape-index.h>
36 using BlendShapeIndexPtr = IntrusivePtr<BlendShapeIndex>;
39 * @brief Internal data for Scene3D::BlendShapeIndex.
41 class BlendShapeIndex : public MotionIndex
43 public: // Creation & Destruction
45 * @brief Create a new BlendShapeIndex object.
46 * @return A smart-pointer to the newly allocated BlendShapeIndex.
48 static BlendShapeIndexPtr New();
52 * @brief Construct a new BlendShapeIndex.
57 * @brief Second-phase constructor.
62 * @brief Virtual destructor.
64 virtual ~BlendShapeIndex();
66 public: // Public Method
68 * @copydoc Dali::Scene3D::BlendShapeIndex::SetBlendShapeId()
70 void SetBlendShapeId(Property::Key blendShapeId);
73 * @copydoc Dali::Scene3D::BlendShapeIndex::GetBlendShapeId()
75 Property::Key GetBlendShapeId() 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 mBlendShapeId{Property::INVALID_KEY}; ///< The id of blend shape
92 } // namespace Internal
94 // Helpers for public-api forwarding methods
96 inline Internal::BlendShapeIndex& GetImplementation(Dali::Scene3D::BlendShapeIndex& blendShapeIndex)
98 DALI_ASSERT_ALWAYS(blendShapeIndex && "BlendShapeIndex handle is empty");
100 BaseObject& handle = blendShapeIndex.GetBaseObject();
102 return static_cast<Internal::BlendShapeIndex&>(handle);
105 inline const Internal::BlendShapeIndex& GetImplementation(const Dali::Scene3D::BlendShapeIndex& blendShapeIndex)
107 DALI_ASSERT_ALWAYS(blendShapeIndex && "BlendShapeIndex handle is empty");
109 const BaseObject& handle = blendShapeIndex.GetBaseObject();
111 return static_cast<const Internal::BlendShapeIndex&>(handle);
114 } // namespace Scene3D
118 #endif // DALI_SCENE3D_MODEL_MOTION_BLEND_SHAPE_INDEX_IMPL_H