|
|
#pragma once
|
|
|
#include <DrawModel/Curve.h>
|
|
|
#include "HTrackerCommon.h"
|
|
|
#include "HTrackerHandleCalculator.h"
|
|
|
#include "HTrackerDrawer.h"
|
|
|
#include "HTrackerTransform.h"
|
|
|
#include "RubberLine.h"
|
|
|
#include "HTrackerSwitch.h"
|
|
|
#include "HTrackerBound.h"
|
|
|
|
|
|
class CSigmaDoc;
|
|
|
class TransformMotiveGraphDrawer;
|
|
|
class ScaleMotionGraphDrawer;
|
|
|
class PanMotionGraphDrawer;
|
|
|
class RotationMotionGraphDrawer;
|
|
|
class ShearMotionGraphDrawer;
|
|
|
class SelectedItemMotionGraphDrawer;
|
|
|
|
|
|
class HTracker
|
|
|
{
|
|
|
public:
|
|
|
enum HTRACKER_STATUS
|
|
|
{
|
|
|
HTRACKER_STATUS_HIDE,
|
|
|
HTRACKER_STATUS_NOT_DRAG, //未拖拽状态
|
|
|
HTRACKER_STATUS_DRAGING //拖拽状态
|
|
|
};
|
|
|
public:
|
|
|
HTracker();
|
|
|
~HTracker();
|
|
|
bool Create(CSigmaDoc * pDoc, CPositionList & selectionSet);
|
|
|
void LButtonDown(int mouseX, int mouseY);
|
|
|
void MouseMove(CDC * pDC, int mouseX, int mouseY);
|
|
|
void LButtonUp(int mouseX, int mouseY);
|
|
|
void Draw(CDC * pDC);
|
|
|
bool IsDraging();
|
|
|
void Reset();
|
|
|
//函数功能:测试鼠标点是否在Handle上。
|
|
|
//返回值:在Handle上,返回正数。数值代表是哪个Handle。不在Handle上返回0。
|
|
|
HTRACKER_HANDLE_KIND HitTest(int mouseX, int mouseY);
|
|
|
bool IsRotateAndShearState();
|
|
|
protected:
|
|
|
void CopySelectionSet(CPositionList & selectionSet);
|
|
|
void TranslateBoundRect(CRect & boundRectOut);
|
|
|
HTRACKER_TRANSFORM_KIND JudgeTransformKind(HTRACKER_HANDLE_KIND kind);
|
|
|
void ChangeGraphDrawer();
|
|
|
void ChangeHtrackerDrawerState();
|
|
|
private:
|
|
|
HTRACKER_STATUS m_status;
|
|
|
CPositionList m_selectionSet; //选择集
|
|
|
CRect m_boundRect; //tracker的外包矩形
|
|
|
HTrackerBound m_bound;
|
|
|
int m_HandleSize; //Handle宽度 单位为像素
|
|
|
HTrackerHandleCalculator m_handleCalctor;
|
|
|
HTrackerDrawer m_drawer;
|
|
|
HTrackerTransform m_trackerTransform;
|
|
|
CSigmaDoc * m_pDoc;
|
|
|
TransformMotiveGraphDrawer* m_pTMGDrawer;
|
|
|
ScaleMotionGraphDrawer * m_pScaleMotionGraphDrawer;
|
|
|
PanMotionGraphDrawer * m_pPanMotionGraphDrawer;
|
|
|
RotationMotionGraphDrawer * m_pRotationMotionGraphDrawer;
|
|
|
ShearMotionGraphDrawer * m_pShearMotionGraphDrawer;
|
|
|
int m_motionCount;
|
|
|
HTrackerSwitch m_switch;
|
|
|
HTRACKER_TRANSFORM_KIND m_transformKind;
|
|
|
SelectedItemMotionGraphDrawer * m_pSIMGDrawer;
|
|
|
};
|
|
|
|