-
Notifications
You must be signed in to change notification settings - Fork 1
/
h2canvasdelegate.h
53 lines (40 loc) · 2.12 KB
/
h2canvasdelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef H2CANVASDELEGATE_H
#define H2CANVASDELEGATE_H
#include "tools.h"
#include "canvasdelegate.h"
class H2CanvasDelegate : public CanvasDelegate
{
friend class ActionHandler;
friend class Canvas;
friend class FenchelNielsenUser;
public:
virtual DelegateType getDelegateType() const override {return DelegateType::H2DELEGATE;}
virtual ~H2CanvasDelegate() {}
protected:
H2CanvasDelegate(uint sizeX, uint sizeY, bool leftCanvas = false, bool rightCanvas = false, ActionHandler *handler = nullptr);
H2Point pixelToH2coordinate(int x, int y) const;
void drawH2Point(const H2Point &p, const QColor &color = "black", int width = 1, bool back = true);
void highlightH2Point(const H2Point &p, const QColor &color = "black", int width = 5);
void drawH2Geodesic(const H2Geodesic &L, const QColor &color = "black", int width = 1, bool back = true);
void drawH2GeodesicArc(const H2GeodesicArc &L, const QColor &color = "black", int width = 1, bool back = true);
void drawStraightH2GeodesicArc(const H2GeodesicArc &L, const QColor &color = "black", int width = 1, bool back = true);
void drawH2Triangle(const H2Triangle &triangle, const QColor &color = "black", int width = 1, bool back = true);
void highlightStraightH2Triangle(const H2Triangle &triangle, const QColor &color);
void drawStraightFilledH2Triangle(const H2Triangle &triangle, bool back = true);
virtual void redrawTop() override;
virtual void resetView() override;
virtual void enter() override;
virtual void leave() override;
virtual void redrawBack() override;
H2Isometry mobius;
virtual void mousePress (int x, int y, Qt::MouseButton button, Qt::MouseButtons buttons) override;
virtual void mouseMove(int x, int y, Qt::MouseButton button, Qt::MouseButtons buttons) override;
virtual void mouseRelease(int x, int y, Qt::MouseButton button, Qt::MouseButtons buttons) override;
virtual void keyPress(QKeyEvent *keyEvent) override;
virtual void keyRelease(QKeyEvent *keyEvent) override;
private:
bool mobiusing;
H2Isometry mobiusSave;
Complex pointSave;
};
#endif // H2CANVASDELEGATE_H