#pragma once #include #include #include #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]; };