代码拉取完成,页面将自动刷新
#ifndef PARSECODE_H
#define PARSECODE_H
#include <QObject>
#include <QVector>
#include <QPoint>
#include "commonfunc.h"
class Element;
class ParseCode
{
public:
ParseCode();
//解析代码入口,返回element数组
QVector<Element*> ParseFrom(const QString &textEdit);
private:
//解析一行代码,生成一个element对象
Element* parseSentence(QString sentence);
//预处理
bool PreProcces(const QString& textEdit);
//获取命令类型
enum CodeType CodeType(const QString &cmd);
//分别创建非图元,直线,弧元素
Element* createNoShapeElement(QString sentence,QStatus status,QPointF lastPoint);
Element* createLineElement(QString sentence,QStatus status,QPointF lastPoint);
Element* createArcElement(QString sentence,QStatus status,QPointF lastPoint);
//提取数值
double extractValFrom(const QString &word);
private:
QString text; //输入文本的内容
QStringList sentenceList; //输入文本的内容按行分解成行列表
QStatus status;
QPointF lastPoint; //记录上一节末点坐标
};
#endif // PARSECODE_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。