#if !defined(__RV_REFER_POS_H_INCLUDED_)
#define __RV_REFER_POS_H_INCLUDED_

#pragma once



#include "ZeroPos.h"

//该算子不支持全局调整。
class INDIX_API CReferPos :public CZeroPos
{
public:
	CReferPos(void);
	virtual ~CReferPos(void);

	virtual void Show(CDelegate* pDelegate,int mode, BOOL bForce);
	virtual void ShowSketch(CDelegate* pDelegate, CSketchMark* pMark,  HGPD hGpd,  int grabType, GPoint grabPos)  ;
	virtual CUCObj* Clone( CUCObj* twin) ;
	virtual BOOL Serialize(HANDLE device, BOOL bIn );

//	virtual void ShowSketch(RvPoint leftTop, RvPoint rightBottom);

	virtual void    SetCurPos(int x, int y);
	//virtual void EndAlign();
	// virtual void MoveEx(double dx, double dy, double cx, double cy, double angle);

	void SetVertical(BOOL flag);
	BOOL IsVertical() { return m_bVertical;};

	//该值为X或Y图像坐标
	int GetCurValue();

	//virtual void SetClientRect(int x, int y, int w, int h);
	virtual void   SetCtrlRect(int left, int top, UINT width, UINT height) ;

	virtual void   SetCtrlRect(int left, int top, int right, int bottom) ;
	virtual RvRect GetCtrlRect();
	virtual void   SetCtrlPos(int x, int y);
	virtual RvPoint GetCtrlPos();

public:
	//实际的一个长度或位置，不一定是坐标,由外部程序决定
	double m_nActualPos;
	
public:
	virtual int   HitTest(CDelegate* pDelegate, GPoint point) ;
	virtual GRect  GetGrabberRect(CDelegate* pDelegate,RvSize size) ;
	virtual void OnEndTrack(CDelegate* pDelegate,HGPD hCur,  GPoint point, int nHitTest) ;

protected:
	BOOL m_bVertical;

};




#endif
