415e7063d874f7801083801132ad3f01d4c0f542
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / bones / tendon_base.hpp
1 #ifndef _RIVE_TENDON_BASE_HPP_
2 #define _RIVE_TENDON_BASE_HPP_
3 #include "component.hpp"
4 #include "core/field_types/core_double_type.hpp"
5 #include "core/field_types/core_uint_type.hpp"
6 namespace rive
7 {
8         class TendonBase : public Component
9         {
10         protected:
11                 typedef Component Super;
12
13         public:
14                 static const uint16_t typeKey = 44;
15
16                 /// Helper to quickly determine if a core object extends another without
17                 /// RTTI at runtime.
18                 bool isTypeOf(uint16_t typeKey) const override
19                 {
20                         switch (typeKey)
21                         {
22                                 case TendonBase::typeKey:
23                                 case ComponentBase::typeKey:
24                                         return true;
25                                 default:
26                                         return false;
27                         }
28                 }
29
30                 uint16_t coreType() const override { return typeKey; }
31
32                 static const uint16_t boneIdPropertyKey = 95;
33                 static const uint16_t xxPropertyKey = 96;
34                 static const uint16_t yxPropertyKey = 97;
35                 static const uint16_t xyPropertyKey = 98;
36                 static const uint16_t yyPropertyKey = 99;
37                 static const uint16_t txPropertyKey = 100;
38                 static const uint16_t tyPropertyKey = 101;
39
40         private:
41                 int m_BoneId = -1;
42                 float m_Xx = 1.0f;
43                 float m_Yx = 0.0f;
44                 float m_Xy = 0.0f;
45                 float m_Yy = 1.0f;
46                 float m_Tx = 0.0f;
47                 float m_Ty = 0.0f;
48         public:
49                 inline int boneId() const { return m_BoneId; }
50                 void boneId(int value)
51                 {
52                         if (m_BoneId == value)
53                         {
54                                 return;
55                         }
56                         m_BoneId = value;
57                         boneIdChanged();
58                 }
59
60                 inline float xx() const { return m_Xx; }
61                 void xx(float value)
62                 {
63                         if (m_Xx == value)
64                         {
65                                 return;
66                         }
67                         m_Xx = value;
68                         xxChanged();
69                 }
70
71                 inline float yx() const { return m_Yx; }
72                 void yx(float value)
73                 {
74                         if (m_Yx == value)
75                         {
76                                 return;
77                         }
78                         m_Yx = value;
79                         yxChanged();
80                 }
81
82                 inline float xy() const { return m_Xy; }
83                 void xy(float value)
84                 {
85                         if (m_Xy == value)
86                         {
87                                 return;
88                         }
89                         m_Xy = value;
90                         xyChanged();
91                 }
92
93                 inline float yy() const { return m_Yy; }
94                 void yy(float value)
95                 {
96                         if (m_Yy == value)
97                         {
98                                 return;
99                         }
100                         m_Yy = value;
101                         yyChanged();
102                 }
103
104                 inline float tx() const { return m_Tx; }
105                 void tx(float value)
106                 {
107                         if (m_Tx == value)
108                         {
109                                 return;
110                         }
111                         m_Tx = value;
112                         txChanged();
113                 }
114
115                 inline float ty() const { return m_Ty; }
116                 void ty(float value)
117                 {
118                         if (m_Ty == value)
119                         {
120                                 return;
121                         }
122                         m_Ty = value;
123                         tyChanged();
124                 }
125
126                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
127                 {
128                         switch (propertyKey)
129                         {
130                                 case boneIdPropertyKey:
131                                         m_BoneId = CoreUintType::deserialize(reader);
132                                         return true;
133                                 case xxPropertyKey:
134                                         m_Xx = CoreDoubleType::deserialize(reader);
135                                         return true;
136                                 case yxPropertyKey:
137                                         m_Yx = CoreDoubleType::deserialize(reader);
138                                         return true;
139                                 case xyPropertyKey:
140                                         m_Xy = CoreDoubleType::deserialize(reader);
141                                         return true;
142                                 case yyPropertyKey:
143                                         m_Yy = CoreDoubleType::deserialize(reader);
144                                         return true;
145                                 case txPropertyKey:
146                                         m_Tx = CoreDoubleType::deserialize(reader);
147                                         return true;
148                                 case tyPropertyKey:
149                                         m_Ty = CoreDoubleType::deserialize(reader);
150                                         return true;
151                         }
152                         return Component::deserialize(propertyKey, reader);
153                 }
154
155         protected:
156                 virtual void boneIdChanged() {}
157                 virtual void xxChanged() {}
158                 virtual void yxChanged() {}
159                 virtual void xyChanged() {}
160                 virtual void yyChanged() {}
161                 virtual void txChanged() {}
162                 virtual void tyChanged() {}
163         };
164 } // namespace rive
165
166 #endif