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"
7 class CubicMirroredVertexBase : public CubicVertex
10 typedef CubicVertex Super;
13 static const uint16_t typeKey = 35;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case CubicMirroredVertexBase::typeKey:
22 case CubicVertexBase::typeKey:
23 case PathVertexBase::typeKey:
24 case ContainerComponentBase::typeKey:
25 case ComponentBase::typeKey:
32 uint16_t coreType() const override { return typeKey; }
34 static const uint16_t rotationPropertyKey = 82;
35 static const uint16_t distancePropertyKey = 83;
38 float m_Rotation = 0.0f;
39 float m_Distance = 0.0f;
41 inline float rotation() const { return m_Rotation; }
42 void rotation(float value)
44 if (m_Rotation == value)
52 inline float distance() const { return m_Distance; }
53 void distance(float value)
55 if (m_Distance == value)
63 Core* clone() const override;
64 void copy(const CubicMirroredVertexBase& object)
66 m_Rotation = object.m_Rotation;
67 m_Distance = object.m_Distance;
68 CubicVertex::copy(object);
71 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
75 case rotationPropertyKey:
76 m_Rotation = CoreDoubleType::deserialize(reader);
78 case distancePropertyKey:
79 m_Distance = CoreDoubleType::deserialize(reader);
82 return CubicVertex::deserialize(propertyKey, reader);
86 virtual void rotationChanged() {}
87 virtual void distanceChanged() {}