DALi signals refactor to remove V2 naming
[platform/core/uifw/dali-core.git] / dali / public-api / modeling / bone.h
1 #ifndef __DALI_BONE_H__
2 #define __DALI_BONE_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21
22 // INTERNAL INCLUDES
23 #include <dali/public-api/common/vector-wrapper.h>
24 #include <dali/public-api/math/matrix.h>
25
26 namespace Dali
27 {
28
29 class Matrix;
30
31 class Bone;
32 typedef std::vector< Bone >           BoneContainer; ///< Container for bones
33 typedef BoneContainer::iterator       BoneIter;      ///< @ref Dali::BoneContainer iterator
34 typedef BoneContainer::const_iterator BoneConstIter; ///< @ref Dali::BoneContainer const iterator
35
36 /**
37  * @brief A single bone in a mesh.
38  *
39  * A Bone is a named actor that can be used to deform a mesh. @see Dali::MeshData for more
40  * information.
41  */
42 class DALI_IMPORT_API Bone
43 {
44 public:
45   /**
46    * @brief Default constructor.
47    */
48   Bone ();
49
50   /**
51    * @brief Constructor.
52    *
53    * @param name of the bone
54    * @param offsetMatrix for the bone
55    */
56   Bone( const std::string& name, const Matrix& offsetMatrix );
57
58   /**
59    * @brief Destructor.
60    */
61   ~Bone();
62
63   /**
64    * @brief Copy constructor.
65    */
66   Bone( const Bone& rhs );
67
68   /**
69    * @brief Assignment operator.
70    */
71   Bone& operator=(const Bone& rhs);
72
73   /**
74    * @brief Get name.
75    *
76    * @return returns the name of the bone
77    */
78   const std::string& GetName() const;
79
80   /**
81    * @brief Get offset matrix.
82    *
83    * @return returns the offset matrix for this bone
84    */
85    const Matrix& GetOffsetMatrix() const;
86
87 private:
88   // Attributes
89   std::string   mName;         ///< Name of bone
90   Matrix        mOffsetMatrix; ///< Transform from mesh space to bone space in bind pose.
91
92 }; // struct Bone
93
94 } // namespace Dali
95
96 #endif // __DALI_BONE_H__