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                 Core* clone() const override;
64                 void copy(const CubicMirroredVertexBase& object)
65                 {
66                         m_Rotation = object.m_Rotation;
67                         m_Distance = object.m_Distance;
68                         CubicVertex::copy(object);
69                 }
70
71                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
72                 {
73                         switch (propertyKey)
74                         {
75                                 case rotationPropertyKey:
76                                         m_Rotation = CoreDoubleType::deserialize(reader);
77                                         return true;
78                                 case distancePropertyKey:
79                                         m_Distance = CoreDoubleType::deserialize(reader);
80                                         return true;
81                         }
82                         return CubicVertex::deserialize(propertyKey, reader);
83                 }
84
85         protected:
86                 virtual void rotationChanged() {}
87                 virtual void distanceChanged() {}
88         };
89 } // namespace rive
90
91 #endif