aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph/geometry.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
committercrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
commite69911a8b161b81ce3f7b209175766da2b7b3d4b (patch)
tree76b1f4b6f9f5ad6111578771be783ee456aeb912 /include/cru/platform/graph/geometry.hpp
parent154b5b838edfdcef93cd0a33c013ad7f5f9d7337 (diff)
downloadcru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.gz
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.bz2
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.zip
...
Diffstat (limited to 'include/cru/platform/graph/geometry.hpp')
-rw-r--r--include/cru/platform/graph/geometry.hpp37
1 files changed, 7 insertions, 30 deletions
diff --git a/include/cru/platform/graph/geometry.hpp b/include/cru/platform/graph/geometry.hpp
index d31b3b27..689b2ab9 100644
--- a/include/cru/platform/graph/geometry.hpp
+++ b/include/cru/platform/graph/geometry.hpp
@@ -1,45 +1,22 @@
#pragma once
-#include "../graphic_base.hpp"
-#include "../native_resource.hpp"
+#include "resource.hpp"
-namespace cru::platform::graph {
-class Geometry : public NativeResource {
- protected:
- Geometry() = default;
-
- public:
- Geometry(const Geometry& other) = delete;
- Geometry& operator=(const Geometry& other) = delete;
-
- Geometry(Geometry&& other) = delete;
- Geometry& operator=(Geometry&& other) = delete;
-
- ~Geometry() override = default;
+#include <memory>
- public:
+namespace cru::platform::graph {
+struct IGeometry : virtual IGraphResource {
virtual bool FillContains(const Point& point) = 0;
};
-class GeometryBuilder : public NativeResource {
- protected:
- GeometryBuilder() = default;
-
- public:
- GeometryBuilder(const GeometryBuilder& other) = delete;
- GeometryBuilder& operator=(const GeometryBuilder& other) = delete;
-
- GeometryBuilder(GeometryBuilder&& other) = delete;
- GeometryBuilder& operator=(GeometryBuilder&& other) = delete;
-
- ~GeometryBuilder() override = default;
+// After called Build, calling every method will throw a
- public:
+class IGeometryBuilder : virtual IGraphResource {
virtual void BeginFigure(const Point& point) = 0;
virtual void LineTo(const Point& point) = 0;
virtual void QuadraticBezierTo(const Point& control_point,
const Point& end_point) = 0;
virtual void CloseFigure(bool close) = 0;
- virtual Geometry* Build() = 0;
+ virtual std::unique_ptr<IGeometry> Build() = 0;
};
} // namespace cru::platform::graph