diff options
Diffstat (limited to 'colormap.h')
-rw-r--r-- | colormap.h | 27 |
1 files changed, 10 insertions, 17 deletions
@@ -1,21 +1,16 @@ #ifndef COLORMAP_H #define COLORMAP_H +#include <memory> #include <vector> -#include <QtQuick> -#include <QSGDynamicTexture> - #include <armadillo> +#include <nod.hpp> #include "colorscale.h" class Colormap - : public QQuickItem { - Q_OBJECT - Q_ENUMS(Orientation) - Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) public: static const int SAMPLES = 128; @@ -24,26 +19,24 @@ public: Vertical }; - Colormap(QQuickItem *parent = 0); + Colormap(); ~Colormap(); + void update(); void setOrientation(Orientation orientation); Orientation orientation() const { return m_orientation; } -signals: - void colorScaleChanged(const ColorScale *scale) const; - void orientationChanged(Orientation orientation) const; + nod::signal<void(std::shared_ptr<const ColorScale>)> colorScaleChanged; + nod::signal<void(Orientation)> orientationChanged; -public slots: - void setColorScale(const ColorScale *scale); + void setColorScale(std::shared_ptr<const ColorScale> scale); -protected: - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); + // QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); private: - QSGNode *newSceneGraph(); + // QSGNode *newSceneGraph(); - QSGDynamicTexture *m_texture; + // QSGDynamicTexture *m_texture; bool m_shouldUpdateTexture, m_shouldUpdateOrientation; Orientation m_orientation; std::vector<float> m_cmap; |