File indexing completed on 2025-01-26 05:19:14

0001 /* Atelier KDE Printer Host for 3D Printing
0002     Copyright (C) <2017-2018>
0003     Author: Patrick José Pereira - patrickjp@kde.org
0004             Kevin Ottens - ervin@kde.org
0005 
0006     This program is free software; you can redistribute it and/or
0007     modify it under the terms of the GNU General Public License as
0008     published by the Free Software Foundation; either version 3 of
0009     the License or any later version accepted by the membership of
0010     KDE e.V. (or its successor approved by the membership of KDE
0011     e.V.), which shall act as a proxy defined in Section 14 of
0012     version 3 of the license.
0013 
0014     This program is distributed in the hope that it will be useful,
0015     but WITHOUT ANY WARRANTY; without even the implied warranty of
0016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017     GNU General Public License for more details.
0018 
0019     You should have received a copy of the GNU General Public License
0020     along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #pragma once
0024 
0025 #include "gcodeto4d.h"
0026 #include <QGeometryRenderer>
0027 #include <QNode>
0028 #include <QObject>
0029 #include <QVector>
0030 
0031 class LineMeshGeometry;
0032 class QString;
0033 
0034 class LineMesh : public Qt3DRender::QGeometryRenderer
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039     explicit LineMesh(Qt3DCore::QNode *parent = Q_NULLPTR);
0040     ~LineMesh() = default;
0041     void read(const QString &path);
0042     Q_INVOKABLE void readAndRun(const QString &path);
0043     void posUpdate(const QVector<QVector4D> &pos);
0044 
0045 signals:
0046     void finished();
0047     void run(const QString &path);
0048 
0049 private:
0050     GcodeTo4D _gcode;
0051     LineMeshGeometry *_lineMeshGeo;
0052 };