DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
QDynExpSurfaceGraph.cpp
Go to the documentation of this file.
1
#include "
QDynExpSurfaceGraph.h
"
2
// This file is part of DynExp.
3
4
#include "
QDynExpSurfaceGraph.h
"
5
6
namespace
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
26
void
DynExpSurfaceGraphBackend::ResetSelectedPoint
() noexcept
27
{
28
SetSelectedPoint
({ -1, -1 });
29
}
30
31
void
DynExpQuick::DynExpSurfaceGraphBackend::UpdateData
()
32
{
33
emit qdataChanged();
34
}
35
36
QVector3D
DynExpSurfaceGraphBackend::GetDataItemPosition
()
const
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
}
QDynExpSurfaceGraph.h
C++ backend of the QDynExpSurfaceGraph QML component.
DynExpQuick::DynExpSurfaceGraphBackend::ResetSelectedPoint
void ResetSelectedPoint() noexcept
Definition
QDynExpSurfaceGraph.cpp:26
DynExpQuick::DynExpSurfaceGraphBackend::GetDataItemPosition
Q_INVOKABLE QVector3D GetDataItemPosition() const
Definition
QDynExpSurfaceGraph.cpp:36
DynExpQuick::DynExpSurfaceGraphBackend::SetSelectedPoint
void SetSelectedPoint(QPoint SelectedPoint) noexcept
Definition
QDynExpSurfaceGraph.cpp:16
DynExpQuick::DynExpSurfaceGraphBackend::UpdateData
void UpdateData()
Definition
QDynExpSurfaceGraph.cpp:31
DynExpQuick::DynExpSurfaceGraphBackend::SelectedPoint
QPoint SelectedPoint
Definition
QDynExpSurfaceGraph.h:24
DynExpQuick::DynExpSurfaceGraphBackend::DynExpSurfaceGraphBackend
DynExpSurfaceGraphBackend(QObject *parent=nullptr)
Definition
QDynExpSurfaceGraph.cpp:8
DynExpQuick::DynExpSurfaceGraphBackend::Proxy
QSurfaceDataProxy *const Proxy
Definition
QDynExpSurfaceGraph.h:57
DynExpQuick
Definition
QDynExpLineGraph.cpp:6
src
DynExpManager
qml
QDynExpSurfaceGraph.cpp
Generated by
1.9.8