Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/3dview/linemesh.h
Show All 20 Lines | |||||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #pragma once | 23 | #pragma once | ||
24 | 24 | | |||
25 | #include <QVector> | 25 | #include <QVector> | ||
26 | #include <QObject> | 26 | #include <QObject> | ||
27 | #include <QNode> | 27 | #include <QNode> | ||
28 | #include <QGeometryRenderer> | 28 | #include <QGeometryRenderer> | ||
29 | #include <QVector3D> | ||||
29 | #include "gcodeto4d.h" | 30 | #include "gcodeto4d.h" | ||
30 | 31 | | |||
31 | class LineMeshGeometry; | 32 | class LineMeshGeometry; | ||
32 | class QString; | 33 | class QString; | ||
33 | 34 | | |||
34 | class LineMesh : public Qt3DRender::QGeometryRenderer | 35 | class LineMesh : public Qt3DRender::QGeometryRenderer | ||
35 | { | 36 | { | ||
36 | Q_OBJECT | 37 | Q_OBJECT | ||
38 | Q_PROPERTY(QVector3D center READ center NOTIFY centerChanged) | ||||
37 | 39 | | |||
38 | public: | 40 | public: | ||
39 | explicit LineMesh(Qt3DCore::QNode *parent = Q_NULLPTR); | 41 | explicit LineMesh(Qt3DCore::QNode *parent = Q_NULLPTR); | ||
40 | ~LineMesh(); | 42 | ~LineMesh(); | ||
41 | void read(const QString &path); | 43 | void read(const QString &path); | ||
42 | Q_INVOKABLE void readAndRun(const QString &path); | 44 | Q_INVOKABLE void readAndRun(const QString &path); | ||
43 | void posUpdate(const QVector<QVector4D> &pos); | 45 | void posUpdate(const QVector<QVector4D> &pos); | ||
44 | 46 | | |||
47 | QVector3D center(); | ||||
48 | | ||||
45 | signals: | 49 | signals: | ||
46 | void finished(); | 50 | void finished(); | ||
47 | void run(const QString &path); | 51 | void run(const QString &path); | ||
52 | void centerChanged(const QVector3D ¢er); | ||||
48 | 53 | | |||
49 | private: | 54 | private: | ||
50 | GcodeTo4D _gcode; | 55 | GcodeTo4D _gcode; | ||
51 | LineMeshGeometry *_lineMeshGeo; | 56 | LineMeshGeometry *_lineMeshGeo; | ||
52 | }; | 57 | }; |