aboutsummaryrefslogtreecommitdiff
path: root/geometry.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuel@nihil.ws>2023-06-04 13:02:14 +0200
committerSamuel Fadel <samuel@nihil.ws>2023-06-04 13:02:14 +0200
commitfb23c8d47f6dcef429423256d8dddcc0f7184fc4 (patch)
tree34e0032f28df5807e4abd90d6b1b4baad24d2991 /geometry.h
parent0f34fd437efb936ef29ac91186321aa7251fbfb1 (diff)
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
Diffstat (limited to 'geometry.h')
-rw-r--r--geometry.h20
1 files changed, 9 insertions, 11 deletions
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:
};