up-to-date submodule(rive-cpp)
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / shapes / cubic_mirrored_vertex_base.hpp
1 #ifndef _RIVE_CUBIC_MIRRORED_VERTEX_BASE_HPP_
2 #define _RIVE_CUBIC_MIRRORED_VERTEX_BASE_HPP_
3 #include "core/field_types/core_double_type.hpp"
4 #include "shapes/cubic_vertex.hpp"
5 namespace rive
6 {
7         class CubicMirroredVertexBase : public CubicVertex
8         {
9         protected:
10                 typedef CubicVertex Super;
11
12         public:
13                 static const uint16_t typeKey = 35;
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 CubicMirroredVertexBase::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 = 82;
35                 static const uint16_t distancePropertyKey = 83;
36
37         private:
38                 float m_Rotation = 0.0f;
39                 float m_Distance = 0.0f;
40         public:
41                 inline float rotation() const { return m_Rotation; }
42                 void rotation(float value)
43                 {
44                         if (m_Rotation == value)
45                         {
46                                 return;
47                         }
48                         m_Rotation = value;
49                         rotationChanged();
50                 }
51
52                 inline float distance() const { return m_Distance; }
53                 void distance(float value)
54                 {
55                         if (m_Distance == value)
56                         {
57                                 return;
58                         }
59                         m_Distance = value;
60                         distanceChanged();
61                 }
62
63                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
64                 {
65                         switch (propertyKey)
66                         {
67                                 case rotationPropertyKey:
68                                         m_Rotation = CoreDoubleType::deserialize(reader);
69                                         return true;
70                                 case distancePropertyKey:
71                                         m_Distance = CoreDoubleType::deserialize(reader);
72                                         return true;
73                         }
74                         return CubicVertex::deserialize(propertyKey, reader);
75                 }
76
77         protected:
78                 virtual void rotationChanged() {}
79                 virtual void distanceChanged() {}
80         };
81 } // namespace rive
82
83 #endif