DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
QDynExpSurfaceGraph.cpp
Go to the documentation of this file.
2// This file is part of DynExp.
3
5
6namespace DynExpQuick
7{
8 DynExpSurfaceGraphBackend::DynExpSurfaceGraphBackend(QObject* parent) : QObject(parent),
9 Proxy(new QSurfaceDataProxy()),
10 XValueAxis(std::make_unique<QValue3DAxis>()), YValueAxis(std::make_unique<QValue3DAxis>()),
11 ZValueAxis(std::make_unique<QValue3DAxis>())
12 {
13 // QSurface3DSeries picks up proxy and transfers ownership to it via qml
14 }
15
16 void DynExpSurfaceGraphBackend::SetSelectedPoint(QPoint SelectedPoint) noexcept
17 {
18 if (this->SelectedPoint == SelectedPoint)
19 return;
20
21 this->SelectedPoint = SelectedPoint;
22
23 emit selectedPointChanged(SelectedPoint);
24 }
25
27 {
28 SetSelectedPoint({ -1, -1 });
29 }
30
32 {
33 emit qdataChanged();
34 }
35
37 {
38 if (SelectedPoint.x() >= 0 && SelectedPoint.x() < Proxy->rowCount() &&
39 SelectedPoint.y() >= 0 && SelectedPoint.y() < Proxy->columnCount())
40 return Proxy->itemAt(SelectedPoint).position();
41 else
42 return QVector3D();
43 }
44}
C++ backend of the QDynExpSurfaceGraph QML component.
Q_INVOKABLE QVector3D GetDataItemPosition() const
void SetSelectedPoint(QPoint SelectedPoint) noexcept
DynExpSurfaceGraphBackend(QObject *parent=nullptr)