-
-
Notifications
You must be signed in to change notification settings - Fork 557
/
Copy pathgcodeviewparse.h
55 lines (42 loc) · 1.35 KB
/
gcodeviewparse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// This file is a part of "grblControl" application.
// This file was originally ported from "GcodeViewParse.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)
// Copyright 2015 Hayrullin Denis Ravilevich
#ifndef GCODEVIEWPARSE_H
#define GCODEVIEWPARSE_H
#include <QObject>
#include <QVector3D>
#include "linesegment.h"
#include "gcodeparser.h"
#include "util.h"
class GcodeViewParse : public QObject
{
Q_OBJECT
public:
explicit GcodeViewParse(QObject *parent = 0);
~GcodeViewParse();
QVector3D getMinimumExtremes();
QVector3D getMaximumExtremes();
QList<LineSegment *> toObjRedux(QList<QString> gcode, double arcPrecision, bool arcDegreeMode);
QList<LineSegment *> getLineSegmentList();
QList<LineSegment *> getLinesFromParser(GcodeParser *gp, double arcPrecision, bool arcDegreeMode);
QList<LineSegment *> *getLines();
void reset();
signals:
public slots:
private:
bool absoluteMode;
bool absoluteIJK;
// Parsed object
QVector3D m_min, m_max;
QList<LineSegment*> lines;
// Parsing state.
QVector3D lastPoint;
int currentLine; // for assigning line numbers to segments.
// Debug
bool debug;
void testExtremes(QVector3D p3d);
void testExtremes(double x, double y, double z);
};
#endif // GCODEVIEWPARSE_H