Kind-of worked on the R-Tree; not really enough time to do much.
[aesalon.git] / include / artisan / gviewport / BasicViewport.h
blob1641ac88be4191c28f0ae9c825336c94bf05528e
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/artisan/gviewport/BasicViewport.h
8 */
10 #ifndef AesalonArtisan_GViewport_BasicViewport_H
11 #define AesalonArtisan_GViewport_BasicViewport_H
13 #include "artisan/Viewport.h"
15 #include "Object.h"
16 #include "Data.h"
17 #include "RenderedImage.h"
19 namespace Artisan {
20 namespace GViewport {
22 class Renderer;
24 class BasicViewport : public Viewport { Q_OBJECT
25 private:
26 Data *m_data;
27 RenderedImage m_image;
29 Rect m_rangeLimit;
30 QPoint m_lastPoint;
31 public:
32 BasicViewport(Data *data);
33 virtual ~BasicViewport();
35 Data *data() const { return m_data; }
37 Rect rangeLimit() const { return m_rangeLimit; }
38 void limitRange(const Rect &newLimit) { m_rangeLimit = newLimit; }
39 public slots:
40 void acceptRenderedImage(RenderedImage *image);
41 void translate(const Point &by);
42 void setViewport(const Rect &range);
43 void updateRange(const Rect &range);
44 protected:
45 virtual void resizeEvent(QResizeEvent *event);
46 virtual void paintEvent(QPaintEvent *event);
47 virtual void mouseMoveEvent(QMouseEvent *event);
48 virtual void mousePressEvent(QMouseEvent *event);
49 virtual void wheelEvent(QWheelEvent *event);
50 private:
51 void enqueue(const Rect &range);
54 } // namespace GViewport
55 } // namespace Artisan
57 #endif