367c1c710de47a5e64a5e4794fd0e4cfa7173b8e
[platform/core/uifw/rive-tizen.git] / submodule / include / shapes / path.hpp
1 #ifndef _RIVE_PATH_HPP_
2 #define _RIVE_PATH_HPP_
3 #include "generated/shapes/path_base.hpp"
4 #include "math/mat2d.hpp"
5 #include <vector>
6
7 namespace rive
8 {
9         class Shape;
10         class CommandPath;
11         class PathVertex;
12
13         class Path : public PathBase
14         {
15         protected:
16                 Shape* m_Shape = nullptr;
17                 CommandPath* m_CommandPath = nullptr;
18                 std::vector<PathVertex*> m_Vertices;
19
20         public:
21                 ~Path();
22                 Shape* shape() const { return m_Shape; }
23                 StatusCode onAddedDirty(CoreContext* context) override;
24                 StatusCode onAddedClean(CoreContext* context) override;
25                 void buildDependencies() override;
26                 virtual const Mat2D& pathTransform() const;
27                 CommandPath* commandPath() const { return m_CommandPath; }
28                 void update(ComponentDirt value) override;
29
30                 void addVertex(PathVertex* vertex);
31
32                 virtual void markPathDirty();
33                 virtual bool isPathClosed() const { return true; }
34                 void onDirty(ComponentDirt dirt) override;
35 #ifdef TESTING
36                 std::vector<PathVertex*>& vertices() { return m_Vertices; }
37 #endif
38         };
39 } // namespace rive
40
41 #endif