Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / rive-cpp / include / rive / shapes / vertex.hpp
1 #ifndef _RIVE_VERTEX_HPP_
2 #define _RIVE_VERTEX_HPP_
3 #include "rive/bones/weight.hpp"
4 #include "rive/generated/shapes/vertex_base.hpp"
5 #include "rive/math/mat2d.hpp"
6 namespace rive {
7     class Vertex : public VertexBase {
8         friend class Weight;
9
10     private:
11         Weight* m_Weight = nullptr;
12         void weight(Weight* value) { m_Weight = value; }
13
14     public:
15         template <typename T> T* weight() { return m_Weight->as<T>(); }
16         virtual void deform(const Mat2D& worldTransform, const float* boneTransforms);
17         bool hasWeight() { return m_Weight != nullptr; }
18         Vec2D renderTranslation();
19
20     protected:
21         virtual void markGeometryDirty() = 0;
22         void xChanged() override;
23         void yChanged() override;
24
25 #ifdef TESTING
26     public:
27         Weight* weight() { return m_Weight; }
28 #endif
29     };
30 } // namespace rive
31
32 #endif