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