You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iBase/iBase/ZxPaintParam.h

65 lines
1.3 KiB
C++

#pragma once
#include <QTime>
#include <QColor>
#include <QRectF>
#include <QTextOption>
#include <functional>
#include "iBase_global.h"
class ZxRenderView;
class QPainter;
class ZxRenderItem;
// 图件过滤器(函数)
typedef std::function <bool (const ZxRenderItem *)> ZxFilterFun;
// 用过滤器来过滤图件
static inline bool ZxMatchFilter(ZxFilterFun filter, const ZxRenderItem * p)
{ return filter ? (p ? filter(p) : false) : true; }
// 绘图参数
class I_BASE_EXPORT ZxPaintParam
{
public:
ZxPaintParam(ZxRenderView* pView, QPainter* painter);
ZxRenderView* getView() const { return pView; }
public:
// 剪裁区域
QRectF clipRect;
// 不使用快照
bool noSnapshot : 1;
// 强制开启符号缓存速度优化(正常情况下只在窗口上开启)
bool forceSymbolCache : 1;
// 控制点的(建议)尺寸
float handleSize;
// 绘制自身条件. 不满足条件的不画自身, 但不影响子图件的绘制
ZxFilterFun selfFilter;
// 绘制子图件的条件. 不满足条件的不画子图件, 但不影响自身的绘制
ZxFilterFun childrenFilter;
// 视图的缩放率
float viewZoom;
// 是否在导出pdf
bool exportingPdf;
// 替换前景色
QColor* overrideColor;
private:
ZxRenderView* pView;
};