[NUI.Scene3D] Make API to apply ModelMotion
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Scene3D / src / public / ModelMotion / MotionIndex.cs
1 /*
2  * Copyright(c) 2023 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using Tizen.NUI;
22
23 namespace Tizen.NUI.Scene3D
24 {
25     /// <summary>
26     /// Index of motion value. It will be used to specify the target of motion applied.
27     ///
28     /// There are two kinds of MotionIndex : MotionTransformIndex and BlendShapeIndex.
29     /// MotionTransformIndex will be used for control the ModelNode's Position / Orientation / Scale, or each components.
30     /// BlendShapeIndex will be used for control some blendshape animation.
31     ///
32     /// We can use this class below cases
33     /// - ModelNodeId (string key) , MotionTransformIndex         : Target is ModelNode's transform property
34     /// - ModelNodeId (int key)    , MotionTransformIndex         : Target is ModelNode's transform property [not implemented yet]
35     /// - ModelNodeId (string key) , BlendShapeIndex (int key)    : Target is ModelNode's BlendShape
36     /// - ModelNodeId (string key) , BlendShapeIndex (string key) : Target is ModelNode's BlendShape [not implemented yet]
37     /// - ModelNodeId (int key)    , BlendShapeIndex (int key)    : Target is ModelNode's BlendShape [not implemented yet]
38     /// - ModelNodeId (int key)    , BlendShapeIndex (string key) : Target is ModelNode's BlendShape [not implemented yet]
39     /// - ModelNodeId (null)       , BlendShapeIndex (string key) : Target is all BlendShape [not implemented yet]
40     /// All other cases are invalid.
41     /// </summary>
42     [EditorBrowsable(EditorBrowsableState.Never)]
43     public abstract class MotionIndex : IDisposable
44     {
45         /// <summary>
46         /// The id of ModelNode. If you want to apply to all ModelNodes who has BlendShape string, let this value as null.
47         /// </summary>
48         [EditorBrowsable(EditorBrowsableState.Never)]
49         public PropertyKey ModelNodeId { get; set; } = null;
50
51         /// <summary>
52         /// Abstract API to get uniform name of index, or null if invalid. Only can be used for internal API
53         /// </summary>
54         abstract internal string GetPropertyName(ModelNode node);
55
56         /// <summary>
57         /// IDisposable.Dipsose.
58         /// </summary>
59         [EditorBrowsable(EditorBrowsableState.Never)]
60         public void Dispose()
61         {
62             ModelNodeId?.Dispose();
63             ModelNodeId = null;
64         }
65     }
66 }