up-to-date submodule(rive-cpp)
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / shapes / cubic_asymmetric_vertex_base.hpp
1 #ifndef _RIVE_CUBIC_ASYMMETRIC_VERTEX_BASE_HPP_
2 #define _RIVE_CUBIC_ASYMMETRIC_VERTEX_BASE_HPP_
3 #include "core/field_types/core_double_type.hpp"
4 #include "shapes/cubic_vertex.hpp"
5 namespace rive
6 {
7         class CubicAsymmetricVertexBase : public CubicVertex
8         {
9         protected:
10                 typedef CubicVertex Super;
11
12         public:
13                 static const uint16_t typeKey = 34;
14
15                 /// Helper to quickly determine if a core object extends another without
16                 /// RTTI at runtime.
17                 bool isTypeOf(uint16_t typeKey) const override
18                 {
19                         switch (typeKey)
20                         {
21                                 case CubicAsymmetricVertexBase::typeKey:
22                                 case CubicVertexBase::typeKey:
23                                 case PathVertexBase::typeKey:
24                                 case ContainerComponentBase::typeKey:
25                                 case ComponentBase::typeKey:
26                                         return true;
27                                 default:
28                                         return false;
29                         }
30                 }
31
32                 uint16_t coreType() const override { return typeKey; }
33
34                 static const uint16_t rotationPropertyKey = 79;
35                 static const uint16_t inDistancePropertyKey = 80;
36                 static const uint16_t outDistancePropertyKey = 81;
37
38         private:
39                 float m_Rotation = 0.0f;
40                 float m_InDistance = 0.0f;
41                 float m_OutDistance = 0.0f;
42         public:
43                 inline float rotation() const { return m_Rotation; }
44                 void rotation(float value)
45                 {
46                         if (m_Rotation == value)
47                         {
48                                 return;
49                         }
50                         m_Rotation = value;
51                         rotationChanged();
52                 }
53
54                 inline float inDistance() const { return m_InDistance; }
55                 void inDistance(float value)
56                 {
57                         if (m_InDistance == value)
58                         {
59                                 return;
60                         }
61                         m_InDistance = value;
62                         inDistanceChanged();
63                 }
64
65                 inline float outDistance() const { return m_OutDistance; }
66                 void outDistance(float value)
67                 {
68                         if (m_OutDistance == value)
69                         {
70                                 return;
71                         }
72                         m_OutDistance = value;
73                         outDistanceChanged();
74                 }
75
76                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
77                 {
78                         switch (propertyKey)
79                         {
80                                 case rotationPropertyKey:
81                                         m_Rotation = CoreDoubleType::deserialize(reader);
82                                         return true;
83                                 case inDistancePropertyKey:
84                                         m_InDistance = CoreDoubleType::deserialize(reader);
85                                         return true;
86                                 case outDistancePropertyKey:
87                                         m_OutDistance = CoreDoubleType::deserialize(reader);
88                                         return true;
89                         }
90                         return CubicVertex::deserialize(propertyKey, reader);
91                 }
92
93         protected:
94                 virtual void rotationChanged() {}
95                 virtual void inDistanceChanged() {}
96                 virtual void outDistanceChanged() {}
97         };
98 } // namespace rive
99
100 #endif