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.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <ZxHandlePolicy.h>
|
|
|
|
|
#include <QPointF>
|
|
|
|
|
#include <QRectF>
|
|
|
|
|
#include "ZxPaintParam.h"
|
|
|
|
|
|
|
|
|
|
class ZxRenderItem;
|
|
|
|
|
|
|
|
|
|
/// 经典的8控制点矩形编辑器.
|
|
|
|
|
class I_PLOTBASE_EXPORT ZxResizePolicy : public ZxHandlePolicy
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
ZxResizePolicy();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
virtual int getHandleId(const QPointF& pt, double fHandleSize);
|
|
|
|
|
virtual void onBeginMove(int handle, const QPointF& pt);
|
|
|
|
|
virtual void onMove(int handle, const QPointF& pt);
|
|
|
|
|
virtual void onEndMove(int handle, const QPointF& pt);
|
|
|
|
|
virtual void onLeftUp(int handle, const QPointF& pt);
|
|
|
|
|
virtual QCursor getCursor(int handle);
|
|
|
|
|
virtual void onPaint(QPainter* painter, const ZxPaintParam& param);
|
|
|
|
|
virtual QRectF getBounds() const;
|
|
|
|
|
|
|
|
|
|
void calcHandlePoints(const QRectF& rect);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
QRectF m_rectOrig;
|
|
|
|
|
QRectF m_rectCurrent;
|
|
|
|
|
bool m_bMoving;
|
|
|
|
|
QPointF m_handlePoints[9];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|