summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/graphgallery/highlightseries.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/datavisualization/graphgallery/highlightseries.h')
-rw-r--r--examples/datavisualization/graphgallery/highlightseries.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/datavisualization/graphgallery/highlightseries.h b/examples/datavisualization/graphgallery/highlightseries.h
new file mode 100644
index 00000000..c74a6b84
--- /dev/null
+++ b/examples/datavisualization/graphgallery/highlightseries.h
@@ -0,0 +1,35 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef HIGHLIGHTSERIES_H
+#define HIGHLIGHTSERIES_H
+
+#include <QtDataVisualization/qsurface3dseries.h>
+
+#include "topographicseries.h"
+
+class HighlightSeries : public QSurface3DSeries
+{
+ Q_OBJECT
+public:
+ explicit HighlightSeries();
+ ~HighlightSeries();
+
+ void setTopographicSeries(TopographicSeries *series);
+ inline void setMinHeight(float height) { m_minHeight = height; }
+
+public Q_SLOTS:
+ void handlePositionChange(const QPoint &position);
+ void handleGradientChange(float value);
+
+private:
+ int m_width = 100;
+ int m_height = 100;
+ int m_srcWidth = 0;
+ int m_srcHeight = 0;
+ QPoint m_position = {};
+ TopographicSeries *m_topographicSeries = nullptr;
+ float m_minHeight = 0.f;
+};
+
+#endif // HIGHLIGHTSERIES_H