2024-03-08 08:33:05 +00:00
|
|
|
|
#ifndef DRAWDATA_H
|
|
|
|
|
#define DRAWDATA_H
|
|
|
|
|
|
|
|
|
|
#include <QPicture>
|
2024-03-15 08:49:50 +00:00
|
|
|
|
#include <QBitmap>
|
2024-03-08 08:33:05 +00:00
|
|
|
|
#include "datafile/dxf/dxfhelper.h"
|
|
|
|
|
#include "datafile/hpgl/importhpgl.h"
|
|
|
|
|
#include "machine/printinfo/mcfiles.h"
|
|
|
|
|
|
|
|
|
|
#define TYPE_FILE 0
|
|
|
|
|
#define TYPE_IMAGE 1
|
|
|
|
|
|
2024-03-15 08:49:50 +00:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
QPicture showPic;//用于显示的picture,画笔为1像素,不为1像素时,MyGraphicsItem中绘制的线条会很淡
|
|
|
|
|
QPicture sendPic;//用于发送的picture,画笔为所设置像素
|
|
|
|
|
} CreatPictureStr;
|
|
|
|
|
|
|
|
|
|
//marker数据,绘制路径,纸宽,对接符间距,是否对接标志,右边距,笔宽
|
|
|
|
|
CreatPictureStr creatPictureByData(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
|
|
|
|
CreatPictureStr creatPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
2024-03-08 08:33:05 +00:00
|
|
|
|
void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePath, int fileIdx = -1, double angle = 0);//创建Marker数据
|
2024-03-15 08:49:50 +00:00
|
|
|
|
void splitPaintPath(QPainterPath originalPath,double segmentHeight,int segmenNum,QPainterPath *pathSegments);//纸张宽度不够时分割图形
|
|
|
|
|
//计算两线段的交点
|
|
|
|
|
bool lineIntersection(QPointF p1, QPointF p2, double y, QPointF* intersection);
|
2024-03-08 08:33:05 +00:00
|
|
|
|
|
|
|
|
|
#endif // DRAWDATA_H
|