2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-scene3d/internal/model-motion/motion-index/motion-property-index-impl.h>
22 #include <dali/public-api/object/type-registry-helper.h>
23 #include <dali/public-api/object/type-registry.h>
36 * Creates control through type registry
40 return Scene3D::MotionPropertyIndex::New();
43 // Setup properties, signals and actions using the type-registry.
44 DALI_TYPE_REGISTRATION_BEGIN(Scene3D::MotionPropertyIndex, Dali::BaseHandle, Create);
45 DALI_TYPE_REGISTRATION_END()
49 MotionPropertyIndexPtr MotionPropertyIndex::New()
51 MotionPropertyIndexPtr motionPropertyIndex = new MotionPropertyIndex();
53 motionPropertyIndex->Initialize();
55 return motionPropertyIndex;
58 MotionPropertyIndex::MotionPropertyIndex()
62 MotionPropertyIndex::~MotionPropertyIndex()
66 void MotionPropertyIndex::Initialize()
70 void MotionPropertyIndex::SetPropertyId(Property::Key propertyId)
72 mPropertyId = propertyId;
75 Property::Key MotionPropertyIndex::GetPropertyId() const
80 std::string MotionPropertyIndex::GetPropertyName(Scene3D::ModelNode node)
82 if(mPropertyId.type == Property::Key::Type::STRING)
84 return mPropertyId.stringKey;
89 Property::Index MotionPropertyIndex::GetPropertyIndex(Scene3D::ModelNode node)
91 if(mPropertyId.type == Property::Key::Type::INDEX)
93 return mPropertyId.indexKey;
95 return Property::INVALID_INDEX;
98 } // namespace Internal
100 } // namespace Scene3D