From fb23c8d47f6dcef429423256d8dddcc0f7184fc4 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sun, 4 Jun 2023 13:02:14 +0200 Subject: Further advances in nuklear port. Rendering now looks similar to Qt version, needs a few tweaks: * Proper multisampling * Background Missing features: * Barcharts * Interactivity (e.g. brushing/linking in all objects) * History view of interactions --- geometry.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'geometry.h') diff --git a/geometry.h b/geometry.h index 200782c..d7a10b8 100644 --- a/geometry.h +++ b/geometry.h @@ -1,17 +1,14 @@ #ifndef GEOMETRY_H #define GEOMETRY_H -class Point2D +struct vec2 { -public: - Point2D(); + float x, y; - void set(float, float); - float x() const { return m_x; } - float y() const { return m_y; } - -private: - float m_x, m_y; + void set(float _x, float _y) { + x = _x; + y = _y; + } }; class RectF @@ -19,7 +16,7 @@ class RectF public: RectF(float, float, float, float); RectF(const RectF &); - RectF(const Point2D &, const Point2D &); + RectF(const vec2 &, const vec2 &); float x() const { return m_x; } float y() const { return m_y; } @@ -27,6 +24,7 @@ public: float height() const { return m_height; } bool contains(float x, float y) const; + bool contains(const vec2 &) const; bool intersects(const RectF &) const; private: @@ -39,7 +37,7 @@ public: Geometry(); int vertexCount() const; - Point2D *vertexDataAsPoint2D(); + vec2 *vertexDataAsPoint2D(); private: }; -- cgit v1.2.3