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 <QPointF>
|
|
|
|
|
#include <QUndoCommand>
|
|
|
|
|
#include "iPlotCurveT_global.h"
|
|
|
|
|
|
|
|
|
|
class ZxObjBase;
|
|
|
|
|
|
|
|
|
|
// 命令: 移动一个图元
|
|
|
|
|
|
|
|
|
|
// TODO 为了压力移动时的速度,而更改逻辑
|
|
|
|
|
// 如果m_fOffsetX>0,且m_vecPoss为空,则认为是直接对后台的Value进行偏移处理
|
|
|
|
|
|
|
|
|
|
class I_PLOTCURVE_T_EXPORT ZxCommandMove : public QUndoCommand
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
ZxCommandMove(ZxObjBase* pObj,
|
|
|
|
|
const QVector<QPointF>& vecPoss,
|
|
|
|
|
const QVector<int> vecIndexesModified,
|
|
|
|
|
float fOffsetX = 0.f,
|
|
|
|
|
float fOffsetY = 0.f,
|
|
|
|
|
QUndoCommand* parent = 0);
|
|
|
|
|
|
|
|
|
|
virtual void redo();
|
|
|
|
|
virtual void undo();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
ZxObjBase* m_pObj;
|
|
|
|
|
QVector<QPointF> m_vecPoss;
|
|
|
|
|
|
|
|
|
|
//这是对Brother的处理
|
|
|
|
|
float m_fOffsetX; //整体移动时,Brother的偏移量,为了redo/undo
|
|
|
|
|
float m_fOffsetY;
|
|
|
|
|
|
|
|
|
|
QVector<int> m_vecIndexesModified;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|