PlotterHMI/datafile/view/drawdata.h
huahaiyan 9f74511e69 20240315
1、增加数据分割功能(完成)
2、更换dxf库(进行中)
2024-03-15 16:49:50 +08:00

28 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef DRAWDATA_H
#define DRAWDATA_H
#include <QPicture>
#include <QBitmap>
#include "datafile/dxf/dxfhelper.h"
#include "datafile/hpgl/importhpgl.h"
#include "machine/printinfo/mcfiles.h"
#define TYPE_FILE 0
#define TYPE_IMAGE 1
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);
void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePath, int fileIdx = -1, double angle = 0);//创建Marker数据
void splitPaintPath(QPainterPath originalPath,double segmentHeight,int segmenNum,QPainterPath *pathSegments);//纸张宽度不够时分割图形
//计算两线段的交点
bool lineIntersection(QPointF p1, QPointF p2, double y, QPointF* intersection);
#endif // DRAWDATA_H