
#if !defined(__RV_ZERO_POS_H_INCLUDED_)
#define __RV_ZERO_POS_H_INCLUDED_

#pragma once
 
#include "Indix.h"

//该算子不支持global align
class INDIX_API CZeroPos :	public CIndicater
{
public:
	CZeroPos(void);
	virtual ~CZeroPos(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  ShowExtender(CDelegate* pDelegate, CLeadMark* pMark/*, BOOL bGrabber=FALSE*/);
	virtual void  ShowGrabber(CDelegate* pDelegate, CLeadMark* pMark/*, BOOL bGrabber=FALSE*/);

	virtual void Shot(const RvImage image ) { return;};
	virtual void ShotEx(const RvImage image , int left, int top){ return;};
	//virtual void Reset(){ return ;};
	virtual void Move(double dx, double dy);

	//坐标原点暂时不支持，仅用于升级
	RV_ORIGIN_TYPE GetOriginType() {return m_originType;};
	void SetOriginType(RV_ORIGIN_TYPE type);

	virtual void    SetCurPos(int x, int y);
	RvPoint GetCurPos();

	//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();

	//virtual void EndAlign();
	//virtual void MoveEx(double dx, double dy, double cx, double cy, double angle);

public:
	virtual GRect  GetGrabberRect(CDelegate* pDelegate,RvSize size) ;
	virtual BOOL   OnPositionChange( HGPD hOri, HGPD hCur, HGPD hNew, GPoint grabPos, RvOffset &offset) ;
	virtual void   OnEndTrack(CDelegate* pDelegate, HGPD hCur,  GPoint point, int nHitTest) ;

	virtual void   DestroyGraphicDescriptor(HGPD hGpd)  ;
	virtual HGPD   CreateGraphicDescriptor(CDelegate* pDelegate) ;
	virtual void   CopyGraphicDescriptor(const HGPD src, HGPD dest);

	virtual int   HitTest(CDelegate* pDelegate, GPoint point) ;

protected:

typedef struct _obj_zero_pos_descriptor{
	GPoint p; 
}GdZeroPos;

	RV_ORIGIN_TYPE  m_originType;
	RvPoint m_curPos;
};






#endif
