a92c47aefc7a4baeb3a86e88bd0bfaed14b4106c
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / shapes / polygon_base.hpp
1 #ifndef _RIVE_POLYGON_BASE_HPP_
2 #define _RIVE_POLYGON_BASE_HPP_
3 #include "core/field_types/core_double_type.hpp"
4 #include "core/field_types/core_uint_type.hpp"
5 #include "shapes/parametric_path.hpp"
6 namespace rive
7 {
8         class PolygonBase : public ParametricPath
9         {
10         protected:
11                 typedef ParametricPath Super;
12
13         public:
14                 static const int typeKey = 51;
15
16                 /// Helper to quickly determine if a core object extends another without
17                 /// RTTI at runtime.
18                 bool isTypeOf(int typeKey) const override
19                 {
20                         switch (typeKey)
21                         {
22                                 case PolygonBase::typeKey:
23                                 case ParametricPathBase::typeKey:
24                                 case PathBase::typeKey:
25                                 case NodeBase::typeKey:
26                                 case TransformComponentBase::typeKey:
27                                 case ContainerComponentBase::typeKey:
28                                 case ComponentBase::typeKey:
29                                         return true;
30                                 default:
31                                         return false;
32                         }
33                 }
34
35                 int coreType() const override { return typeKey; }
36
37                 static const int pointsPropertyKey = 125;
38                 static const int cornerRadiusPropertyKey = 126;
39
40         private:
41                 int m_Points = 5;
42                 float m_CornerRadius = 0;
43         public:
44                 inline int points() const { return m_Points; }
45                 void points(int value)
46                 {
47                         if (m_Points == value)
48                         {
49                                 return;
50                         }
51                         m_Points = value;
52                         pointsChanged();
53                 }
54
55                 inline float cornerRadius() const { return m_CornerRadius; }
56                 void cornerRadius(float value)
57                 {
58                         if (m_CornerRadius == value)
59                         {
60                                 return;
61                         }
62                         m_CornerRadius = value;
63                         cornerRadiusChanged();
64                 }
65
66                 bool deserialize(int propertyKey, BinaryReader& reader) override
67                 {
68                         switch (propertyKey)
69                         {
70                                 case pointsPropertyKey:
71                                         m_Points = CoreUintType::deserialize(reader);
72                                         return true;
73                                 case cornerRadiusPropertyKey:
74                                         m_CornerRadius = CoreDoubleType::deserialize(reader);
75                                         return true;
76                         }
77                         return ParametricPath::deserialize(propertyKey, reader);
78                 }
79
80         protected:
81                 virtual void pointsChanged() {}
82                 virtual void cornerRadiusChanged() {}
83         };
84 } // namespace rive
85
86 #endif