29 lines
1.2 KiB
C
29 lines
1.2 KiB
C
#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
|